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.5.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.5.2
Choose a head ref

Commits on Oct 6, 2021

  1. Ignore typedoc deps

    ardatan authored Oct 6, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    16bf6dd View commit details
  2. Proposed fix to bypass issue with schema files and pkg (#3641)

    * proposed fix to bypass issue with pkg
    
    Please see #3447
    
    * use resolveGlobs instead of resolveGlobsSync for load
    
    * adjust pkg fix code code so ci tests passed
    
    * Add changeset
    
    * Changeset edit
    johnheenan authored Oct 6, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    94bee8b View commit details
  3. chore(release): update monorepo packages versions (#3653)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored Oct 6, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5af1323 View commit details
  4. chore(deps): update dependency graphql-scalars to v1.11.1 (#3654)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 6, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    7742fef View commit details
  5. chore(deps): update babel monorepo to v7.15.8 (#3655)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 6, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a1c53a6 View commit details

Commits on Oct 7, 2021

  1. chore(deps): update dependency graphql-helix to v1.8.1 (#3656)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 7, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    24c725d View commit details
  2. chore(deps): update dependency graphql-helix to v1.8.2 (#3657)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 7, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    c7bc55e View commit details

Commits on Oct 8, 2021

  1. fix(deps): update apollo graphql packages (#3661)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 8, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    0c79a58 View commit details
  2. chore(deps): update jest monorepo to v27.2.5 (#3662)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 8, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5492ef0 View commit details
  3. chore(deps): update dependency @vue/compiler-sfc to v3.2.20 (#3664)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 8, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f35bf3c View commit details

Commits on Oct 9, 2021

  1. chore(deps): update dependency lint-staged to v11.2.1 (#3666)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 9, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    2c04893 View commit details
  2. fix(deps): update dependency sync-fetch to v0.3.1 (#3668)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 9, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    8258e1a View commit details
  3. chore(deps): update dependency graphql-helix to v1.8.3 (#3667)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 9, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    9de336a View commit details
  4. chore(deps): update dependency lint-staged to v11.2.2 (#3669)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 9, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    22d1e6c View commit details

Commits on Oct 10, 2021

  1. fix(import): remove code causing Maximum call stack size exceeded (#…

    …3665)
    
    * Remove error caused lines
    
    * Fix fixture - multiple-levels-master-schema
    
    * Add fixtures - multiple directories with master schema
    
    * Add test case with expected SDL
    
    * Add changeset
    
    * Remove unusable fixture files
    
    * Remove unusable expected SDL
    hojin-choi authored Oct 10, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    8ffbb60 View commit details
  2. chore(release): update monorepo packages versions (#3672)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored Oct 10, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    c7e1e0f View commit details
  3. fix(deps): update dependency @theguild/components to v1.6.0 (#3671)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 10, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e9f1239 View commit details
  4. chore(deps): update dependency lint-staged to v11.2.3 (#3673)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 10, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    ec3ac8e View commit details

Commits on Oct 11, 2021

  1. fix(deps): update dependency @guild-docs/client to v1.1.0 (#3676)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 11, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    7f728c8 View commit details
  2. fix(deps): update dependency @guild-docs/server to v1.0.6 (#3675)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 11, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d38a26e View commit details
  3. chore(deps): update typescript-eslint monorepo to v5 (#3678)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 11, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e7f0479 View commit details
  4. fix(deps): update dependency @guild-docs/client to v1.1.1 (#3677)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 11, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    2176491 View commit details

Commits on Oct 12, 2021

  1. chore(deps): update dependency @types/react to v17.0.28 (#3681)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 12, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3473245 View commit details
  2. fix(deps): update dependency shiki to v0.9.12 (#3682)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 12, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    669d108 View commit details
  3. 1

    Unverified

    This user has not yet uploaded their public signing key.
    Copy the full SHA
    58262be View commit details
  4. fix(deps): update dependency next-i18next to v8.9.0 (#3684)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 12, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    8f1cd13 View commit details
  5. chore(deps): update dependency @types/node to v14.17.22 (#3686)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 12, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a7fb4e6 View commit details
  6. fix(deps): update apollo graphql packages (#3689)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 12, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    ae1fbd8 View commit details

Commits on Oct 13, 2021

  1. chore(deps): update dependency eslint-plugin-import to v2.25.2 (#3680)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 13, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    c9089ae View commit details
  2. chore(deps): update dependency @types/react to v17.0.29 (#3687)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 13, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    bb8855f View commit details
  3. chore(deps): update dependency esbuild to v0.13.5 (#3690)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 13, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f4691ad View commit details
  4. chore(deps): update dependency typescript to v4.4.4 (#3688)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 13, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    ef2b72a View commit details
  5. chore(release): update monorepo packages versions (#3685)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored Oct 13, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    757a2ea View commit details
  6. chore(deps): update dependency graphql-scalars to v1.12.0 (#3694)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 13, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    12bf669 View commit details
  7. chore(deps): update dependency @types/node to v14.17.25 (#3693)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 13, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    8706d19 View commit details
  8. chore(deps): update dependency @types/node to v14.17.26 (#3697)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 13, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f4c6569 View commit details

Commits on Oct 14, 2021

  1. fix(deps): update apollo graphql packages (#3698)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 14, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    926a601 View commit details
  2. chore(deps): update dependency esbuild to v0.13.6 (#3699)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 14, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    8bd7165 View commit details
  3. chore(deps): update dependency @types/react to v17.0.30 (#3700)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 14, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    cb86c6f View commit details
  4. chore(deps): update dependency @types/node to v14.17.27 (#3701)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 14, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f0202ec View commit details
  5. chore(deps): update dependency ts-jest to v27.0.6 (#3702)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 14, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    77fb7f0 View commit details

Commits on Oct 15, 2021

  1. fix(deps): update chakra-ui monorepo (#3703)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 15, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4ad8865 View commit details
  2. fix(deps): update dependency @guild-docs/server to v2 (#3696)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 15, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d70ad71 View commit details

Commits on Oct 16, 2021

  1. chore(deps): update dependency esbuild to v0.13.7 (#3705)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 16, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    35f1588 View commit details
  2. chore(deps): update dependency ts-jest to v27.0.7 (#3706)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 16, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3c2012f View commit details

Commits on Oct 17, 2021

  1. chore(deps): update dependency esbuild to v0.13.8 (#3707)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 17, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    50de73a View commit details
  2. fix(deps): update dependency @emotion/react to v11.5.0 (#3708)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 17, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    8e7b998 View commit details
  3. chore(deps): update jest monorepo to v27.3.0 (#3709)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 17, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    dda1a67 View commit details

Commits on Oct 18, 2021

  1. chore(deps): update dependency mock-socket to v9.0.6 (#3710)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 18, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3e30de0 View commit details

Commits on Oct 19, 2021

  1. chore(deps): update typescript-eslint monorepo to v5.1.0 (#3714)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Oct 19, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    48854a7 View commit details
Showing with 3,958 additions and 2,270 deletions.
  1. +3 −3 .github/workflows/benchmark.yml
  2. +3 −3 .github/workflows/canary.yml
  3. +3 −3 .github/workflows/release.yml
  4. +47 −23 .github/workflows/tests.yml
  5. +4 −1 babel.config.js
  6. +17 −0 benchmark/federation/CHANGELOG.md
  7. +6 −6 benchmark/federation/package.json
  8. +92 −84 benchmark/federation/yarn.lock
  9. +18 −18 package.json
  10. +21 −0 packages/batch-delegate/CHANGELOG.md
  11. +5 −5 packages/batch-delegate/package.json
  12. +3 −3 packages/batch-delegate/tests/basic.example.test.ts
  13. +2 −2 packages/batch-delegate/tests/withTransforms.test.ts
  14. +30 −0 packages/batch-execute/CHANGELOG.md
  15. +2 −2 packages/batch-execute/package.json
  16. +8 −5 packages/batch-execute/src/createBatchingExecutor.ts
  17. +6 −9 packages/batch-execute/src/mergeRequests.ts
  18. +16 −16 packages/batch-execute/tests/batchExecute.test.ts
  19. +43 −0 packages/delegate/CHANGELOG.md
  20. +4 −4 packages/delegate/package.json
  21. +2 −1 packages/delegate/src/checkResultAndHandleErrors.ts
  22. +6 −5 packages/delegate/src/createRequest.ts
  23. +16 −26 packages/delegate/src/delegateToSchema.ts
  24. +19 −15 packages/delegate/src/finalizeGatewayRequest.ts
  25. +4 −6 packages/delegate/src/prepareGatewayDocument.ts
  26. +4 −1 packages/delegate/src/resolveExternalValue.ts
  27. +4 −4 packages/delegate/tests/createRequest.test.ts
  28. +4 −4 packages/delegate/tests/delegateToSchema.test.ts
  29. +2 −2 packages/delegate/tests/errors.test.ts
  30. +1 −5 packages/delegate/tests/finalizeGatewayRequest.test.ts
  31. +8 −0 packages/graphql-tag-pluck/CHANGELOG.md
  32. +4 −4 packages/graphql-tag-pluck/package.json
  33. +35 −0 packages/import/CHANGELOG.md
  34. +2 −2 packages/import/package.json
  35. +0 −7 packages/import/src/index.ts
  36. +3 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/1/1.model.graphql
  37. +4 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/1/1.mutation.graphql
  38. +4 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/1/1.query.graphql
  39. +3 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/1/index.graphql
  40. +3 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/10/10.model.graphql
  41. +4 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/10/10.mutation.graphql
  42. +4 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/10/10.query.graphql
  43. +3 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/10/index.graphql
  44. +3 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/2/2.model.graphql
  45. +4 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/2/2.mutation.graphql
  46. +4 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/2/2.query.graphql
  47. +3 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/2/index.graphql
  48. +3 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/3/3.model.graphql
  49. +4 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/3/3.mutation.graphql
  50. +4 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/3/3.query.graphql
  51. +3 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/3/index.graphql
  52. +3 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/4/4.model.graphql
  53. +4 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/4/4.mutation.graphql
  54. +4 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/4/4.query.graphql
  55. +3 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/4/index.graphql
  56. +3 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/5/5.model.graphql
  57. +4 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/5/5.mutation.graphql
  58. +4 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/5/5.query.graphql
  59. +3 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/5/index.graphql
  60. +3 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/6/6.model.graphql
  61. +4 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/6/6.mutation.graphql
  62. +4 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/6/6.query.graphql
  63. +3 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/6/index.graphql
  64. +3 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/7/7.model.graphql
  65. +4 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/7/7.mutation.graphql
  66. +4 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/7/7.query.graphql
  67. +3 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/7/index.graphql
  68. +3 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/8/8.model.graphql
  69. +4 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/8/8.mutation.graphql
  70. +4 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/8/8.query.graphql
  71. +3 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/8/index.graphql
  72. +3 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/9/9.model.graphql
  73. +4 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/9/9.mutation.graphql
  74. +4 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/9/9.query.graphql
  75. +3 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/9/index.graphql
  76. +10 −0 packages/import/tests/schema/fixtures/multiple-directories-with-master-schema/index.graphql
  77. +1 −1 packages/import/tests/schema/fixtures/multiple-levels-master-schema/level1.graphql
  78. +71 −0 packages/import/tests/schema/import-schema.spec.ts
  79. +8 −0 packages/jest-transform/CHANGELOG.md
  80. +2 −2 packages/jest-transform/package.json
  81. +22 −0 packages/links/CHANGELOG.md
  82. +3 −4 packages/links/package.json
  83. +2 −4 packages/links/src/GraphQLUpload.ts
  84. +19 −13 packages/links/src/linkToExecutor.ts
  85. +6 −0 packages/load-files/CHANGELOG.md
  86. +1 −1 packages/load-files/package.json
  87. +21 −0 packages/load/CHANGELOG.md
  88. +3 −3 packages/load/package.json
  89. +4 −1 packages/load/src/filter-document-kind.ts
  90. +16 −0 packages/loaders/apollo-engine/CHANGELOG.md
  91. +3 −3 packages/loaders/apollo-engine/package.json
  92. +8 −2 packages/loaders/apollo-engine/src/index.ts
  93. +17 −0 packages/loaders/code-file/CHANGELOG.md
  94. +3 −3 packages/loaders/code-file/package.json
  95. +8 −2 packages/loaders/code-file/src/index.ts
  96. +17 −0 packages/loaders/git/CHANGELOG.md
  97. +3 −3 packages/loaders/git/package.json
  98. +8 −2 packages/loaders/git/src/index.ts
  99. +9 −0 packages/loaders/github/CHANGELOG.md
  100. +3 −3 packages/loaders/github/package.json
  101. +35 −0 packages/loaders/graphql-file/CHANGELOG.md
  102. +3 −3 packages/loaders/graphql-file/package.json
  103. +22 −2 packages/loaders/graphql-file/src/index.ts
  104. +16 −0 packages/loaders/json-file/CHANGELOG.md
  105. +2 −2 packages/loaders/json-file/package.json
  106. +8 −2 packages/loaders/json-file/src/index.ts
  107. +8 −0 packages/loaders/module/CHANGELOG.md
  108. +2 −2 packages/loaders/module/package.json
  109. +10 −0 packages/loaders/prisma/CHANGELOG.md
  110. +3 −3 packages/loaders/prisma/package.json
  111. +1 −0 packages/loaders/url/.gitignore
  112. +49 −0 packages/loaders/url/CHANGELOG.md
  113. +10 −9 packages/loaders/url/package.json
  114. +4 −0 packages/loaders/url/src/addCancelToResponseStream.ts
  115. +9 −0 packages/loaders/url/src/defaultAsyncFetch.ts
  116. +16 −0 packages/loaders/url/src/defaultSyncFetch.ts
  117. +16 −0 packages/loaders/url/src/event-stream/handleEventStreamResponse.ts
  118. +19 −0 packages/loaders/url/src/event-stream/handleReadable.ts
  119. +155 −0 packages/loaders/url/src/event-stream/handleReadableStream.ts
  120. +72 −0 packages/loaders/url/src/handleMultipartMixedResponse.ts
  121. +83 −191 packages/loaders/url/src/index.ts
  122. +337 −0 packages/loaders/url/tests/url-loader-browser.spec.ts
  123. +200 −25 packages/loaders/url/tests/url-loader.spec.ts
  124. +19 −0 packages/merge/CHANGELOG.md
  125. +2 −2 packages/merge/package.json
  126. +2 −2 packages/merge/src/typedefs-mergers/enum.ts
  127. +2 −2 packages/merge/src/typedefs-mergers/input-type.ts
  128. +2 −2 packages/merge/src/typedefs-mergers/interface.ts
  129. +2 −2 packages/merge/src/typedefs-mergers/merge-typedefs.ts
  130. +2 −2 packages/merge/src/typedefs-mergers/scalar.ts
  131. +2 −2 packages/merge/src/typedefs-mergers/type.ts
  132. +4 −4 packages/merge/src/typedefs-mergers/union.ts
  133. +1 −1 packages/merge/tests/extract-extensions-from-schema.spec.ts
  134. +6 −6 packages/merge/tests/merge-typedefs.spec.ts
  135. +15 −0 packages/mock/CHANGELOG.md
  136. +3 −3 packages/mock/package.json
  137. +16 −8 packages/mock/src/MockStore.ts
  138. +23 −0 packages/mock/tests/store.spec.ts
  139. +10 −0 packages/node-require/CHANGELOG.md
  140. +4 −4 packages/node-require/package.json
  141. +6 −0 packages/optimize/CHANGELOG.md
  142. +1 −1 packages/optimize/package.json
  143. +8 −0 packages/relay-operation-optimizer/CHANGELOG.md
  144. +2 −2 packages/relay-operation-optimizer/package.json
  145. +8 −0 packages/resolvers-composition/CHANGELOG.md
  146. +3 −3 packages/resolvers-composition/package.json
  147. +21 −0 packages/schema/CHANGELOG.md
  148. +4 −4 packages/schema/package.json
  149. +1 −1 packages/schema/tests/schemaGenerator.test.ts
  150. +31 −0 packages/stitch/CHANGELOG.md
  151. +7 −8 packages/stitch/package.json
  152. +3 −3 packages/stitch/src/createMergedTypeResolver.ts
  153. +1 −1 packages/stitch/src/relay.ts
  154. +10 −5 packages/stitch/src/typeFromAST.ts
  155. +23 −80 packages/stitch/tests/alternateStitchSchemas.test.ts
  156. +2 −2 packages/stitch/tests/dataloader.test.ts
  157. +5 −5 packages/stitch/tests/example.test.ts
  158. +3 −3 packages/stitch/tests/selectionSets.test.ts
  159. +39 −76 packages/stitch/tests/stitchSchemas.test.ts
  160. +2 −2 packages/stitch/tests/typeMerging.test.ts
  161. +21 −0 packages/stitching-directives/CHANGELOG.md
  162. +4 −4 packages/stitching-directives/package.json
  163. +4 −4 packages/stitching-directives/src/stitchingDirectives.ts
  164. +1 −1 packages/stitching-directives/src/stitchingDirectivesTransformer.ts
  165. +24 −0 packages/utils/CHANGELOG.md
  166. +2 −2 packages/utils/package.json
  167. +2 −1 packages/utils/src/Interfaces.ts
  168. +1 −1 packages/utils/src/build-operation-for-field.ts
  169. +18 −0 packages/utils/src/getOperationASTFromRequest.ts
  170. +1 −0 packages/utils/src/index.ts
  171. +1 −1 packages/utils/src/print-schema-with-directives.ts
  172. +3 −3 packages/utils/src/rootTypes.ts
  173. +4 −1 packages/utils/src/types.ts
  174. +8 −8 packages/utils/src/validate-documents.ts
  175. +2 −2 packages/utils/src/visitResult.ts
  176. +16 −16 packages/utils/tests/build-operation-node-for-field.spec.ts
  177. +1 −1 packages/utils/tests/mapSchema.test.ts
  178. +4 −4 packages/utils/tests/print-schema-with-directives.spec.ts
  179. +8 −13 packages/utils/tests/visitResult.test.ts
  180. +6 −0 packages/webpack-loader-runtime/CHANGELOG.md
  181. +1 −1 packages/webpack-loader-runtime/package.json
  182. +9 −0 packages/webpack-loader/CHANGELOG.md
  183. +3 −3 packages/webpack-loader/package.json
  184. +36 −0 packages/wrap/CHANGELOG.md
  185. +4 −7 packages/wrap/package.json
  186. +2 −1 packages/wrap/src/introspect.ts
  187. +2 −1 packages/wrap/src/transforms/HoistField.ts
  188. +2 −1 packages/wrap/src/transforms/WrapFields.ts
  189. +2 −2 packages/wrap/tests/requests.test.ts
  190. +3 −3 packages/wrap/tests/transformWrapQuery.test.ts
  191. +9 −16 packages/wrap/tests/transforms.test.ts
  192. +2 −1 renovate.json
  193. +3 −1 scripts/match-graphql.js
  194. +3 −13 website/docs/batch-execution.mdx
  195. +0 −2 website/docs/schema-stitching/stitch-federation.mdx
  196. +16 −16 website/package.json
  197. +1,503 −1,349 yarn.lock
6 changes: 3 additions & 3 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -17,14 +17,14 @@ jobs:
- name: Use Node
uses: actions/setup-node@master
with:
node-version: '16.8.0'
node-version: 17
- name: Cache Yarn
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-16.8.0-15-yarn-${{ hashFiles('yarn.lock') }}
key: ${{ runner.os }}-17-15-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-16.8.0-15-yarn
${{ runner.os }}-17-15-yarn
- name: Install Dependencies using Yarn
run: yarn install --ignore-engines && git checkout yarn.lock
- name: Build packages
6 changes: 3 additions & 3 deletions .github/workflows/canary.yml
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ jobs:
- name: Use Node
uses: actions/setup-node@v2
with:
node-version: '16.8.0'
node-version: 17
- name: Configure Git Credentials
run: |
git config --global user.email "theguild-bot@users.noreply.github.com"
@@ -44,9 +44,9 @@ jobs:
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-16.8.0-15-yarn-${{ hashFiles('yarn.lock') }}
key: ${{ runner.os }}-17-15-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-16.8.0-15-yarn-
${{ runner.os }}-17-15-yarn-
- name: Install Dependencies using Yarn
run: yarn install --ignore-engines && git checkout yarn.lock
- name: Release Canary
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ jobs:
- name: Use Node
uses: actions/setup-node@v2
with:
node-version: '16.8.0'
node-version: 17
- name: Setup NPM credentials
run: echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" >> ~/.npmrc
env:
@@ -33,9 +33,9 @@ jobs:
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-16.8.0-15-yarn-${{ hashFiles('yarn.lock') }}
key: ${{ runner.os }}-17-15-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-16.8.0-15-yarn-
${{ runner.os }}-17-15-yarn-
- name: Install Dependencies using Yarn
run: yarn install --ignore-engines && git checkout yarn.lock
- name: Create Release Pull Request or Publish to npm
70 changes: 47 additions & 23 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -4,9 +4,7 @@ on:
push:
branches:
- master
pull_request:
branches:
- master
pull_request: {}

jobs:
lint:
@@ -18,14 +16,14 @@ jobs:
- name: Use Node
uses: actions/setup-node@master
with:
node-version: 16
node-version: 17
- name: Cache Yarn
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-16-15-yarn-${{ hashFiles('yarn.lock') }}
key: ${{ runner.os }}-17-15-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-16-15-yarn
${{ runner.os }}-17-15-yarn
- name: Install Dependencies using Yarn
run: yarn install --ignore-engines && git checkout yarn.lock
- name: Lint
@@ -38,40 +36,40 @@ jobs:
graphql_version:
- 14
- 15
# - 16.0.0-rc.1
- 16.0.0-rc.6
steps:
- name: Checkout Master
uses: actions/checkout@v2
- name: Use Node
uses: actions/setup-node@master
with:
node-version: 16
node-version: 17
- name: Cache Yarn
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-16-${{matrix.graphql_version}}-yarn-${{ hashFiles('yarn.lock') }}
key: ${{ runner.os }}-17-${{matrix.graphql_version}}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-16-${{matrix.graphql_version}}-yarn
${{ runner.os }}-17-${{matrix.graphql_version}}-yarn
- name: Use GraphQL v${{matrix.graphql_version}}
run: node ./scripts/match-graphql.js ${{matrix.graphql_version}}
- name: Install Dependencies using Yarn
run: yarn install --ignore-engines && git checkout yarn.lock
- name: Build
- name: Type Check
run: yarn ts:check
test:
name: Unit Test on Node ${{matrix.node_version}} (${{matrix.os}}) and GraphQL v${{matrix.graphql_version}}
name: Unit Test on Node ${{matrix.node-version}} (${{matrix.os}}) and GraphQL v${{matrix.graphql_version}}
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest] # remove windows to speed up the tests
node_version: [12, '16.8.0']
node-version: [12, 17]
graphql_version:
- 14
- 15
# - 16.0.0-rc.1
- 16.0.0-rc.6
include:
- node_version: 14
- node-version: 14
os: windows-latest
graphql_version: 15
steps:
@@ -80,14 +78,14 @@ jobs:
- name: Use Node
uses: actions/setup-node@master
with:
node-version: ${{ matrix.node_version }}
node-version: ${{ matrix.node-version }}
- name: Cache Yarn
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{matrix.node_version}}-${{matrix.graphql_version}}-yarn-${{ hashFiles('yarn.lock') }}
key: ${{ runner.os }}-${{matrix.node-version}}-${{matrix.graphql_version}}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{matrix.node_version}}-${{matrix.graphql_version}}-yarn
${{ runner.os }}-${{matrix.node-version}}-${{matrix.graphql_version}}-yarn
- name: Use GraphQL v${{matrix.graphql_version}}
run: node ./scripts/match-graphql.js ${{matrix.graphql_version}}
- name: Install Dependencies using Yarn
@@ -96,9 +94,9 @@ jobs:
uses: actions/cache@v2
with:
path: .cache/jest
key: ${{ runner.os }}-${{matrix.node_version}}-${{matrix.graphql_version}}-jest-${{ hashFiles('yarn.lock') }}
key: ${{ runner.os }}-${{matrix.node-version}}-${{matrix.graphql_version}}-jest-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{matrix.node_version}}-${{matrix.graphql_version}}-jest-
${{ runner.os }}-${{matrix.node-version}}-${{matrix.graphql_version}}-jest-
- name: Test
run: yarn test --ci
env:
@@ -112,17 +110,43 @@ jobs:
- name: Use Node
uses: actions/setup-node@master
with:
node-version: '16.8.0'
node-version: 17
- name: Cache Yarn
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-16.8.0-15-yarn-${{ hashFiles('yarn.lock') }}
key: ${{ runner.os }}-17-15-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-16.8.0-15-yarn
${{ runner.os }}-17-15-yarn
- name: Install Dependencies using Yarn
run: yarn install --ignore-engines && git checkout yarn.lock
- name: Build Packages
run: yarn build
- name: Test ESM
run: node scripts/test-esm.mjs
test_browser:
name: Browser Test
runs-on: ubuntu-latest
steps:
- name: Checkout Master
uses: actions/checkout@v2
- name: Use Node
uses: actions/setup-node@master
with:
node-version: 16
- name: Cache Yarn
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-16-15-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-16-15-yarn
- name: Install Dependencies using Yarn
run: yarn install --ignore-engines && git checkout yarn.lock
- name: Build Packages
run: yarn build
- name: Test
run: yarn test --ci browser
env:
CI: true
TEST_BROWSER: true
5 changes: 4 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
module.exports = {
presets: [['@babel/preset-env', { targets: { node: 'current' } }], '@babel/preset-typescript'],
presets: [
['@babel/preset-env', { targets: { node: process.versions.node.split('.')[0] } }],
'@babel/preset-typescript',
],
plugins: ['@babel/plugin-proposal-class-properties'],
};
17 changes: 17 additions & 0 deletions benchmark/federation/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# federation-benchmark

## 0.0.19

### Patch Changes

- Updated dependencies [981eef80]
- Updated dependencies [4bfb3428]
- @graphql-tools/stitch@8.4.1
- @graphql-tools/stitching-directives@2.2.1

## 0.0.18

### Patch Changes

- Updated dependencies [149afddb]
- @graphql-tools/stitch@8.4.0
- @graphql-tools/stitching-directives@2.2.0

## 0.0.17

### Patch Changes
12 changes: 6 additions & 6 deletions benchmark/federation/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "federation-benchmark",
"version": "0.0.17",
"version": "0.0.19",
"private": true,
"scripts": {
"start": "cross-env NODE_ENV=production node index.js",
@@ -9,12 +9,12 @@
"loadtest:monolith": "k6 -e ENDPOINT=monolith run k6.js"
},
"dependencies": {
"@apollo/gateway": "0.42.0",
"@apollo/federation": "0.33.0",
"@graphql-tools/stitch": "8.3.1",
"@graphql-tools/stitching-directives": "2.1.1",
"@apollo/gateway": "0.42.3",
"@apollo/federation": "0.33.3",
"@graphql-tools/stitch": "8.4.1",
"@graphql-tools/stitching-directives": "2.2.1",
"express": "4.17.1",
"graphql": "15.6.1",
"graphql": "15.7.0",
"graphql-tag": "2.12.5",
"wait-on": "6.0.0",
"cross-env": "7.0.3"
176 changes: 92 additions & 84 deletions benchmark/federation/yarn.lock
Original file line number Diff line number Diff line change
@@ -7,23 +7,24 @@
resolved "https://registry.yarnpkg.com/@apollo/core-schema/-/core-schema-0.1.0.tgz#a9444f60deaded118657eb3373ddd64ced9ba0cd"
integrity sha512-BwOWRnDLj1Y3mMdfjdcv8/h7jcfVnUqb+LfpWRX3siXWtGCGsrg+OTj0l7M7uJGOnN6ZM0XJyY9Pk5Lisb7q6Q==

"@apollo/federation@0.33.0", "@apollo/federation@^0.33.0":
version "0.33.0"
resolved "https://registry.yarnpkg.com/@apollo/federation/-/federation-0.33.0.tgz#73e3ead912844c5c99beecfa6eadd5fea9ccda32"
integrity sha512-Zywqb6Zv12/PVl7K/jtDgcJFghg02fqqDHyGbHBhf0+WdNvI9QqRvOY433BuZw/NYcRUbz9cPEAG5JCRB2K83w==
"@apollo/federation@0.33.3", "@apollo/federation@^0.33.3":
version "0.33.3"
resolved "https://registry.yarnpkg.com/@apollo/federation/-/federation-0.33.3.tgz#07710308c1a097c3aaee53759860751f6fff82e3"
integrity sha512-+BRJW1Kf7im86CWPQEdocXQTyPUH132MMoMCXuRvM4F1idb5EldqRkFNM8y9IAYNnbHsthmIWlrqmkuYg+irGQ==
dependencies:
"@apollo/subgraph" "^0.1.2"
apollo-graphql "^0.9.3"
apollo-server-types "^3.0.2"
lodash.xorby "^4.7.0"

"@apollo/gateway@0.42.0":
version "0.42.0"
resolved "https://registry.yarnpkg.com/@apollo/gateway/-/gateway-0.42.0.tgz#c77dc063d57358d93342d7ec452850879e2e3695"
integrity sha512-tNFhz8A6hsAN29rf2LvrqiDySx4x4TQS2wg/pNhwjEKJLcHkH4JC0bsGKz5mBy+6Dv812XS9r2TOdiMO5IdFCw==
"@apollo/gateway@0.42.3":
version "0.42.3"
resolved "https://registry.yarnpkg.com/@apollo/gateway/-/gateway-0.42.3.tgz#783db6d775cbd725b6d73c3c8f2acf41dcd14301"
integrity sha512-xJoY/wIv/LmsqcbPEEYgaGhzo/Ok8Ce1GFZJRigpmjCCsm0TFmWWgXRQ14RbtUi0TzCBdOcnSh1NfaJYpHgAdQ==
dependencies:
"@apollo/core-schema" "^0.1.0"
"@apollo/federation" "^0.33.0"
"@apollo/query-planner" "^0.5.0"
"@apollo/federation" "^0.33.3"
"@apollo/query-planner" "^0.5.1"
"@opentelemetry/api" "^1.0.1"
"@types/node-fetch" "2.5.12"
apollo-graphql "^0.9.3"
@@ -56,16 +57,23 @@
"@types/node" "^10.1.0"
long "^4.0.0"

"@apollo/query-planner@^0.5.0":
version "0.5.0"
resolved "https://registry.yarnpkg.com/@apollo/query-planner/-/query-planner-0.5.0.tgz#98fa95c4da79951795099cbfd547146d4fa4f2f0"
integrity sha512-lWXo84TGLU+z/Puf/uSdXwCKvCap6sWW6AHrMU94eCEs9Jmq6eEw1ozMDeN6ORk3fVcaRQ+To0D6JpKX9NNiLw==
"@apollo/query-planner@^0.5.1":
version "0.5.1"
resolved "https://registry.yarnpkg.com/@apollo/query-planner/-/query-planner-0.5.1.tgz#6b8e3dce2104a03166d7b9e787a0b9948abd72f9"
integrity sha512-oIohoBu12UBt2YP1bh+iR2BekNQS8fvA2rjA7JPA+WLiQvzpz646B2ix0WepFf8a8oig7cYFx8aRVj8qQYRUdg==
dependencies:
apollo-graphql "^0.9.3"
chalk "^4.1.0"
deep-equal "^2.0.5"
pretty-format "^26.0.0"

"@apollo/subgraph@^0.1.2":
version "0.1.2"
resolved "https://registry.yarnpkg.com/@apollo/subgraph/-/subgraph-0.1.2.tgz#ea2e9c46a88012c22a2cd696f4e0f4b4c4608eb1"
integrity sha512-vrPtpayvJkLdqc/iLjhXi+W9HQ+Avnb2a8ylaZb0lsm9p0y1H5QxNDhC3SHhdYRvBnNeqgxE+OGYG1rHldMQIQ==
dependencies:
apollo-graphql "^0.9.3"

"@apollographql/apollo-tools@^0.5.1":
version "0.5.1"
resolved "https://registry.yarnpkg.com/@apollographql/apollo-tools/-/apollo-tools-0.5.1.tgz#f0baef739ff7e2fafcb8b98ad29f6ac817e53e32"
@@ -85,37 +93,37 @@
dependencies:
tslib "~2.0.1"

"@graphql-tools/batch-delegate@8.1.0":
version "8.1.0"
resolved "https://registry.yarnpkg.com/@graphql-tools/batch-delegate/-/batch-delegate-8.1.0.tgz#3214703a43084c6fc8ee6c949ce181fd8cee117a"
integrity sha512-iebquVJEjfP6QGUiQR5V1xdnB+rJbfIHYHBHQc5X/W6wUD4NlaovjGXTDHiEl/B72TWVRtpuOs4KO0WT+GKO4Q==
"@graphql-tools/batch-delegate@8.2.0":
version "8.2.0"
resolved "https://registry.yarnpkg.com/@graphql-tools/batch-delegate/-/batch-delegate-8.2.0.tgz#743cb6b92e872b42fed91c9146896251e9718f46"
integrity sha512-h3RQqXC/mupOBsWVpr6a9zr2x1azcgE7EKSoe4m6FXaHf2a0rBJpw2IJLPnwbgksuxQELfRfza3jOrGYVV25WA==
dependencies:
"@graphql-tools/delegate" "^8.2.0"
"@graphql-tools/utils" "^8.2.0"
"@graphql-tools/delegate" "^8.3.0"
"@graphql-tools/utils" "^8.4.0"
dataloader "2.0.0"
tslib "~2.3.0"

"@graphql-tools/batch-execute@^8.1.0":
version "8.1.0"
resolved "https://registry.yarnpkg.com/@graphql-tools/batch-execute/-/batch-execute-8.1.0.tgz#fd463bab0e870a662bb00f12d5ce0013b11ae990"
integrity sha512-PPf8SZto4elBtkaV65RldkjvxCuwYV7tLYKH+w6QnsxogfjrtiwijmewtqIlfnpPRnuhmMzmOlhoDyf0I8EwHw==
"@graphql-tools/batch-execute@^8.3.0":
version "8.3.0"
resolved "https://registry.yarnpkg.com/@graphql-tools/batch-execute/-/batch-execute-8.3.0.tgz#a8fabc5f5d6e9fa5b34bbc9cdc2f1809ee164f3f"
integrity sha512-rv7lCH4T8hapJ9o1/aOhr64oEZhYaNRt8lzuEC3BlhzJc/szSt+/ry6mBNDjca6tjxJpMc82XLWAx9ppBLnyVA==
dependencies:
"@graphql-tools/utils" "^8.2.0"
"@graphql-tools/utils" "^8.5.0"
dataloader "2.0.0"
tslib "~2.3.0"
value-or-promise "1.0.10"
value-or-promise "1.0.11"

"@graphql-tools/delegate@^8.2.0":
version "8.2.1"
resolved "https://registry.yarnpkg.com/@graphql-tools/delegate/-/delegate-8.2.1.tgz#750df27be7641836e0cb654b953581de30f2d1a6"
integrity sha512-fvQjSrCJCfchSQlLNHPcj1TwojyV1CPtXmwtSEVKvyp9axokuP37WGyliOWUYCepfwpklklLFUeTEiWlCoxv2Q==
"@graphql-tools/delegate@^8.3.0", "@graphql-tools/delegate@^8.4.0":
version "8.4.0"
resolved "https://registry.yarnpkg.com/@graphql-tools/delegate/-/delegate-8.4.0.tgz#630c7e30b8b0f4039bc453082d6f77501488a9b6"
integrity sha512-FtMN1+q6aNahg0AGCEndUpfdOZ6O7OnIsLTauMPEG/vrwoIlMb8tn+qBRlGrWWxyUPKBSD31T74EWM3Tq/bBaQ==
dependencies:
"@graphql-tools/batch-execute" "^8.1.0"
"@graphql-tools/schema" "^8.2.0"
"@graphql-tools/utils" "^8.2.0"
"@graphql-tools/batch-execute" "^8.3.0"
"@graphql-tools/schema" "^8.3.0"
"@graphql-tools/utils" "^8.5.0"
dataloader "2.0.0"
tslib "~2.3.0"
value-or-promise "1.0.10"
value-or-promise "1.0.11"

"@graphql-tools/merge@6.2.16":
version "6.2.16"
@@ -126,12 +134,12 @@
"@graphql-tools/utils" "8.0.1"
tslib "~2.3.0"

"@graphql-tools/merge@^8.1.0", "@graphql-tools/merge@^8.1.1":
version "8.1.1"
resolved "https://registry.yarnpkg.com/@graphql-tools/merge/-/merge-8.1.1.tgz#692ff0de5e6b025a1166e25d7cda4e20ec0c2df3"
integrity sha512-zyeUbFG5zasSQC6LnBxzhmPTLYeeT3c0ijYfmFlIlOLiTAdRgCjIba03l6kKHcCiMDJYr+P+Nz5kKYLGqPSSjQ==
"@graphql-tools/merge@^8.2.0":
version "8.2.0"
resolved "https://registry.yarnpkg.com/@graphql-tools/merge/-/merge-8.2.0.tgz#8f6638eeecf19f59fef28598024308e0452dd0a2"
integrity sha512-nfMLYF7zczjnIbChZtqbvozRfuRweMD1Fe9HHd4RXd3Tcsj6E17srW0QJfxUoIIWh4pitj+XwZAwhj1PWBDU7g==
dependencies:
"@graphql-tools/utils" "^8.2.2"
"@graphql-tools/utils" "^8.4.0"
tslib "~2.3.0"

"@graphql-tools/mock@^8.1.2":
@@ -154,36 +162,36 @@
tslib "~2.2.0"
value-or-promise "1.0.6"

"@graphql-tools/schema@^8.0.1", "@graphql-tools/schema@^8.2.0":
version "8.2.0"
resolved "https://registry.yarnpkg.com/@graphql-tools/schema/-/schema-8.2.0.tgz#ae75cbb2df6cee9ed6d89fce56be467ab23758dc"
integrity sha512-ufmI5mJQa8NJczzfkh0pUttKvspqDcT5LLakA3jUmOrrE4d4NVj6onZlazdTzF5sAepSNqanFnwhrxZpCAJMKg==
"@graphql-tools/schema@^8.0.1", "@graphql-tools/schema@^8.3.0":
version "8.3.0"
resolved "https://registry.yarnpkg.com/@graphql-tools/schema/-/schema-8.3.0.tgz#ddf4297859c6d7ac1ebbbd91460260ed424115db"
integrity sha512-OJD4Q1Xa3sffRiHzy0sskZz9ZWeqaujINfoim4CTk5Y9es1LS+WnKi25wVhmL2SGzzmKuAv7oDn+dpQAlM+Gfw==
dependencies:
"@graphql-tools/merge" "^8.1.0"
"@graphql-tools/utils" "^8.2.0"
"@graphql-tools/merge" "^8.2.0"
"@graphql-tools/utils" "^8.4.0"
tslib "~2.3.0"
value-or-promise "1.0.10"

"@graphql-tools/stitch@8.3.1":
version "8.3.1"
resolved "https://registry.yarnpkg.com/@graphql-tools/stitch/-/stitch-8.3.1.tgz#8e4dfeb720585f478cc81f810c48d23531c85ae8"
integrity sha512-qSULit2caRVTJcUPuHNWiRbfuD18Q3m2Txt4MFGNRUAukqVs6q2vHwNpGxvnGAyTZ8FR+FiGujmIqKMsf5bqhw==
dependencies:
"@graphql-tools/batch-delegate" "8.1.0"
"@graphql-tools/delegate" "^8.2.0"
"@graphql-tools/merge" "^8.1.1"
"@graphql-tools/schema" "^8.2.0"
"@graphql-tools/utils" "^8.2.2"
"@graphql-tools/wrap" "^8.1.0"
value-or-promise "1.0.11"

"@graphql-tools/stitch@8.4.0":
version "8.4.0"
resolved "https://registry.yarnpkg.com/@graphql-tools/stitch/-/stitch-8.4.0.tgz#a6bc683d39563510c7c8ff41d614f163dc33e24d"
integrity sha512-snzffvVGbp2HKkAiXS3NTkIBx3muwoZOLnkDYjVIgzrDfpUjl1lCXhwW0YV9jDEZ4qhOE83GsbTRiC/7gNaXfA==
dependencies:
"@graphql-tools/batch-delegate" "8.2.0"
"@graphql-tools/delegate" "^8.3.0"
"@graphql-tools/merge" "^8.2.0"
"@graphql-tools/schema" "^8.3.0"
"@graphql-tools/utils" "^8.4.0"
"@graphql-tools/wrap" "^8.2.0"
tslib "~2.3.0"

"@graphql-tools/stitching-directives@2.1.1":
version "2.1.1"
resolved "https://registry.yarnpkg.com/@graphql-tools/stitching-directives/-/stitching-directives-2.1.1.tgz#7c5d40bbdf0ebd114408e36b6074446361898302"
integrity sha512-RgnijzFRKORYIcqzvoO+TA4sXRTgGb7AuOWjVl5pyqu/JRfQZ3zThIzq/+20XyjtPxfZloObOx+6L4HnPKk9WA==
"@graphql-tools/stitching-directives@2.2.0":
version "2.2.0"
resolved "https://registry.yarnpkg.com/@graphql-tools/stitching-directives/-/stitching-directives-2.2.0.tgz#d787ae21c706eb5ef4956dbbe69e6a5270e3e48a"
integrity sha512-UlAMrnM1oVBtGaB+yjFbXPq6xzbQ2uAxzUWnnzDByC1PEeJ4JGLlzaFKrQplBmV8r9f8Ru4GsdFxxYhCeDFucA==
dependencies:
"@graphql-tools/delegate" "^8.2.0"
"@graphql-tools/utils" "^8.2.0"
"@graphql-tools/delegate" "^8.3.0"
"@graphql-tools/utils" "^8.4.0"
tslib "~2.3.0"

"@graphql-tools/utils@8.0.1":
@@ -202,23 +210,23 @@
camel-case "4.1.2"
tslib "~2.2.0"

"@graphql-tools/utils@^8.2.0", "@graphql-tools/utils@^8.2.2":
version "8.2.2"
resolved "https://registry.yarnpkg.com/@graphql-tools/utils/-/utils-8.2.2.tgz#d29420bf1003d2876cb30f373145be432c7f7c4b"
integrity sha512-29FFY5U4lpXuBiW9dRvuWnBVwGhWbGLa2leZcAMU/Pz47Cr/QLZGVgpLBV9rt+Gbs7wyIJM7t7EuksPs0RDm3g==
"@graphql-tools/utils@^8.4.0", "@graphql-tools/utils@^8.5.0":
version "8.5.0"
resolved "https://registry.yarnpkg.com/@graphql-tools/utils/-/utils-8.5.0.tgz#439487ac756d9458a33091e5e0435ddf8e794f3e"
integrity sha512-jMwLm6YdN+Vbqntg5GHqDvGLpLa/xPSpRs/c40d0rBuel77wo7AaQ8jHeBSpp9y+7kp7HrGSWff1u7yJ7F8ppw==
dependencies:
tslib "~2.3.0"

"@graphql-tools/wrap@^8.1.0":
version "8.1.0"
resolved "https://registry.yarnpkg.com/@graphql-tools/wrap/-/wrap-8.1.0.tgz#2e618c78de910725130e5231666ca69a75f6cf99"
integrity sha512-WLT/bFewOIY8KJMzgOJSM/02fXJSFktFvI+JRu39wDH+hwFy1y7pFC0Bs1TP8B/hAEJ+t9+7JspX0LQWAUFjDg==
"@graphql-tools/wrap@^8.2.0":
version "8.3.0"
resolved "https://registry.yarnpkg.com/@graphql-tools/wrap/-/wrap-8.3.0.tgz#ae40302965176614adde80fd1e3ea93b87d3219d"
integrity sha512-DB9Rc/GHAAPizarlCAeo7KzZLN0VaMB+9XG6Pm8IfoNNYHq1I6czlzskHGd+U5nkXUhkuHFlV2QnersxhyJkHA==
dependencies:
"@graphql-tools/delegate" "^8.2.0"
"@graphql-tools/schema" "^8.2.0"
"@graphql-tools/utils" "^8.2.0"
"@graphql-tools/delegate" "^8.4.0"
"@graphql-tools/schema" "^8.3.0"
"@graphql-tools/utils" "^8.5.0"
tslib "~2.3.0"
value-or-promise "1.0.10"
value-or-promise "1.0.11"

"@hapi/hoek@^9.0.0":
version "9.2.0"
@@ -979,10 +987,10 @@ graphql-tag@2.12.5, graphql-tag@^2.11.0:
dependencies:
tslib "^2.1.0"

graphql@15.6.1:
version "15.6.1"
resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.6.1.tgz#9125bdf057553525da251e19e96dab3d3855ddfc"
integrity sha512-3i5lu0z6dRvJ48QP9kFxBkJ7h4Kso7PS8eahyTFz5Jm6CvQfLtNIE8LX9N6JLnXTuwR+sIYnXzaWp6anOg0QQw==
graphql@15.7.0:
version "15.7.0"
resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.7.0.tgz#caace26caf9b875b80982c45db58765d8a060e3e"
integrity sha512-1jvUsS5mSzcgXLTQNQyrP7eKkBZW+HUnmx2LYSnfvkyseVpij8wwO/sFBGgxbkZ+zzFwYQxrHsOana5oMXmMxg==

has-bigints@^1.0.1:
version "1.0.1"
@@ -1784,10 +1792,10 @@ uuid@^8.0.0:
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==

value-or-promise@1.0.10:
version "1.0.10"
resolved "https://registry.yarnpkg.com/value-or-promise/-/value-or-promise-1.0.10.tgz#5bf041f1e9a8e7043911875547636768a836e446"
integrity sha512-1OwTzvcfXkAfabk60UVr5NdjtjJ0Fg0T5+B1bhxtrOEwSH2fe8y4DnLgoksfCyd8yZCOQQHB0qLMQnwgCjbXLQ==
value-or-promise@1.0.11:
version "1.0.11"
resolved "https://registry.yarnpkg.com/value-or-promise/-/value-or-promise-1.0.11.tgz#3e90299af31dd014fe843fe309cefa7c1d94b140"
integrity sha512-41BrgH+dIbCFXClcSapVs5M6GkENd3gQOJpEfPDNa71LsUGMXDL0jMWpI/Rh7WhX+Aalfz2TTS3Zt5pUsbnhLg==

value-or-promise@1.0.6:
version "1.0.6"
36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
@@ -39,41 +39,41 @@
},
"homepage": "https://github.com/ardatan/graphql-tools#readme",
"devDependencies": {
"@babel/core": "7.15.5",
"@babel/core": "7.15.8",
"@babel/plugin-proposal-class-properties": "7.14.5",
"@babel/preset-env": "7.15.6",
"@babel/preset-env": "7.15.8",
"@babel/preset-typescript": "7.15.0",
"@changesets/cli": "2.17.0",
"@types/debug": "4.1.7",
"@types/jest": "27.0.2",
"@types/node": "14.17.21",
"@typescript-eslint/eslint-plugin": "4.33.0",
"@typescript-eslint/parser": "4.33.0",
"babel-jest": "27.2.4",
"@types/node": "14.17.32",
"@typescript-eslint/eslint-plugin": "5.2.0",
"@typescript-eslint/parser": "5.2.0",
"babel-jest": "27.3.1",
"bob-the-bundler": "1.5.1",
"chalk": "4.1.2",
"concurrently": "6.3.0",
"eslint": "7.32.0",
"eslint": "8.1.0",
"eslint-config-prettier": "8.3.0",
"eslint-config-standard": "16.0.3",
"eslint-plugin-import": "2.24.2",
"eslint-plugin-import": "2.25.2",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "5.1.0",
"eslint-plugin-promise": "5.1.1",
"eslint-plugin-standard": "5.0.0",
"globby": "11.0.4",
"graphql": "15.6.1",
"graphql-helix": "1.8.0",
"graphql": "15.7.0",
"graphql-helix": "1.8.4",
"graphql-subscriptions": "1.2.1",
"husky": "7.0.2",
"jest": "27.2.4",
"lint-staged": "11.2.0",
"nock": "13.1.3",
"husky": "7.0.4",
"jest": "27.3.1",
"lint-staged": "11.2.6",
"nock": "13.1.4",
"patch-package": "6.4.7",
"prettier": "2.4.1",
"ts-jest": "27.0.5",
"ts-jest": "27.0.7",
"typedoc": "0.21.9",
"typedoc-plugin-markdown": "3.10.4",
"typescript": "4.4.3"
"typescript": "4.4.4"
},
"lint-staged": {
"packages/**/src/**/*.{ts,tsx}": [
@@ -95,7 +95,7 @@
]
},
"resolutions": {
"graphql": "15.6.1",
"graphql": "15.7.0",
"esbuild": "^0.13.0",
"@changesets/apply-release-plan": "5.0.1"
}
21 changes: 21 additions & 0 deletions packages/batch-delegate/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# @graphql-tools/batch-delegate

## 8.2.1

### Patch Changes

- 4bfb3428: enhance: use ^ for tslib dependency
- Updated dependencies [4bfb3428]
- @graphql-tools/delegate@8.4.1
- @graphql-tools/utils@8.5.1

## 8.2.0

### Minor Changes

- 149afddb: fix: getting ready for GraphQL v16

### Patch Changes

- Updated dependencies [149afddb]
- @graphql-tools/delegate@8.3.0
- @graphql-tools/utils@8.4.0

## 8.1.0

### Minor Changes
10 changes: 5 additions & 5 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": "8.1.0",
"version": "8.2.1",
"description": "A set of utils for faster development of GraphQL tools",
"repository": {
"type": "git",
@@ -32,14 +32,14 @@
"input": "./src/index.ts"
},
"dependencies": {
"@graphql-tools/delegate": "^8.2.0",
"@graphql-tools/utils": "^8.2.0",
"@graphql-tools/delegate": "^8.4.1",
"@graphql-tools/utils": "^8.5.1",
"dataloader": "2.0.0",
"tslib": "~2.3.0"
},
"devDependencies": {
"@graphql-tools/schema": "^8.2.0",
"@graphql-tools/stitch": "^8.3.0"
"@graphql-tools/schema": "^8.3.1",
"@graphql-tools/stitch": "^8.4.1"
},
"publishConfig": {
"access": "public",
6 changes: 3 additions & 3 deletions packages/batch-delegate/tests/basic.example.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { execute, parse } from 'graphql';
import { execute, OperationTypeNode, parse } from 'graphql';

import { makeExecutableSchema } from '@graphql-tools/schema';
import { batchDelegateToSchema } from '@graphql-tools/batch-delegate';
@@ -62,7 +62,7 @@ describe('batch delegation within basic stitching example', () => {
resolve(chirp, _args, context, info) {
return batchDelegateToSchema({
schema: authorSchema,
operation: 'query',
operation: 'query' as OperationTypeNode,
fieldName: 'usersByIds',
key: chirp.chirpedAtUserId,
argsFromKeys: (ids) => ({ ids }),
@@ -155,7 +155,7 @@ describe('batch delegation within basic stitching example', () => {
resolve(user, _args, context, info) {
return batchDelegateToSchema({
schema: postsSchema,
operation: 'query',
operation: 'query' as OperationTypeNode,
fieldName: 'posts',
key: user.postIds,
context,
4 changes: 2 additions & 2 deletions packages/batch-delegate/tests/withTransforms.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { execute, GraphQLList, GraphQLObjectType, Kind, parse } from 'graphql';
import { execute, GraphQLList, GraphQLObjectType, Kind, OperationTypeNode, parse } from 'graphql';

import { makeExecutableSchema } from '@graphql-tools/schema';
import { batchDelegateToSchema } from '@graphql-tools/batch-delegate';
@@ -93,7 +93,7 @@ describe('works with complex transforms', () => {
selectionSet: `{ id }`,
resolve: (user, _args, context, info) => batchDelegateToSchema({
schema: bookSchema,
operation: 'query',
operation: 'query' as OperationTypeNode,
fieldName: 'booksByUserIds',
key: user.id,
argsFromKeys: (userIds) => ({ userIds }),
30 changes: 30 additions & 0 deletions packages/batch-execute/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
# @graphql-tools/batch-execute

## 8.3.1

### Patch Changes

- 4bfb3428: enhance: use ^ for tslib dependency
- Updated dependencies [4bfb3428]
- @graphql-tools/utils@8.5.1

## 8.3.0

### Minor Changes

- ad04dc79: enhance: make operationType optional

### Patch Changes

- Updated dependencies [ad04dc79]
- @graphql-tools/utils@8.5.0

## 8.2.0

### Minor Changes

- 149afddb: fix: getting ready for GraphQL v16

### Patch Changes

- Updated dependencies [149afddb]
- @graphql-tools/utils@8.4.0

## 8.1.1

### Patch Changes
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": "8.1.1",
"version": "8.3.1",
"description": "A set of utils for faster development of GraphQL tools",
"repository": {
"type": "git",
@@ -32,7 +32,7 @@
"input": "./src/index.ts"
},
"dependencies": {
"@graphql-tools/utils": "^8.2.4",
"@graphql-tools/utils": "^8.5.1",
"dataloader": "2.0.0",
"tslib": "~2.3.0",
"value-or-promise": "1.0.11"
13 changes: 8 additions & 5 deletions packages/batch-execute/src/createBatchingExecutor.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import DataLoader from 'dataloader';

import { Executor, ExecutionRequest, ExecutionResult } from '@graphql-tools/utils';
import { Executor, ExecutionRequest, ExecutionResult, getOperationASTFromRequest } from '@graphql-tools/utils';

import { mergeRequests } from './mergeRequests';
import { splitResult } from './splitResult';
@@ -16,7 +16,8 @@ export function createBatchingExecutor(
const loadFn = createLoadFn(executor, extensionsReducer);
const loader = new DataLoader(loadFn, dataLoaderOptions);
return function batchingExecutor(request: ExecutionRequest) {
return request.operationType === 'subscription' ? executor(request) : loader.load(request);
const operationAst = getOperationASTFromRequest(request);
return operationAst.operation === 'subscription' ? executor(request) : loader.load(request);
};
}

@@ -31,15 +32,17 @@ function createLoadFn(
let currentBatch: Array<ExecutionRequest> = [request];
execBatches.push(currentBatch);

const operationType = request.operationType;
const operationAst = getOperationASTFromRequest(request);
const operationType = operationAst.operation;

if (operationType == null) {
throw new Error('could not identify operation type of document');
}

while (++index < requests.length) {
const currentRequest = requests[index];
const currentOperationType = currentRequest.operationType;
const currentOperationAST = getOperationASTFromRequest(currentRequest);
const currentOperationType = currentOperationAST.operation;

if (operationType === currentOperationType) {
currentBatch.push(currentRequest);
@@ -51,7 +54,7 @@ function createLoadFn(

const results = await Promise.all(
execBatches.map(async execBatch => {
const mergedRequests = mergeRequests(execBatch[0].operationType, execBatch, extensionsReducer);
const mergedRequests = mergeRequests(execBatch, extensionsReducer);
const resultBatches = (await executor(mergedRequests)) as ExecutionResult;
return splitResult(resultBatches, execBatch.length);
})
15 changes: 6 additions & 9 deletions packages/batch-execute/src/mergeRequests.ts
Original file line number Diff line number Diff line change
@@ -5,20 +5,17 @@ import {
Kind,
DefinitionNode,
OperationDefinitionNode,
OperationTypeNode,
DocumentNode,
FragmentDefinitionNode,
VariableDefinitionNode,
SelectionNode,
FragmentSpreadNode,
VariableNode,
VisitorKeyMap,
ASTKindToNode,
InlineFragmentNode,
FieldNode,
} from 'graphql';

import { ExecutionRequest } from '@graphql-tools/utils';
import { ExecutionRequest, getOperationASTFromRequest } from '@graphql-tools/utils';

import { createPrefix } from './prefix';

@@ -57,7 +54,6 @@ import { createPrefix } from './prefix';
* }
*/
export function mergeRequests(
operationType: OperationTypeNode,
requests: Array<ExecutionRequest>,
extensionsReducer: (mergedExtensions: Record<string, any>, request: ExecutionRequest) => Record<string, any>
): ExecutionRequest {
@@ -69,7 +65,7 @@ export function mergeRequests(

for (const index in requests) {
const request = requests[index];
const prefixedRequests = prefixRequest(createPrefix(index), request, operationType);
const prefixedRequests = prefixRequest(createPrefix(index), request);

for (const def of prefixedRequests.document.definitions) {
if (isOperationDefinition(def)) {
@@ -86,6 +82,8 @@ export function mergeRequests(
mergedExtensions = extensionsReducer(mergedExtensions, request);
}

const firstRequest = requests[0];
const operationType = firstRequest.operationType ?? getOperationASTFromRequest(firstRequest).operation;
const mergedOperationDefinition: OperationDefinitionNode = {
kind: Kind.OPERATION_DEFINITION,
operation: operationType,
@@ -109,7 +107,7 @@ export function mergeRequests(
};
}

function prefixRequest(prefix: string, request: ExecutionRequest, operationType: OperationTypeNode): ExecutionRequest {
function prefixRequest(prefix: string, request: ExecutionRequest): ExecutionRequest {
const executionVariables = request.variables ?? {};

function prefixNode(node: VariableNode | FragmentDefinitionNode | FragmentSpreadNode) {
@@ -152,7 +150,6 @@ function prefixRequest(prefix: string, request: ExecutionRequest, operationType:
return {
document: prefixedDocument,
variables: prefixedVariables,
operationType,
};
}

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

/**
32 changes: 16 additions & 16 deletions packages/batch-execute/tests/batchExecute.test.ts
Original file line number Diff line number Diff line change
@@ -68,8 +68,8 @@ describe('batch execution', () => {

it('batchs multiple executions', async () => {
const [first, second] = await Promise.all([
batchExec({ document: parse('{ field1 field2 }'), operationType: 'query' }),
batchExec({ document: parse('{ field2 field3(input: "3") }'), operationType: 'query' }),
batchExec({ document: parse('{ field1 field2 }') }),
batchExec({ document: parse('{ field2 field3(input: "3") }') }),
]) as ExecutionResult[];

expect(first?.data).toEqual({ field1: '1', field2: '2' });
@@ -80,8 +80,8 @@ describe('batch execution', () => {

it('preserves root field aliases in the final result', async () => {
const [first, second] = await Promise.all([
batchExec({ document: parse('{ a: field1 b: field2 }'), operationType: 'query' }),
batchExec({ document: parse('{ c: field2 d: field3(input: "3") }'), operationType: 'query' }),
batchExec({ document: parse('{ a: field1 b: field2 }') }),
batchExec({ document: parse('{ c: field2 d: field3(input: "3") }') }),
]) as ExecutionResult[];

expect(first?.data).toEqual({ a: '1', b: '2' });
@@ -95,12 +95,12 @@ describe('batch execution', () => {
batchExec({
document: parse('query($a: String){ field3(input: $a) }'),
variables: { a: '1' },
operationType: 'query',

}),
batchExec({
document: parse('query($a: String){ field3(input: $a) }'),
variables: { a: '2' },
operationType: 'query',

}),
]) as ExecutionResult[];

@@ -112,8 +112,8 @@ describe('batch execution', () => {

it('renames fields within inline spreads', async () => {
const [first, second] = await Promise.all([
batchExec({ document: parse('{ ...on Query { field1 } }'), operationType: 'query' }),
batchExec({ document: parse('{ ...on Query { field2 } }'), operationType: 'query' }),
batchExec({ document: parse('{ ...on Query { field1 } }') }),
batchExec({ document: parse('{ ...on Query { field2 } }') }),
]) as ExecutionResult[];

const squishedDoc = executorDocument?.replace(/\s+/g, ' ');
@@ -128,11 +128,11 @@ describe('batch execution', () => {
const [first, second] = await Promise.all([
batchExec({
document: parse('fragment A on Widget { name } query{ widget { ...A } }'),
operationType: 'query',

}),
batchExec({
document: parse('fragment A on Widget { name } query{ widget { ...A } }'),
operationType: 'query',

}),
]) as ExecutionResult[];

@@ -150,11 +150,11 @@ describe('batch execution', () => {
const [first, second] = await Promise.all([
batchExec({
document: parse('fragment A on Query { field1 } query{ ...A }'),
operationType: 'query',

}),
batchExec({
document: parse('fragment A on Query { field2 } query{ ...A }'),
operationType: 'query',

}),
]) as ExecutionResult[];

@@ -167,11 +167,11 @@ describe('batch execution', () => {
const [first, second] = await Promise.all([
batchExec({
document: parse('{ first: boom(message: "first error") }'),
operationType: 'query',

}),
batchExec({
document: parse('{ second: boom(message: "second error") }'),
operationType: 'query',

}),
]) as ExecutionResult[];

@@ -184,8 +184,8 @@ describe('batch execution', () => {

it('returns request-level errors to all results', async () => {
const [first, second] = await Promise.all([
batchExec({ document: parse('{ field1 field2 }'), operationType: 'query' }),
batchExec({ document: parse('{ notgonnawork }'), operationType: 'query' }),
batchExec({ document: parse('{ field1 field2 }') }),
batchExec({ document: parse('{ notgonnawork }') }),
]) as ExecutionResult[];

expect(first?.errors?.length).toEqual(1);
43 changes: 43 additions & 0 deletions packages/delegate/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,48 @@
# @graphql-tools/delegate

## 8.4.1

### Patch Changes

- 4bfb3428: enhance: use ^ for tslib dependency
- Updated dependencies [4bfb3428]
- @graphql-tools/batch-execute@8.3.1
- @graphql-tools/schema@8.3.1
- @graphql-tools/utils@8.5.1

## 8.4.0

### Minor Changes

- ad04dc79: enhance: make operationType optional

### Patch Changes

- Updated dependencies [ad04dc79]
- @graphql-tools/batch-execute@8.3.0
- @graphql-tools/utils@8.5.0

## 8.3.0

### Minor Changes

- 149afddb: fix: getting ready for GraphQL v16

### Patch Changes

- Updated dependencies [149afddb]
- @graphql-tools/batch-execute@8.2.0
- @graphql-tools/schema@8.3.0
- @graphql-tools/utils@8.4.0

## 8.2.3

### Patch Changes

- 58262be7: enhance: show more clear error messages for aggregated error
- Updated dependencies [58262be7]
- @graphql-tools/utils@8.3.0

## 8.2.2

### Patch Changes
8 changes: 4 additions & 4 deletions packages/delegate/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@graphql-tools/delegate",
"version": "8.2.2",
"version": "8.4.1",
"description": "A set of utils for faster development of GraphQL tools",
"repository": {
"type": "git",
@@ -32,9 +32,9 @@
"input": "./src/index.ts"
},
"dependencies": {
"@graphql-tools/batch-execute": "^8.1.1",
"@graphql-tools/schema": "^8.2.0",
"@graphql-tools/utils": "^8.2.4",
"@graphql-tools/batch-execute": "^8.3.1",
"@graphql-tools/schema": "^8.3.1",
"@graphql-tools/utils": "^8.5.1",
"dataloader": "2.0.0",
"tslib": "~2.3.0",
"value-or-promise": "1.0.11"
3 changes: 2 additions & 1 deletion packages/delegate/src/checkResultAndHandleErrors.ts
Original file line number Diff line number Diff line change
@@ -50,7 +50,8 @@ export function mergeDataAndErrors(
// locatedError path argument must be defined, but it is just forwarded to a constructor that allows a undefined value
// https://github.com/graphql/graphql-js/blob/b4bff0ba9c15c9d7245dd68556e754c41f263289/src/error/locatedError.js#L25
// https://github.com/graphql/graphql-js/blob/b4bff0ba9c15c9d7245dd68556e754c41f263289/src/error/GraphQLError.js#L19
const newError = locatedError(new AggregateError(errors), undefined as any, path as any);
const combinedError = new AggregateError(errors, errors.map(error => error.message).join(', \n'));
const newError = locatedError(combinedError, undefined as any, path as any);

return { data: newError, unpathedErrors: [] };
}
11 changes: 6 additions & 5 deletions packages/delegate/src/createRequest.ts
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@ import {
SelectionSetNode,
DefinitionNode,
DocumentNode,
NameNode,
} from 'graphql';

import {
@@ -26,12 +27,12 @@ import { ICreateRequestFromInfo, ICreateRequest } from './types';

export function getDelegatingOperation(parentType: GraphQLObjectType, schema: GraphQLSchema): OperationTypeNode {
if (parentType === schema.getMutationType()) {
return 'mutation';
return 'mutation' as OperationTypeNode;
} else if (parentType === schema.getSubscriptionType()) {
return 'subscription';
return 'subscription' as OperationTypeNode;
}

return 'query';
return 'query' as OperationTypeNode;
}

export function createRequestFromInfo({
@@ -149,7 +150,7 @@ export function createRequest({
selectionSet: newSelectionSet,
};

const operationName = targetOperationName
const operationName: NameNode | undefined = targetOperationName
? {
kind: Kind.NAME,
value: targetOperationName,
@@ -186,9 +187,9 @@ export function createRequest({
variables: newVariables,
rootValue: targetRootValue,
operationName: targetOperationName,
operationType: targetOperation,
context,
info,
operationType: targetOperation,
};
}

42 changes: 16 additions & 26 deletions packages/delegate/src/delegateToSchema.ts
Original file line number Diff line number Diff line change
@@ -4,9 +4,7 @@ import {
validate,
GraphQLSchema,
FieldDefinitionNode,
getOperationAST,
OperationTypeNode,
OperationDefinitionNode,
DocumentNode,
GraphQLOutputType,
ExecutionArgs,
@@ -25,6 +23,7 @@ import {
isAsyncIterable,
getDefinedRootType,
memoize1,
getOperationASTFromRequest,
} from '@graphql-tools/utils';

import {
@@ -118,16 +117,11 @@ function getDelegationContext<TContext>({
transformedSchema,
skipTypeMerging = false,
}: IDelegateRequestOptions<TContext>): DelegationContext<TContext> {
const { operationType: operation, context, operationName, document } = request;
let operationDefinition: Maybe<OperationDefinitionNode>;
const operationDefinition = getOperationASTFromRequest(request);
let targetFieldName: string;

if (fieldName == null) {
operationDefinition = getOperationAST(document, operationName);
if (operationDefinition == null) {
throw new Error('Cannot infer main operation from the provided document.');
}
targetFieldName = (operationDefinition?.selectionSet.selections[0] as unknown as FieldDefinitionNode).name.value;
targetFieldName = (operationDefinition.selectionSet.selections[0] as unknown as FieldDefinitionNode).name.value;
} else {
targetFieldName = fieldName;
}
@@ -137,6 +131,8 @@ function getDelegationContext<TContext>({
const subschemaOrSubschemaConfig: GraphQLSchema | SubschemaConfig<any, any, any, any> =
stitchingInfo?.subschemaMap.get(schema) ?? schema;

const operation = operationDefinition.operation;

if (isSubschemaConfig(subschemaOrSubschemaConfig)) {
const targetSchema = subschemaOrSubschemaConfig.schema;
return {
@@ -146,7 +142,7 @@ function getDelegationContext<TContext>({
operation,
fieldName: targetFieldName,
args,
context,
context: request.context,
info,
returnType: returnType ?? info?.returnType ?? getDelegationReturnType(targetSchema, operation, targetFieldName),
transforms:
@@ -167,7 +163,7 @@ function getDelegationContext<TContext>({
operation,
fieldName: targetFieldName,
args,
context,
context: request.context,
info,
returnType:
returnType ?? info?.returnType ?? getDelegationReturnType(subschemaOrSubschemaConfig, operation, targetFieldName),
@@ -181,7 +177,7 @@ function validateRequest(delegationContext: DelegationContext<any>, document: Do
const errors = validate(delegationContext.targetSchema, document);
if (errors.length > 0) {
if (errors.length > 1) {
const combinedError = new AggregateError(errors);
const combinedError = new AggregateError(errors, errors.map(error => error.message).join(', \n'));
throw combinedError;
}
const error = errors[0];
@@ -208,23 +204,17 @@ function getExecutor<TContext>(delegationContext: DelegationContext<TContext>):
}

export const createDefaultExecutor = memoize1(function createDefaultExecutor(schema: GraphQLSchema): Executor {
return function defaultExecutor({
document,
context,
variables,
rootValue,
operationName,
operationType,
}: ExecutionRequest) {
return function defaultExecutor(request: ExecutionRequest) {
const operationAst = getOperationASTFromRequest(request);
const executionArgs: ExecutionArgs = {
schema,
document,
contextValue: context,
variableValues: variables,
rootValue,
operationName,
document: request.document,
contextValue: request.context,
variableValues: request.variables,
rootValue: request.rootValue,
operationName: request.operationName,
};
if (operationType === 'subscription') {
if (operationAst.operation === 'subscription') {
return subscribe(executionArgs);
}
return execute(executionArgs);
34 changes: 19 additions & 15 deletions packages/delegate/src/finalizeGatewayRequest.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
ArgumentNode,
ASTKindToNode,
DocumentNode,
FragmentDefinitionNode,
getNamedType,
GraphQLField,
@@ -19,7 +19,6 @@ import {
VariableDefinitionNode,
versionInfo as graphqlVersionInfo,
visit,
VisitorKeyMap,
visitWithTypeInfo,
} from 'graphql';

@@ -31,6 +30,7 @@ import {
createVariableNameGenerator,
implementsAbstractType,
inspect,
ASTVisitorKeyMap,
} from '@graphql-tools/utils';

import { DelegationContext } from './types';
@@ -94,12 +94,14 @@ function finalizeGatewayDocument(
});
}

const newDocument: DocumentNode = {
kind: Kind.DOCUMENT,
definitions: [...newOperations, ...newFragments],
};

return {
usedVariables,
newDocument: {
kind: Kind.DOCUMENT,
definitions: [...newOperations, ...newFragments],
},
newDocument,
};
}

@@ -158,7 +160,7 @@ function addVariablesToRootFields(

const type = getDefinedRootType(targetSchema, operation.operation);

const newSelectionSet: Array<SelectionNode> = [];
const newSelections: Array<SelectionNode> = [];

for (const selection of operation.selectionSet.selections) {
if (selection.kind === Kind.FIELD) {
@@ -178,22 +180,24 @@ function addVariablesToRootFields(
updateArguments(targetField, argumentNodeMap, variableDefinitionMap, newVariables, args);
}

newSelectionSet.push({
newSelections.push({
...selection,
arguments: Object.values(argumentNodeMap),
});
} else {
newSelectionSet.push(selection);
newSelections.push(selection);
}
}

const newSelectionSet: SelectionSetNode = {
kind: Kind.SELECTION_SET,
selections: newSelections,
};

return {
...operation,
variableDefinitions: Object.values(variableDefinitionMap),
selectionSet: {
kind: Kind.SELECTION_SET,
selections: newSelectionSet,
},
selectionSet: newSelectionSet,
};
});

@@ -284,14 +288,14 @@ function collectFragmentVariables(
};
}

const filteredSelectionSetVisitorKeys: Partial<VisitorKeyMap<ASTKindToNode>> = {
const filteredSelectionSetVisitorKeys: ASTVisitorKeyMap = {
SelectionSet: ['selections'],
Field: ['selectionSet'],
InlineFragment: ['selectionSet'],
FragmentDefinition: ['selectionSet'],
};

const variablesVisitorKeys: Partial<VisitorKeyMap<ASTKindToNode>> = {
const variablesVisitorKeys: ASTVisitorKeyMap = {
SelectionSet: ['selections'],
Field: ['arguments', 'directives', 'selectionSet'],
Argument: ['value'],
10 changes: 4 additions & 6 deletions packages/delegate/src/prepareGatewayDocument.ts
Original file line number Diff line number Diff line change
@@ -16,11 +16,9 @@ import {
GraphQLOutputType,
isObjectType,
FieldNode,
VisitorKeyMap,
ASTKindToNode,
} from 'graphql';

import { implementsAbstractType, getRootTypeNames, memoize2 } from '@graphql-tools/utils';
import { implementsAbstractType, getRootTypeNames, memoize2, ASTVisitorKeyMap } from '@graphql-tools/utils';

import { getDocumentMetadata } from './getDocumentMetadata';
import { StitchingInfo } from './types';
@@ -52,12 +50,12 @@ export function prepareGatewayDocument(

const typeInfo = new TypeInfo(transformedSchema);

const expandedDocument = {
const expandedDocument: DocumentNode = {
kind: Kind.DOCUMENT,
definitions: [...operations, ...fragments, ...expandedFragments],
};

const visitorKeyMap: Partial<VisitorKeyMap<ASTKindToNode>> = {
const visitorKeyMap: ASTVisitorKeyMap = {
Document: ['definitions'],
OperationDefinition: ['selectionSet'],
SelectionSet: ['selections'],
@@ -392,7 +390,7 @@ function wrapConcreteTypes(

const typeInfo = new TypeInfo(targetSchema);

const visitorKeys: Partial<VisitorKeyMap<ASTKindToNode>> = {
const visitorKeys: ASTVisitorKeyMap = {
Document: ['definitions'],
OperationDefinition: ['selectionSet'],
SelectionSet: ['selections'],
5 changes: 4 additions & 1 deletion packages/delegate/src/resolveExternalValue.ts
Original file line number Diff line number Diff line change
@@ -168,7 +168,10 @@ function reportUnpathedErrorsViaNull(unpathedErrors: Array<GraphQLError>) {
return unreportedErrors[0];
}

const combinedError = new AggregateError(unreportedErrors);
const combinedError = new AggregateError(
unreportedErrors,
unreportedErrors.map(error => error.message).join(', \n')
);
// We cast path as any for GraphQL.js 14 compat
// locatedError path argument must be defined, but it is just forwarded to a constructor that allows a undefined value
// https://github.com/graphql/graphql-js/blob/b4bff0ba9c15c9d7245dd68556e754c41f263289/src/error/locatedError.js#L25
8 changes: 4 additions & 4 deletions packages/delegate/tests/createRequest.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { graphql, Kind, GraphQLError } from 'graphql';
import { graphql, Kind, GraphQLError, OperationTypeNode } from 'graphql';

import { createRequest } from '../src/createRequest';
import { makeExecutableSchema } from '@graphql-tools/schema';
@@ -66,7 +66,7 @@ describe('bare requests', () => {
}
}]
}],
targetOperation: 'query',
targetOperation: 'query' as OperationTypeNode,
targetFieldName: 'test',
});
return delegateRequest({
@@ -149,7 +149,7 @@ describe('bare requests', () => {
}],
},
}],
targetOperation: 'query',
targetOperation: 'query' as OperationTypeNode,
targetFieldName: 'test',
});
return delegateRequest({
@@ -214,7 +214,7 @@ describe('bare requests', () => {
value: 'delegate',
},
}],
targetOperation: 'query',
targetOperation: 'query' as OperationTypeNode,
targetFieldName: 'test',
});
return delegateRequest({
8 changes: 4 additions & 4 deletions packages/delegate/tests/delegateToSchema.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { graphql } from 'graphql';
import { graphql, OperationTypeNode } from 'graphql';

import { delegateToSchema } from '../src/delegateToSchema';
import { makeExecutableSchema } from '@graphql-tools/schema';
@@ -36,7 +36,7 @@ describe('delegateToSchema', () => {
Query: {
delegateToSchema: (_root, args, context, info) => delegateToSchema({
schema: innerSchema,
operation: 'query',
operation: 'query' as OperationTypeNode,
fieldName: 'test',
args,
context,
@@ -83,7 +83,7 @@ describe('delegateToSchema', () => {
Query: {
delegateToSchema: (_root, args, context, info) => delegateToSchema({
schema: innerSchema,
operation: 'query',
operation: 'query' as OperationTypeNode,
fieldName: 'test',
args,
context,
@@ -130,7 +130,7 @@ describe('delegateToSchema', () => {
Query: {
delegateToSchema: (_root, args, context, info) => delegateToSchema({
schema: innerSchema,
operation: 'query',
operation: 'query' as OperationTypeNode,
fieldName: 'test',
args,
context,
4 changes: 2 additions & 2 deletions packages/delegate/tests/errors.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GraphQLError, GraphQLResolveInfo, locatedError, graphql } from 'graphql';
import { GraphQLError, GraphQLResolveInfo, locatedError, graphql, OperationTypeNode } from 'graphql';

import { makeExecutableSchema } from '@graphql-tools/schema';
import { ExecutionResult } from '@graphql-tools/utils';
@@ -140,7 +140,7 @@ describe('Errors', () => {
Query: {
object: (_parent, _args, context, info) => delegateToSchema({
schema: remoteSchema,
operation: 'query',
operation: 'query' as OperationTypeNode,
context,
info,
}),
6 changes: 1 addition & 5 deletions packages/delegate/tests/finalizeGatewayRequest.test.ts
Original file line number Diff line number Diff line change
@@ -20,8 +20,7 @@ describe('finalizeGatewayRequest', () => {
document: query,
variables: {
id: 'c1',
},
operationType: 'query' as const
}
}, {
targetSchema: bookingSchema
} as DelegationContext);
@@ -55,7 +54,6 @@ describe('finalizeGatewayRequest', () => {
id: 'c1',
limit: 10,
},
operationType: 'query' as const,
}, {
targetSchema: bookingSchema
} as DelegationContext);
@@ -82,7 +80,6 @@ describe('finalizeGatewayRequest', () => {
variables: {
test: 'test',
},
operationType: 'query' as const,
}, {
targetSchema: propertySchema
} as DelegationContext);
@@ -113,7 +110,6 @@ describe('finalizeGatewayRequest', () => {
variables: {
id: 'b1',
},
operationType: 'query' as const,
}, {
targetSchema: bookingSchema
} as DelegationContext);
8 changes: 8 additions & 0 deletions packages/graphql-tag-pluck/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @graphql-tools/graphql-tag-pluck

## 7.1.3

### Patch Changes

- 4bfb3428: enhance: use ^ for tslib dependency
- Updated dependencies [4bfb3428]
- @graphql-tools/utils@8.5.1

## 7.1.2

### Patch Changes
8 changes: 4 additions & 4 deletions packages/graphql-tag-pluck/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@graphql-tools/graphql-tag-pluck",
"version": "7.1.2",
"version": "7.1.3",
"description": "Pluck graphql-tag template literals",
"license": "MIT",
"repository": {
@@ -29,15 +29,15 @@
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
},
"dependencies": {
"@babel/parser": "7.15.7",
"@babel/parser": "7.15.8",
"@babel/traverse": "7.15.4",
"@babel/types": "7.15.6",
"@graphql-tools/utils": "^8.2.5",
"@graphql-tools/utils": "^8.5.1",
"tslib": "~2.3.0"
},
"devDependencies": {
"@types/babel__traverse": "7.14.2",
"@vue/compiler-sfc": "3.2.19"
"@vue/compiler-sfc": "3.2.20"
},
"buildOptions": {
"external": [
35 changes: 35 additions & 0 deletions packages/import/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,40 @@
# @graphql-tools/import

## 6.5.7

### Patch Changes

- 4bfb3428: enhance: use ^ for tslib dependency
- Updated dependencies [4bfb3428]
- @graphql-tools/utils@8.5.1

## 6.5.6

### Patch Changes

- Updated dependencies [ad04dc79]
- @graphql-tools/utils@8.5.0

## 6.5.5

### Patch Changes

- Updated dependencies [149afddb]
- @graphql-tools/utils@8.4.0

## 6.5.4

### Patch Changes

- Updated dependencies [58262be7]
- @graphql-tools/utils@8.3.0

## 6.5.3

### Patch Changes

- 8ffbb600: Remove code causing Maximum call stack size exceeded in @graphql-tools/import package.

## 6.5.2

### Patch Changes
4 changes: 2 additions & 2 deletions packages/import/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@graphql-tools/import",
"version": "6.5.2",
"version": "6.5.7",
"description": "A set of utils for faster development of GraphQL tools",
"repository": {
"type": "git",
@@ -34,7 +34,7 @@
"directory": "dist"
},
"dependencies": {
"@graphql-tools/utils": "8.2.5",
"@graphql-tools/utils": "8.5.1",
"resolve-from": "5.0.0",
"tslib": "~2.3.0"
}
7 changes: 0 additions & 7 deletions packages/import/src/index.ts
Original file line number Diff line number Diff line change
@@ -163,13 +163,6 @@ function visitFile(

if (!otherLines) {
visitedFiles.set(filePath, allImportedDefinitionsMap);

const definitionSet = new Set<DefinitionNode>();
allImportedDefinitionsMap?.forEach((importedDefinitions, importedDefinitionName) => {
importedDefinitions?.forEach(importedDefinition => {
addDefinition(importedDefinition, importedDefinitionName, definitionSet);
});
});
} else {
const fileDefinitionMap = visitedFiles.get(filePath);
if (fileDefinitionMap) {
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type Model1 {
data: String!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# import Model1 from './1.model.graphql'
type Mutation {
createModel1(data: String!): Model1!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# import Model1 from './1.model.graphql'
type Query {
query_model_1: Model1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# import * from './1.model.graphql'
# import * from './1.query.graphql'
# import * from './1.mutation.graphql'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type Model10 {
data: String!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# import Model10 from './10.model.graphql'
type Mutation {
createModel10(data: String!): Model10!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# import Model10 from './10.model.graphql'
type Query {
query_model_10: Model10
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# import * from './10.model.graphql'
# import * from './10.query.graphql'
# import * from './10.mutation.graphql'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type Model2 {
data: String!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# import Model2 from './2.model.graphql'
type Mutation {
createModel2(data: String!): Model2!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# import Model2 from './2.model.graphql'
type Query {
query_model_2: Model2
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# import * from './2.model.graphql'
# import * from './2.query.graphql'
# import * from './2.mutation.graphql'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type Model3 {
data: String!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# import Model3 from './3.model.graphql'
type Mutation {
createModel3(data: String!): Model3!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# import Model3 from './3.model.graphql'
type Query {
query_model_3: Model3
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# import * from './3.model.graphql'
# import * from './3.query.graphql'
# import * from './3.mutation.graphql'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type Model4 {
data: String!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# import Model4 from './4.model.graphql'
type Mutation {
createModel4(data: String!): Model4!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# import Model4 from './4.model.graphql'
type Query {
query_model_4: Model4
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# import * from './4.model.graphql'
# import * from './4.query.graphql'
# import * from './4.mutation.graphql'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type Model5 {
data: String!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# import Model5 from './5.model.graphql'
type Mutation {
createModel5(data: String!): Model5!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# import Model5 from './5.model.graphql'
type Query {
query_model_5: Model5
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# import * from './5.model.graphql'
# import * from './5.query.graphql'
# import * from './5.mutation.graphql'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type Model6 {
data: String!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# import Model6 from './6.model.graphql'
type Mutation {
createModel6(data: String!): Model6!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# import Model6 from './6.model.graphql'
type Query {
query_model_6: Model6
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# import * from './6.model.graphql'
# import * from './6.query.graphql'
# import * from './6.mutation.graphql'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type Model7 {
data: String!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# import Model7 from './7.model.graphql'
type Mutation {
createModel7(data: String!): Model7!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# import Model7 from './7.model.graphql'
type Query {
query_model_7: Model7
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# import * from './7.model.graphql'
# import * from './7.query.graphql'
# import * from './7.mutation.graphql'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type Model8 {
data: String!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# import Model8 from './8.model.graphql'
type Mutation {
createModel8(data: String!): Model8!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# import Model8 from './8.model.graphql'
type Query {
query_model_8: Model8
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# import * from './8.model.graphql'
# import * from './8.query.graphql'
# import * from './8.mutation.graphql'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type Model9 {
data: String!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# import Model9 from './9.model.graphql'
type Mutation {
createModel9(data: String!): Model9!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# import Model9 from './9.model.graphql'
type Query {
query_model_9: Model9
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# import * from './9.model.graphql'
# import * from './9.query.graphql'
# import * from './9.mutation.graphql'
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# import * from './1/index.graphql'
# import * from './2/index.graphql'
# import * from './3/index.graphql'
# import * from './4/index.graphql'
# import * from './5/index.graphql'
# import * from './6/index.graphql'
# import * from './7/index.graphql'
# import * from './8/index.graphql'
# import * from './9/index.graphql'
# import * from './10/index.graphql'
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# import Query.* from './level2.graphql'
# import * from './level2.graphql'
71 changes: 71 additions & 0 deletions packages/import/tests/schema/import-schema.spec.ts
Original file line number Diff line number Diff line change
@@ -984,6 +984,77 @@ describe('importSchema', () => {
expect(importSchema('fixtures/multiple-levels-master-schema/level1.graphql')).toBeSimilarGqlDoc(expectedSDL);
});

test('imports dependencies with transitive dependencies while using master schemata with directories', () => {
const expectedSDL = /* GraphQL */`
type Model1 {
data: String!
}

type Model10 {
data: String!
}

type Model2 {
data: String!
}

type Model3 {
data: String!
}

type Model4 {
data: String!
}

type Model5 {
data: String!
}

type Model6 {
data: String!
}

type Model7 {
data: String!
}

type Model8 {
data: String!
}

type Model9 {
data: String!
}

type Mutation {
createModel1(data: String!): Model1!
createModel10(data: String!): Model10!
createModel2(data: String!): Model2!
createModel3(data: String!): Model3!
createModel4(data: String!): Model4!
createModel5(data: String!): Model5!
createModel6(data: String!): Model6!
createModel7(data: String!): Model7!
createModel8(data: String!): Model8!
createModel9(data: String!): Model9!
}

type Query {
query_model_1: Model1
query_model_10: Model10
query_model_2: Model2
query_model_3: Model3
query_model_4: Model4
query_model_5: Model5
query_model_6: Model6
query_model_7: Model7
query_model_8: Model8
query_model_9: Model9
}
`;
expect(importSchema('fixtures/multiple-directories-with-master-schema/index.graphql')).toBeSimilarGqlDoc(expectedSDL);
});

test('imports multi-level types without direct references', () => {
const expectedSDL = /* GraphQL */`\
type Level1 {
8 changes: 8 additions & 0 deletions packages/jest-transform/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @graphql-tools/jest-transform

## 1.1.1

### Patch Changes

- 4bfb3428: enhance: use ^ for tslib dependency
- Updated dependencies [4bfb3428]
- @graphql-tools/webpack-loader@6.6.1

## 1.1.0

### Minor Changes
4 changes: 2 additions & 2 deletions packages/jest-transform/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@graphql-tools/jest-transform",
"version": "1.1.0",
"version": "1.1.1",
"description": "Jest Plugin to load and parse imported GraphQL files",
"repository": {
"type": "git",
@@ -32,7 +32,7 @@
"input": "./src/index.ts"
},
"dependencies": {
"@graphql-tools/webpack-loader": "^6.6.0",
"@graphql-tools/webpack-loader": "^6.6.1",
"@jest/transform": "^27.0.2",
"@jest/types": "^27.0.2",
"tslib": "~2.3.0"
22 changes: 22 additions & 0 deletions packages/links/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# @graphql-tools/links

## 8.2.1

### Patch Changes

- 981eef80: enhance: remove isPromise and cleanup file-upload handling
- 4bfb3428: enhance: use ^ for tslib dependency
- Updated dependencies [4bfb3428]
- @graphql-tools/delegate@8.4.1
- @graphql-tools/utils@8.5.1

## 8.2.0

### Minor Changes

- ad04dc79: enhance: make operationType optional

### Patch Changes

- Updated dependencies [ad04dc79]
- @graphql-tools/delegate@8.4.0
- @graphql-tools/utils@8.5.0

## 8.1.0

### Minor Changes
7 changes: 3 additions & 4 deletions packages/links/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@graphql-tools/links",
"version": "8.1.0",
"version": "8.2.1",
"description": "A set of utils for faster development of GraphQL tools",
"repository": {
"type": "git",
@@ -45,12 +45,11 @@
"graphql-upload": "12.0.0"
},
"dependencies": {
"@graphql-tools/delegate": "^8.2.0",
"@graphql-tools/utils": "^8.2.0",
"@graphql-tools/delegate": "^8.4.1",
"@graphql-tools/utils": "^8.5.1",
"apollo-upload-client": "16.0.0",
"cross-fetch": "3.1.4",
"form-data": "4.0.0",
"is-promise": "4.0.0",
"tslib": "~2.3.0"
},
"publishConfig": {
6 changes: 2 additions & 4 deletions packages/links/src/GraphQLUpload.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
import { GraphQLScalarType, GraphQLError } from 'graphql';
import isPromise from 'is-promise';

const GraphQLUpload = new GraphQLScalarType({
name: 'Upload',
description: 'The `Upload` scalar type represents a file upload.',
parseValue: (value: any) => {
if (value != null && isPromise(value.promise)) {
if (value != null && 'promise' in value) {
// graphql-upload v10
return value.promise;
} else if (isPromise(value)) {
} else {
// graphql-upload v9
return value;
}
throw new GraphQLError('Upload value invalid.');
},
// serialization requires to support schema stitching
serialize: value => value,
32 changes: 19 additions & 13 deletions packages/links/src/linkToExecutor.ts
Original file line number Diff line number Diff line change
@@ -2,25 +2,31 @@ import { toPromise } from '@apollo/client/core';
import { ApolloLink, execute } from '@apollo/client/link/core';
import { Observable } from '@apollo/client/utilities';

import { Executor, ExecutionRequest, ExecutionResult, observableToAsyncIterable } from '@graphql-tools/utils';
import {
Executor,
ExecutionRequest,
ExecutionResult,
observableToAsyncIterable,
getOperationASTFromRequest,
} from '@graphql-tools/utils';

export const linkToExecutor =
(link: ApolloLink): Executor =>
async <TReturn, TArgs, TContext>(params: ExecutionRequest<TArgs, TContext>) => {
const { document, variables, extensions, context, operationType, operationName, info } = params;
export function linkToExecutor(link: ApolloLink): Executor {
return function executorFromLink<TReturn, TArgs, TContext>(request: ExecutionRequest<TArgs, TContext>) {
const observable = execute(link, {
query: document,
variables,
query: request.document,
operationName: request.operationName,
variables: request.variables,
context: {
graphqlContext: context,
graphqlResolveInfo: info,
graphqlContext: request.context,
graphqlResolveInfo: request.info,
clientAwareness: {},
},
extensions,
operationName,
extensions: request.extensions,
}) as Observable<ExecutionResult<TReturn>>;
if (operationType === 'subscription') {
return observableToAsyncIterable<ExecutionResult<TReturn>>(observable)[Symbol.asyncIterator]();
const operationAst = getOperationASTFromRequest(request);
if (operationAst.operation === 'subscription') {
return observableToAsyncIterable<ExecutionResult<TReturn>>(observable);
}
return toPromise(observable);
};
}
6 changes: 6 additions & 0 deletions packages/load-files/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @graphql-tools/load-files

## 6.5.2

### Patch Changes

- 4bfb3428: enhance: use ^ for tslib dependency

## 6.5.1

### Patch Changes
2 changes: 1 addition & 1 deletion packages/load-files/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@graphql-tools/load-files",
"version": "6.5.1",
"version": "6.5.2",
"description": "A set of utils for faster development of GraphQL tools",
"repository": {
"type": "git",
21 changes: 21 additions & 0 deletions packages/load/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# @graphql-tools/load

## 7.4.1

### Patch Changes

- 4bfb3428: enhance: use ^ for tslib dependency
- Updated dependencies [4bfb3428]
- @graphql-tools/schema@8.3.1
- @graphql-tools/utils@8.5.1

## 7.4.0

### Minor Changes

- 149afddb: fix: getting ready for GraphQL v16

### Patch Changes

- Updated dependencies [149afddb]
- @graphql-tools/schema@8.3.0
- @graphql-tools/utils@8.4.0

## 7.3.2

### Patch Changes
6 changes: 3 additions & 3 deletions packages/load/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@graphql-tools/load",
"version": "7.3.2",
"version": "7.4.1",
"description": "A set of utils for faster development of GraphQL tools",
"repository": {
"type": "git",
@@ -34,8 +34,8 @@
"graphql-type-json": "0.3.2"
},
"dependencies": {
"@graphql-tools/utils": "^8.2.3",
"@graphql-tools/schema": "8.2.0",
"@graphql-tools/utils": "^8.5.1",
"@graphql-tools/schema": "8.3.1",
"p-limit": "3.1.0",
"tslib": "~2.3.0"
},
5 changes: 4 additions & 1 deletion packages/load/src/filter-document-kind.ts
Original file line number Diff line number Diff line change
@@ -4,7 +4,10 @@ import { env } from 'process';
/**
* @internal
*/
export const filterKind = (content: DocumentNode | undefined, filterKinds: null | string[]) => {
export const filterKind = (
content: DocumentNode | undefined,
filterKinds: null | string[]
): DocumentNode | undefined => {
if (content && content.definitions && content.definitions.length && filterKinds && filterKinds.length > 0) {
const invalidDefinitions: DefinitionNode[] = [];
const validDefinitions: DefinitionNode[] = [];
16 changes: 16 additions & 0 deletions packages/loaders/apollo-engine/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# @graphql-tools/apollo-engine-loader

## 7.1.2

### Patch Changes

- 4bfb3428: enhance: use ^ for tslib dependency
- Updated dependencies [4bfb3428]
- @graphql-tools/utils@8.5.1

## 7.1.1

### Patch Changes

- 58262be7: enhance: show more clear error messages for aggregated error
- Updated dependencies [58262be7]
- @graphql-tools/utils@8.3.0

## 7.1.0

### Minor Changes
6 changes: 3 additions & 3 deletions packages/loaders/apollo-engine/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@graphql-tools/apollo-engine-loader",
"version": "7.1.0",
"version": "7.1.2",
"description": "A set of utils for faster development of GraphQL tools",
"repository": {
"type": "git",
@@ -30,10 +30,10 @@
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
},
"dependencies": {
"@graphql-tools/utils": "^8.2.0",
"@graphql-tools/utils": "^8.5.1",
"cross-fetch": "^3.1.4",
"tslib": "~2.3.0",
"sync-fetch": "0.3.0"
"sync-fetch": "0.3.1"
},
"publishConfig": {
"access": "public",
10 changes: 8 additions & 2 deletions packages/loaders/apollo-engine/src/index.ts
Original file line number Diff line number Diff line change
@@ -64,7 +64,10 @@ export class ApolloEngineLoader implements Loader<ApolloEngineOptions> {
const { data, errors } = await response.json();

if (errors) {
throw new AggregateError(errors, 'Introspection from Apollo Engine failed');
throw new AggregateError(
errors,
'Introspection from Apollo Engine failed; \n ' + errors.map((e: Error) => e.message).join('\n')
);
}

const source = parseGraphQLSDL(pointer, data.service.schema.document, options);
@@ -81,7 +84,10 @@ export class ApolloEngineLoader implements Loader<ApolloEngineOptions> {
const { data, errors } = response.json();

if (errors) {
throw new AggregateError(errors, 'Introspection from Apollo Engine failed');
throw new AggregateError(
errors,
'Introspection from Apollo Engine failed; \n ' + errors.map((e: Error) => e.message).join('\n')
);
}

const source = parseGraphQLSDL(pointer, data.service.schema.document, options);
17 changes: 17 additions & 0 deletions packages/loaders/code-file/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# @graphql-tools/code-file-loader

## 7.2.2

### Patch Changes

- 4bfb3428: enhance: use ^ for tslib dependency
- Updated dependencies [4bfb3428]
- @graphql-tools/graphql-tag-pluck@7.1.3
- @graphql-tools/utils@8.5.1

## 7.2.1

### Patch Changes

- 58262be7: enhance: show more clear error messages for aggregated error
- Updated dependencies [58262be7]
- @graphql-tools/utils@8.3.0

## 7.2.0

### Minor Changes
6 changes: 3 additions & 3 deletions packages/loaders/code-file/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@graphql-tools/code-file-loader",
"version": "7.2.0",
"version": "7.2.2",
"description": "A set of utils for faster development of GraphQL tools",
"repository": {
"type": "git",
@@ -30,8 +30,8 @@
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
},
"dependencies": {
"@graphql-tools/utils": "^8.2.0",
"@graphql-tools/graphql-tag-pluck": "^7.1.0",
"@graphql-tools/utils": "^8.5.1",
"@graphql-tools/graphql-tag-pluck": "^7.1.3",
"globby": "^11.0.3",
"tslib": "~2.3.0",
"unixify": "^1.0.0"
10 changes: 8 additions & 2 deletions packages/loaders/code-file/src/index.ts
Original file line number Diff line number Diff line change
@@ -151,7 +151,10 @@ export class CodeFileLoader implements Loader<CodeFileLoaderOptions> {
if (errors.length === 1) {
throw errors[0];
}
throw new AggregateError(errors);
throw new AggregateError(
errors,
`Reading from ${pointer} failed ; \n ` + errors.map((e: Error) => e.message).join('\n')
);
}

return finalResult;
@@ -181,7 +184,10 @@ export class CodeFileLoader implements Loader<CodeFileLoaderOptions> {
if (errors.length === 1) {
throw errors[0];
}
throw new AggregateError(errors);
throw new AggregateError(
errors,
`Reading from ${pointer} failed ; \n ` + errors.map((e: Error) => e.message).join('\n')
);
}

return finalResult;
17 changes: 17 additions & 0 deletions packages/loaders/git/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# @graphql-tools/git-loader

## 7.1.2

### Patch Changes

- 4bfb3428: enhance: use ^ for tslib dependency
- Updated dependencies [4bfb3428]
- @graphql-tools/graphql-tag-pluck@7.1.3
- @graphql-tools/utils@8.5.1

## 7.1.1

### Patch Changes

- 58262be7: enhance: show more clear error messages for aggregated error
- Updated dependencies [58262be7]
- @graphql-tools/utils@8.3.0

## 7.1.0

### Minor Changes
6 changes: 3 additions & 3 deletions packages/loaders/git/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@graphql-tools/git-loader",
"version": "7.1.0",
"version": "7.1.2",
"description": "A set of utils for faster development of GraphQL tools",
"repository": {
"type": "git",
@@ -30,8 +30,8 @@
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
},
"dependencies": {
"@graphql-tools/graphql-tag-pluck": "^7.1.0",
"@graphql-tools/utils": "^8.2.0",
"@graphql-tools/graphql-tag-pluck": "^7.1.3",
"@graphql-tools/utils": "^8.5.1",
"is-glob": "4.0.3",
"micromatch": "^4.0.4",
"tslib": "~2.3.0",
10 changes: 8 additions & 2 deletions packages/loaders/git/src/index.ts
Original file line number Diff line number Diff line change
@@ -184,7 +184,10 @@ export class GitLoader implements Loader<GitLoaderOptions> {
if (errors.length === 1) {
throw errors[0];
}
throw new AggregateError(errors);
throw new AggregateError(
errors,
`Reading from ${pointer} failed ; \n ` + errors.map((e: Error) => e.message).join('\n')
);
}

return finalResult;
@@ -256,7 +259,10 @@ export class GitLoader implements Loader<GitLoaderOptions> {
if (errors.length === 1) {
throw errors[0];
}
throw new AggregateError(errors);
throw new AggregateError(
errors,
`Reading from ${pointer} failed ; \n ` + errors.map((e: Error) => e.message).join('\n')
);
}

return finalResult;
9 changes: 9 additions & 0 deletions packages/loaders/github/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @graphql-tools/github-loader

## 7.1.1

### Patch Changes

- 4bfb3428: enhance: use ^ for tslib dependency
- Updated dependencies [4bfb3428]
- @graphql-tools/graphql-tag-pluck@7.1.3
- @graphql-tools/utils@8.5.1

## 7.1.0

### Minor Changes
6 changes: 3 additions & 3 deletions packages/loaders/github/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@graphql-tools/github-loader",
"version": "7.1.0",
"version": "7.1.1",
"description": "A set of utils for faster development of GraphQL tools",
"repository": {
"type": "git",
@@ -30,8 +30,8 @@
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
},
"dependencies": {
"@graphql-tools/utils": "^8.2.0",
"@graphql-tools/graphql-tag-pluck": "^7.1.0",
"@graphql-tools/utils": "^8.5.1",
"@graphql-tools/graphql-tag-pluck": "^7.1.3",
"cross-fetch": "3.1.4",
"tslib": "~2.3.0"
},
35 changes: 35 additions & 0 deletions packages/loaders/graphql-file/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,40 @@
# @graphql-tools/graphql-file-loader

## 7.3.2

### Patch Changes

- 4bfb3428: enhance: use ^ for tslib dependency
- Updated dependencies [4bfb3428]
- @graphql-tools/import@6.5.7
- @graphql-tools/utils@8.5.1

## 7.3.1

### Patch Changes

- 58262be7: enhance: show more clear error messages for aggregated error
- Updated dependencies [58262be7]
- @graphql-tools/utils@8.3.0
- @graphql-tools/import@6.5.4

## 7.3.0

### Minor Changes

- 94bee8ba: This change allows pkg - npm to have snapshot stored schema files read by graphql-tools.

[pkg](https://www.npmjs.com/package/pkg) generates cross platform binary executables of node apps and includes a packaged read-only filesystem called a snapshot.

This change was made because the pkg snapshot file system does not support use of globbing.

If you want to use the snapshot facilty with pkg for schema files then:

1. Access your snapshot schema file or files through a \_\_dirname join
2. Your file or files must be accessed by name without the glob '\*' character.
3. Do not add ignore files with ! (with or without a glob)
4. Do not specify includeSources: true

## 7.2.0

### Minor Changes
6 changes: 3 additions & 3 deletions packages/loaders/graphql-file/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@graphql-tools/graphql-file-loader",
"version": "7.2.0",
"version": "7.3.2",
"description": "A set of utils for faster development of GraphQL tools",
"repository": {
"type": "git",
@@ -33,8 +33,8 @@
"input": "./src/index.ts"
},
"dependencies": {
"@graphql-tools/import": "^6.5.0",
"@graphql-tools/utils": "^8.2.0",
"@graphql-tools/import": "^6.5.7",
"@graphql-tools/utils": "^8.5.1",
"globby": "^11.0.3",
"unixify": "^1.0.0",
"tslib": "~2.3.0"
24 changes: 22 additions & 2 deletions packages/loaders/graphql-file/src/index.ts
Original file line number Diff line number Diff line change
@@ -103,12 +103,26 @@ export class GraphQLFileLoader implements Loader<GraphQLFileLoaderOptions> {
}

async resolveGlobs(glob: string, options: GraphQLFileLoaderOptions) {
if (
!glob.includes('*') &&
(await this.canLoad(glob, options)) &&
!asArray(options.ignore || []).length &&
!options['includeSources']
)
return [glob]; // bypass globby when no glob character, can be loaded, no ignores and source not requested. Fixes problem with pkg and passes ci tests
const globs = this._buildGlobs(glob, options);
const result = await globby(globs, createGlobbyOptions(options));
return result;
}

resolveGlobsSync(glob: string, options: GraphQLFileLoaderOptions) {
if (
!glob.includes('*') &&
this.canLoadSync(glob, options) &&
!asArray(options.ignore || []).length &&
!options['includeSources']
)
return [glob]; // bypass globby when no glob character, can be loaded, no ignores and source not requested. Fixes problem with pkg and passes ci tests
const globs = this._buildGlobs(glob, options);
const result = globby.sync(globs, createGlobbyOptions(options));
return result;
@@ -140,7 +154,10 @@ export class GraphQLFileLoader implements Loader<GraphQLFileLoaderOptions> {
if (errors.length === 1) {
throw errors[0];
}
throw new AggregateError(errors);
throw new AggregateError(
errors,
`Reading from ${pointer} failed ; \n ` + errors.map((e: Error) => e.message).join('\n')
);
}

return finalResult;
@@ -170,7 +187,10 @@ export class GraphQLFileLoader implements Loader<GraphQLFileLoaderOptions> {
if (errors.length === 1) {
throw errors[0];
}
throw new AggregateError(errors);
throw new AggregateError(
errors,
`Reading from ${pointer} failed ; \n ` + errors.map((e: Error) => e.message).join('\n')
);
}

return finalResult;
16 changes: 16 additions & 0 deletions packages/loaders/json-file/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# @graphql-tools/json-file-loader

## 7.3.2

### Patch Changes

- 4bfb3428: enhance: use ^ for tslib dependency
- Updated dependencies [4bfb3428]
- @graphql-tools/utils@8.5.1

## 7.3.1

### Patch Changes

- 58262be7: enhance: show more clear error messages for aggregated error
- Updated dependencies [58262be7]
- @graphql-tools/utils@8.3.0

## 7.3.0

### Minor Changes
4 changes: 2 additions & 2 deletions packages/loaders/json-file/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@graphql-tools/json-file-loader",
"version": "7.3.0",
"version": "7.3.2",
"description": "A set of utils for faster development of GraphQL tools",
"repository": {
"type": "git",
@@ -30,7 +30,7 @@
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
},
"dependencies": {
"@graphql-tools/utils": "^8.2.0",
"@graphql-tools/utils": "^8.5.1",
"globby": "^11.0.3",
"unixify": "^1.0.0",
"tslib": "~2.3.0"
10 changes: 8 additions & 2 deletions packages/loaders/json-file/src/index.ts
Original file line number Diff line number Diff line change
@@ -129,7 +129,10 @@ export class JsonFileLoader implements Loader {
if (errors.length === 1) {
throw errors[0];
}
throw new AggregateError(errors);
throw new AggregateError(
errors,
`Reading from ${pointer} failed ; \n ` + errors.map((e: Error) => e.message).join('\n')
);
}

return finalResult;
@@ -159,7 +162,10 @@ export class JsonFileLoader implements Loader {
if (errors.length === 1) {
throw errors[0];
}
throw new AggregateError(errors);
throw new AggregateError(
errors,
`Reading from ${pointer} failed ; \n ` + errors.map((e: Error) => e.message).join('\n')
);
}

return finalResult;
8 changes: 8 additions & 0 deletions packages/loaders/module/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @graphql-tools/module-loader

## 7.1.1

### Patch Changes

- 4bfb3428: enhance: use ^ for tslib dependency
- Updated dependencies [4bfb3428]
- @graphql-tools/utils@8.5.1

## 7.1.0

### Minor Changes
4 changes: 2 additions & 2 deletions packages/loaders/module/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@graphql-tools/module-loader",
"version": "7.1.0",
"version": "7.1.1",
"description": "A set of utils for faster development of GraphQL tools",
"repository": {
"type": "git",
@@ -30,7 +30,7 @@
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
},
"dependencies": {
"@graphql-tools/utils": "^8.2.0",
"@graphql-tools/utils": "^8.5.1",
"tslib": "~2.3.0"
},
"publishConfig": {
10 changes: 10 additions & 0 deletions packages/loaders/prisma/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# @graphql-tools/prisma-loader

## 7.1.1

### Patch Changes

- 4bfb3428: enhance: use ^ for tslib dependency
- Updated dependencies [981eef80]
- Updated dependencies [4bfb3428]
- @graphql-tools/url-loader@7.4.2
- @graphql-tools/utils@8.5.1

## 7.1.0

### Minor Changes
6 changes: 3 additions & 3 deletions packages/loaders/prisma/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@graphql-tools/prisma-loader",
"version": "7.1.0",
"version": "7.1.1",
"description": "A set of utils for faster development of GraphQL tools",
"repository": {
"type": "git",
@@ -30,8 +30,8 @@
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
},
"dependencies": {
"@graphql-tools/url-loader": "^7.1.0",
"@graphql-tools/utils": "^8.2.0",
"@graphql-tools/url-loader": "^7.4.2",
"@graphql-tools/utils": "^8.5.1",
"@types/js-yaml": "^4.0.0",
"@types/json-stable-stringify": "^1.0.32",
"@types/jsonwebtoken": "^8.5.0",
1 change: 1 addition & 0 deletions packages/loaders/url/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tests/webpack.js
49 changes: 49 additions & 0 deletions packages/loaders/url/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,54 @@
# @graphql-tools/url-loader

## 7.4.2

### Patch Changes

- 981eef80: enhance: remove isPromise and cleanup file-upload handling
- 4bfb3428: enhance: use ^ for tslib dependency
- Updated dependencies [981eef80]
- Updated dependencies [4bfb3428]
- @graphql-tools/wrap@8.3.1
- @graphql-tools/delegate@8.4.1
- @graphql-tools/utils@8.5.1

## 7.4.1

### Patch Changes

- 5dfea0b5: Correctly handle response cancelation for SSE (subscriptions and live queries) and HTTP Multipart responses (defer and stream).

`AbortController.signal` wasn't passed to `Request` while calling `fetch`, so it wasn't possible to stop the HTTP request by the user.

## 7.4.0

### Minor Changes

- ad04dc79: enhance: make operationType optional

### Patch Changes

- Updated dependencies [ad04dc79]
- @graphql-tools/delegate@8.4.0
- @graphql-tools/utils@8.5.0
- @graphql-tools/wrap@8.3.0

## 7.3.0

### Minor Changes

- 9b1026dd: replace heavy lodash dependency with dset/merge

### Patch Changes

- 2563447a: fix(url-loader): handle SSE correctly with ReadableStream

## 7.2.1

### Patch Changes

- f895177e: fix(url-loader): incremental delivery for defer/stream and SSE

## 7.2.0

### Minor Changes
19 changes: 10 additions & 9 deletions packages/loaders/url/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@graphql-tools/url-loader",
"version": "7.2.0",
"version": "7.4.2",
"description": "A set of utils for faster development of GraphQL tools",
"repository": {
"type": "git",
@@ -39,28 +39,29 @@
"@types/extract-files": "8.1.1",
"graphql-upload": "12.0.0",
"mock-http": "1.1.0",
"mock-socket": "9.0.5"
"mock-socket": "9.0.6",
"puppeteer": "10.4.0",
"babel-loader": "8.2.3",
"webpack": "5.60.0"
},
"dependencies": {
"@graphql-tools/delegate": "^8.2.0",
"@graphql-tools/utils": "^8.2.0",
"@graphql-tools/wrap": "^8.1.0",
"@ardatan/fetch-event-source": "2.0.2",
"@graphql-tools/delegate": "^8.4.1",
"@graphql-tools/utils": "^8.5.1",
"@graphql-tools/wrap": "^8.3.1",
"@n1ru4l/graphql-live-query": "0.8.1",
"@types/websocket": "1.0.4",
"@types/ws": "^8.0.0",
"abort-controller": "3.0.0",
"cross-fetch": "3.1.4",
"dset": "^3.1.0",
"extract-files": "11.0.0",
"form-data": "4.0.0",
"graphql-sse": "^1.0.1",
"graphql-ws": "^5.4.1",
"lodash": "4.17.21",
"meros": "1.1.4",
"is-promise": "4.0.0",
"isomorphic-ws": "4.0.1",
"subscriptions-transport-ws": "^0.10.0",
"sync-fetch": "0.3.0",
"sync-fetch": "0.3.1",
"tslib": "~2.3.0",
"valid-url": "1.0.9",
"ws": "8.2.3",
4 changes: 4 additions & 0 deletions packages/loaders/url/src/addCancelToResponseStream.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { withCancel } from '@graphql-tools/utils';
export function addCancelToResponseStream<T>(resultStream: AsyncIterable<T>, controller: AbortController) {
return withCancel(resultStream, () => controller.abort());
}
9 changes: 9 additions & 0 deletions packages/loaders/url/src/defaultAsyncFetch.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { fetch as crossFetch } from 'cross-fetch';

export type AsyncFetchFn = typeof crossFetch;
export const defaultAsyncFetch: AsyncFetchFn = async (input: RequestInfo, init?: RequestInit): Promise<Response> => {
if (typeof fetch !== 'undefined') {
return fetch(input, init);
}
return crossFetch(input, init);
};
16 changes: 16 additions & 0 deletions packages/loaders/url/src/defaultSyncFetch.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import syncFetchImported from 'sync-fetch';

export const defaultSyncFetch: SyncFetchFn = (input: RequestInfo, init?: RequestInit): SyncResponse => {
if (typeof input === 'string') {
delete init?.signal;
} else {
delete (input as any).signal;
}
return syncFetchImported(input, init);
};

export type SyncFetchFn = (input: RequestInfo, init?: RequestInit) => SyncResponse;
export type SyncResponse = Omit<Response, 'json' | 'text'> & {
json: () => any;
text: () => string;
};
16 changes: 16 additions & 0 deletions packages/loaders/url/src/event-stream/handleEventStreamResponse.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* eslint-disable */

import { ExecutionResult } from 'graphql';
import { handleReadable } from './handleReadable';
import { handleReadableStream } from './handleReadableStream';

export async function handleEventStreamResponse(response: Response): Promise<AsyncIterableIterator<ExecutionResult>> {
const body = await response.body;
if (body) {
if ('pipe' in body) {
return handleReadable(body);
}
return handleReadableStream(body) as any;
}
throw new Error('Body is null???');
}
19 changes: 19 additions & 0 deletions packages/loaders/url/src/event-stream/handleReadable.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* eslint-disable no-labels */
import type { Readable } from 'stream';

export async function* handleReadable(readable: Readable) {
outer: for await (const chunk of readable) {
const chunkStr = chunk.toString();
for (const part of chunkStr.split('\n\n')) {
if (part) {
const eventStr = part.split('event: ')[1];
const dataStr = part.split('data: ')[1];
const data = JSON.parse(dataStr);
if (eventStr === 'complete') {
break outer;
}
yield data.payload || data;
}
}
}
}
155 changes: 155 additions & 0 deletions packages/loaders/url/src/event-stream/handleReadableStream.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
// Based on https://github.com/Azure/fetch-event-source/blob/main/src/parse.ts

const enum ControlChars {
NewLine = 10,
CarriageReturn = 13,
Space = 32,
Colon = 58,
}

/**
* Represents a message sent in an event stream
* https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format
*/
export interface EventSourceMessage {
/** The event ID to set the EventSource object's last event ID value. */
id: string;
/** A string identifying the type of event described. */
event: string;
/** The event data */
data: string;
/** The reconnection interval (in milliseconds) to wait before retrying the connection */
retry?: number;
}

export async function* handleReadableStream(stream: ReadableStream<Uint8Array>) {
const decoder = new TextDecoder();
const reader = stream.getReader();

let buffer: Uint8Array | undefined;
let position = 0; // current read position
let fieldLength = -1; // length of the `field` portion of the line
let discardTrailingNewline = false;

try {
let result: ReadableStreamDefaultReadResult<Uint8Array>;
let message: EventSourceMessage = {
data: '',
event: '',
id: '',
retry: undefined,
};
while (!(result = await reader.read()).done) {
const arr = result.value;
if (buffer === undefined) {
buffer = arr;
position = 0;
fieldLength = -1;
} else {
// we're still parsing the old line. Append the new bytes into buffer:
buffer = concat(buffer, arr);
}

const bufLength = buffer.length;
let lineStart = 0; // index where the current line starts
while (position < bufLength) {
if (discardTrailingNewline) {
if (buffer[position] === ControlChars.NewLine) {
lineStart = ++position; // skip to next char
}

discardTrailingNewline = false;
}

// start looking forward till the end of line:
let lineEnd = -1; // index of the \r or \n char
for (; position < bufLength && lineEnd === -1; ++position) {
switch (buffer[position]) {
case ControlChars.Colon: {
if (fieldLength === -1) {
// first colon in line
fieldLength = position - lineStart;
}
break;
}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
case ControlChars.CarriageReturn: {
discardTrailingNewline = true;
}
// eslint-disable-next-line no-fallthrough
case ControlChars.NewLine: {
lineEnd = position;
break;
}
}
}

if (lineEnd === -1) {
// We reached the end of the buffer but the line hasn't ended.
// Wait for the next arr and then continue parsing:
break;
}

// we've reached the line end, send it out:
const line = buffer.subarray(lineStart, lineEnd);
if (line.length === 0) {
// empty line denotes end of message. Trigger the callback and start a new message:
yield JSON.parse(message.data);
message = {
data: '',
event: '',
id: '',
retry: undefined,
};
} else if (fieldLength > 0) {
// exclude comments and lines with no values
// line is of format "<field>:<value>" or "<field>: <value>"
// https://html.spec.whatwg.org/multipage/server-sent-events.html#event-stream-interpretation
const field = decoder.decode(line.subarray(0, fieldLength));
const valueOffset = fieldLength + (line[fieldLength + 1] === ControlChars.Space ? 2 : 1);
const value = decoder.decode(line.subarray(valueOffset));

switch (field) {
case 'data':
// if this message already has data, append the new value to the old.
// otherwise, just set to the new value:
message.data = message.data ? message.data + '\n' + value : value; // otherwise,
break;
case 'event':
message.event = value;
break;
case 'id':
message.id = value;
break;
case 'retry': {
const retry = parseInt(value, 10);
message.retry = retry;
break;
}
}
}
lineStart = position; // we're now on the next line
fieldLength = -1;
}

if (lineStart === bufLength) {
buffer = undefined; // we've finished reading it
} else if (lineStart !== 0) {
// Create a new view into buffer beginning at lineStart so we don't
// need to copy over the previous lines when we get the new arr:
buffer = buffer.subarray(lineStart);
position -= lineStart;
}
}
} finally {
reader.releaseLock();
}
}

function concat(a: Uint8Array, b: Uint8Array) {
const res = new Uint8Array(a.length + b.length);
res.set(a);
res.set(b, a.length);
return res;
}
72 changes: 72 additions & 0 deletions packages/loaders/url/src/handleMultipartMixedResponse.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/* eslint-disable */

import { ExecutionResult, GraphQLError } from 'graphql';
import { meros as merosIncomingMessage } from 'meros/node';
import { meros as merosReadableStream } from 'meros/browser';
import { IncomingMessage } from 'http';
import { mapAsyncIterator } from '@graphql-tools/utils';
import { dset } from 'dset/merge';

interface ExecutionPatchResult<TData = { [key: string]: any }, TExtensions = { [key: string]: any }> {
errors?: ReadonlyArray<GraphQLError>;
data?: TData;
path?: ReadonlyArray<string | number>;
label?: string;
hasNext: boolean;
extensions?: TExtensions;
}

type Part =
| {
body: ExecutionPatchResult;
json: true;
}
| {
body: string | Buffer;
json: false;
};

function isIncomingMessage(body: any): body is IncomingMessage {
return body != null && typeof body === 'object' && 'pipe' in body;
}

export async function handleMultipartMixedResponse(response: Response) {
const body = await (response.body as unknown as Promise<IncomingMessage> | ReadableStream);
const contentType = response.headers.get('content-type') || '';
let asyncIterator: AsyncIterator<Part>;
if (isIncomingMessage(body)) {
// Meros/node expects headers as an object map with the content-type prop
body.headers = {
'content-type': contentType,
};
// And it expects `IncomingMessage` and `node-fetch` returns `body` as `Promise<PassThrough>`
asyncIterator = (await merosIncomingMessage(body)) as any;
} else {
// Nothing is needed for regular `Response`.
asyncIterator = (await merosReadableStream(response)) as any;
}

const executionResult: ExecutionResult = {};
return mapAsyncIterator(asyncIterator, (part: Part) => {
if (part.json) {
const chunk = part.body;
if (chunk.path) {
if (chunk.data) {
const path: Array<string | number> = ['data'];
dset(executionResult, path.concat(chunk.path), chunk.data);
}
if (chunk.errors) {
executionResult.errors = (executionResult.errors || []).concat(chunk.errors);
}
} else {
if (chunk.data) {
executionResult.data = chunk.data;
}
if (chunk.errors) {
executionResult.errors = chunk.errors;
}
}
return executionResult;
}
});
}
Loading