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: graphql/graphql-js
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f597c694339b7c488f05496806e404659f6ff955
Choose a base ref
...
head repository: graphql/graphql-js
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3a51ecade74a0198847e8b1ab1bcdc129485b79b
Choose a head ref
Loading
Showing with 5,972 additions and 4,919 deletions.
  1. +17 −6 .eslintrc.yml
  2. +0 −52 .github/actions/deploy-dir-as-branch/action.yml
  3. +31 −96 .github/workflows/ci.yml
  4. +116 −0 .github/workflows/cmd-publish-pr-on-npm.yml
  5. +48 −0 .github/workflows/cmd-run-benchmark.yml
  6. +51 −0 .github/workflows/deploy-artifact-as-branch.yml
  7. +159 −0 .github/workflows/github-actions-bot.yml
  8. +38 −0 .github/workflows/pull_request.yml
  9. +14 −0 .github/workflows/pull_request_opened.yml
  10. +26 −0 .github/workflows/push.yml
  11. +1 −0 .node-version
  12. +3 −3 codecov.yml
  13. +1 −1 integrationTests/integration-test.js
  14. +1 −5 integrationTests/node/package.json
  15. +9 −7 integrationTests/node/test.js
  16. +2 −1 integrationTests/ts/package.json
  17. +5,026 −4,422 package-lock.json
  18. +25 −25 package.json
  19. +15 −13 src/error/GraphQLError.ts
  20. +46 −77 src/error/__tests__/GraphQLError-test.ts
  21. +1 −6 src/error/__tests__/locatedError-test.ts
  22. +1 −0 src/error/index.ts
  23. +5 −6 src/error/locatedError.ts
  24. +4 −3 src/error/syntaxError.ts
  25. +4 −0 src/execution/__tests__/directives-test.ts
  26. +60 −1 src/execution/__tests__/subscribe-test.ts
  27. +5 −5 src/execution/execute.ts
  28. +5 −1 src/execution/index.ts
  29. +47 −38 src/execution/subscribe.ts
  30. +11 −17 src/execution/values.ts
  31. +2 −0 src/index.ts
  32. +2 −1 src/jsutils/instanceOf.ts
  33. +13 −0 src/language/__tests__/parser-test.ts
  34. +2 −1 src/language/ast.ts
  35. +2 −1 src/language/directiveLocation.ts
  36. +2 −1 src/language/kinds.ts
  37. +43 −16 src/language/parser.ts
  38. +2 −1 src/language/tokenKind.ts
  39. +14 −8 src/type/definition.ts
  40. +2 −1 src/type/introspection.ts
  41. +5 −5 src/type/scalars.ts
  42. +1 −1 src/type/validate.ts
  43. +16 −0 src/utilities/__tests__/printSchema-test.ts
  44. +3 −8 src/utilities/coerceInputValue.ts
  45. +4 −2 src/utilities/findBreakingChanges.ts
  46. +8 −10 src/utilities/getOperationRootType.ts
  47. +1 −1 src/validation/__tests__/validation-test.ts
  48. +3 −4 src/validation/rules/ExecutableDefinitionsRule.ts
  49. +1 −1 src/validation/rules/FieldsOnCorrectTypeRule.ts
  50. +2 −2 src/validation/rules/FragmentsOnCompositeTypesRule.ts
  51. +2 −2 src/validation/rules/KnownArgumentNamesRule.ts
  52. +2 −2 src/validation/rules/KnownDirectivesRule.ts
  53. +3 −1 src/validation/rules/KnownFragmentNamesRule.ts
  54. +1 −1 src/validation/rules/KnownTypeNamesRule.ts
  55. +1 −1 src/validation/rules/LoneAnonymousOperationRule.ts
  56. +4 −2 src/validation/rules/LoneSchemaDefinitionRule.ts
  57. +1 −1 src/validation/rules/NoFragmentCyclesRule.ts
  58. +1 −1 src/validation/rules/NoUndefinedVariablesRule.ts
  59. +3 −4 src/validation/rules/NoUnusedFragmentsRule.ts
  60. +1 −1 src/validation/rules/NoUnusedVariablesRule.ts
  61. +1 −1 src/validation/rules/OverlappingFieldsCanBeMergedRule.ts
  62. +2 −2 src/validation/rules/PossibleFragmentSpreadsRule.ts
  63. +4 −5 src/validation/rules/PossibleTypeExtensionsRule.ts
  64. +2 −2 src/validation/rules/ProvidedRequiredArgumentsRule.ts
  65. +2 −2 src/validation/rules/ScalarLeafsRule.ts
  66. +2 −2 src/validation/rules/SingleFieldSubscriptionsRule.ts
  67. +1 −1 src/validation/rules/UniqueArgumentDefinitionNamesRule.ts
  68. +1 −1 src/validation/rules/UniqueArgumentNamesRule.ts
  69. +2 −2 src/validation/rules/UniqueDirectiveNamesRule.ts
  70. +1 −1 src/validation/rules/UniqueDirectivesPerLocationRule.ts
  71. +2 −2 src/validation/rules/UniqueEnumValueNamesRule.ts
  72. +2 −2 src/validation/rules/UniqueFieldDefinitionNamesRule.ts
  73. +1 −1 src/validation/rules/UniqueFragmentNamesRule.ts
  74. +1 −1 src/validation/rules/UniqueInputFieldNamesRule.ts
  75. +6 −1 src/validation/rules/UniqueOperationNamesRule.ts
  76. +2 −2 src/validation/rules/UniqueOperationTypesRule.ts
  77. +4 −5 src/validation/rules/UniqueTypeNamesRule.ts
  78. +1 −1 src/validation/rules/UniqueVariableNamesRule.ts
  79. +6 −10 src/validation/rules/ValuesOfCorrectTypeRule.ts
  80. +1 −1 src/validation/rules/VariablesAreInputTypesRule.ts
  81. +1 −1 src/validation/rules/VariablesInAllowedPositionRule.ts
  82. +5 −5 src/validation/rules/custom/NoDeprecatedCustomRule.ts
  83. +1 −1 src/validation/rules/custom/NoSchemaIntrospectionCustomRule.ts
  84. +2 −2 src/version.ts
