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: v14.3.1
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: v14.4.0
Choose a head ref
Loading
Showing with 44,419 additions and 21,838 deletions.
  1. +6 −4 .eslintrc.yml
  2. +2 −1 .flowconfig
  3. +3 −3 .github/CONTRIBUTING.md
  4. +1 −1 .github/ISSUE_TEMPLATE.md
  5. +2 −3 .npmignore
  6. +10 −0 .nycflowrc.yml
  7. +2 −1 .nycrc.yml
  8. +32 −28 .travis.yml
  9. +1 −1 LICENSE
  10. +2 −2 README.md
  11. +109 −0 docs/APIReference-Errors.md
  12. +60 −0 docs/APIReference-Execution.md
  13. +35 −0 docs/APIReference-ExpressGraphQL.md
  14. +179 −0 docs/APIReference-GraphQL.md
  15. +305 −0 docs/APIReference-Language.md
  16. +666 −0 docs/APIReference-TypeSystem.md
  17. +245 −0 docs/APIReference-Utilities.md
  18. +68 −0 docs/APIReference-Validation.md
  19. +117 −0 docs/Guides-ConstructingTypes.md
  20. +53 −0 docs/Tutorial-Authentication.md
  21. +58 −0 docs/Tutorial-BasicTypes.md
  22. +59 −0 docs/Tutorial-ExpressGraphQL.md
  23. +62 −0 docs/Tutorial-GettingStarted.md
  24. +87 −0 docs/Tutorial-GraphQLClients.md
  25. +194 −0 docs/Tutorial-Mutations.md
  26. +144 −0 docs/Tutorial-ObjectTypes.md
  27. +130 −0 docs/Tutorial-PassingArguments.md
  28. +10 −10 package.json
  29. +8 −26 resources/benchmark.js
  30. +67 −17 resources/build.js
  31. +87 −0 resources/check-cover.js
  32. +267 −0 resources/gen-changelog.js
  33. +34 −0 resources/gen-version.js
  34. +1 −8 resources/inline-invariant.js
  35. +46 −8 resources/utils.js
  36. +0 −174 resources/watch.js
  37. +6,168 −1,809 src/__fixtures__/github-schema.graphql
  38. +32,458 −14,903 src/__fixtures__/github-schema.json
  39. +1 −8 src/__fixtures__/index.js
  40. +0 −5 src/__fixtures__/kitchen-sink.graphql
  41. +4 −5 src/__fixtures__/schema-kitchen-sink.graphql
  42. +2 −8 src/__tests__/starWarsData.js
  43. +1 −8 src/__tests__/starWarsIntrospection-test.js
  44. +1 −8 src/__tests__/starWarsQuery-test.js
  45. +1 −8 src/__tests__/starWarsSchema.js
  46. +1 −8 src/__tests__/starWarsValidation-test.js
  47. +36 −0 src/__tests__/version-test.js
  48. +30 −14 src/error/GraphQLError.js
  49. +77 −9 src/error/__tests__/GraphQLError-test.js
  50. +1 −8 src/error/__tests__/locatedError-test.js
  51. +0 −101 src/error/__tests__/printError-test.js
  52. +2 −9 src/error/formatError.js
  53. +2 −11 src/error/index.js
  54. +1 −8 src/error/locatedError.js
  55. +0 −92 src/error/printError.js
  56. +1 −8 src/error/syntaxError.js
  57. +1 −8 src/execution/__tests__/abstract-promise-test.js
  58. +2 −12 src/execution/__tests__/abstract-test.js
  59. +1 −8 src/execution/__tests__/directives-test.js
  60. +1 −8 src/execution/__tests__/executor-test.js
  61. +1 −8 src/execution/__tests__/lists-test.js
  62. +1 −8 src/execution/__tests__/mutations-test.js
  63. +1 −8 src/execution/__tests__/nonnull-test.js
  64. +1 −8 src/execution/__tests__/resolve-test.js
  65. +1 −8 src/execution/__tests__/schema-test.js
  66. +1 −8 src/execution/__tests__/sync-test.js
  67. +1 −8 src/execution/__tests__/union-interface-test.js
  68. +2 −9 src/execution/__tests__/variables-test.js
  69. +33 −58 src/execution/execute.js
  70. +1 −8 src/execution/index.js
  71. +6 −14 src/execution/values.js
  72. +26 −50 src/graphql.js
  73. +8 −8 src/index.js
  74. +2 −9 src/jsutils/ObjMap.js
  75. +1 −8 src/jsutils/PromiseOrValue.js
  76. +1 −8 src/jsutils/__tests__/dedent-test.js
  77. +35 −0 src/jsutils/__tests__/didYouMean-test.js
  78. +16 −0 src/jsutils/__tests__/identityFunc-test.js
  79. +4 −14 src/jsutils/__tests__/inspect-test.js
  80. +1 −8 src/jsutils/__tests__/instanceOf-test.js
  81. +24 −0 src/jsutils/__tests__/isObjectLike-test.js
  82. +0 −36 src/jsutils/__tests__/quotedOrList-test.js
  83. +1 −8 src/jsutils/__tests__/suggestionList-test.js
  84. +1 −8 src/jsutils/dedent.js
  85. +1 −8 src/jsutils/defineToJSON.js
  86. +1 −8 src/jsutils/defineToStringTag.js
  87. +39 −0 src/jsutils/didYouMean.js
  88. +8 −0 src/jsutils/identityFunc.js
  89. +17 −25 src/jsutils/inspect.js
  90. +3 −10 src/jsutils/instanceOf.js
  91. +1 −8 src/jsutils/invariant.js
  92. +1 −8 src/jsutils/isInvalid.js
  93. +1 −8 src/jsutils/isNullish.js
  94. +9 −0 src/jsutils/isObjectLike.js
  95. +1 −8 src/jsutils/isPromise.js
  96. +1 −8 src/jsutils/keyMap.js
  97. +1 −8 src/jsutils/keyValMap.js
  98. +1 −8 src/jsutils/mapValue.js
  99. +10 −12 src/jsutils/memoize3.js
  100. +1 −8 src/jsutils/nodejsCustomInspectSymbol.js
  101. +0 −30 src/jsutils/orList.js
  102. +1 −8 src/jsutils/promiseForObject.js
  103. +1 −8 src/jsutils/promiseReduce.js
  104. +0 −17 src/jsutils/quotedOrList.js
  105. +5 −13 src/jsutils/suggestionList.js
  106. +1 −8 src/language/__tests__/blockString-test.js
  107. +20 −27 src/language/__tests__/lexer-test.js
  108. +1 −8 src/language/__tests__/parser-benchmark.js
  109. +10 −17 src/language/__tests__/parser-test.js
  110. +78 −0 src/language/__tests__/printLocation-test.js
  111. +1 −8 src/language/__tests__/printer-test.js
  112. +73 −8 src/language/__tests__/schema-parser-test.js
  113. +3 −8 src/language/__tests__/schema-printer-test.js
  114. +1 −8 src/language/__tests__/source-test.js
  115. +6 −11 src/language/__tests__/toJSONDeep.js
  116. +1 −8 src/language/__tests__/visitor-test.js
  117. +50 −9 src/language/ast.js
  118. +1 −8 src/language/blockString.js
  119. +1 −8 src/language/directiveLocation.js
  120. +8 −10 src/language/index.js
  121. +1 −8 src/language/kinds.js
  122. +8 −49 src/language/lexer.js
  123. +1 −8 src/language/location.js
  124. +24 −32 src/language/parser.js
  125. +1 −8 src/language/predicates.js
  126. +85 −0 src/language/printLocation.js
  127. +3 −9 src/language/printer.js
  128. +1 −8 src/language/source.js
  129. +35 −0 src/language/tokenKind.js
  130. +2 −9 src/language/visitor.js
  131. +1 −8 src/polyfills/find.js
  132. +1 −8 src/polyfills/flatMap.js
  133. +1 −8 src/polyfills/isFinite.js
  134. +1 −8 src/polyfills/isInteger.js
  135. +1 −8 src/polyfills/objectEntries.js
  136. +1 −8 src/polyfills/objectValues.js
  137. +1 −8 src/subscription/__tests__/asyncIteratorReject-test.js
  138. +1 −8 src/subscription/__tests__/eventEmitterAsyncIterator-test.js
  139. +1 −8 src/subscription/__tests__/eventEmitterAsyncIterator.js
  140. +1 −8 src/subscription/__tests__/mapAsyncIterator-test.js
  141. +2 −9 src/subscription/__tests__/subscribe-test.js
  142. +1 −8 src/subscription/asyncIteratorReject.js
  143. +2 −8 src/subscription/index.js
  144. +1 −8 src/subscription/mapAsyncIterator.js
  145. +32 −43 src/subscription/subscribe.js
  146. +27 −38 src/type/__tests__/definition-test.js
  147. +18 −8 src/type/__tests__/directive-test.js
  148. +4 −11 src/type/__tests__/enumType-test.js
  149. +2 −12 src/type/__tests__/introspection-test.js
  150. +2 −13 src/type/__tests__/predicate-test.js
  151. +2 −12 src/type/__tests__/schema-test.js
  152. +2 −9 src/type/__tests__/serialization-test.js
  153. +130 −21 src/type/__tests__/validation-test.js
  154. +33 −40 src/type/definition.js
  155. +14 −18 src/type/directives.js
  156. +1 −8 src/type/index.js
  157. +229 −249 src/type/introspection.js
  158. +10 −25 src/type/scalars.js
  159. +3 −12 src/type/schema.js
  160. +88 −125 src/type/validate.js
  161. +1 −8 src/utilities/TypeInfo.js
  162. +1 −8 src/utilities/__tests__/assertValidName-test.js
  163. +1 −8 src/utilities/__tests__/astFromValue-test.js
  164. +1 −8 src/utilities/__tests__/buildASTSchema-benchmark.js
  165. +32 −66 src/utilities/__tests__/buildASTSchema-test.js
  166. +1 −8 src/utilities/__tests__/buildClientSchema-benchmark.js
  167. +49 −13 src/utilities/__tests__/buildClientSchema-test.js
  168. +26 −33 src/utilities/__tests__/coerceValue-test.js
  169. +1 −8 src/utilities/__tests__/concatAST-test.js
  170. +40 −76 src/utilities/__tests__/extendSchema-test.js
  171. +147 −65 src/utilities/__tests__/findBreakingChanges-test.js
  172. +1 −8 src/utilities/__tests__/findDeprecatedUsages-test.js
  173. +1 −8 src/utilities/__tests__/getOperationAST-test.js
  174. +1 −8 src/utilities/__tests__/getOperationRootType-test.js
  175. +1 −8 src/utilities/__tests__/introspectionFromSchema-benchmark.js
  176. +1 −8 src/utilities/__tests__/introspectionFromSchema-test.js
  177. +1 −8 src/utilities/__tests__/isValidLiteralValue-test.js
  178. +1 −8 src/utilities/__tests__/lexicographicSortSchema-test.js
  179. +21 −16 src/utilities/__tests__/schemaPrinter-test.js
  180. +1 −8 src/utilities/__tests__/separateOperations-test.js
  181. +14 −23 src/utilities/__tests__/stripIgnoredCharacters-test.js
  182. +1 −8 src/utilities/__tests__/typeComparators-test.js
  183. +1 −8 src/utilities/__tests__/valueFromAST-test.js
  184. +1 −8 src/utilities/__tests__/valueFromASTUntyped-test.js
  185. +2 −10 src/utilities/assertValidName.js
  186. +4 −11 src/utilities/astFromValue.js
  187. +7 −12 src/utilities/buildASTSchema.js
  188. +10 −14 src/utilities/buildClientSchema.js
  189. +20 −24 src/utilities/coerceValue.js
  190. +1 −8 src/utilities/concatAST.js
  191. +1 −8 src/utilities/extendSchema.js
  192. +353 −657 src/utilities/findBreakingChanges.js
  193. +1 −8 src/utilities/findDeprecatedUsages.js
  194. +2 −10 src/utilities/getOperationAST.js
  195. +1 −8 src/utilities/getOperationRootType.js
  196. +1 −8 src/utilities/index.js
  197. +1 −8 src/utilities/introspectionFromSchema.js
  198. +10 −8 src/utilities/introspectionQuery.js
  199. +1 −8 src/utilities/isValidJSValue.js
  200. +1 −8 src/utilities/isValidLiteralValue.js
  201. +4 −9 src/utilities/lexicographicSortSchema.js
  202. +5 −11 src/utilities/schemaPrinter.js
  203. +1 −8 src/utilities/separateOperations.js
  204. +3 −9 src/utilities/stripIgnoredCharacters.js
  205. +1 −8 src/utilities/typeComparators.js
  206. +1 −8 src/utilities/typeFromAST.js
  207. +5 −15 src/utilities/valueFromAST.js
  208. +1 −8 src/utilities/valueFromASTUntyped.js
  209. +7 −20 src/validation/ValidationContext.js
  210. +1 −8 src/validation/__tests__/ExecutableDefinitions-test.js
  211. +1 −8 src/validation/__tests__/FieldsOnCorrectType-test.js
  212. +1 −8 src/validation/__tests__/FragmentsOnCompositeTypes-test.js
  213. +1 −8 src/validation/__tests__/KnownArgumentNames-test.js
  214. +1 −8 src/validation/__tests__/KnownDirectives-test.js
  215. +1 −8 src/validation/__tests__/KnownFragmentNames-test.js
  216. +1 −8 src/validation/__tests__/KnownTypeNames-test.js
  217. +1 −8 src/validation/__tests__/LoneAnonymousOperation-test.js
  218. +1 −8 src/validation/__tests__/LoneSchemaDefinition-test.js
  219. +1 −8 src/validation/__tests__/NoFragmentCycles-test.js
  220. +1 −8 src/validation/__tests__/NoUndefinedVariables-test.js
  221. +1 −8 src/validation/__tests__/NoUnusedFragments-test.js
  222. +1 −8 src/validation/__tests__/NoUnusedVariables-test.js
  223. +1 −8 src/validation/__tests__/OverlappingFieldsCanBeMerged-test.js
  224. +1 −8 src/validation/__tests__/PossibleFragmentSpreads-test.js
  225. +1 −8 src/validation/__tests__/PossibleTypeExtensions-test.js
  226. +1 −8 src/validation/__tests__/ProvidedRequiredArguments-test.js
  227. +1 −8 src/validation/__tests__/ScalarLeafs-test.js
  228. +1 −8 src/validation/__tests__/SingleFieldSubscriptions-test.js
  229. +1 −8 src/validation/__tests__/UniqueArgumentNames-test.js
  230. +1 −8 src/validation/__tests__/UniqueDirectiveNames-test.js
  231. +68 −34 src/validation/__tests__/UniqueDirectivesPerLocation-test.js
  232. +1 −8 src/validation/__tests__/UniqueEnumValueNames-test.js
  233. +1 −8 src/validation/__tests__/UniqueFieldDefinitionNames-test.js
  234. +1 −8 src/validation/__tests__/UniqueFragmentNames-test.js
  235. +1 −8 src/validation/__tests__/UniqueInputFieldNames-test.js
  236. +1 −8 src/validation/__tests__/UniqueOperationNames-test.js
  237. +1 −8 src/validation/__tests__/UniqueOperationTypes-test.js
  238. +1 −8 src/validation/__tests__/UniqueTypeNames-test.js
  239. +1 −8 src/validation/__tests__/UniqueVariableNames-test.js
  240. +18 −35 src/validation/__tests__/ValuesOfCorrectType-test.js
  241. +1 −8 src/validation/__tests__/VariablesAreInputTypes-test.js
  242. +1 −8 src/validation/__tests__/VariablesInAllowedPosition-test.js
  243. +3 −27 src/validation/__tests__/harness.js
  244. +1 −8 src/validation/__tests__/validateGQL-benchmark.js
  245. +1 −8 src/validation/__tests__/validateSDL-benchmark.js
  246. +1 −8 src/validation/__tests__/validation-test.js
  247. +1 −8 src/validation/index.js
  248. +1 −8 src/validation/rules/ExecutableDefinitions.js
  249. +9 −17 src/validation/rules/FieldsOnCorrectType.js
  250. +2 −12 src/validation/rules/FragmentsOnCompositeTypes.js
  251. +10 −21 src/validation/rules/KnownArgumentNames.js
  252. +1 −8 src/validation/rules/KnownDirectives.js
  253. +1 −8 src/validation/rules/KnownFragmentNames.js
  254. +6 −14 src/validation/rules/KnownTypeNames.js
  255. +1 −8 src/validation/rules/LoneAnonymousOperation.js
  256. +1 −8 src/validation/rules/LoneSchemaDefinition.js
  257. +2 −10 src/validation/rules/NoFragmentCycles.js
  258. +1 −8 src/validation/rules/NoUndefinedVariables.js
  259. +1 −8 src/validation/rules/NoUnusedFragments.js
  260. +1 −8 src/validation/rules/NoUnusedVariables.js
  261. +1 −8 src/validation/rules/OverlappingFieldsCanBeMerged.js
  262. +3 −16 src/validation/rules/PossibleFragmentSpreads.js
  263. +6 −14 src/validation/rules/PossibleTypeExtensions.js
  264. +3 −16 src/validation/rules/ProvidedRequiredArguments.js
  265. +3 −16 src/validation/rules/ScalarLeafs.js
  266. +4 −12 src/validation/rules/SingleFieldSubscriptions.js
  267. +1 −8 src/validation/rules/UniqueArgumentNames.js
  268. +2 −12 src/validation/rules/UniqueDirectiveNames.js
  269. +40 −25 src/validation/rules/UniqueDirectivesPerLocation.js
  270. +2 −12 src/validation/rules/UniqueEnumValueNames.js
  271. +2 −12 src/validation/rules/UniqueFieldDefinitionNames.js
  272. +1 −8 src/validation/rules/UniqueFragmentNames.js
  273. +1 −8 src/validation/rules/UniqueInputFieldNames.js
  274. +1 −8 src/validation/rules/UniqueOperationNames.js
  275. +2 −12 src/validation/rules/UniqueOperationTypes.js
  276. +2 −12 src/validation/rules/UniqueTypeNames.js
  277. +1 −8 src/validation/rules/UniqueVariableNames.js
  278. +27 −40 src/validation/rules/ValuesOfCorrectType.js
  279. +1 −8 src/validation/rules/VariablesAreInputTypes.js
  280. +2 −12 src/validation/rules/VariablesInAllowedPosition.js
  281. +5 −17 src/validation/specifiedRules.js
  282. +2 −9 src/validation/validate.js
  283. +21 −0 src/version.js
  284. +90 −805 yarn.lock
