From f4c8fe88b463cd49193659fc08400c844c68ddf2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 4 Jan 2022 12:26:10 +0200 Subject: [PATCH] Version Packages (#113) Co-authored-by: github-actions[bot] --- .changeset/nasty-ties-admire.md | 5 ---- .changeset/poor-grapes-lie.md | 23 --------------- .changeset/rotten-planets-worry.md | 7 ----- .changeset/thirty-monkeys-fail.md | 11 ------- .changeset/yellow-olives-drop.md | 13 --------- CHANGELOG.md | 47 ++++++++++++++++++++++++++++++ package-lock.json | 4 +-- package.json | 2 +- 8 files changed, 50 insertions(+), 62 deletions(-) delete mode 100644 .changeset/nasty-ties-admire.md delete mode 100644 .changeset/poor-grapes-lie.md delete mode 100644 .changeset/rotten-planets-worry.md delete mode 100644 .changeset/thirty-monkeys-fail.md delete mode 100644 .changeset/yellow-olives-drop.md diff --git a/.changeset/nasty-ties-admire.md b/.changeset/nasty-ties-admire.md deleted file mode 100644 index 488babbad8..0000000000 --- a/.changeset/nasty-ties-admire.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'graphql-executor': patch ---- - -Add graphql-js v14 support diff --git a/.changeset/poor-grapes-lie.md b/.changeset/poor-grapes-lie.md deleted file mode 100644 index 63b38ec590..0000000000 --- a/.changeset/poor-grapes-lie.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -'graphql-executor': patch ---- - -Introduce the `ExecutorSchema` interface - -`graphql-executor` "upgrades" `GraphQLSchema` objects created with `graphql-js` v14 and v15 to a `graphql-js` v16-compatibile version by providing utility functions that analyze the schema and provide all the necessary metadata. This change introduces the the `ExecutorSchema` interface so that clients can explicitly perform this schema preparation step. - -The included (memoized) `toExectorSchema` utility function generates an `ExecutorSchema` from a `GraphQLSchema` object and is called implicitly if only a `GraphQLSchema` is passed to the executor. Using the new `executorSchema` option, however, a pre-specified `ExecutorSchema` instance can be used. In this case, the `GraphQLSchema` passed via the `schema` option is never used by `graphql-executor` and only required so that it can be passed through to resolvers via the `info` argument. - -The `ExecutorSchema` is also passed to resolvers within an `executorSchema` property added to the `info` argument (using TypeScript interface merging). This property is populated both when the `ExecutorSchema` is provided explicitly and when it is generated from the `GraphQLSchema`. - -BREAKING CHANGE: - -The `Executor` class is now instantiated with an configuration object containing a `schema` of type `GraphQLSchema` and an optional `executorSchema` of type `ExecutorSchema`. Previously, the executor was instantiated without any parameters. - -NOTE: - -When the executor is instantiated with both a `schema` and an `executorSchema`: - -1. `graphql-executor` does not validate the `schema` or `executorSchema`. -2. `graphql-executor` does not check whether the `executorSchema` matches the `schema`. -3. `graphql-executor` does not utilize the `schema` in any way except to pass its value to resolvers as a property of the `info` argument. diff --git a/.changeset/rotten-planets-worry.md b/.changeset/rotten-planets-worry.md deleted file mode 100644 index aa9f0180a9..0000000000 --- a/.changeset/rotten-planets-worry.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'graphql-executor': patch ---- - -remove createSourceEventStream function export - -BREAKING CHANGE: access to createSourceEventStream is still possible in advanced cases, but now only via an explicitly created instance of the internal Executor class. diff --git a/.changeset/thirty-monkeys-fail.md b/.changeset/thirty-monkeys-fail.md deleted file mode 100644 index 7a3d6cf7ad..0000000000 --- a/.changeset/thirty-monkeys-fail.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -'graphql-executor': patch ---- - -Skip schema validation prior to first use. - -Schemas can (and should!) still be validated when and where appropriate using the dedicated graphql-js validateSchema method. - -graphql-js validates previously unvalidated schemas prior to the first execution. The validation step is skipped by graphql-js if and only if the schema was created with the `assumeValid` option, which essentially triggers a faux validation run that produces no errors. - -graphql-executor now simply does not automatically validate schemas, preferring to require servers to explicitly validate schemas when and where appropriate, just as document validation is a distinct, explicit step. diff --git a/.changeset/yellow-olives-drop.md b/.changeset/yellow-olives-drop.md deleted file mode 100644 index 141e672be5..0000000000 --- a/.changeset/yellow-olives-drop.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -'graphql-executor': patch ---- - -Allow cross-realm execution - -This is made possible by avoiding instanceof checks within the executor proper. - -New predicates are introduced that rely on Symbol.toStringTag (or error names) to identify objects from other realms. - -Field/type resolvers and isTypeOf functions that are passed GraphQL type system entities and use native graphql-js predicates will still encounter cross-realm errors. - -Cross-realm execution can be avoided by end-users by simply calling the original isSchema predicate from graphql-js. diff --git a/CHANGELOG.md b/CHANGELOG.md index b69a1bf647..0acbbf62db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,52 @@ # graphql-executor +## 0.0.12 + +### Patch Changes + +- d93aa9a2: Add graphql-js v14 support +- 832b8afb: Introduce the `ExecutorSchema` interface + + `graphql-executor` "upgrades" `GraphQLSchema` objects created with `graphql-js` v14 and v15 to a `graphql-js` v16-compatibile version by providing utility functions that analyze the schema and provide all the necessary metadata. This change introduces the the `ExecutorSchema` interface so that clients can explicitly perform this schema preparation step. + + The included (memoized) `toExectorSchema` utility function generates an `ExecutorSchema` from a `GraphQLSchema` object and is called implicitly if only a `GraphQLSchema` is passed to the executor. Using the new `executorSchema` option, however, a pre-specified `ExecutorSchema` instance can be used. In this case, the `GraphQLSchema` passed via the `schema` option is never used by `graphql-executor` and only required so that it can be passed through to resolvers via the `info` argument. + + The `ExecutorSchema` is also passed to resolvers within an `executorSchema` property added to the `info` argument (using TypeScript interface merging). This property is populated both when the `ExecutorSchema` is provided explicitly and when it is generated from the `GraphQLSchema`. + + BREAKING CHANGE: + + The `Executor` class is now instantiated with an configuration object containing a `schema` of type `GraphQLSchema` and an optional `executorSchema` of type `ExecutorSchema`. Previously, the executor was instantiated without any parameters. + + NOTE: + + When the executor is instantiated with both a `schema` and an `executorSchema`: + + 1. `graphql-executor` does not validate the `schema` or `executorSchema`. + 2. `graphql-executor` does not check whether the `executorSchema` matches the `schema`. + 3. `graphql-executor` does not utilize the `schema` in any way except to pass its value to resolvers as a property of the `info` argument. + +- ac0430a1: remove createSourceEventStream function export + + BREAKING CHANGE: access to createSourceEventStream is still possible in advanced cases, but now only via an explicitly created instance of the internal Executor class. + +- d06133c6: Skip schema validation prior to first use. + + Schemas can (and should!) still be validated when and where appropriate using the dedicated graphql-js validateSchema method. + + graphql-js validates previously unvalidated schemas prior to the first execution. The validation step is skipped by graphql-js if and only if the schema was created with the `assumeValid` option, which essentially triggers a faux validation run that produces no errors. + + graphql-executor now simply does not automatically validate schemas, preferring to require servers to explicitly validate schemas when and where appropriate, just as document validation is a distinct, explicit step. + +- ecc37585: Allow cross-realm execution + + This is made possible by avoiding instanceof checks within the executor proper. + + New predicates are introduced that rely on Symbol.toStringTag (or error names) to identify objects from other realms. + + Field/type resolvers and isTypeOf functions that are passed GraphQL type system entities and use native graphql-js predicates will still encounter cross-realm errors. + + Cross-realm execution can be avoided by end-users by simply calling the original isSchema predicate from graphql-js. + ## 0.0.11 ### Patch Changes diff --git a/package-lock.json b/package-lock.json index 9137239e8f..b459233c92 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "graphql-executor", - "version": "0.0.11", + "version": "0.0.12", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "graphql-executor", - "version": "0.0.11", + "version": "0.0.12", "license": "MIT", "devDependencies": { "@babel/core": "7.16.5", diff --git a/package.json b/package.json index 7cd9ef4abd..1dfbaaef35 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "graphql-executor", - "version": "0.0.11", + "version": "0.0.12", "description": "A customizable GraphQL Spec compliant Executor class.", "license": "MIT", "main": "index",