23 changes: 17 additions & 6 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
parserOptions:
sourceType: script
ecmaVersion: 2020
env:
es6: true
node: true
es2022: true
reportUnusedDisableDirectives: true
plugins:
- internal-rules
@@ -77,7 +75,7 @@ rules:
node/prefer-promises/fs: off

##############################################################################
# `eslint-plugin-import` rule list based on `v2.25.x`
# `eslint-plugin-import` rule list based on `v2.26.x`
##############################################################################

# Static analysis
@@ -174,7 +172,7 @@ rules:
simple-import-sort/exports: off # TODO

##############################################################################
# ESLint builtin rules list based on `v8.7.x`
# ESLint builtin rules list based on `v8.13.x`
##############################################################################

# Possible Errors
@@ -487,7 +485,7 @@ overrides:
tsdoc/syntax: error

##########################################################################
# `@typescript-eslint/eslint-plugin` rule list based on `v5.10.x`
# `@typescript-eslint/eslint-plugin` rule list based on `v5.19.x`
##########################################################################

# Supported Rules
@@ -532,6 +530,7 @@ overrides:
'@typescript-eslint/no-non-null-asserted-optional-chain': error
'@typescript-eslint/no-non-null-assertion': error
'@typescript-eslint/no-parameter-properties': error
'@typescript-eslint/no-redundant-type-constituents': error
'@typescript-eslint/no-invalid-void-type': error
'@typescript-eslint/no-require-imports': error
'@typescript-eslint/no-this-alias': error
@@ -547,6 +546,7 @@ overrides:
'@typescript-eslint/no-unsafe-call': off # TODO consider
'@typescript-eslint/no-unsafe-member-access': off # TODO consider
'@typescript-eslint/no-unsafe-return': off # TODO consider
'@typescript-eslint/no-useless-empty-export': error
'@typescript-eslint/no-var-requires': error
'@typescript-eslint/non-nullable-type-assertion-style': off #TODO temporarily disabled
'@typescript-eslint/prefer-as-const': error
@@ -647,6 +647,7 @@ overrides:
'@typescript-eslint/no-extra-parens': off
'@typescript-eslint/no-extra-semi': off
'@typescript-eslint/semi': off
'@typescript-eslint/space-before-blocks': off
'@typescript-eslint/space-before-function-paren': off
'@typescript-eslint/space-infix-ops': off
'@typescript-eslint/type-annotation-spacing': off
@@ -661,19 +662,25 @@ overrides:
import/no-restricted-paths: off
import/no-extraneous-dependencies: [error, { devDependencies: true }]
- files: 'integrationTests/*'
env:
node: true
rules:
node/no-sync: off
node/no-unpublished-require: [error, { allowModules: ['mocha'] }]
import/no-extraneous-dependencies: [error, { devDependencies: true }]
import/no-nodejs-modules: off
- files: 'integrationTests/*/**'
env:
node: true
rules:
node/no-sync: off
node/no-missing-require: [error, { allowModules: ['graphql'] }]
import/no-commonjs: off
import/no-nodejs-modules: off
no-console: off
- files: 'benchmark/**'
env:
node: true
rules:
internal-rules/only-ascii: [error, { allowEmoji: true }]
node/no-sync: off
@@ -683,6 +690,8 @@ overrides:
no-console: off
no-await-in-loop: off
- files: 'resources/**'
env:
node: true
rules:
internal-rules/only-ascii: [error, { allowEmoji: true }]
node/no-unpublished-require: off
@@ -700,6 +709,8 @@ overrides:
node/no-unpublished-import: off
import/no-default-export: off
- files: 'website/**'
env:
node: true
plugins:
- 'react'
extends:
52 changes: 0 additions & 52 deletions .github/actions/deploy-dir-as-branch/action.yml

