# @theorchard/graphql-server

## 5.1.2

### Patch Changes

-   Update dependencies

## 5.1.0

### Minor Changes

-   SEC: Replace uuid with Node's native randomUUID
-   BREAKING: Minimum node version >= 20

## 5.0.4

### Patch Changes

-   SEC: lodash from 4.17.23 to 4.18.1

## 5.0.3

### Patch Changes

-   SEC: lodash-es from 4.17.23 to 4.18.1

## 5.0.2

### Patch Changes

-   Update @apollo/server to fix vulnerability

## 5.0.1

### Patch Changes

-   Update @apollo/subgraph

## 5.0.0

Note: `@theorchard/jwt-service-handler` must be installed separately.

### Major Changes

-   jwt-service-handler moved to peer dependency

## 4.4.1

### Patch Changes

-   Migrate lodash dependency to lodash-es

## 4.4.0

### Minor Changes

-   Update @apollo/server to 5.4.0
    -   Resolves security vulnerability

## 4.3.2

### Patch Changes

-   Bump lodash to 4.17.23 to fix vulnerabilities
-   Updated dependencies
    -   @theorchard/jwt-service-handler@4.6.3

## 4.3.1

### Patch Changes

-   Updated dependencies
    -   @theorchard/jwt-service-handler@4.6.2

## 4.3.0

### Minor Changes

-   adds ForbiddenError

## 4.2.0

### Minor Changes

-   Added support for Sentry data sanitization

## 4.1.0

### Minor Changes

-   Adds optional `schemaTransformers`, a list of functions which can be used to transform the schema. This enables the use of custom directives.
-   The `schemaTransformers` are passed into the `startApolloServer` function within its `options` param (see README for example):

```ts
    await startApolloServer<ServiceConfig, ServiceContext>({
        ...,
        schemaTransformers: [schemaTransformer],
    });
```

## 4.0.1

### Patch Changes

-   Updated dependencies
    -   @theorchard/jwt-service-handler@4.6.0

## 4.0.0

### Major Changes

-   Pinning graphql 16.8.1, upgrading graphql-server to Apollo v5, express v5

### Patch Changes

-   Updated dependencies
    -   @theorchard/jwt-service-handler@4.5.1

## 3.6.0

### Minor Changes

-   PP-1092 Add factory/utility methods to get authorizationGetter and correlationIdGetter fns using an ApolloContext.

This is especially useful for usage with the ts-pdp-sdk's PdpAuthorizationBackend, where `ServiceDataSourceOptions` contains `context: ApolloContext`.

```ts
const createDataSources = (options: ServiceDataSourceOptions): ServiceDataSources => ({
    return {
        ...
        authorizationBackend: new PdpAuthorizationBackend(
            {
                environment: options.config.environment,
                authorizationGetter: authorizationGetterFactory(options.context),
                correlationIdGetter: correlationIdGetterFactory(options.context),
                owsPdpUrl: options.config.owsPdpUrl,
            }
        ),
    }
});
```

## 3.5.4

### Patch Changes

-   Updated dependencies
    -   @theorchard/jwt-service-handler@4.5.0

## 3.5.3

### Patch Changes

-   Updated dependencies
    -   @theorchard/jwt-service-handler@4.4.0

## 3.5.2

### Patch Changes

-   Updated dependencies
    -   @theorchard/utils-environment@1.1.0
    -   @theorchard/jwt-service-handler@4.3.2

## 3.5.1

### Patch Changes

-   Updated dependencies
    -   @theorchard/constants@1.6.0
    -   @theorchard/utils-environment@1.0.18
    -   @theorchard/jwt-service-handler@4.3.1

## 3.5.0

### Minor Changes

-   Include auth0ClientId in ApolloContext

## 3.4.1

### Patch Changes

-   Updated dependencies - @theorchard/jwt-service-handler@4.3.0

## 3.4.0

### Minor Changes

-   Updated dependencies
    -   dd-trace@5.29.0

## 3.3.0

### Minor Changes

-   Updated dependencies
    -   express@4.21.2

## 3.2.5

### Patch Changes

-   Updated dependencies
    -   @theorchard/jwt-service-handler@4.2.2

## 3.2.4

### Patch Changes

-   Updated dependencies
    -   @theorchard/constants@1.5.0
    -   @theorchard/utils-environment@1.0.17
    -   @theorchard/jwt-service-handler@4.2.1

## 3.2.3

### Patch Changes

-   Made JWT warnings dependent on env var LOG_JWT_WARNINGS = true

## 3.2.2

### Patch Changes

-   Updated dependencies
    -   @theorchard/jwt-service-handler@4.2.0

## 3.2.1

### Patch Changes

-   Updated dependencies
    -   @theorchard/jwt-service-handler@4.1.0

## 3.2.0