10 changes: 6 additions & 4 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ rules:
# https://github.com/prettier/eslint-plugin-prettier#installation
prettier/prettier: error

# `eslint-plugin-flowtype` rule list based on `v3.9.x`
# `eslint-plugin-flowtype` rule list based on `v3.11.x`
# https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype

flowtype/array-style-complex-type: [error, verbose]
@@ -30,11 +30,12 @@ rules:
flowtype/no-weak-types: [error, { any: false }]
flowtype/require-compound-type-alias: off
flowtype/require-exact-type: off # TODO
flowtype/require-inexact-type: off # checked by Flow
flowtype/require-parameter-type: off
flowtype/require-readonly-react-props: off
flowtype/require-return-type: off
flowtype/require-types-at-top: off
flowtype/require-valid-file-annotation: [error, always, { annotationStyle: block }]
flowtype/require-valid-file-annotation: [error, always, { annotationStyle: line, strict: true }]
flowtype/require-variable-type: off
flowtype/sort-keys: off
flowtype/spread-exact-type: off
@@ -242,7 +243,7 @@ rules:
- error
- selector: 'FunctionDeclaration[async=true]'
message: >
async functions are not allowed outside of the test suite because
async functions are not allowed inside package source code because
older versions of NodeJS do not support them without additional
runtime dependencies. Instead, use explicit Promises.
no-tabs: error
@@ -253,7 +254,7 @@ rules:
operator-assignment: [error, always]
padding-line-between-statements: off
prefer-object-spread: error
quotes: [error, single, { avoidEscape: true, allowTemplateLiterals: true }]
quotes: [error, single, { avoidEscape: true, allowTemplateLiterals: false }]
sort-keys: off
sort-vars: off
spaced-comment: [error, always]
@@ -359,6 +360,7 @@ overrides:
parserOptions:
sourceType: script
rules:
no-restricted-syntax: off
no-console: off
no-sync: off
global-require: off
3 changes: 2 additions & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@ deprecated-utility=error
dynamic-export=off
unsafe-getters-setters=error
inexact-spread=error
implicit-inexact-object=error
unnecessary-optional-chain=error
unnecessary-invariant=off