This file was deleted.

127 changes: 31 additions & 96 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
name: CI
on: [push, pull_request]
env:
NODE_VERSION_USED_FOR_DEVELOPMENT: 17
on: workflow_call
jobs:
lint:
name: Lint source files
@@ -16,7 +14,7 @@ jobs:
uses: actions/setup-node@v2
with:
cache: npm
node-version: ${{ env.NODE_VERSION_USED_FOR_DEVELOPMENT }}
node-version-file: '.node-version'

- name: Install Dependencies
run: npm ci --ignore-scripts
@@ -65,7 +63,7 @@ jobs:
uses: actions/setup-node@v2
with:
cache: npm
node-version: ${{ env.NODE_VERSION_USED_FOR_DEVELOPMENT }}
node-version-file: '.node-version'

- name: Install Dependencies
run: npm ci --ignore-scripts
@@ -75,7 +73,7 @@ jobs:
# run: npm ls --depth 999

- name: Run npm install
run: npm install --force --package-lock-only --ignore-scripts --engine-strict --strict-peer-deps
run: npm install --ignore-scripts --force --package-lock-only --engine-strict --strict-peer-deps

- name: Check that package-lock.json is in sync with package.json
run: git diff --exit-code package-lock.json
@@ -92,7 +90,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION_USED_FOR_DEVELOPMENT }}
node-version-file: '.node-version'
# We install bunch of packages during integration tests without locking them
# so we skip cache action to not pollute cache for other jobs.

@@ -115,7 +113,7 @@ jobs:
uses: actions/setup-node@v2
with:
cache: npm
node-version: ${{ env.NODE_VERSION_USED_FOR_DEVELOPMENT }}
node-version-file: '.node-version'

- name: Install Dependencies
run: npm ci --ignore-scripts
@@ -136,7 +134,7 @@ jobs:
uses: actions/setup-node@v2
with:
cache: npm
node-version: ${{ env.NODE_VERSION_USED_FOR_DEVELOPMENT }}
node-version-file: '.node-version'

- name: Install Dependencies
run: npm ci --ignore-scripts
@@ -175,75 +173,10 @@ jobs:
- name: Run Tests
run: npm run testonly