### Minor Changes

-   Upgrade body-parser to resolve CVE-2024-45590 and apollo/server and express packages

## 3.1.3

### Patch Changes

-   Updated dependencies
    -   @theorchard/jwt-service-handler@4.0.6

## 3.1.2

### Patch Changes

-   KDH-28 Put Log Query variables behind ENV which is false by default so we dont accidentally log sensitive data. Turn it ON only when required for debugging.

## 3.1.1

### Patch Changes

-   KDH-28 Log Query variables.

## 3.1.0

### Minor Changes

-   Re-add json bodyparser limit of 4mb, default is 100kb which causes payload too large errors. This functionality was dropped in 2.0.0

## 3.0.2

### Patch Changes

-   Updated dependencies
    -   @apollo/server@4.10.4

## 3.0.1

### Patch Changes

-   Updated dependencies
    -   graphql@16.8.1

## 3.0.0

### Major Changes

-   Updated dependencies
    -   express@4.19.2
    -   dd-trace@5.10.0

### Breaking Changes

-   Upgrades to Datadog v5 which now requires Node.js > 16
-   dd-trace has updated typings and you might need to change some of the functions to match it. More here: https://github.com/DataDog/dd-trace-js/blob/master/MIGRATING.md

## 2.1.9

### Patch Changes

-   @theorchard/utils-environment@1.0.16
-   @theorchard/jwt-service-handler@4.0.5

## 2.1.8

### Patch Changes

-   @theorchard/utils-environment@1.0.15
-   @theorchard/jwt-service-handler@4.0.4

## 2.1.7

### Patch Changes

-   Updated dependencies
    -   @theorchard/utils-environment@1.0.14
    -   @theorchard/jwt-service-handler@4.0.3

## 2.1.6

### Patch Changes

-   GraphQLError instances are now sent to Sentry when thrown.

## 2.1.5

### Patch Changes

-   Updated dependencies
    -   @theorchard/constants@1.4.1
    -   @theorchard/utils-environment@1.0.13
    -   @theorchard/jwt-service-handler@4.0.2

## 2.1.4

### Patch Changes

-   Make @types/compression a proper dependency

## 2.1.3

### Patch Changes

-   Updated dependencies
    -   @theorchard/constants@1.4.0
    -   @theorchard/utils-environment@1.0.12
    -   @theorchard/jwt-service-handler@4.0.1

## 2.1.2

### Patch Changes

-   Updated dependencies
    -   @theorchard/jwt-service-handler@4.0.0

## 2.1.1

### Patch Changes

-   Updated dependencies
    -   @theorchard/jwt-service-handler@3.0.0

## 2.1.0

### Minor Changes

-   PP-474 Update graphql-server to extract the Identity Id from the Authorization header's bearer token (JWT). Put this identity id into the request context, overriding whatever may have been passed as an Orchard-Identity- header.

## 2.0.4

### Patch Changes

-   Updated dependencies
    -   @theorchard/constants@1.3.1
    -   @theorchard/utils-environment@1.0.11
    -   @theorchard/jwt-service-handler@2.1.1

## 2.0.3

### Patch Changes

-   Updated dependencies
    -   @theorchard/jwt-service-handler@2.1.0

## 2.0.2

### Patch Changes

-   Add datasources to context passed to datasources

## 2.0.1

### Patch Changes

-   Re-export JwtHandler so it can be used in tests.

## 2.0.0

### Major Changes

-   Upgraded to use Apollo server v4.
-   Removed the "enableTracing" option, since it is now controlled by the existence of APOLLO_KEY env var.
-   Updated dependencies
    -   @theorchard/jwt-service-handler@2.0.0

## 1.10.0

### Minor Changes

-   Adds the Referer header to the list of headers passed through graphql requests

### Patch Changes

-   Updated dependencies
    -   @theorchard/constants@1.3.0
    -   @theorchard/utils-environment@1.0.10
    -   @theorchard/jwt-service-handler@1.1.2

## 1.9.1

### Patch Changes

-   Updated dependencies
    -   @theorchard/constants@1.2.1
    -   @theorchard/utils-environment@1.0.9
    -   @theorchard/jwt-service-handler@1.1.1

## 1.9.0

### Minor Changes

-   Add Service Token support

### Patch Changes

-   Updated dependencies
    -   @theorchard/jwt-service-handler@1.1.0

## 1.8.1

### Patch Changes

-   Updated dependencies
    -   @theorchard/constants@1.1.1
    -   @theorchard/utils-environment@1.0.8
    -   @theorchard/jwt-service-handler@1.0.14

## 1.8.0

### Minor Changes

-   Export UserInputError.

## 1.7.1

### Patch Changes

-   Updated dependencies
    -   @theorchard/constants@1.1.0
    -   @theorchard/utils-environment@1.0.7
    -   @theorchard/jwt-service-handler@1.0.13

