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/merge@6.2.10
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/merge@6.2.11
Choose a head ref

Commits on Feb 24, 2021

  1. chore(deps): update dependency eslint-config-prettier to v8.1.0 (#2647)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Feb 24, 2021
    Copy the full SHA
    b360ca7 View commit details
  2. fix(batchDelegate): don't batch delegation to different root fields (#…

    …2648)
    
    * fix(batchDelegate): don't batch delegation to different root fields
    
    see #2638
    
    * add changeset
    
    * don't change exported type until next major release
    
    this type probably doesn't need to be exported anyway
    yaacovCR authored Feb 24, 2021
    Copy the full SHA
    048d62d View commit details
  3. chore(deps): update dependency @vue/compiler-sfc to v3.0.6 (#2650)

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

Commits on Feb 25, 2021

  1. chore(release): update monorepo packages versions (#2649)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored Feb 25, 2021
    Copy the full SHA
    e343815 View commit details
  2. chore(deps): update dependency nock to v13.0.8 (#2651)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Feb 25, 2021
    Copy the full SHA
    360f74d View commit details
  3. chore(CI): fix Jest cache

    ardatan committed Feb 25, 2021
    Copy the full SHA
    698f091 View commit details
  4. fix(load-files): fix ignored file bug when filename finishes with ext… (

    #2653)
    
    * fix(load-files): fix ignored file bug when filename finishes with extension
    
    * cleanup(load-files): Remove duplicated test
    Nighthawk14 authored Feb 25, 2021
    Copy the full SHA
    2c98084 View commit details
  5. fix(deps): update dependency graphql-ws to v4.2.0 (#2654)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Feb 25, 2021
    Copy the full SHA
    3bb34ad View commit details
  6. Copy the full SHA
    5c7a20d View commit details
  7. chore(release): update monorepo packages versions (#2655)

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

Commits on Feb 26, 2021

  1. feat(load-files): Allow extensions and ignoredExtensions to have a tr… (

    #2658)
    
    * feat(load-files): Allow extensions and ignoredExtensions to have a trailing dot
    
    * Add changeset
    Antoine Savignac authored Feb 26, 2021
    Copy the full SHA
    69eec3a View commit details
  2. Copy the full SHA
    981e3ef View commit details

Commits on Feb 28, 2021

  1. feat(mock): add reset method to MockStore (#2661)

    * feat(mock): add reset method to MockStore
    
    * Add tests
    ardatan committed Feb 28, 2021
    Copy the full SHA
    5ac494b View commit details
  2. chore(release): update monorepo packages versions (#2660)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    2 people authored and ardatan committed Feb 28, 2021
    Copy the full SHA
    4eda5f5 View commit details
  3. chore(deps): update dependency graphql-scalars to v1.8.0 (#2662)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    2 people authored and ardatan committed Feb 28, 2021
    Copy the full SHA
    e267617 View commit details
  4. chore(deps): update babel monorepo to v7.13.8 (#2663)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    2 people authored and ardatan committed Feb 28, 2021
    Copy the full SHA
    283a538 View commit details
  5. chore(deps): update dependency nock to v13.0.9 (#2664)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    2 people authored and ardatan committed Feb 28, 2021
    Copy the full SHA
    068ae6e View commit details
  6. chore(deps): update dependency patch-package to v6.3.1 (#2665)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    2 people authored and ardatan committed Feb 28, 2021
    Copy the full SHA
    4a2a729 View commit details
  7. chore(deps): update dependency eslint to v7.21.0 (#2666)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    2 people authored and ardatan committed Feb 28, 2021
    Copy the full SHA
    d63447f View commit details
  8. chore(deps): update dependency typedoc-plugin-markdown to v3.6.0 (#2667)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    2 people authored and ardatan committed Feb 28, 2021
    Copy the full SHA
    74c2690 View commit details
  9. Copy the full SHA
    4e8c07a View commit details

Commits on Mar 1, 2021

  1. Accept a fourth argument in "processImport()" for users to get the re…

    …sult of visitedFiles (#2669)
    
    * feat(mock): add reset method to MockStore (#2661)
    
    * feat(mock): add reset method to MockStore
    
    * Add tests
    
    * chore(release): update monorepo packages versions (#2660)
    
    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    
    * chore(deps): update dependency graphql-scalars to v1.8.0 (#2662)
    
    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    
    * chore(deps): update babel monorepo to v7.13.8 (#2663)
    
    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    
    * chore(deps): update dependency nock to v13.0.9 (#2664)
    
    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    
    * chore(deps): update dependency patch-package to v6.3.1 (#2665)
    
    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    
    * chore(deps): update dependency eslint to v7.21.0 (#2666)
    
    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    
    * chore(deps): update dependency typedoc-plugin-markdown to v3.6.0 (#2667)
    
    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    
    * Accept map for users to get the result of visitedFiles
    
    * fix: Normalize paths for Windows
    
    * Add a changeset by `yarn changeset`
    
    Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com>
    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    6 people committed Mar 1, 2021
    Copy the full SHA
    b8cae68 View commit details
  2. chore(release): update monorepo packages versions (#2670)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    2 people authored and ardatan committed Mar 1, 2021
    Copy the full SHA
    68b4007 View commit details
  3. chore(deps): update dependency patch-package to v6.4.0 (#2671)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    2 people authored and ardatan committed Mar 1, 2021
    Copy the full SHA
    d36a3cd View commit details
  4. Copy the full SHA
    3078fc4 View commit details
  5. chore(release): update monorepo packages versions (#2674)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    2 people authored and ardatan committed Mar 1, 2021
    Copy the full SHA
    f005627 View commit details
  6. chore(deps): update dependency patch-package to v6.4.1 (#2675)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    2 people authored and ardatan committed Mar 1, 2021
    Copy the full SHA
    e9af823 View commit details
  7. chore(deps): update dependency patch-package to v6.4.2 (#2676)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    2 people authored and ardatan committed Mar 1, 2021
    Copy the full SHA
    3051063 View commit details
  8. chore(deps): update dependency @vue/compiler-sfc to v3.0.7 (#2677)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 1, 2021
    Copy the full SHA
    340b7a8 View commit details
  9. chore(deps): update typescript-eslint monorepo (#2678)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 1, 2021
    Copy the full SHA
    8c5361f View commit details
  10. chore(deps): update dependency @typescript-eslint/parser to v4.16.1 (#…

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

Commits on Mar 2, 2021

  1. fix(deps): update babel monorepo to v7.13.9 (#2680)

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

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

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 2, 2021
    Copy the full SHA
    4022b3c View commit details
  4. chore(deps): update dependency nock to v13.0.10 (#2684)

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

Commits on Mar 4, 2021

  1. chore(deps): update dependency typedoc to v0.20.29 (#2688)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 4, 2021
    Copy the full SHA
    8660d9f View commit details
  2. chore(deps): update dependency ts-jest to v26.5.3 (#2689)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 4, 2021
    Copy the full SHA
    f003f7e View commit details
  3. chore(deps): update dependency patch-package to v6.4.5 (#2690)

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

Commits on Mar 5, 2021

  1. chore(deps): update dependency typescript to v4.2.3 (#2692)

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

Commits on Mar 6, 2021

  1. chore(deps): update dependency graphql-subscriptions to v1.2.1 (#2693)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 6, 2021
    Copy the full SHA
    ef34a7c View commit details
  2. chore(deps): update dependency typedoc to v0.20.30 (#2694)

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

Commits on Mar 7, 2021

  1. fix(deps): update dependency ws to v7.4.4 (#2695)

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

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 7, 2021
    Copy the full SHA
    096514a View commit details
  3. fix(deps): update dependency @types/websocket to v1.0.2 (#2697)

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

Commits on Mar 8, 2021

  1. chore(deps): update dependency nock to v13.0.11 (#2698)

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

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 8, 2021
    Copy the full SHA
    4f9a5d2 View commit details
  3. chore(deps): update dependency graphql-scalars to v1.9.0 (#2702)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 8, 2021
    Copy the full SHA
    4c27410 View commit details
  4. [deploy_website] Added codegen to config for indexing (#2704)

    Fixed bug with enter key in search
    tvvignesh authored Mar 8, 2021
    Copy the full SHA
    7ab45c7 View commit details
  5. chore(deps): update typescript-eslint monorepo to v4.17.0 (#2705)

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

Commits on Mar 9, 2021

  1. chore(deps): update babel monorepo to v7.13.10 (#2706)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Mar 9, 2021
    Copy the full SHA
    1ad5c9c View commit details
Showing with 3,978 additions and 4,591 deletions.
  1. +4 −1 .github/PULL_REQUEST_TEMPLATE.md
  2. +1 −4 .github/workflows/canary.yml
  3. +1 −4 .github/workflows/release.yml
  4. +8 −15 .github/workflows/tests.yml
  5. +1 −4 .github/workflows/website.yml
  6. +4 −1 algolia/config.json
  7. +4 −0 babel.config.js
  8. +2 −7 jest.config.js
  9. +20 −15 package.json
  10. +8 −0 packages/batch-delegate/CHANGELOG.md
  11. +4 −4 packages/batch-delegate/package.json
  12. +29 −11 packages/batch-delegate/src/getLoader.ts
  13. +1 −0 packages/batch-delegate/src/types.ts
  14. +43 −30 packages/batch-execute/CHANGELOG.md
  15. +2 −2 packages/batch-execute/package.json
  16. +1 −3 packages/batch-execute/src/createBatchingExecutor.ts
  17. +1 −1 packages/batch-execute/src/getBatchingExecutor.ts
  18. +4 −4 packages/batch-execute/src/mergeExecutionParams.ts
  19. +0 −15 packages/batch-execute/src/types.ts
  20. +13 −0 packages/delegate/CHANGELOG.md
  21. +3 −3 packages/delegate/package.json
  22. +11 −16 packages/delegate/src/Subschema.ts
  23. +7 −13 packages/delegate/src/delegateToSchema.ts
  24. +28 −50 packages/delegate/src/types.ts
  25. +4 −4 packages/graphql-tag-pluck/package.json
  26. +6 −0 packages/import/CHANGELOG.md
  27. +1 −1 packages/import/package.json
  28. +5 −3 packages/import/src/index.ts
  29. +15 −1 packages/import/tests/documents/import-documents.spec.ts
  30. +13 −0 packages/links/CHANGELOG.md
  31. +5 −5 packages/links/package.json
  32. +1 −2 packages/links/src/linkToExecutor.ts
  33. +1 −2 packages/links/src/linkToSubscriber.ts
  34. +24 −0 packages/load-files/CHANGELOG.md
  35. +2 −2 packages/load-files/package.json
  36. +57 −62 packages/load-files/src/index.ts
  37. +101 −53 packages/load-files/tests/file-scanner.spec.ts
  38. +7 −0 packages/load-files/tests/test-assets/13/1.a.b.resolvers.js
  39. +7 −0 packages/load-files/tests/test-assets/13/1.a.b.resolvers.s.js
  40. +5 −0 packages/load-files/tests/test-assets/custom-extractor/factory-func.js
  41. +5 −0 packages/load-files/tests/test-assets/ignore-extensions/test.resolvers.d.ts
  42. +5 −0 packages/load-files/tests/test-assets/ignore-extensions/test.resolvers.js
  43. +1 −1 packages/load/package.json
  44. +1 −1 packages/loaders/apollo-engine/package.json
  45. +1 −1 packages/loaders/github/package.json
  46. +11 −0 packages/loaders/prisma/CHANGELOG.md
  47. +2 −4 packages/loaders/prisma/package.json
  48. +35 −22 packages/loaders/prisma/src/prisma-yml/Variables.ts
  49. +3 −37 packages/loaders/prisma/src/prisma-yml/__snapshots__/PrismaDefinition.test.ts.snap
  50. +0 −114 packages/loaders/prisma/src/prisma-yml/prisma-json-schema.ts
  51. +2 −43 packages/loaders/prisma/src/prisma-yml/yaml.ts
  52. +6 −0 packages/loaders/url/CHANGELOG.md
  53. +6 −6 packages/loaders/url/package.json
  54. +12 −5 packages/loaders/url/src/index.ts
  55. +9 −0 packages/merge/CHANGELOG.md
  56. +2 −2 packages/merge/package.json
  57. +3 −8 packages/merge/src/typedefs-mergers/comments.ts
  58. +53 −47 packages/merge/src/typedefs-mergers/merge-nodes.ts
  59. +88 −57 packages/merge/src/typedefs-mergers/merge-typedefs.ts
  60. +51 −0 packages/merge/src/typedefs-mergers/schema-def.ts
  61. +16 −81 packages/merge/src/typedefs-mergers/utils.ts
  62. +12 −0 packages/mock/CHANGELOG.md
  63. +1 −1 packages/mock/package.json
  64. +4 −0 packages/mock/src/MockStore.ts
  65. +5 −0 packages/mock/src/types.ts
  66. +7 −0 packages/mock/tests/store.spec.ts
  67. +1 −1 packages/relay-operation-optimizer/package.json
  68. +1 −1 packages/schema/package.json
  69. +14 −0 packages/stitch/CHANGELOG.md
  70. +4 −4 packages/stitch/package.json
  71. +8 −8 packages/stitch/src/stitchSchemas.ts
  72. +50 −42 packages/stitch/src/types.ts
  73. +28 −0 packages/utils/CHANGELOG.md
  74. +2 −2 packages/utils/package.json
  75. +0 −44 packages/utils/src/create-schema-definition.ts
  76. +39 −0 packages/utils/src/executor.ts
  77. +1 −1 packages/utils/src/index.ts
  78. +26 −6 packages/utils/src/prune.ts
  79. +9 −1 packages/utils/src/types.ts
  80. +237 −3 packages/utils/tests/prune.test.ts
  81. +0 −28 packages/utils/tests/pruneSchema.test.ts
  82. +1 −2 packages/wrap/src/introspect.ts
  83. +2 −1 packages/wrap/src/makeRemoteExecutableSchema.ts
  84. +15 −12 packages/wrap/src/types.ts
  85. +30 −30 patches/{@changesets+apply-release-plan+4.0.0.patch → @changesets+apply-release-plan+4.2.0.patch}
  86. +6 −19 patches/{@changesets+cli+2.13.0.patch → @changesets+cli+2.14.1.patch}
  87. 0 patches/{@docsearch+react+3.0.0-alpha.32.patch → @docsearch+react+3.0.0-alpha.34.patch}
  88. +13 −0 patches/@docusaurus+theme-search-algolia+2.0.0-alpha.ffe8b6106.patch
  89. +7 −0 website/docs/mocking.md
  90. +28 −0 website/docs/schema-merging.md
  91. +4 −4 website/package.json
  92. +2,657 −3,614 yarn.lock
5 changes: 4 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -13,7 +13,10 @@

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)
Related # (issue)
<!--
Please do not use "Fixed" or "Resolves". Keep "Related" as-is.
-->

## Type of change

5 changes: 1 addition & 4 deletions .github/workflows/canary.yml
Original file line number Diff line number Diff line change
@@ -28,13 +28,10 @@ jobs:
run: echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" >> ~/.npmrc
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache Yarn
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache.outputs.dir }}
path: '**/node_modules'
key: ${{ runner.os }}-15-15-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-15-15-yarn-
5 changes: 1 addition & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -29,13 +29,10 @@ jobs:
run: echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" >> ~/.npmrc
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache Yarn
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache.outputs.dir }}
path: '**/node_modules'
key: ${{ runner.os }}-15-15-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-15-15-yarn-
23 changes: 8 additions & 15 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -19,16 +19,13 @@ jobs:
uses: actions/setup-node@master
with:
node-version: 15
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache Yarn
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-${{matrix.node_version}}-${{matrix.graphql_version}}-yarn-${{ hashFiles('yarn.lock') }}
path: '**/node_modules'
key: ${{ runner.os }}-15-15-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{matrix.node_version}}-${{matrix.graphql_version}}-yarn
${{ runner.os }}-15-15-yarn
- name: Install Dependencies using Yarn
run: yarn install --ignore-engines && git checkout yarn.lock
- name: Lint
@@ -46,13 +43,10 @@ jobs:
uses: actions/setup-node@master
with:
node-version: 15
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache Yarn
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache.outputs.dir }}
path: '**/node_modules'
key: ${{ runner.os }}-14-${{matrix.graphql_version}}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-14-${{matrix.graphql_version}}-yarn
@@ -77,13 +71,10 @@ jobs:
uses: actions/setup-node@master
with:
node-version: ${{ matrix.node_version }}
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache Yarn
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache.outputs.dir }}
path: '**/node_modules'
key: ${{ runner.os }}-${{matrix.node_version}}-${{matrix.graphql_version}}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{matrix.node_version}}-${{matrix.graphql_version}}-yarn
@@ -99,4 +90,6 @@ jobs:
restore-keys: |
${{ runner.os }}-${{matrix.node_version}}-${{matrix.graphql_version}}-jest-
- name: Test
run: yarn test --logHeapUsage
run: yarn test --ci
env:
CI: true
5 changes: 1 addition & 4 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
@@ -28,13 +28,10 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: '15.x'
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache Yarn
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache.outputs.dir }}
path: '**/node_modules'
key: ${{ runner.os }}-15-15-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-15-15-yarn-
5 changes: 4 additions & 1 deletion algolia/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"index_name": "theguild",
"start_urls": [
"https://graphql-code-generator.com/",
"https://graphql-code-generator.com/docs/getting-started/index",
"https://graphql-mesh.com/docs/",
"https://graphql-mesh.com/docs/getting-started/introduction",
"https://www.graphql-tools.com/docs/",
@@ -19,7 +21,8 @@
"https://graphql-inspector.com/sitemap.xml",
"https://graphql-modules.com/sitemap.xml",
"https://graphql-cli.com/sitemap.xml",
"https://the-guild.dev/sitemap.xml"
"https://the-guild.dev/sitemap.xml",
"https://graphql-code-generator.com/sitemap.xml"
],
"sitemap_alternate_links": true,
"stop_urls": [],
4 changes: 4 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
presets: [['@babel/preset-env', { targets: { node: 'current' } }], '@babel/preset-typescript'],
plugins: ['@babel/plugin-proposal-class-properties'],
};
9 changes: 2 additions & 7 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
const { resolve } = require('path');
const { pathsToModuleNameMapper } = require('ts-jest/utils');
const CI = !!process.env.CI;

const ROOT_DIR = __dirname;
const TSCONFIG = resolve(ROOT_DIR, 'tsconfig.json');
const tsconfig = require(TSCONFIG);

module.exports = {
transform: { '^.+\\.tsx?$': 'ts-jest' },
testEnvironment: 'node',
rootDir: ROOT_DIR,
globals: {
'ts-jest': {
diagnostics: false,
tsconfig: TSCONFIG,
},
},
restoreMocks: true,
reporters: ['default'],
modulePathIgnorePatterns: ['dist', 'test-assets', 'test-files', 'fixtures'],
moduleNameMapper: pathsToModuleNameMapper(tsconfig.compilerOptions.paths, { prefix: `${ROOT_DIR}/` }),
collectCoverage: false,
cacheDirectory: resolve(ROOT_DIR, `${CI ? '' : 'node_modules/'}.cache/jest`),
};
35 changes: 20 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -41,33 +41,38 @@
"graphql": "^14.0.0 || ^15.0.0"
},
"devDependencies": {
"patch-package": "6.2.2",
"@changesets/cli": "2.14.0",
"@types/jest": "26.0.20",
"@types/node": "14.14.31",
"@typescript-eslint/eslint-plugin": "4.15.2",
"@typescript-eslint/parser": "4.15.2",
"@ardatan/bob-the-bundler": "1.2.2",
"@babel/core": "7.13.10",
"@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.21",
"@types/node": "14.14.35",
"@typescript-eslint/eslint-plugin": "4.19.0",
"@typescript-eslint/parser": "4.19.0",
"babel-jest": "26.6.3",
"concurrently": "6.0.0",
"eslint": "7.20.0",
"eslint-config-prettier": "8.0.0",
"eslint": "7.22.0",
"eslint-config-prettier": "8.1.0",
"eslint-config-standard": "16.0.2",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "4.3.1",
"eslint-plugin-standard": "5.0.0",
"graphql": "15.5.0",
"graphql-helix": "1.2.3",
"graphql-subscriptions": "1.2.0",
"graphql-subscriptions": "1.2.1",
"husky": "4.3.8",
"jest": "26.6.3",
"lint-staged": "10.5.4",
"nock": "13.0.7",
"nock": "13.0.11",
"patch-package": "6.4.7",
"prettier": "2.2.1",
"ts-jest": "26.5.2",
"typedoc": "0.20.28",
"typedoc-plugin-markdown": "3.5.0",
"typescript": "4.2.2"
"ts-jest": "26.5.4",
"typedoc": "0.20.33",
"typedoc-plugin-markdown": "3.6.0",
"typescript": "4.2.3"
},
"husky": {
"hooks": {
@@ -94,6 +99,6 @@
},
"resolutions": {
"graphql": "15.5.0",
"@changesets/apply-release-plan": "4.0.0"
"@changesets/apply-release-plan": "4.2.0"
}
}
8 changes: 8 additions & 0 deletions packages/batch-delegate/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @graphql-tools/batch-delegate

## 7.0.2

### Patch Changes

- 161963ac: fix(batch-delegate): only batch together delegations to the same root field

see #2638.

## 7.0.1

### Patch Changes
8 changes: 4 additions & 4 deletions packages/batch-delegate/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@graphql-tools/batch-delegate",
"version": "7.0.1",
"version": "7.0.2",
"description": "A set of utils for faster development of GraphQL tools",
"repository": {
"type": "git",
@@ -22,14 +22,14 @@
"input": "./src/index.ts"
},
"dependencies": {
"@graphql-tools/delegate": "^7.0.10",
"@graphql-tools/delegate": "^7.1.0",
"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.0"
"@graphql-tools/stitch": "7.5.0",
"@graphql-tools/utils": "7.7.0"
},
"publishConfig": {
"access": "public",
40 changes: 29 additions & 11 deletions packages/batch-delegate/src/getLoader.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import { getNamedType, GraphQLOutputType, GraphQLList, GraphQLSchema } from 'graphql';
import { getNamedType, GraphQLOutputType, GraphQLList, GraphQLSchema, FieldNode } from 'graphql';

import DataLoader from 'dataloader';

import { delegateToSchema, SubschemaConfig } from '@graphql-tools/delegate';
import { relocatedError } from '@graphql-tools/utils';

import { BatchDelegateOptions, DataLoaderCache } from './types';
import { BatchDelegateOptions } from './types';

const cache1: DataLoaderCache = new WeakMap();
const cache1: WeakMap<
ReadonlyArray<FieldNode>,
WeakMap<GraphQLSchema | SubschemaConfig, Record<string, DataLoader<any, any>>>
> = new WeakMap();

function createBatchFn<K = any>(options: BatchDelegateOptions) {
const argsFromKeys = options.argsFromKeys ?? ((keys: ReadonlyArray<K>) => ({ ids: keys }));
@@ -33,25 +36,40 @@ function createBatchFn<K = any>(options: BatchDelegateOptions) {
}

export function getLoader<K = any, V = any, C = K>(options: BatchDelegateOptions): DataLoader<K, V, C> {
let cache2: WeakMap<GraphQLSchema | SubschemaConfig, DataLoader<K, V, C>> = cache1.get(options.info.fieldNodes);
let loader: DataLoader<K, V, C>;
const fieldName = options.fieldName ?? options.info.fieldName;

let cache2: WeakMap<GraphQLSchema | SubschemaConfig, Record<string, DataLoader<K, V, C>>> = cache1.get(
options.info.fieldNodes
);

if (cache2 === undefined) {
const batchFn = createBatchFn(options);
cache2 = new WeakMap();
cache1.set(options.info.fieldNodes, cache2);
loader = new DataLoader<K, V, C>(keys => batchFn(keys), options.dataLoaderOptions);
cache2.set(options.schema, loader);
const loaders = Object.create(null);
cache2.set(options.schema, loaders);
const batchFn = createBatchFn(options);
const loader = new DataLoader<K, V, C>(keys => batchFn(keys), options.dataLoaderOptions);
loaders[fieldName] = loader;
return loader;
}

let loaders = cache2.get(options.schema);

if (loaders === undefined) {
loaders = Object.create(null);
cache2.set(options.schema, loaders);
const batchFn = createBatchFn(options);
const loader = new DataLoader<K, V, C>(keys => batchFn(keys), options.dataLoaderOptions);
loaders[fieldName] = loader;
return loader;
}

loader = cache2.get(options.schema);
let loader = loaders[fieldName];

if (loader === undefined) {
const batchFn = createBatchFn(options);
loader = new DataLoader<K, V, C>(keys => batchFn(keys), options.dataLoaderOptions);
cache2.set(options.schema, loader);
return loader;
loaders[fieldName] = loader;
}

return loader;
1 change: 1 addition & 0 deletions packages/batch-delegate/src/types.ts
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@ import DataLoader from 'dataloader';

import { IDelegateToSchemaOptions, SubschemaConfig } from '@graphql-tools/delegate';

// TODO: remove in next major release
export type DataLoaderCache<K = any, V = any, C = K> = WeakMap<
ReadonlyArray<FieldNode>,
WeakMap<GraphQLSchema | SubschemaConfig, DataLoader<K, V, C>>
Loading