benchmark:
name: Run benchmark
build-npm-dist:
name: Build 'npmDist' artifact
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
persist-credentials: false

- name: Deepen cloned repo
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
run: 'git fetch --depth=1 origin $BASE_SHA:refs/tags/BASE'

- name: Setup Node.js
uses: actions/setup-node@v2
with:
cache: npm
node-version: ${{ env.NODE_VERSION_USED_FOR_DEVELOPMENT }}

- name: Install Dependencies
run: npm ci --ignore-scripts

- name: Run Benchmark
run: 'npm run benchmark -- --revs HEAD BASE'

diff-npm-package:
name: Diff content of NPM package
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
persist-credentials: false

- name: Deepen cloned repo
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
run: 'git fetch --depth=1 origin $BASE_SHA:refs/tags/BASE'

- name: Setup Node.js
uses: actions/setup-node@v2
with:
cache: npm
node-version: ${{ env.NODE_VERSION_USED_FOR_DEVELOPMENT }}

- name: Install Dependencies
run: npm ci --ignore-scripts

- name: Generate report
run: 'node resources/diff-npm-package.js BASE HEAD'

- name: Upload generated report
uses: actions/upload-artifact@v2
with:
name: npm-dist-diff.html
path: ./npm-dist-diff.html
if-no-files-found: ignore

deploy-to-npm-branch:
name: Deploy to `npm` branch
runs-on: ubuntu-latest
if: |
github.event_name == 'push' &&
github.repository == 'graphql/graphql-js' &&
github.ref == 'refs/heads/main'
needs: [test, fuzz, lint, checkForCommonlyIgnoredFiles, integrationTests]
needs: [test, fuzz, lint, integrationTests]
steps:
- name: Checkout repo
uses: actions/checkout@v2
@@ -254,28 +187,24 @@ jobs:
uses: actions/setup-node@v2
with:
cache: npm
node-version: ${{ env.NODE_VERSION_USED_FOR_DEVELOPMENT }}
node-version-file: '.node-version'

- name: Install Dependencies
run: npm ci --ignore-scripts

- name: Build NPM package
run: npm run build:npm

- name: Deploy to `npm` branch
uses: ./.github/actions/deploy-dir-as-branch
- name: Upload npmDist package
uses: actions/upload-artifact@v2
with:
src_dir: npmDist
target_branch: npm
name: npmDist
path: ./npmDist

deploy-to-deno-branch:
name: Deploy to `deno` branch
build-deno-dist:
name: Build 'denoDist' artifact
runs-on: ubuntu-latest
if: |
github.event_name == 'push' &&
github.repository == 'graphql/graphql-js' &&
github.ref == 'refs/heads/main'
needs: [test, fuzz, lint, checkForCommonlyIgnoredFiles, integrationTests]
needs: [test, fuzz, lint, integrationTests]
steps:
- name: Checkout repo
uses: actions/checkout@v2
@@ -286,21 +215,21 @@ jobs:
uses: actions/setup-node@v2
with:
cache: npm
node-version: ${{ env.NODE_VERSION_USED_FOR_DEVELOPMENT }}
node-version-file: '.node-version'

- name: Install Dependencies
run: npm ci --ignore-scripts

- name: Build Deno package
run: npm run build:deno

- name: Deploy to `deno` branch
uses: ./.github/actions/deploy-dir-as-branch
- name: Upload denoDist package
uses: actions/upload-artifact@v2
with:
src_dir: denoDist
target_branch: deno
name: denoDist
path: ./denoDist

build-website:
build-website-dist:
name: Build website
runs-on: ubuntu-latest
steps:
@@ -313,10 +242,16 @@ jobs:
uses: actions/setup-node@v2
with:
cache: npm
node-version: ${{ env.NODE_VERSION_USED_FOR_DEVELOPMENT }}
node-version-file: '.node-version'

- name: Install Dependencies
run: npm ci --ignore-scripts

- name: Build Docs
run: npm run build:website

- name: Upload denoDist package
uses: actions/upload-artifact@v2
with:
name: websiteDist
path: ./websiteDist
Loading