Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ardatan/graphql-tools
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: @graphql-tools/load-files@6.3.1
Choose a base ref
...
head repository: ardatan/graphql-tools
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: @graphql-tools/load-files@6.3.2
Choose a head ref

Commits on Mar 11, 2021

  1. fix(deps): update dependency graphql-ws to v4.2.1 (#2721)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 11, 2021
    Copy the full SHA
    bd53235 View commit details

Commits on Mar 12, 2021

  1. chore(deps): update dependency @types/node to v14.14.34 (#2725)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 12, 2021
    Copy the full SHA
    9f02bbb View commit details
  2. chore(deps): update dependency patch-package to v6.4.7 (#2726)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 12, 2021
    Copy the full SHA
    f4277c9 View commit details
  3. Add generic pruning filter option (#2724)

    * Add generic pruning filter option
    
    * Add changeset
    
    Co-authored-by: Shane Myrick <accounts@shanemyrick.com>
    smyrick and Shane Myrick authored Mar 12, 2021
    Copy the full SHA
    5b637e2 View commit details
  4. chore(release): update monorepo packages versions (#2727)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored Mar 12, 2021
    Copy the full SHA
    233a3f7 View commit details

Commits on Mar 13, 2021

  1. chore(deps): update dependency eslint to v7.22.0 (#2728)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 13, 2021
    Copy the full SHA
    42c6b71 View commit details
  2. chore(deps): update dependency @types/babel__traverse to v7.11.1 (#2730)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 13, 2021
    Copy the full SHA
    d43b000 View commit details

Commits on Mar 14, 2021

  1. chore(deps): update dependency typedoc to v0.20.31 (#2731)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 14, 2021
    Copy the full SHA
    c95f32e View commit details

Commits on Mar 15, 2021

  1. chore(deps): update dependency typedoc to v0.20.32 (#2733)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 15, 2021
    Copy the full SHA
    3ca228b View commit details
  2. fix(deps): update dependency @babel/parser to v7.13.11 (#2734)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 15, 2021
    Copy the full SHA
    3bc37f1 View commit details
  3. chore(deps): update typescript-eslint monorepo to v4.18.0 (#2738)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 15, 2021
    Copy the full SHA
    d8c9485 View commit details

Commits on Mar 16, 2021

  1. chore(deps): update dependency @apollo/client to v3.3.12 (#2736)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 16, 2021
    Copy the full SHA
    bd67e5b View commit details
  2. chore(deps): update dependency @types/node to v14.14.35 (#2737)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 16, 2021
    Copy the full SHA
    33abcf5 View commit details

Commits on Mar 17, 2021

  1. chore(deps): update dependency ts-jest to v26.5.4 (#2740)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 17, 2021
    Copy the full SHA
    bd6228f View commit details
  2. chore(deps): update dependency @types/jest to v26.0.21 (#2741)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 17, 2021
    Copy the full SHA
    aaf6d8d View commit details
  3. fix(deps): update dependency graphql-ws to v4.2.2 (#2742)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 17, 2021
    Copy the full SHA
    8ad1449 View commit details

Commits on Mar 18, 2021

  1. fix(deps): update dependency eventsource to v1.1.0 (#2743)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 18, 2021
    Copy the full SHA
    ae2fd7d View commit details

Commits on Mar 19, 2021

  1. fix(deps): update docusaurus monorepo to v2.0.0-alpha.ffe8b6106 (#2722)

    * fix(deps): update docusaurus monorepo to v2.0.0-alpha.ffe8b6106
    
    * fix patch-package
    
    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com>
    3 people authored Mar 19, 2021
    Copy the full SHA
    876e65f View commit details
  2. chore(deps): update dependency @changesets/cli to v2.14.1 (#2552)

    * chore(deps): update dependency @changesets/cli to v2.14.1
    
    * fix patch
    
    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com>
    3 people authored Mar 19, 2021
    Copy the full SHA
    45d1e36 View commit details
  3. chore(deps): update dependency @changesets/apply-release-plan to v4.2…

    ….0 (#2544)
    
    * chore(deps): update dependency @changesets/apply-release-plan to v4.2.0
    
    * fix patch
    
    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com>
    3 people authored Mar 19, 2021
    Copy the full SHA
    299d44a View commit details
  4. fix(deps): update dependency cross-fetch to v3.1.1 (#2729)

    * fix(deps): update dependency cross-fetch to v3.1.1
    
    * changeset
    
    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com>
    3 people authored Mar 19, 2021
    Copy the full SHA
    50bc217 View commit details
  5. Use Promise instead of Bluebird in Prisma Loader (#2732)

    * Use Promise instead of Bluebird in Prisma Loader
    
    * fix tests
    
    Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com>
    kamilkisiela and ardatan authored Mar 19, 2021
    Copy the full SHA
    de05971 View commit details
  6. Update deps

    ardatan committed Mar 19, 2021
    Copy the full SHA
    517a781 View commit details
  7. chore(release): update monorepo packages versions (#2747)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored Mar 19, 2021
    Copy the full SHA
    8927943 View commit details

Commits on Mar 20, 2021

  1. fix(deps): update dependency cross-fetch to v3.1.2 (#2748)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 20, 2021
    Copy the full SHA
    1c1e69a View commit details

Commits on Mar 22, 2021

  1. chore(deps): update dependency typedoc to v0.20.33 (#2750)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 22, 2021
    Copy the full SHA
    bf9c216 View commit details
  2. fix(deps): update dependency globby to v11.0.3 (#2751)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 22, 2021
    Copy the full SHA
    21efa37 View commit details
  3. fix(deps): update babel monorepo to v7.13.12 (#2753)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 22, 2021
    Copy the full SHA
    e34effe View commit details
  4. chore(deps): update typescript-eslint monorepo to v4.19.0 (#2754)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 22, 2021
    Copy the full SHA
    f8966b0 View commit details

Commits on Mar 23, 2021

  1. fix(deps): update react monorepo to v17.0.2 (#2755)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 23, 2021
    Copy the full SHA
    d0446c7 View commit details
  2. fix(deps): update dependency graphql-ws to v4.2.3 (#2756)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 23, 2021
    Copy the full SHA
    3eb72fd View commit details
  3. Copy the full SHA
    43da6b5 View commit details

Commits on Mar 24, 2021

  1. feat(types): add TContext to stitchSchemas and executor (#2760)

    * feat(types): add TContext to stitchSchemas and executor
    
    * more
    
    * Improve
    
    * Fix build
    ardatan authored Mar 24, 2021
    Copy the full SHA
    58fd4b2 View commit details
  2. chore(release): update monorepo packages versions (#2757)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored Mar 24, 2021
    Copy the full SHA
    a38a9f1 View commit details
  3. Copy the full SHA
    f84e7b1 View commit details
  4. Copy the full SHA
    194ac37 View commit details
  5. chore(release): update monorepo packages versions (#2762)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored Mar 24, 2021
    Copy the full SHA
    3c42fdd View commit details
  6. fix(deps): update dependency relay-compiler to v11.0.1 (#2763)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 24, 2021
    Copy the full SHA
    a8f5abd View commit details
  7. chore(deps): update dependency @apollo/client to v3.3.13 (#2764)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 24, 2021
    Copy the full SHA
    a872d70 View commit details

Commits on Mar 25, 2021

  1. chore(deps): update dependency typedoc to v0.20.34 (#2765)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 25, 2021
    Copy the full SHA
    5aa68bf View commit details
  2. chore(deps): update dependency @types/node to v14.14.36 (#2766)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 25, 2021
    Copy the full SHA
    9b113fc View commit details
  3. chore(deps): update dependency @types/jest to v26.0.22 (#2767)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 25, 2021
    Copy the full SHA
    29fbf0e View commit details

Commits on Mar 26, 2021

  1. fix(deps): update dependency graphql-ws to v4.3.1 (#2769)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 26, 2021
    Copy the full SHA
    8250b29 View commit details
  2. Copy the full SHA
    fba4233 View commit details
  3. Copy the full SHA
    f9db243 View commit details
  4. [deploy_website] Update stitch-schema-extensions.md (#2771)

    At least minor explanation :)
    tomasstrejcek authored Mar 26, 2021
    Copy the full SHA
    bac0e5a View commit details

Commits on Mar 27, 2021

  1. chore(deps): update babel monorepo to v7.13.13 (#2772)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 27, 2021
    Copy the full SHA
    27ccd14 View commit details
  2. chore(deps): update dependency @types/node to v14.14.37 (#2774)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 27, 2021
    Copy the full SHA
    14e0483 View commit details
  3. chore(deps): update dependency @vue/compiler-sfc to v3.0.8 (#2773)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 27, 2021
    Copy the full SHA
    0f69d88 View commit details
  4. chore(deps): update dependency eslint to v7.23.0 (#2775)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 27, 2021
    Copy the full SHA
    2d934f6 View commit details
Showing with 3,061 additions and 4,542 deletions.
  1. +15 −15 package.json
  2. +3 −3 packages/batch-delegate/package.json
  3. +43 −30 packages/batch-execute/CHANGELOG.md
  4. +2 −2 packages/batch-execute/package.json
  5. +1 −3 packages/batch-execute/src/createBatchingExecutor.ts
  6. +1 −1 packages/batch-execute/src/getBatchingExecutor.ts
  7. +4 −4 packages/batch-execute/src/mergeExecutionParams.ts
  8. +0 −15 packages/batch-execute/src/types.ts
  9. +21 −0 packages/delegate/CHANGELOG.md
  10. +3 −3 packages/delegate/package.json
  11. +11 −16 packages/delegate/src/Subschema.ts
  12. +7 −13 packages/delegate/src/delegateToSchema.ts
  13. +1 −0 packages/delegate/src/index.ts
  14. +28 −50 packages/delegate/src/types.ts
  15. +5 −5 packages/graphql-tag-pluck/package.json
  16. +13 −0 packages/links/CHANGELOG.md
  17. +5 −5 packages/links/package.json
  18. +1 −2 packages/links/src/linkToExecutor.ts
  19. +1 −2 packages/links/src/linkToSubscriber.ts
  20. +6 −0 packages/load-files/CHANGELOG.md
  21. +2 −2 packages/load-files/package.json
  22. +0 −9 packages/load-files/src/index.ts
  23. +1 −1 packages/load/package.json
  24. +1 −1 packages/loaders/apollo-engine/package.json
  25. +1 −1 packages/loaders/github/package.json
  26. +11 −0 packages/loaders/prisma/CHANGELOG.md
  27. +2 −4 packages/loaders/prisma/package.json
  28. +35 −22 packages/loaders/prisma/src/prisma-yml/Variables.ts
  29. +3 −37 packages/loaders/prisma/src/prisma-yml/__snapshots__/PrismaDefinition.test.ts.snap
  30. +0 −114 packages/loaders/prisma/src/prisma-yml/prisma-json-schema.ts
  31. +2 −43 packages/loaders/prisma/src/prisma-yml/yaml.ts
  32. +6 −0 packages/loaders/url/CHANGELOG.md
  33. +4 −4 packages/loaders/url/package.json
  34. +12 −6 packages/loaders/url/src/index.ts
  35. +9 −0 packages/merge/CHANGELOG.md
  36. +2 −2 packages/merge/package.json
  37. +3 −8 packages/merge/src/typedefs-mergers/comments.ts
  38. +53 −47 packages/merge/src/typedefs-mergers/merge-nodes.ts
  39. +88 −57 packages/merge/src/typedefs-mergers/merge-typedefs.ts
  40. +51 −0 packages/merge/src/typedefs-mergers/schema-def.ts
  41. +16 −81 packages/merge/src/typedefs-mergers/utils.ts
  42. +1 −1 packages/relay-operation-optimizer/package.json
  43. +14 −0 packages/stitch/CHANGELOG.md
  44. +4 −4 packages/stitch/package.json
  45. +8 −8 packages/stitch/src/stitchSchemas.ts
  46. +50 −42 packages/stitch/src/types.ts
  47. +22 −0 packages/utils/CHANGELOG.md
  48. +1 −1 packages/utils/package.json
  49. +39 −0 packages/utils/src/executor.ts
  50. +1 −0 packages/utils/src/index.ts
  51. +5 −0 packages/utils/src/prune.ts
  52. +9 −1 packages/utils/src/types.ts
  53. +106 −1 packages/utils/tests/prune.test.ts
  54. +1 −2 packages/wrap/src/introspect.ts
  55. +2 −1 packages/wrap/src/makeRemoteExecutableSchema.ts
  56. +15 −12 packages/wrap/src/types.ts
  57. +30 −30 patches/{@changesets+apply-release-plan+4.0.0.patch → @changesets+apply-release-plan+4.2.0.patch}
  58. +6 −19 patches/{@changesets+cli+2.13.0.patch → @changesets+cli+2.14.1.patch}
  59. 0 patches/{@docsearch+react+3.0.0-alpha.32.patch → @docsearch+react+3.0.0-alpha.34.patch}
  60. +0 −38 patches/@docusaurus+theme-search-algolia+2.0.0-alpha.fd17476c3.patch
  61. +13 −0 patches/@docusaurus+theme-search-algolia+2.0.0-alpha.ffe8b6106.patch
  62. +14 −1 website/docs/migration-from-tools.md
  63. +1 −1 website/docs/schema-directives.md
  64. +2 −0 website/docs/stitch-schema-extensions.md
  65. +4 −4 website/package.json
  66. +2,240 −3,768 yarn.lock
30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -41,20 +41,19 @@
"graphql": "^14.0.0 || ^15.0.0"
},
"devDependencies": {
"patch-package": "6.4.6",
"@babel/core": "7.13.10",
"@babel/preset-env": "7.13.10",
"@babel/preset-typescript": "7.13.0",
"@babel/plugin-proposal-class-properties": "7.13.0",
"@changesets/cli": "2.14.0",
"@types/jest": "26.0.20",
"@types/node": "14.14.33",
"@typescript-eslint/eslint-plugin": "4.17.0",
"@typescript-eslint/parser": "4.17.0",
"@ardatan/bob-the-bundler": "1.2.2",
"@babel/core": "7.13.14",
"@babel/plugin-proposal-class-properties": "7.13.0",
"@babel/preset-env": "7.13.12",
"@babel/preset-typescript": "7.13.0",
"@changesets/cli": "2.14.1",
"@types/jest": "26.0.22",
"@types/node": "14.14.37",
"@typescript-eslint/eslint-plugin": "4.20.0",
"@typescript-eslint/parser": "4.20.0",
"babel-jest": "26.6.3",
"concurrently": "6.0.0",
"eslint": "7.21.0",
"eslint": "7.23.0",
"eslint-config-prettier": "8.1.0",
"eslint-config-standard": "16.0.2",
"eslint-plugin-import": "2.22.1",
@@ -64,13 +63,14 @@
"graphql": "15.5.0",
"graphql-helix": "1.2.3",
"graphql-subscriptions": "1.2.1",
"husky": "4.3.8",
"husky": "6.0.0",
"jest": "26.6.3",
"lint-staged": "10.5.4",
"nock": "13.0.11",
"patch-package": "6.4.7",
"prettier": "2.2.1",
"ts-jest": "26.5.3",
"typedoc": "0.20.30",
"ts-jest": "26.5.4",
"typedoc": "0.20.34",
"typedoc-plugin-markdown": "3.6.0",
"typescript": "4.2.3"
},
@@ -99,6 +99,6 @@
},
"resolutions": {
"graphql": "15.5.0",
"@changesets/apply-release-plan": "4.0.0"
"@changesets/apply-release-plan": "4.2.0"
}
}
6 changes: 3 additions & 3 deletions packages/batch-delegate/package.json
Original file line number Diff line number Diff line change
@@ -22,14 +22,14 @@
"input": "./src/index.ts"
},
"dependencies": {
"@graphql-tools/delegate": "^7.0.10",
"@graphql-tools/delegate": "^7.1.1",
"dataloader": "2.0.0",
"tslib": "~2.1.0"
},
"devDependencies": {
"@graphql-tools/schema": "7.1.3",
"@graphql-tools/stitch": "7.4.0",
"@graphql-tools/utils": "7.5.2"
"@graphql-tools/stitch": "7.5.0",
"@graphql-tools/utils": "7.7.1"
},
"publishConfig": {
"access": "public",
73 changes: 43 additions & 30 deletions packages/batch-execute/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,68 +1,81 @@
# @graphql-tools/batch-execute

## 7.1.0

### Minor Changes

- 58fd4b28: feat(types): add TContext to stitchSchemas and executor

### Patch Changes

- Updated dependencies [58fd4b28]
- Updated dependencies [43da6b59]
- @graphql-tools/utils@7.7.0

## 7.0.0

### Major Changes

- be1a1575: ## Breaking Changes:

#### Schema Generation and Decoration API (`@graphql-tools/schema`)

- Resolver validation options should now be set to `error`, `warn` or `ignore` rather than `true` or `false`. In previous versions, some of the validators caused errors to be thrown, while some issued warnings. This changes brings consistency to validator behavior.

- The `allowResolversNotInSchema` has been renamed to `requireResolversToMatchSchema`, to harmonize the naming convention of all the validators. The default setting of `requireResolversToMatchSchema` is `error`, matching the previous behavior.

#### Schema Delegation (`delegateToSchema` & `@graphql-tools/delegate`)

- The `delegateToSchema` return value has matured and been formalized as an `ExternalObject`, in which all errors are integrated into the GraphQL response, preserving their initial path. Those advanced users accessing the result directly will note the change in error handling. This also allows for the deprecation of unnecessary helper functions including `slicedError`, `getErrors`, `getErrorsByPathSegment` functions. Only external errors with missing or invalid paths must still be preserved by annotating the remote object with special properties. The new `getUnpathedErrors` function is therefore necessary for retrieving only these errors. Note also the new `annotateExternalObject` and `mergeExternalObjects` functions, as well as the renaming of `handleResult` to `resolveExternalValue`.

- Transform types and the `applySchemaTransforms` are now relocated to the `delegate` package; `applyRequestTransforms`/`applyResultTransforms` functions have been deprecated, however, as this functionality has been replaced since v6 by the `Transformer` abstraction.

- The `transformRequest`/`transformResult` methods are now provided additional `delegationContext` and `transformationContext` arguments -- these were introduced in v6, but previously optional.

- The `transformSchema` method may wish to create additional delegating resolvers and so it is now provided the `subschemaConfig` and final (non-executable) `transformedSchema` parameters. As in v6, the `transformSchema` is kicked off once to produce the non-executable version, and then, if a wrapping schema is being generated, proxying resolvers are created with access to the (non-executable) initial result. In v7, the individual `transformSchema` methods also get access to the result of the first run, if necessary, they can create additional wrapping schema proxying resolvers.

- `applySchemaTransforms` parameters have been updated to match and support the `transformSchema` parameters above.

#### Remote Schemas & Wrapping (`wrapSchema`, `makeRemoteExecutableSchema`, and `@graphql-tools/wrap`)

- `wrapSchema` and `generateProxyingResolvers` now only take a single options argument with named properties of type `SubschemaConfig`. The previously possible shorthand version with first argument consisting of a `GraphQLSchema` and second argument representing the transforms should be reworked as a `SubschemaConfig` object.
- Similarly, the `ICreateProxyingResolverOptions` interface that provides the options for the `createProxyingResolver` property of `SubschemaConfig` options has been adjusted. The `schema` property previously could be set to a `GraphQLSchema` or a `SubschemaConfig` object. This property has been removed in favor of a `subschemaConfig` property that will always be a `SubschemaConfig` object. The `transforms` property has been removed; transforms should be included within the `SubschemaConfig` object.`

- Similarly, the `ICreateProxyingResolverOptions` interface that provides the options for the `createProxyingResolver` property of `SubschemaConfig` options has been adjusted. The `schema` property previously could be set to a `GraphQLSchema` or a `SubschemaConfig` object. This property has been removed in favor of a `subschemaConfig` property that will always be a `SubschemaConfig` object. The `transforms` property has been removed; transforms should be included within the `SubschemaConfig` object.`

- The format of the wrapping schema has solidified. All non-root fields are expected to use identical resolvers, either `defaultMergedResolver` or a custom equivalent, with root fields doing the hard work of proxying. Support for custom merged resolvers throught `createMergedResolver` has been deprecated, as custom merging resolvers conflicts when using stitching's type merging, where resolvers are expected to be identical across subschemas.

- The `WrapFields` transform's `wrappingResolver` option has been removed, as this complicates multiple wrapping layers, as well as planned functionality to wrap subscription root fields in potentially multiple layers, as the wrapping resolvers may be different in different layers. Modifying resolvers can still be performed by use of an additional transform such as `TransformRootFields` or `TransformObjectFields`.

- The `ExtendSchema` transform has been removed, as it is conceptually simpler just to use `stitchSchemas` with one subschema.

- The `ReplaceFieldsWithFragment`, `AddFragmentsByField`, `AddSelectionSetsByField`, and `AddMergedTypeSelectionSets` transforms has been removed, as they are superseded by the `AddSelectionSets` and `VisitSelectionSets` transforms. The `AddSelectionSets` purposely takes parsed SDL rather than strings, to nudge end users to parse these strings at build time (when possible), rather than at runtime. Parsing of selection set strings can be performed using the `parseSelectionSet` function from `@graphql-tools/utils`.

#### Schema Stitching (`stitchSchemas` & `@graphql-tools/stitch`)

- `stitchSchemas`'s `mergeTypes` option is now true by default! This causes the `onTypeConflict` option to be ignored by default. To use `onTypeConflict` to select a specific type instead of simply merging, simply set `mergeTypes` to false.

- `schemas` argument has been deprecated, use `subschemas`, `typeDefs`, or `types`, depending on what you are stitching.

- When using batch delegation in type merging, the `argsFromKeys` function is now set only via the `argsFromKeys` property. Previously, if `argsFromKeys` was absent, it could be read from `args`.

- Support for fragment hints has been removed in favor of selection set hints.

- `stitchSchemas` now processes all `GraphQLSchema` and `SubschemaConfig` subschema input into new `Subschema` objects, handling schema config directives such aso`@computed` as well as generating the final transformed schema, stored as the `transformedSchema` property, if transforms are used. Signatures of the `onTypeConflict`, `fieldConfigMerger`, and `inputFieldConfigMerger` have been updated to include metadata related to the original and transformed subschemas. Note the property name change for `onTypeConflict` from `schema` to `subschema`.

#### Mocking (`addMocksToSchema` and `@graphql-tools/mock`)

- Mocks returning objects with fields set as functions are now operating according to upstream graphql-js convention, i.e. these functions take three arguments, `args`, `context`, and `info` with `parent` available as `this` rather than as the first argument.

#### Other Utilities (`@graphql-tools/utils`)
- `filterSchema`'s `fieldFilter` will now filter *all* fields across Object, Interface, and Input types. For the previous Object-only behavior, switch to the `objectFieldFilter` option.

- `filterSchema`'s `fieldFilter` will now filter _all_ fields across Object, Interface, and Input types. For the previous Object-only behavior, switch to the `objectFieldFilter` option.
- Unused `fieldNodes` utility functions have been removed.
- Unused `typeContainsSelectionSet` function has been removed, and `typesContainSelectionSet` has been moved to the `stitch` package.
- Unnecessary `Operation` type has been removed in favor of `OperationTypeNode` from upstream graphql-js.
- As above, `applySchemaTransforms`/`applyRequestTransforms`/`applyResultTransforms` have been removed from the `utils` package, as they are implemented elsewhere or no longer necessary.

## Related Issues

- proxy all the errors: #1047, #1641
- better error handling for merges #2016, #2062
- fix typings #1614
4 changes: 2 additions & 2 deletions packages/batch-execute/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@graphql-tools/batch-execute",
"version": "7.0.0",
"version": "7.1.0",
"description": "A set of utils for faster development of GraphQL tools",
"repository": {
"type": "git",
@@ -22,7 +22,7 @@
"input": "./src/index.ts"
},
"dependencies": {
"@graphql-tools/utils": "^7.0.0",
"@graphql-tools/utils": "^7.7.0",
"dataloader": "2.0.0",
"is-promise": "4.0.0",
"tslib": "~2.1.0"
4 changes: 1 addition & 3 deletions packages/batch-execute/src/createBatchingExecutor.ts
Original file line number Diff line number Diff line change
@@ -4,9 +4,7 @@ import isPromise from 'is-promise';

import DataLoader from 'dataloader';

import { ExecutionResult } from '@graphql-tools/utils';

import { ExecutionParams, Executor } from './types';
import { ExecutionParams, Executor, ExecutionResult } from '@graphql-tools/utils';

import { mergeExecutionParams } from './mergeExecutionParams';
import { splitResult } from './splitResult';
2 changes: 1 addition & 1 deletion packages/batch-execute/src/getBatchingExecutor.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import DataLoader from 'dataloader';

import { ExecutionParams, Executor } from './types';
import { ExecutionParams, Executor } from '@graphql-tools/utils';
import { createBatchingExecutor } from './createBatchingExecutor';
import { memoize2of4 } from './memoize';

8 changes: 4 additions & 4 deletions packages/batch-execute/src/mergeExecutionParams.ts
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ import {
OperationTypeNode,
} from 'graphql';

import { ExecutionParams } from './types';
import { ExecutionParams } from '@graphql-tools/utils';

import { createPrefix } from './prefix';

@@ -150,9 +150,9 @@ function aliasTopLevelFields(prefix: string, document: DocumentNode): DocumentNo
};
},
};
return visit(document, transformer, ({ [Kind.DOCUMENT]: [`definitions`] } as unknown) as VisitorKeyMap<
ASTKindToNode
>);
return visit(document, transformer, ({
[Kind.DOCUMENT]: [`definitions`],
} as unknown) as VisitorKeyMap<ASTKindToNode>);
}

/**
15 changes: 0 additions & 15 deletions packages/batch-execute/src/types.ts

This file was deleted.

21 changes: 21 additions & 0 deletions packages/delegate/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# @graphql-tools/delegate

## 7.1.1

### Patch Changes

- f84e7b15: fix(delegate): export executor typings not to have breaking change
- Updated dependencies [194ac370]
- @graphql-tools/utils@7.7.1

## 7.1.0

### Minor Changes

- 58fd4b28: feat(types): add TContext to stitchSchemas and executor

### Patch Changes

- Updated dependencies [58fd4b28]
- Updated dependencies [43da6b59]
- @graphql-tools/batch-execute@7.1.0
- @graphql-tools/utils@7.7.0

## 7.0.10

### Patch Changes
6 changes: 3 additions & 3 deletions packages/delegate/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@graphql-tools/delegate",
"version": "7.0.10",
"version": "7.1.1",
"description": "A set of utils for faster development of GraphQL tools",
"repository": {
"type": "git",
@@ -22,9 +22,9 @@
"input": "./src/index.ts"
},
"dependencies": {
"@graphql-tools/batch-execute": "^7.0.0",
"@graphql-tools/batch-execute": "^7.1.0",
"@graphql-tools/schema": "^7.0.0",
"@graphql-tools/utils": "^7.1.6",
"@graphql-tools/utils": "^7.7.1",
"@ardatan/aggregate-error": "0.0.6",
"dataloader": "2.0.0",
"is-promise": "4.0.0",
27 changes: 11 additions & 16 deletions packages/delegate/src/Subschema.ts
Original file line number Diff line number Diff line change
@@ -1,41 +1,36 @@
import { GraphQLSchema } from 'graphql';

import {
SubschemaConfig,
Transform,
MergedTypeConfig,
CreateProxyingResolverFn,
Subscriber,
Executor,
BatchingOptions,
} from './types';
import { SubschemaConfig, Transform, MergedTypeConfig, CreateProxyingResolverFn, BatchingOptions } from './types';

import { applySchemaTransforms } from './applySchemaTransforms';
import { Executor, Subscriber } from '@graphql-tools/utils';

export function isSubschema(value: any): value is Subschema {
return Boolean(value.transformedSchema);
}

interface ISubschema extends SubschemaConfig {
interface ISubschema<K = any, V = any, C = K, TContext = Record<string, any>>
extends SubschemaConfig<K, V, C, TContext> {
transformedSchema: GraphQLSchema;
}

export class Subschema<K = any, V = any, C = K> implements ISubschema {
export class Subschema<K = any, V = any, C = K, TContext = Record<string, any>>
implements ISubschema<K, V, C, TContext> {
public schema: GraphQLSchema;

public rootValue?: Record<string, any>;
public executor?: Executor;
public subscriber?: Subscriber;
public executor?: Executor<TContext>;
public subscriber?: Subscriber<TContext>;
public batch?: boolean;
public batchingOptions?: BatchingOptions<K, V, C>;

public createProxyingResolver?: CreateProxyingResolverFn;
public createProxyingResolver?: CreateProxyingResolverFn<TContext>;
public transforms: Array<Transform>;
public transformedSchema: GraphQLSchema;

public merge?: Record<string, MergedTypeConfig>;
public merge?: Record<string, MergedTypeConfig<any, any, TContext>>;

constructor(config: SubschemaConfig) {
constructor(config: SubschemaConfig<K, V, C, TContext>) {
this.schema = config.schema;

this.rootValue = config.rootValue;
Loading