@@ -35,4 +36,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$DisableFlowOnNegativeTest

[version]
^0.98.0
^0.102.0
6 changes: 3 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ Contributing to graphql-js
We want to make contributing to this project as easy and transparent as
possible. Hopefully this document makes the process for contributing clear and
answers any questions you may have. If not, feel free to open an
[Issue](https://github.com/facebook/graphql/issues).
[Issue](https://github.com/graphql/graphql-spec/issues/).

## Issues

@@ -24,10 +24,10 @@ your [pull requests](https://help.github.com/articles/creating-a-pull-request).
### Considered Changes

Since graphql-js is a reference implementation of the
[GraphQL spec](https://facebook.github.io/graphql/), only changes which comply
[GraphQL spec](https://graphql.github.io/graphql-spec/), only changes which comply
with this spec will be considered. If you have a change in mind which requires a
change to the spec, please first open an
[issue](https://github.com/facebook/graphql/issues/) against the spec.
[issue](https://github.com/graphql/graphql-spec/issues/) against the spec.

### Contributor License Agreement ("CLA")

2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ The best way to get a bug fixed is to provide a *pull request* with a simplified

# Feature requests

GraphQL.js is a reference implementation of the [GraphQL specification](https://github.com/facebook/graphql). To discuss new features which are not GraphQL.js specific and fundamentally change the way GraphQL works, open an issue against the specification.
GraphQL.js is a reference implementation of the [GraphQL specification](https://github.com/graphql/graphql-spec). To discuss new features which are not GraphQL.js specific and fundamentally change the way GraphQL works, open an issue against the specification.

# Security bugs

5 changes: 2 additions & 3 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -9,14 +9,13 @@ npm-debug.log
yarn.lock
package-lock.json

.babelrc
.nycrc
.nyc_output
codecov.yml
CONTRIBUTING.md
node_modules
coverage
resources
src
docs
dist
__tests__
npm
10 changes: 10 additions & 0 deletions .nycflowrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
include:
- "src/"
exclude:
- "src/polyfills"
clean: true
temp-directory: "coverage/flow"
report-dir: "coverage/flow"
skip-full: true
skip-empty: true
reporter: [json, html, text]
3 changes: 2 additions & 1 deletion .nycrc.yml
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ include:
exclude:
- "src/polyfills"
clean: true
temp-directory: "coverage"
temp-directory: "coverage/tests"
report-dir: "coverage/tests"
skip-full: true
reporter: [json, html, text]
60 changes: 32 additions & 28 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -5,36 +5,40 @@ cache: yarn

# https://github.com/nodejs/Release
node_js:
- '12'
- '11'
- '10'
- '8'
- '6'
- '12'
- '11'
- '10'
- '8'
- '6'

script: npm run testonly
script: |
if [[ "$(node -pe process.version)" == v10.* ]]; then # Is latest LTS?
npm run test:ci &&
bash <(curl -s https://codecov.io/bash) -f coverage/tests/coverage-final.json
else
npm run testonly
fi
jobs:
include:
- node_js: 'lts/*'
script: npm run test:ci && bash <(curl -s https://codecov.io/bash) -f coverage/coverage-final.json
- stage: deploy
if: branch = master OR tag IS present
script: echo "Deploying..."
node_js: 'lts/*'
deploy:
- provider: script
script: npm run gitpublish
skip_cleanup: true
on:
branch: master
- provider: npm
skip_cleanup: true
email: "mahoney.mattj@gmail.com"
api_key:
secure: VrDxiDK9vhe0F8WulJ+HcAkMwuvqIhtXYethlJBwkS9N57F4RuxzCJE0VuDDS90qMAewA450lfT5caCazir4opvpZebB16iy8/9J2ymhBj6bJs9rm/B3Xg/xQSLOWAmdq1H4lPF6CihQ5LR57BZbi9Rx3f5JOeXgiqQNASJH+mrXiQh3qZ9Ry8YJXhvcUDQNX57ooSBeGYXf5PcKsEUF0Qs6XLUCUdOztMrtA+sIZkQxAaEBBG7tkE6LdF3OJl2ORNMig05juyfeevcGk6g4XnoIA4gvnW1KHToLvuGWdoCHAW1N269JAaH4bL2JfcA5A7KXbZVwif0jIJz47dmOsnIMlMdSqBpw7zSRSq2Ikv1Vb5XRPeVk0CK0d2kUZej6Jb9+/Jed39chfyAAMVM4Wba8UcTKbOIqv7Kl1SmmgBOGveK7k4fpffbWdofi9avuqzeftdFrM1FULsX5Wne9n3xuJDvVLW0YRB2+FVmfwGNwzW5X/bzgLDRWB5W5JL60FXt91Hrk5bIi0GcPx6n0Ls7IJ9U6r5kWfcuTYl0gxOiWQDJ0OCXBXA5taIO6/AX/d9af4VhGc/EVxuIpUaW52nZOL49KG/3tYx39mDCqRf7w7/658RVXNO/yLy6b/QPY7+3Lua9y88xLxru3bI9gpNUdnYUFIehktuiAkuunWoA=
on:
branch: master
tags: true
- stage: deploy
if: branch = master OR tag IS present
script: echo "Deploying..."
node_js: lts/*
deploy:
- provider: script
script: npm run gitpublish
skip_cleanup: true
on:
branch: master
- provider: npm
skip_cleanup: true
on:
branch: master
tags: true
email: ivan.goncharov.ua@gmail.com
api_key:
secure: c4qeYtN4p41iqGxJFczGGaKgVKXEhKeCUOLAsgweLRN2yCAextWpZDP5EGn3lKZdLtovMIGsyVmdF1HDTKsAk/aBfPYsyvRgUpjtCUfxz0N48O009Erzkz7ibRrXkhcHWAKyE/RJRNpEkn8f7XdkEgewP1rjoSYhINizNZijDIhUfKVq41OfNRJoIv5WOX9DaArSJESde0z/wASlxS0vM4nrt0qjUdnMK4Dm0KGcJKJEqu/LA0YbZHfjl90pjr87MQzsYV1LF14EAI2JVzincrlOlyF872vLbja6AmFcugWNlefDGroV9LvSJUdlRdhDzc9Sr7Z4zgydOyHG6mvXgp0t4dV2fiJVWuU+oJL/v5LZ6jNEkk3jH5xDjC2xB9P45gm93HHekZzf5R3LQh8lfmdiFlhFDMVfv+8+T+nm+rwE9edxc68IBTPRaIRwnvNMpLJ1vuseBfWf5B6CKR1YNQESz1eweNdVa8DrKqXzOsMVNh1/lMIB5rqT6J/C+XQJbmiaYso5tksgr0FmyFJ6I/NQX0IazRS4Ao7paIf+hdgogePI4G5U4MW3M6WUTP9J2hQkqiWmmbgYAXYoYmrvoEMUi85voUdBjoyJtSvIQSz2Ai8JvwX3mNyinzef2wd9xP1eyTEqfY5CgNS5GgScIarcW9kWpQXT9lU4qFtklGw=

notifications:
irc:
@@ -43,10 +47,10 @@ notifications:
on_failure: change
skip_join: true
channels:
- "chat.freenode.net#graphql"
- chat.freenode.net#graphql
slack:
secure: G7fzaXoPI1cyyW7dlpQ8oG/ot73n4kE83HgbyK1iEN1YBfodsytVgh0jS+zB3DhhRAotS/VfGVz9Wj2Oo109U5w/FyxdMGuKvFan/0B/aAws1sPxLGWA5230u1wTKQCHAu17+yppFOODUu1ILDXaD2A//Wj5iru9M4NnKc1bO6VHkfBHPTLQLbdPHmorwuSH02Ocbh7K4XOWzXRxM6VrwamEn1KnyXGu2w3QdJUT31OjGEEdf6FUzvjwzFgXPhngCw5+enpwm71ljHDNu8YHhXvHtS4328O5pYQO8np7j653HNEqi+ZUiYEOWpwC8be1xHdvi/s32tPFZiCx28ZmDoCUrY744tpPtE6tzuncmSKB0Y3EjutdXBpxllNr5l5hpX5092G2MlpokFbv85J+E2ALcZYNYeFOqTYTKwTYkxK6B1x4amBNpM+FXgUhloK4BK9OT0Qh5SiQOsM8cZT0h6QP91n+REljtpugW3VbuIxq5OJAi42FYbHBC27pohhq6ohU1euZfobk9a7ZawnjoEUk1EZHXiJzYKY/QqzyB6dwk0ersBl3l3OX/wnjwKTkqc9aTmDWo2L+lHaUCXuCY1+KQXsRicfnH395szTJXQbvcbN0zz188gdz6sawzi5BxndWo0NRwZyOG2YcyUHFQR4bK1rL7Lo6t6rijQ/XMeQ=

env:
global:
secure: "uUjOV39iCLSLtShQfKk9AelIu2PqyKf8dYu4rqVcL5Y9yCHdds1KYysVgCx9XhndrugHNCXWzT/sKDS8voc/NRsfycnvdCIvu+dtBwf9lCHGcMyABFpvsjQfKTGyMCbYNDO8Hd/OQqHCFVj1lh4aNGev8tGqpJoMEDPdQbDKsvMVKWfo9QraXYYK7yh7U2vbidAV+YBj/e3VFfR2UQ+OECHxyxFGxWMbyTF8qRZ7JUsgCaJ82zrx0A7VoEJ6BeXxzhYDPuh3QTON9bXiJpWR/QcsKZNQ7d6Dxf06yo4XQDU9igxe6qst41Hj3IiZzLCyucoPXvoRsbmUcsAVdF4PWq3fnHUmyjRwOMcTjPd2SM4FPJpwnSGZEpstzKSJ3pDzpgRGsF7ai5nGNCes6RCi4AUf96GTjt0JAD+AXwD7mrGlcn4oi0m6r1GcNhDOFsBEgFqz26FXUFQcAqrHzZvsqvG01Cs5pAFMUIEpCyCrkDKClc/LWjJoVInDEVCwGqZk6Qz2XroYjFs25m+aB3ycSIN1qgkTg6szMO76tds4YtL8JDHaAXDbvXAk8YRYbQCAIFQVaIpkp8R1kJa++dP8Q3j/lwAkz+57XJ5KPRlLh7KMqF1joTGKptA0c2vD0sees2RxPrcZGmp6eaOLy3JhQmXfPaRLLpiK+plz6T25f7Y="
secure: uUjOV39iCLSLtShQfKk9AelIu2PqyKf8dYu4rqVcL5Y9yCHdds1KYysVgCx9XhndrugHNCXWzT/sKDS8voc/NRsfycnvdCIvu+dtBwf9lCHGcMyABFpvsjQfKTGyMCbYNDO8Hd/OQqHCFVj1lh4aNGev8tGqpJoMEDPdQbDKsvMVKWfo9QraXYYK7yh7U2vbidAV+YBj/e3VFfR2UQ+OECHxyxFGxWMbyTF8qRZ7JUsgCaJ82zrx0A7VoEJ6BeXxzhYDPuh3QTON9bXiJpWR/QcsKZNQ7d6Dxf06yo4XQDU9igxe6qst41Hj3IiZzLCyucoPXvoRsbmUcsAVdF4PWq3fnHUmyjRwOMcTjPd2SM4FPJpwnSGZEpstzKSJ3pDzpgRGsF7ai5nGNCes6RCi4AUf96GTjt0JAD+AXwD7mrGlcn4oi0m6r1GcNhDOFsBEgFqz26FXUFQcAqrHzZvsqvG01Cs5pAFMUIEpCyCrkDKClc/LWjJoVInDEVCwGqZk6Qz2XroYjFs25m+aB3ycSIN1qgkTg6szMO76tds4YtL8JDHaAXDbvXAk8YRYbQCAIFQVaIpkp8R1kJa++dP8Q3j/lwAkz+57XJ5KPRlLh7KMqF1joTGKptA0c2vD0sees2RxPrcZGmp6eaOLy3JhQmXfPaRLLpiK+plz6T25f7Y=
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) Facebook, Inc. and its affiliates.
Copyright (c) 2019 GraphQL Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -15,8 +15,8 @@ Looking for help? Find resources [from the community](https://graphql.org/commun
## Getting Started

An overview of GraphQL in general is available in the
[README](https://github.com/facebook/graphql/blob/master/README.md) for the
[Specification for GraphQL](https://github.com/facebook/graphql). That overview
[README](https://github.com/graphql/graphql-spec/blob/master/README.md) for the
[Specification for GraphQL](https://github.com/graphql/graphql-spec). That overview
describes a simple set of GraphQL examples that exist as [tests](src/__tests__)
in this repository. A good way to get started with this repository is to walk
through that README and the corresponding tests in parallel.
109 changes: 109 additions & 0 deletions docs/APIReference-Errors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
---
title: graphql/error
layout: ../_core/GraphQLJSLayout
category: API Reference
permalink: /graphql-js/error/
sublinks: formatError,GraphQLError,locatedError,syntaxError
next: /graphql-js/execution/
---

The `graphql/error` module is responsible for creating and formatting
GraphQL errors. You can import either from the `graphql/error` module, or from the root `graphql` module. For example:

```js
import { GraphQLError } from 'graphql'; // ES6
var { GraphQLError } = require('graphql'); // CommonJS
```

## Overview

<ul class="apiIndex">
<li>
<a href="#graphqlerror">
<pre>class GraphQLError</pre>
A representation of an error that occurred within GraphQL.
</a>
</li>
<li>
<a href="#syntaxerror">
<pre>function syntaxError</pre>
Produces a GraphQLError representing a syntax error.
</a>
</li>
<li>
<a href="#locatedError">
<pre>function locatedError</pre>
Produces a new GraphQLError aware of the location responsible for the error.
</a>
</li>
<li>
<a href="#formaterror">
<pre>function formatError</pre>
Format an error according to the rules described by the Response Format.
</a>
</li>
</ul>

## Errors

### GraphQLError

```js
class GraphQLError extends Error {
constructor(
message: string,
nodes?: Array<any>,
stack?: ?string,
source?: Source,
positions?: Array<number>,
originalError?: ?Error,
extensions?: ?{ [key: string]: mixed }
)
}
```
A representation of an error that occurred within GraphQL. Contains
information about where in the query the error occurred for debugging. Most
commonly constructed with `locatedError` below.
### syntaxError
```js
function syntaxError(
source: Source,
position: number,
description: string
): GraphQLError;
```

Produces a GraphQLError representing a syntax error, containing useful
descriptive information about the syntax error's position in the source.

### locatedError

```js
function locatedError(error: ?Error, nodes: Array<any>): GraphQLError {
```
Given an arbitrary Error, presumably thrown while attempting to execute a
GraphQL operation, produce a new GraphQLError aware of the location in the
document responsible for the original Error.
### formatError
```js
function formatError(error: GraphQLError): GraphQLFormattedError

type GraphQLFormattedError = {
message: string,
locations: ?Array<GraphQLErrorLocation>
};

type GraphQLErrorLocation = {
line: number,
column: number
};
```
Given a GraphQLError, format it according to the rules described by the
Response Format, Errors section of the GraphQL Specification.
Loading