## 1.7.0

### Minor Changes

-   Fix warn/warning loglevel

## 1.6.0

### Minor Changes

-   Add logger to the default context

## 1.5.4

### Patch Changes

-   @theorchard/utils-environment@1.0.6
-   @theorchard/jwt-service-handler@1.0.12

## 1.5.3

### Patch Changes

-   @theorchard/utils-environment@1.0.5
-   @theorchard/jwt-service-handler@1.0.11

## 1.5.2

### Patch Changes

-   @theorchard/utils-environment@1.0.4
-   @theorchard/jwt-service-handler@1.0.10

## 1.5.1

### Patch Changes

-   Use shared constants from the new constants libraries.
-   Updated dependencies
    -   @theorchard/graphql-constants@1.0.0
    -   @theorchard/constants@1.0.0
    -   @theorchard/utils-environment@1.0.3
    -   @theorchard/jwt-service-handler@1.0.9

## 1.5.0

### Minor Changes

-   Update @apollo/federation version to work with nodejs 16.14.2.

## 1.4.4

### Patch Changes

-   @theorchard/utils-environment@1.0.2
-   @theorchard/jwt-service-handler@1.0.8

## 1.4.3

### Patch Changes

-   @theorchard/utils-environment@1.0.1
-   @theorchard/jwt-service-handler@1.0.7

## 1.4.2

### Patch Changes

-   Parse `orchard-profile-uuid` header; Return `profileUUID` alongside with `profileId` and `profileType` in `getProfileFromIdentity` function.

## 1.4.1

### Patch Changes

-   Updated dependencies [undefined]
    -   @theorchard/identity@1.0.1

## 1.4.0

### Minor Changes

-   Add support for tracing with the APOLLO_TRACING env var

## 1.3.0

### Minor Changes

-   Increase apollo server bodyParserConfig limit to 4mb, default is 100kb which causes Payload Too Large errors.

## 1.2.0

### Minor Changes

-   Exported `logger`.
-   Updated dependencies []
    -   @theorchard/jwt-service-handler@1.0.6

## 1.1.8

### Patch Changes

-   Removed format.colorize() in logger.ts

## 1.1.7

### Patch Changes

-   Re-export env util from @theorchard/utils-environment

## 1.1.6

### Patch Changes

-   Use utils-environment package

## 1.1.5

### Patch Changes

-   Bump ddtrace version to 1.3.0

## 1.1.4

### Patch Changes

-   Change git hash in datadog version opt-in.

## 1.1.3

### Patch Changes

-   Upgrades to the latest dd-trace version
-   Appends the first 7 numbers of the git hash to the dd version

## 1.1.2

### Patch Changes

-   Downgrade dd-trace to 0.36.3

## 1.1.1

### Patch Changes

-   Bumps dd-trace version
-   Return dd tracer from init call

## 1.1.1-beta

### Patch Changes

-   Add option to configure the variables to record in the graphql datadog plugin

## 1.1.0

### Minor Changes

-   Use fargate task revision + git commit as DD_VERSION

## 1.0.13

### Patch Changes

-   Pull brand from the JWT and add to GraphQL context

## 1.0.12

### Patch Changes

-   Updated dependencies
    -   @theorchard/jwt-service-handler@1.0.5

## 1.0.11

### Patch Changes

-   Use renamed ows-utils => field-validator package

## 1.0.10

### Patch Changes

-   Removed Hmac authorization log
-   Updated dependencies
    -   @theorchard/jwt-service-handler@1.0.4

## 1.0.9

### Patch Changes

-   Fix JwtHandler creation
-   Updated dependencies
    -   @theorchard/jwt-service-handler@1.0.3

## 1.0.8

### Patch Changes

-   Add initServer callback

## 1.0.7

### Patch Changes

-   Fix bug were the jwt enabled services were stored as a string in the local cache.
-   Updated dependencies
    -   @theorchard/jwt-service-handler@1.0.2

## 1.0.6

### Patch Changes

-   Remove automatic legacy headers conversion
-   Fix requestor service header
-   Do not remove auth header when using the getUpstreamHeaders util

## 1.0.5

### Patch Changes

-   Do not forward aut header on HMAC tokens

## 1.0.4

### Patch Changes

-   Updated dependencies
    -   @theorchard/ows-utils@1.0.1

## 1.0.3

### Patch Changes

-   Fix jwt output

## 1.0.2

### Patch Changes

-   Improve JWT handling
-   Updated dependencies
    -   @theorchard/jwt-service-handler@1.0.1

## 1.0.1

### Patch Changes

-   Refactors identity headers in the apollo context.
-   Updated dependencies
    -   @theorchard/datasource-ows@1.0.8
    -   @theorchard/identity@1.0.0
