From da734596c35c221efbd25e3718655ee1d88a59d8 Mon Sep 17 00:00:00 2001 From: Lee Byron Date: Tue, 30 Jun 2015 17:31:01 -0700 Subject: [PATCH] GraphQL technical preview MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is the first public commit in what has been a few months of internal development. Future development will occur in public directly in this repository. Squashed commit of the following: commit 4175b26ed97167c93aa19f596c3329e28c865e70 Author: Nicolas Lagoutte Date: Wed Jan 5 15:08:52 2022 +0000 Prevent Infinite Loop in OverlappingFieldsCanBeMergedRule (#3442) Co-authored-by: Ivan Goncharov commit 29b811fca5f726c9a3aa1d979c70ecbced8b4ec8 Author: Ivan Goncharov Date: Mon Jan 3 22:50:09 2022 +0200 Fix index.ts files to be compatible with Typedoc (#3447) commit 47bd8c8897c72d3efc17ecb1599a95cee6bac5e8 Author: Ivan Goncharov Date: Mon Jan 3 22:27:37 2022 +0200 Use 'eslint-plugin-simple-import-sort' to sort imports (#3446) commit 085d1ee89d11093e910912eb5d8cc3fbd6c7a0dc Author: Ivan Goncharov Date: Mon Dec 27 15:44:59 2021 +0200 Update deps (#3444) commit f890300dd3a9a6257ea9c1ec266b16ef405eed71 Author: Ivan Goncharov Date: Sun Dec 26 20:31:09 2021 +0200 ci/checkPackageLock: update only package-lock.json (#3443) commit 872c6b98a2fd21946aec25e757236c6652f16229 Author: Christoph Zwerschke Date: Sun Dec 26 10:29:15 2021 +0100 UniqueArgumentDefinitionNamesRule: Improve tests (#3441) Co-authored-by: Ivan Goncharov commit 533b423f3ec6c9a5624ed16c89589975a21f653f Author: Ivan Goncharov Date: Wed Dec 22 16:01:12 2021 +0200 Update deps (#3438) commit db4986e8a254fb833609e03d2e6fe3a3ec9a5bf4 Author: Ivan Goncharov Date: Mon Dec 20 23:31:13 2021 +0200 CONTRIBUTING.md: remove reference to Facebook bug bounty program (#3437) commit 671e68bca999054693e5e231208d79f7c09c247e Author: Ivan Goncharov Date: Mon Dec 20 23:09:56 2021 +0200 gh/actions: make all cloned repo read-only (#3436) commit 67e14cffd4d7e866bf148868906d777b0e5226bd Author: Ivan Goncharov Date: Mon Dec 20 23:03:57 2021 +0200 gh/actions: run benchmark & diff-npm-package only on PRs (#3435) commit e2ebf04363d25d172d9c64c82f810e318ddcc5b1 Author: Ivan Goncharov Date: Mon Dec 20 22:47:33 2021 +0200 gh/actions: remove 'npm dedupe' check since it unexpectadly do update (#3434) commit 71dd289ba323f9d9c4c42311652faba965bd7c4f Author: Ivan Goncharov Date: Mon Dec 20 20:02:29 2021 +0200 gh/actions: refactor out action to deploy branches (#3433) commit 3ab82f4981970f50dd3a96e22a11839e4ec5bb7b Author: Ivan Goncharov Date: Fri Dec 17 16:23:06 2021 +0200 16.2.0 commit f17351c10652b1c9a55ca0936bb3b2ac4414b5b7 Author: Christoph Zwerschke Date: Fri Dec 17 14:46:23 2021 +0100 assertName-test: test new instead of deprecated function (#3423) Co-authored-by: Ivan Goncharov commit 779519253a68d7a906f366858aec75cee239452e Author: Ivan Goncharov Date: Fri Dec 17 15:21:02 2021 +0200 gh/actions: run benchmark and NPM diff on correct base commits (#3427) Fixes #3371 commit 95a85f73a9975a0ad6394d11096c57c6872a2cc2 Author: Ivan Goncharov Date: Tue Dec 14 17:46:33 2021 +0200 type/definition: export `resolve*Thunk` functions (#3426) commit 4f56285ddbef8a18a8eb0bdd3b91c700cd8cd288 Author: Christoph Zwerschke Date: Tue Dec 14 14:53:55 2021 +0100 Minor grammar fixes in collectFields documentation (#3422) commit c8bbb0a6197b1b50088f8910fec86704e8bf41b5 Author: Ivan Goncharov Date: Thu Dec 9 17:44:08 2021 +0200 resources/utils: extract 'writeGeneratedFile' to utils (#3420) commit 90bd6ff72625173dd39a1f82cfad9336cfad8f65 Author: Ivan Goncharov Date: Tue Dec 7 23:22:05 2021 +0200 16.1.0 commit ab52ddc9227806fa530e5892173028a656929059 Author: Ivan Goncharov Date: Tue Dec 7 23:18:48 2021 +0200 package.json: Specify NPM release tag explicitly (#3417) commit 763c1496d8b5b01ace64dd4b82c3f2037ecb0b08 Author: Yaacov Rydzinski Date: Tue Dec 7 22:19:42 2021 +0200 fix c8 ignore decorator typos (#3416) commit 6e48d16f92b9a6df8638b1486354c6be2537033b Author: Ivan Goncharov Date: Sat Dec 4 22:45:25 2021 +0200 ci: add check for unnessary duplicates in package-lock.json (#3407) commit c145cd42afb606e6bee33593b048b977c92f7a0b Author: Ivan Goncharov Date: Sat Dec 4 22:35:15 2021 +0200 Simplify code by replacing Object.entries with Object.keys (#3406) commit 947165fc33e39631fddaa8e3432263d2e7e0e98f Author: Ivan Goncharov Date: Sat Dec 4 22:12:01 2021 +0200 Use for '--ignore-scripts' for all `npm ci` & `npm install` (#3405) commit ce4277e94587f51424bffe405bb488f38f1218da Author: Ivan Goncharov Date: Sat Dec 4 21:22:56 2021 +0200 github/workflows: simplify npm cache setup (#3404) commit 13530ced071abde76ea2c3fcc49bf62a5a939b3a Author: Ivan Goncharov Date: Sat Dec 4 00:57:04 2021 +0200 ci: add check that 'package-lock.json' doesn't have conflicts (#3403) commit d26f6e91d49ee7d7b95f27c1991a79dd43cb1b58 Author: Ivan Goncharov Date: Fri Dec 3 23:08:18 2021 +0200 tests: Improve formating of strings with 'dedent' tag (#3401) commit cbbff7fd01c38bc08979e652463ba94f67cd39e6 Author: Ivan Goncharov Date: Fri Dec 3 20:01:42 2021 +0200 expectJSON: improve readability (#3400) commit 01dfa68652f7c11ef08ebd0abe53e5a38a94e0af Author: Ivan Goncharov Date: Wed Dec 1 19:39:40 2021 +0200 Update deps (#3399) commit 8540df21ea7d50ab003f8bb8260e15a26246bf4a Author: Ivan Goncharov Date: Wed Dec 1 19:17:11 2021 +0200 Switch coverage from nyc to c8 (#3398) commit 36f068e8cca064f9796d35de27ba1ef489873926 Author: Paul Serraino Date: Wed Dec 1 05:40:11 2021 -0600 Update doc examples to reflect the current API (#3393) commit bc3564ace52be65e391714f3097b1e6ca0a372dc Author: Ivan Goncharov Date: Tue Nov 30 20:27:45 2021 +0200 typeFromAST: use exhaustive switch and remove invariant (#3396) commit 79d984f0a88386ac6f606e5852d3d1f0e8874b47 Author: Ivan Goncharov Date: Tue Nov 30 00:05:26 2021 +0200 Remove $FlowFixMe comments (#3392) commit fca503ec2c3d918444c7e9c1373e1753aa06fb44 Author: Ivan Goncharov Date: Mon Nov 29 22:40:43 2021 +0200 Enable '@typescript-eslint/switch-exhaustiveness-check' rule (#3391) commit 37ec050c1a47b77003cbf1bd5606fac3fcc647b8 Author: Ivan Goncharov Date: Mon Nov 29 18:35:05 2021 +0200 Update deps (#3390) commit 39be2f6a785dc8d6b752541a33a10ef604c5cb42 Author: Ivan Goncharov Date: Mon Nov 29 16:23:16 2021 +0200 package.json: Drop unused '@babel/eslint-parser' (#3389) commit 0fb6afc9c31e16b7c5a752d0baaa829e583aa244 Author: Ivan Goncharov Date: Sun Nov 28 23:47:08 2021 +0200 Drop "eslint-plugin-istanbul" and implement as internal ESLint rule (#3388) commit 82ff6539a5b961b00367ed7d6ac57a7297af2a9a Author: Ivan Goncharov Date: Sun Nov 28 23:04:27 2021 +0200 Update package-lock.json (#3387) commit 2344c47a365515f4716bf418290471f768be54dc Author: Ivan Goncharov Date: Sun Nov 28 22:49:36 2021 +0200 Add support for Node17 (#3386) commit e8c946165c902956b9041ea1b39505686cc009f6 Author: Ivan Goncharov Date: Sun Nov 28 20:15:30 2021 +0200 Preserve non-error values thrown from resolvers (#3384) commit cce8a85fe897a0ff9a71156e83aeb2a83fef6872 Author: Alex Reilly Date: Mon Nov 22 23:28:37 2021 -0800 lexer-tests: Use tildas as invalid characters (#3377) commit 0d1297a4305e46b52ee82675f883a9e2772f17a8 Author: Alex Reilly Date: Mon Nov 22 23:27:25 2021 -0800 execute: fix spec section names in comments (#3376) commit be1261373e45bfd96676efe612b4e02aa308ce72 Author: Ivan Goncharov Date: Mon Nov 22 17:22:10 2021 +0200 printSchema: handle descriptions that are non-printable as block strings (#3375) commit 11a08024a35b08104b291627f4fdb2e8c69f8cab Author: Francisco Marques Date: Tue Nov 16 12:14:50 2021 +0000 Export GRAPHQL_MAX_INT and GRAPHQL_MIN_INT (#3355) commit 085c9efaa4586aa9b4bbf21f80ea612a79069b8d Author: Ivan Goncharov Date: Mon Nov 8 17:28:28 2021 +0200 Add devAssert about removal of positional arguments (#3365) commit 30b446938a9b5afeb25c642d8af1ea33f6c849f3 Author: Ivan Goncharov Date: Mon Nov 1 22:45:53 2021 +0200 16.0.1 commit b262418e816b3852dddbbedf0efad4ddead1a5fe Author: Ivan Goncharov Date: Mon Nov 1 22:42:37 2021 +0200 Lexer: fix line & column for multiline BLOCK_STRING tokens (#3354) Fixes #3353 commit 958ac6c9b27b7147b47fa4c36d792c01a8d341a3 Author: Ivan Goncharov Date: Mon Nov 1 16:46:27 2021 +0200 GraphQLError-test: text how extensions is inherited from originalError (#3348) commit 10c1c3d6cd8e165501fb1471b5babfabd1be1eb1 Author: Ivan Goncharov Date: Fri Oct 29 16:36:06 2021 +0300 checkgit.sh: Added a check for local modifications (#3347) commit 7ca43c87bc9cc30b0b931c553908a2db77abb3cc Author: Ivan Goncharov Date: Thu Oct 28 22:49:11 2021 +0300 16.0.0 commit ced56b2df0364a2b7f784e43ada69cc612d6e32a Author: Ivan Goncharov Date: Thu Oct 28 22:46:23 2021 +0300 version-test: fix validation of `versionInfo.preReleaseTag` (#3345) commit 2831917db113caca33c9df0a6cb9c90eed3a1776 Author: Ivan Goncharov Date: Thu Oct 28 20:15:05 2021 +0300 build-npm: fix type inference during TS declarations build commit d2eb7bd9de8ed258eb2a4be3825760efeec467e9 Author: Ivan Goncharov Date: Thu Oct 28 19:38:50 2021 +0300 version: force proper typing on version literals Types should be generic and stay the same across different versions E.g. `preReleaseTag` should be typed `string | null` even if it's a `null` literal for this particular release commit 6453612a6c40a1f8ad06845f1516c5f0dafa666c Author: Ivan Goncharov Date: Wed Oct 27 16:28:04 2021 +0300 16.0.0-rc.7 commit 556ac034ef021ddedfe7af037fefc52c479804fd Author: Yaacov Rydzinski Date: Wed Oct 27 16:23:17 2021 +0300 Use default GITHUB_ACTOR if unset (#3331) Co-authored-by: Ivan Goncharov commit c2435fd1b8b22e034ad1b266bf092ace0e06d015 Author: Ivan Goncharov Date: Wed Oct 27 15:15:50 2021 +0300 Fix TS error caused by importing internal files directly (#3339) commit a745361c621950f8c3b8895bc13e455c20f7854a Author: Ivan Goncharov Date: Tue Oct 26 22:54:21 2021 +0300 GraphQLError: Add test to check order of fields in JSON.stringify (#3336) commit dc1f7a57bd0829fc63a933aacbc1c7b542f21772 Author: Yaacov Rydzinski Date: Mon Oct 25 18:17:10 2021 +0300 use GITHUB_TOKEN (#3330) commit 811ba373311006901cc7bbaf34035b60f949fd5e Author: Yaacov Rydzinski Date: Mon Oct 25 18:02:36 2021 +0300 Fix release instructions (#3329) commit d35bca5f7e1eea49804c46ef9c7bd35791759b6d Author: Ivan Goncharov Date: Sat Oct 23 15:33:43 2021 +0300 16.0.0-rc.6 commit fd50cebbd110d95d74b527a6189d2ad1ab348d0e Author: Ivan Goncharov Date: Sat Oct 23 15:30:48 2021 +0300 GraphQLField: relax default value of TArgs to `any` (#3328) commit 52f17544200f13e0e2d455f834deeecf4953d72d Author: Ivan Goncharov Date: Fri Oct 22 13:48:31 2021 +0300 GraphQLError: enumerate only spec prescribed properties (#3326) commit b93641125a7f75a7cb10bc9c5cf6bd89983834bb Author: Ivan Goncharov Date: Wed Oct 20 17:45:53 2021 +0300 GraphQLError: fix empty `locations` if error got nodes without locations (#3325) commit a3d215bdce6fc4eda9f0fce25d52224c3bea2700 Author: Ivan Goncharov Date: Wed Oct 20 13:19:53 2021 +0300 GraphQLError-test: merge check of source with rest of the properties (#3324) commit cd35c99bbacf65e1096349d844774d2f7c038e56 Author: Ivan Goncharov Date: Wed Oct 20 12:48:35 2021 +0300 Lexer: use standard JS functions to handle Unicode (#3322) commit 7da9cd31a78fa135d2a44a97d1a4dfad0858b001 Author: Christoph Zwerschke Date: Tue Oct 19 11:45:51 2021 +0200 lexer: fix expression to decode surrogate pairs (#3278) commit f42cee922d13576b1452bb5bf6c7b155bf0e2ecd Author: Christoph Zwerschke Date: Tue Oct 19 09:53:00 2021 +0200 jsutils: add test for Path functions (#2478) Co-authored-by: Ivan Goncharov commit 4c9bf037ed32b8a9bd2215b264c8b89e1f6c86c2 Author: Ivan Goncharov Date: Mon Oct 18 15:16:30 2021 +0300 16.0.0-rc.5 commit e91f3a88bacecd1e656132ea1bb6786999931058 Author: Ivan Goncharov Date: Mon Oct 18 15:13:58 2021 +0300 Update deps (#3320) commit 7c6bf480b5cfc09451b2951c6303351a76785dc1 Author: Ivan Goncharov Date: Mon Oct 18 14:52:50 2021 +0300 Add message that we only support TS >= 4.1.0 (#3319) commit ada5ee0d9a720f97b11f7296ec5b1936021088fe Author: Ivan Goncharov Date: Mon Oct 18 13:52:57 2021 +0300 Deprecate 'ASTKindToNode' (#3318) commit 73025aa009039c1e2e74f7bbd088ec6ab6e07e94 Author: Ivan Goncharov Date: Mon Oct 18 12:26:43 2021 +0300 Convert const "enum-like" maps to TS enums (#3317) commit 3deb5cccddd4ffaa123ba03952a947eccf813e5d Author: Yaacov Rydzinski Date: Fri Oct 15 11:34:34 2021 +0300 Export OperationTypeNode as value (#3316) commit 06d9cb42b6523a9bca39c6690d47de1c3f52a8cb Author: Ivan Goncharov Date: Wed Oct 13 17:07:51 2021 +0300 Change type of error extensions from anonymous Record to named interfaces (#3315) commit 04c6fce07a9c1ee271a637899614e5de5b35eaf8 Author: Ivan Goncharov Date: Wed Oct 13 14:37:22 2021 +0300 16.0.0-rc.4 commit e289e6412ca59cd6298796d61efa19d78eeb945c Author: Martin Trobäck Date: Wed Oct 13 13:34:09 2021 +0200 language: change OperationTypeNode to enum (#3312) Co-authored-by: Ivan Goncharov commit d48d5028a88f912f8b506a8a8b8dd938de96cb80 Author: jjangga0214 Date: Wed Oct 13 19:38:16 2021 +0900 refactor(language/ast.d.ts): use Kind enum type (#2984) Co-authored-by: Ivan Goncharov commit b1ce2c3567fc34f351fe20cc73d098bfdd474ebc Author: Ivan Goncharov Date: Wed Oct 13 11:50:54 2021 +0300 GraphQLError: keep extensions always present (#3313) commit 82900fa245f4c2a6b148de1d71c8bede52d34b7d Author: Ivan Goncharov Date: Tue Oct 12 16:02:44 2021 +0300 GraphQLError: use enumerable properties (#3311) commit 01fa86887954685e2fa12c8f8a23cea2d47c13d1 Author: Ivan Goncharov Date: Tue Oct 12 15:01:11 2021 +0300 expectJSON: return custom object instead of `expect` (#3310) commit f45bc0ade059fbec6c02ecf6ebdf6dbc4adba017 Author: Ivan Goncharov Date: Tue Oct 12 00:17:00 2021 +0300 Move deprecated `SubscriptionArgs` to 'src/subscription' (#3309) commit 2aad6b44f7a04e3b87be03ce3ad126ba4d57fe71 Author: Ivan Goncharov Date: Mon Oct 11 23:38:22 2021 +0300 execute: Correctly report missing root type error (#3308) commit 71c7a1413e16fc71bd7435e1c7ca01b4f123d563 Author: Ivan Goncharov Date: Mon Oct 11 22:47:22 2021 +0300 Reuse `groupBy` in validation rules (#3307) commit 96b146d97f0fc6a06fd2c4b1444c5b00c0da3fd6 Author: Ivan Goncharov Date: Mon Oct 11 22:11:55 2021 +0300 Added 'GraphQLSchema.getRootType' and deprecate `getOperationRootType` (#3305) commit 2170e4a485e067e68870aabb551f5cd44bd088d4 Author: Ivan Goncharov Date: Mon Oct 11 18:21:31 2021 +0300 Add 'UniqueArgumentDefinitionNamesRule' validation rule (#3208) commit 6aee19b99c22b62135fa522a88bb17a6b94ad905 Author: Yaacov Rydzinski Date: Mon Oct 11 18:08:03 2021 +0300 Deprecate SubscriptionArgs and broaden ExecutionArgs (#3306) Co-authored-by: Ivan Goncharov commit 302ab18666a2fc7c87fde96812ced577b1ca8eaf Author: Ivan Goncharov Date: Mon Oct 11 12:13:29 2021 +0300 README: remove credits for `*.d.ts` files (#3304) commit 2272f9839d73b32fb23825538e26571d462da422 Author: Ivan Goncharov Date: Sun Oct 10 14:39:00 2021 +0300 Remove unnecessary Promise.resolve and Promise.reject (#3290) commit 239aa33b8a934a8e1ad4a4b4051d17b04efc3439 Author: Yaacov Rydzinski Date: Sat Oct 9 11:57:09 2021 +0300 Align calls of buildExecutionContext (#3293) commit 588d096f9b4fe4092d87be90e53b2fcc17bb5445 Author: Yaacov Rydzinski Date: Thu Oct 7 16:56:46 2021 +0300 Deprecate 'graphql/subscriptions' and move code to 'execution' (#3292) commit bfc354e78d6093307330a53e88623b674ba6ad4e Author: Ivan Goncharov Date: Wed Oct 6 16:58:21 2021 +0300 integrationTests/ts: Simplify extensions tests (#3289) commit ae34b82753730354776e0f4c40ce5e47756bef2f Author: Ivan Goncharov Date: Tue Oct 5 19:58:25 2021 +0300 16.0.0-rc.3 commit 577417319062f8ac330b314acc733211bdc09721 Author: Ivan Goncharov Date: Tue Oct 5 13:48:00 2021 +0300 Move validation of names into `GraphQL*` constructors (#3288) commit 22b95040951348edff7934447a060b5a06295c9a Author: Ivan Goncharov Date: Tue Oct 5 12:04:22 2021 +0300 assertValidName: share character classes with lexer (#3287) commit 0c7165a5d0a7054cac4f2a0898ace19ca9d67f76 Author: Ivan Goncharov Date: Fri Oct 1 17:40:16 2021 +0300 Improve documentation of validation rules (#3285) * Added missing documentation * Added links to GraphQL spec commit ac8f0c6b484a0d5dca2dc13c387247f96772580a Author: Ivan Goncharov Date: Fri Oct 1 13:37:30 2021 +0300 VariablesAreInputTypesRule: add test for ignoring unknown types (#3284) commit cb48918c603311b20f62e4e36d9f76158a9b5b64 Author: Ivan Goncharov Date: Fri Oct 1 12:30:34 2021 +0300 validation: restrict maximum number of errors to 100 by default (#3283) commit 5ed10eff2f9761862a5d025d06fd46b0761097a5 Author: Ivan Goncharov Date: Wed Sep 29 17:13:33 2021 +0300 integrationTests/ts: split tests into separate files (#3280) commit ec57f067eb15b0ce221c5af547ad1b2fb313e789 Author: Ivan Goncharov Date: Wed Sep 29 16:07:59 2021 +0300 Make 'extensions' non-optional in schema types (#3279) commit 564757fb62bfd4e2472e6e7465971baad2371805 Author: Ivan Goncharov Date: Tue Sep 28 13:55:33 2021 +0300 ESLint: enable some of the rules previously blocked by TS conversion (#3277) commit 44613ccb2d1c8e70625692ba01b30763bf38a994 Author: Ivan Goncharov Date: Mon Sep 27 15:22:45 2021 +0300 Update deps (#3276) commit 8261922bafb8c2b5c5041093ce271bdfcdf133c3 Author: Ivan Goncharov Date: Fri Sep 24 19:17:24 2021 +0300 type/introspection: add missing `__Directive.args(includeDeprecated:)` (#3273) commit e95ea9b77986fb4299ac12f423d2b501dcf52050 Author: Ivan Goncharov Date: Fri Sep 24 14:27:09 2021 +0300 collectFields/collectSubfields refactor and export as part of public API (#3272) Motivated by #3246 commit a05dcfc39c887e267a3985c5340aa5df7d9fe526 Author: Ivan Goncharov Date: Thu Sep 23 18:12:18 2021 +0300 isNode: check exact value of node's `kind` (#3271) commit f4efee9d5bea33ef690bcf4430e95b9fdb7a780c Author: Ivan Goncharov Date: Thu Sep 23 17:41:39 2021 +0300 visitor: speed up visitInParallel by dropping support for unknown nodes (#3270) commit 009142154a0471c442e41e2914dd94d8b6690ac5 Author: Arda TANRIKULU Date: Mon Sep 20 12:00:14 2021 -0400 Bring `visitorKeys` back (#3250) Co-authored-by: Ivan Goncharov commit 505b4f8eac7b9c52152fbb3cd0f594407da4140a Author: Christoph Zwerschke Date: Mon Sep 20 15:14:12 2021 +0200 lexer: Remove superfluous statement in `readDigits` (#3264) * lexer: Remove superfluous statement in `readDigits` * review changes Co-authored-by: Ivan Goncharov commit e6820a98b27b0d0c0c880edfe3b5b39a72496a62 Author: Ivan Goncharov Date: Thu Sep 16 14:24:28 2021 +0300 integrationTests: increase timeout to 60s (#3263) With previous timeout Webpack test was failing on CI from time to time commit ac9833e4358e1995729a6c54009781ea434d4354 Author: Ivan Goncharov Date: Wed Sep 15 18:19:07 2021 +0300 integrationTests: small refactoring (#3262) commit e88c58efc3cc56ec2353ef3153bd1f2302fdd629 Author: Tim Griesser Date: Wed Sep 15 10:17:31 2021 -0400 Add TResult to GraphQLFieldResolver signature (#3255) commit 9e584e3794e20dd109a165566ba86540ba039c3d Author: Ivan Goncharov Date: Wed Sep 15 14:37:54 2021 +0300 Error.toStringTag change return string from 'Object' to 'GraphQLError' (#3261) We maintained this hack for a long time to make our Errors compatible with with chai's `to.deep.equal` commit 2df59f18dd3f3c415eaba57d744131a674079ddf Author: Trevor Scheer Date: Sun Sep 5 21:07:13 2021 -0700 fix: Preserve `deprecationReason` on `GraphQLInputField`s (#3257) Co-authored-by: Ivan Goncharov commit 8423d33631ae63cdac460f1af67d24d37f694427 Author: Ivan Goncharov Date: Mon Sep 6 07:04:08 2021 +0300 Deprecate 'formatError' and added 'GraphQLError.toJSON' instead (#3259) commit da685ee1edcffe46bb6902ed48318f0f1905065e Author: Ivan Goncharov Date: Mon Aug 30 18:42:22 2021 +0300 Deprecate 'printError' function (#3252) commit 16b3d0404015ccf43a6792a55f1adfcf341e86f1 Author: Ivan Goncharov Date: Mon Aug 30 16:19:18 2021 +0300 16.0.0-rc.2 commit 976d64b7633c5b3e1123ae3f657804907d7a4800 Author: Laurin Quast Date: Fri Aug 27 15:25:44 2021 +0200 Parser: allow classes that extend Parser to access the instance attributes (#3248) commit 2d61e22a6eba93ab5efea69ec1de25e64a48dfec Author: Ivan Goncharov Date: Thu Aug 26 14:05:16 2021 +0300 16.0.0-rc.1 commit d32c5a1348b6d3d0bbede7fe063c56976c1903c3 Author: Ivan Goncharov Date: Thu Aug 26 14:02:08 2021 +0300 Update deps (#3244) commit 4bb273de4932ba81fc41bc6581415527df862205 Author: Ivan Goncharov Date: Wed Aug 25 15:39:06 2021 +0300 parser: add specialized error for extension with descriptions (#3242) Fixes #2568 Fixes #2385 commit 91bc70b64e533af7f442a4fd1207b56feef0ef02 Author: Ivan Goncharov Date: Wed Aug 18 12:25:13 2021 +0300 docs(buildASTSchema): add Subscription to list of root types (#3240) commit e5be298dff06d06830e967ec87f405a5d1fd0764 Author: Ivan Goncharov Date: Wed Aug 18 12:06:40 2021 +0300 execute: Forbid to return `null` from `serialize` function (#3239) Fixes #1579 commit 0fef3c49907b63b1ea5a4ff1da7011775f465fc2 Author: Ivan Goncharov Date: Wed Aug 11 22:48:03 2021 +0300 execute: Forbid to return `null` from `serialize` function (#3231) Fixes #1579 commit 4f21cdc1f1cbd5873735b8426f8aa8b2f8d5db8c Author: Ivan Goncharov Date: Tue Aug 10 16:22:33 2021 +0300 Add type params to GraphQLScalar (#3228) commit af878f32ad77587ed9234317f1f417ec2e416ade Author: Jan Melcher Date: Wed Aug 4 15:09:57 2021 +0200 Disallow "true", "false", and "null" as enum values (#3223) commit 5f86d693fdef398b451679b55bcf520265c568a7 Author: Ivan Goncharov Date: Wed Aug 4 15:37:31 2021 +0300 Fix failing CI on main (#3209) commit 6a5f51f3bd07f3914c7f1ec01908e9e325b77d58 Author: Ivan Goncharov Date: Wed Jul 7 17:54:40 2021 +0300 ci: generate diff for NPM package (#3207) commit 8ca3d896794a866e3de6fcba3109874cd84674d8 Author: Lee Byron Date: Thu Jul 1 13:45:36 2021 -0700 RFC: Support full Unicode in lexer (#3117) Depends on #3115 Implements RFC at graphql/graphql-spec#849. * Replaces `isSourceCharacter` with `isUnicodeScalarValue` * Adds `isSupplementaryCodePoint`, used in String, BlockStrings, and Comments to ensure correct lexing of JavaScript's UTF-16 source. * Updates `printCodePointAt` to correctly print supplementary code points. * Adds variable-width Unicode escape sequences * Adds explicit support for legacy JSON-style fixed-width Unicode escape sequence surrogate pairs. * Adds `printString` to no longer rely on `JSON.stringify`. Borrows some implementation details from Node.js internals for string printing. Implements: > When producing a {StringValue}, implementations should use escape sequences to > represent non-printable control characters (U+0000 to U+001F and U+007F to > U+009F). Other escape sequences are not necessary, however an implementation may > use escape sequences to represent any other range of code points. Closes #2449 Co-authored-by: Andreas Marek commit 4493ca3d1281e01635570824f70867aa68610323 Author: Saihajpreet Singh Date: Wed Jun 30 07:01:13 2021 -0400 build: add eslint-plugin-tsdoc (#3146) commit e8bc07b96583095c9599e75a358de65ad0e70594 Author: Ivan Goncharov Date: Tue Jun 29 11:06:32 2021 +0300 Update deps (#3206) commit d099942faf5a8b1348fdbce74a1e1d078a041582 Author: Ivan Goncharov Date: Tue Jun 22 12:49:05 2021 +0300 Replace 'Idx' with 'Index' in variable names (#3194) commit df1bddac6e7f2cef730b5c3695126820d075bbfd Author: Ivan Goncharov Date: Sun Jun 20 16:52:07 2021 +0300 build-npm: fix assert message about not supported tag (#3190) commit fff43395ef3c4c083793435d21b412ff7cc21c6d Author: Ivan Goncharov Date: Sun Jun 20 13:54:06 2021 +0300 instanceOf: add additional tests (#3189) commit 829acf01c0e38add817f0ab7af51b58bb6567054 Author: Ivan Goncharov Date: Sun Jun 20 11:43:24 2021 +0300 16.0.0-alpha.5 commit 85cc18edebb2208ea5bfb4c1695e15020025d2b0 Author: Ivan Goncharov Date: Sun Jun 20 11:37:30 2021 +0300 integrationTests: Add test for webpack (#3188) Motivated by #3178 commit dab4f44cd587c2cbb8760f9315f7501712058478 Author: Yaacov Rydzinski Date: Fri Jun 18 19:22:01 2021 +0300 refactor: collectFields to separate utility (#3187) commit 40db6398321832946ed649e6d5a5a91696d6c0d6 Author: Janic Duplessis Date: Wed Jun 16 03:25:04 2021 -0400 Export TypeKind as value (#3178) commit ffd815814e0403523ca3257237459c57f8d0e42a Author: Ivan Goncharov Date: Tue Jun 15 19:14:09 2021 +0300 Switch schema types to use ReadonlyArrays (#3182) commit 4d92729f664a50ea9a722e4b255cecc73a7ea72d Author: Ivan Goncharov Date: Tue Jun 15 18:34:11 2021 +0300 Switch tests & internal funcs to accept ReadonlyArrays (#3181) commit 2490f44babea37e6c58f82e622a7967c148347a9 Author: Ivan Goncharov Date: Tue Jun 15 18:25:16 2021 +0300 simplify validation harness by extracting union types into approriate… (#3180) commit f9bf263cf5e642d2af041bd92e7d249516390b4b Author: Ivan Goncharov Date: Mon Jun 14 20:29:13 2021 +0300 KnownDirectivesRule-test: add tests for missing directive locations (#3179) commit 1a9630684ed16076ba19cdb27442e12ae8285648 Author: Ivan Goncharov Date: Mon Jun 14 18:51:42 2021 +0300 kitchenSinkQuery: add '@onVariableDefinition' directive (#3177) commit 632c0d8b6bb232e98db4d3eac198b070c2ea8a50 Author: Ivan Goncharov Date: Mon Jun 14 18:20:14 2021 +0300 KnownDirectivesRule-test: remove dependency on harness schema (#3176) commit 0b7625f6f38f2245b38642e4c572712d5d5478be Author: Ivan Goncharov Date: Mon Jun 14 13:01:58 2021 +0300 TypeInfo-test: remove dependency on harness schema for validation tests (#3175) commit d39a7b5e42d33a33d99f8b732015389b311f4301 Author: Ivan Goncharov Date: Mon Jun 14 12:40:03 2021 +0300 ci: use update 'actions/setup-node' to v2 (#3174) commit 96fe0054d58b3444acd1c0eba22789b0c556c69b Author: Ivan Goncharov Date: Mon Jun 14 11:44:18 2021 +0300 16.0.0-alpha.4 commit 21b45a7eaf75e16700929959407f6282607b1e1f Author: Saihajpreet Singh Date: Mon Jun 14 04:40:29 2021 -0400 fix: broken link to prettier rules (#3173) commit 58122ef35f08175c8d054de427b49f570901536e Author: Ivan Goncharov Date: Sun Jun 13 20:25:50 2021 +0300 Avoid relying on constructor.name for instanceOf error check. (#3172) Fixes #2894 commit 81ca7781ec15e2d6b91d6146a3e545afb31af92b Author: Ivan Goncharov Date: Sun Jun 13 16:50:56 2021 +0300 Add 'Symbol.toStringTag' into every publicly exported class (#3170) commit 9a04b4ce15d82bbe0c86f43e43c3f6481d50ecee Author: Yaacov Rydzinski Date: Thu Jun 10 15:05:39 2021 +0300 allows passing --watch to npm run testonly (#3158) commit 28a382e74a9e86d6a1a0ed4267df592d6991fa9c Author: Ivan Goncharov Date: Wed Jun 9 17:03:16 2021 +0300 SingleFieldSubscriptionsRule: fix order of imports (#3167) commit d82c8e2aa603536c6a305b1c66fb329c4d086302 Author: Ivan Goncharov Date: Wed Jun 9 13:20:05 2021 +0300 SingleFieldSubscriptionsRule-test: extract test schema from harness (#3166) commit 120758aefeb33bc62a962d25e53634e16571678d Author: Ivan Goncharov Date: Wed Jun 9 13:03:54 2021 +0300 build-npm: correctly set NPM tag on experimental pre-releases (#3161) Example `v16.0.0-alpha.3.experimental-stream-defer.2` commit dc2a3eb4e7ee81b85dd14d2910f355a8b7844c5f Author: Yaacov Rydzinski Date: Tue Jun 8 12:29:08 2021 +0300 execute: Rename resolveField function and update comments (#3159) commit 6d71a1bc3239d8a2d2c8906fed8121f14be0b56b Author: Ivan Goncharov Date: Fri Jun 4 18:09:04 2021 +0300 versions-test: add support for experimental pre-releases (#3160) commit fd3ab05cccaa35db1fb3fac7b989a71c26c5aa73 Author: Ivan Goncharov Date: Fri Jun 4 01:58:51 2021 +0300 16.0.0-alpha.3 commit 88a2f4780f33918af0bcd8a5899f83bf03b69101 Author: Ivan Goncharov Date: Fri Jun 4 01:56:27 2021 +0300 package.json: fix generating release commit (#3157) commit d5eac891ccb2c0b27b5b38101448d8fc1c3d8f89 Author: Benjie Gillam Date: Thu Jun 3 18:51:43 2021 +0100 RFC: Assert subscription field is not introspection. (#2861) commit fd3d8c9fc5e80b23e2f151c818b94e77aef3922a Author: Lee Byron Date: Thu Jun 3 10:34:33 2021 -0700 Refactor Lexer (#3115) Co-authored-by: Ivan Goncharov commit 1ac35c4a7acb0d4f9b125737328ac19d6c6aed01 Author: Ivan Goncharov Date: Wed Jun 2 17:36:55 2021 +0300 tsconfig.json: enable 'isolatedModules' (#3154) commit 15148f8080f113899d61e79d7f9d8e987c32dc0f Author: Yaroslav Kukytsyak Date: Wed Jun 2 11:06:55 2021 +0200 Fix typescript-4.3 version in the integration tests (#3153) commit 10d26ccc3e6d45c668428ed6b173fce70caf9cbb Author: Ivan Goncharov Date: Tue Jun 1 19:00:20 2021 +0300 CI: Add new job to check health of package-lock.json (#3151) commit e08993aed2f71517f22d9c7d8c8a75d6668e0c92 Author: Ivan Goncharov Date: Mon May 31 11:48:19 2021 +0300 Update deps (#3149) commit d8478dc43fae917287f4e8445e58121c36b72a73 Author: Ivan Goncharov Date: Fri May 28 16:44:15 2021 +0300 ESLint: fail `npm run lint` if any warnings are reported (#3144) commit bf26a52257cc47513d8a0bd8219c57c8fd279d4a Author: Lee Byron Date: Wed May 26 22:27:24 2021 -0700 TS: Enable strict mode commit 69b4c59447b32c1014058ecd990e1880aa07e9c4 Author: Lee Byron Date: Wed May 26 22:23:48 2021 -0700 TS: Fix strict issues in src/error commit 8066ac9d411921fddf587c83ba3ec49a0786c080 Author: Lee Byron Date: Wed May 26 22:18:18 2021 -0700 TS: Fix strict issues in src/execution commit 26bf00ac34c8aaf14f30691508516c8485cb5853 Author: Lee Byron Date: Wed May 26 22:10:28 2021 -0700 TS: Fix strict issues in src/jsutils commit 2fadef3f32bbe438d0e4c99db08858ecbbebf1d5 Author: Lee Byron Date: Wed May 26 21:51:15 2021 -0700 TS: Fix strict issues in src/language commit a7f3cc68ba081745066b0642ec65522dd27cd46f Author: Lee Byron Date: Wed May 26 16:45:47 2021 -0700 TS: Fix strict issues in src/subscription commit ac7098505ac3f5485ad3ac79351f0e64175bde23 Author: Lee Byron Date: Wed May 26 16:25:38 2021 -0700 TS: Fix strict issues in src/type commit 5accb29e380bea1cf3bf15e372b73d50e7bf3b6a Author: Lee Byron Date: Wed May 26 15:23:18 2021 -0700 TS: Fix strict issues in src/utilities commit 6b95561bb2d76705944abd40a828d9284cafe46d Author: Lee Byron Date: Wed May 26 14:45:47 2021 -0700 TS: Fix strict issues in src/validation * Add `"strict": true` to tsconfig.json * Fix all issues that arise within `src/validation` commit c589c3d285cb1ec44b09bf0b50ec041ec083760c Author: saihaj Date: Tue Oct 27 10:11:59 2020 -0500 Temporary relax tsconfig and added bunch of error supressions commit 76e0607cd35e418ec4ed9105d0003af2c67e0b4f Author: Saihajpreet Singh Date: Sat May 15 10:54:07 2021 -0400 TS Migration: enable tests antd remove flow infra (#3091) commit f1f26dc48a192998240db136e55673efdf5e8434 Author: Ivan Goncharov Date: Mon May 24 14:46:03 2021 +0300 Extract TS specific changes from `*.d.ts` files commit 291784031d0dba584b608bd13a88ba40643f114d Author: Ivan Goncharov Date: Fri May 14 17:00:56 2021 +0300 Switch to TS syntax (#3090) commit daf11ba1d81cdeed55da255aed0333fd9efbdac7 Author: Saihajpreet Singh Date: Fri May 14 10:05:19 2021 -0400 Migrate to TS: rename `.js` to `.ts` and fix everything in latter PRs (#3088) using this `find src -name "*.js" -exec sh -c 'git mv "$0" "${0%.js}.ts"' {} \;` shell command renamed all files in `src` commit 2d3fcfa34e05351c942fc9df1e43e775df7534e2 Author: Ivan Goncharov Date: Tue May 25 03:45:30 2021 +0300 16.0.0-alpha.2 commit 544fe7be283d748683ec20f1674c4400431a73d8 Author: Ivan Goncharov Date: Tue May 25 02:40:10 2021 +0300 Synchronise `*.d.ts` with sources converted to TS (#3132) commit 5e062eaf28cf9c69d8a7fea411ea1f72e59ac7ec Author: Ivan Goncharov Date: Tue May 25 01:41:34 2021 +0300 TS: Drop template argument from GraphQLFormattedError (#3131) commit e4283043668dda1a1d4b66f38e4f590e1fec978c Author: Ivan Goncharov Date: Mon May 24 22:54:46 2021 +0300 coerceInputValue: add missing argument in function call (#3130) commit f1f3d8ea270295514af7b926f78b6ecc4bdf3190 Author: Ivan Goncharov Date: Mon May 24 13:39:34 2021 +0300 definition.d.ts: correct types (#3129) commit 82a9a6cca21fd7286e7b6211a1606af034a3a859 Author: Ivan Goncharov Date: Mon May 24 12:28:11 2021 +0300 definition: Remove deprecation comment (#3128) commit 4def93d03720fb1475b6fde58e2b9e7ff245db1a Author: Ivan Goncharov Date: Mon May 24 12:09:12 2021 +0300 Disable '@typescript-eslint/prefer-readonly' (#3127) commit ea267c7aa350d67a8fe217cd3ef91daeab79d519 Author: Ivan Goncharov Date: Mon May 24 00:46:08 2021 +0300 Restrict TS to files inside `src` (#3126) commit 4adac42649442fcd4545f5451734535fd662018a Author: Ivan Goncharov Date: Sun May 23 23:36:49 2021 +0300 TypeInfo: use explicit type for `getFieldDef` arg (#3125) commit 23a404b6b02210ac02d2f9308fb845fe1f7bfcc3 Author: Ivan Goncharov Date: Sun May 23 16:24:37 2021 +0300 src/type: correct order of import/exports (#3124) commit 667ad15a085d3d70c7f382400b241713c94b9fa9 Author: Ivan Goncharov Date: Sun May 23 16:17:14 2021 +0300 visitor: convert arguments descriptions to JSDoc comments (#3123) commit 4b1f920844191ac337120c67a2543f41fd02ca33 Author: Ivan Goncharov Date: Sat May 22 14:27:15 2021 +0300 valueFromAST: drop unnecessary 'void' since `mixed` already includes it (#3122) commit b4271c1bc0312974a1ef1d81029f704c9edbeafc Author: Ivan Goncharov Date: Fri May 21 19:45:07 2021 +0300 `*.d.ts`: Switch comments to comment to TSDoc (#3121) commit 1bd65a3efe5d4c7dad9c7d1e018610054a962e93 Author: Ivan Goncharov Date: Thu May 20 15:09:42 2021 +0300 subscription-test: add missing await (#3120) commit cffcec45029d0823aebd95b253846614231abde9 Author: Ivan Goncharov Date: Thu May 20 11:19:25 2021 +0300 Remove empty lines from '*.d.ts' files (#3119) commit d4ca2475162302bfbc29432a04cff35dceebd901 Author: Ivan Goncharov Date: Thu May 20 10:09:54 2021 +0300 TS: switch all imports to type imports (#3118) commit e591d0a1e158df03c3a842c7897a08fc232e6cf6 Author: Ivan Goncharov Date: Wed May 19 19:11:02 2021 +0300 Drop support for TS 3.7 commit 9a4a228bd6bdac6c006c2aaaed30106dc6e372a9 Author: Ivan Goncharov Date: Wed May 19 18:46:18 2021 +0300 gen-version: fix notice comment was polluting 'version.d.ts' commit b39b47d7ee34252432df0428cd8710407d02a2fb Author: Ivan Goncharov Date: Mon May 17 14:15:00 2021 +0300 OverlappingFieldsCanBeMergedRule: futher simplify 'PairSet' (#3108) commit 9b0514a093135e9437acbb858f642c49b290728e Author: Ivan Goncharov Date: Sun May 16 20:03:07 2021 +0300 getLocation: use more explicit `matchAll` instead of `RegExp.exec` (#3105) commit 558b0e0ecb4afbb4c0bc6bbe0094a0a39a48f26f Author: Ivan Goncharov Date: Sun May 16 18:41:22 2021 +0300 ESLint: fix config for '@typescript-eslint/no-throw-literal' (#3103) commit 941ca3f11ff2318fd76896b98c2b1007a007d937 Author: Ivan Goncharov Date: Sun May 16 16:09:36 2021 +0300 eslintrc: fix spelling mistake in comment (#3102) commit fb8a3cef8e663ae38b5c6bac331cfb46fb171c79 Author: Ivan Goncharov Date: Sun May 16 16:05:13 2021 +0300 Flow: remove unnecessary '%checks' (#3101) commit 27d519b4fcb00a09a18277c7121e20a9d2a2da91 Author: Ivan Goncharov Date: Sun May 16 15:58:14 2021 +0300 Flow: add missing arg name in function type (#3100) commit 7fb6c784a57dd42025fe3dc646eeaccad78fa5d3 Author: Ivan Goncharov Date: Sun May 16 15:46:48 2021 +0300 OverlappingFieldsCanBeMergedRule: refactor 'PairSet' (#3099) commit b029ef8e35d442fc8d6524b142a320956b60ae08 Author: Ivan Goncharov Date: Sun May 16 14:51:57 2021 +0300 mapAsyncIterator: simplify test case (#3098) commit a0670bced1a930b39cada78b397b354c41d388cf Author: Ivan Goncharov Date: Sun May 16 14:23:18 2021 +0300 Flow: use only type imports for importing types (#3097) commit 501b665fe30076daf17dd86e4ee9e93d9218ca10 Author: Ivan Goncharov Date: Sun May 16 14:10:14 2021 +0300 Flow: Remove inferrable types (#3096) commit e94c2fa42992bd58f92709189c1ccc4b203d11b5 Author: Ivan Goncharov Date: Sat May 15 19:09:40 2021 +0300 Update prettier to 2.3 (#3094) commit 11d71e4bc8ae5718def8ffc06a84cc19ca1a5bba Author: Ivan Goncharov Date: Fri May 14 16:09:32 2021 +0300 16.0.0-alpha.1 commit 39b69da863fca34f0e921bb9ac6a1b99797e17cf Author: Ivan Goncharov Date: Thu May 13 18:57:12 2021 +0300 Flow: switched to exact object by default (#3085) In preparation for TS migration commit 6fd56074295634a7362df055568a3cd4cb676e47 Author: Ivan Goncharov Date: Thu May 13 18:34:59 2021 +0300 getFieldDef: accept FieldNode instead of field name (#3084) commit 266f9fa7317b8ac1828fac7c36807badfff393b3 Author: Ivan Goncharov Date: Thu May 13 15:20:48 2021 +0300 execute: inline collectAndExecuteSubfields function (#3083) commit 0ebcb2f7af16e77481608cd6bbe5600b4e0e5d8d Author: Ivan Goncharov Date: Wed May 12 23:11:41 2021 +0300 collectFields: use ES6 collections instead of Object.create(null) (#3082) commit 86523ec5f80b459d43b6b16db80b185f903f49e5 Author: Ivan Goncharov Date: Wed May 12 14:11:43 2021 +0300 Flow: Replace force type conversion with explicit $FlowFixMe comments (#3081) In preparation for TS convertion commit 0bb8500f6f8f6f771d829579ec6eb1075f6f8eaf Author: Ivan Goncharov Date: Wed May 12 13:43:35 2021 +0300 Workaround for Flow issue with 'String.raw' (#3080) In preparation for TS migration commit 33ec4ef3d95aafeb7bb1261dba26e7795d68adfd Author: Ivan Goncharov Date: Wed May 12 13:31:29 2021 +0300 dedent: simplify implementation (#3079) commit 740de807adef1ca1bc50bece08594e6e688ca601 Author: Ivan Goncharov Date: Wed May 12 13:21:11 2021 +0300 babel: Stop transpiling optional chaining operator (#3078) commit 98dcac3e6a84156658601bfe303575f448e5fa14 Author: Lee Byron Date: Mon May 10 15:24:05 2021 -0700 Simplify printSchema directive printing (#3075) commit 78d5f832b6f4c11d7f0af8aab68ff4229ba4f46f Author: Ivan Goncharov Date: Mon May 10 21:08:55 2021 +0300 Improve naming 'err => error' and 'arr => array' (#3073) commit 3cfb2bef1673aa82b5ee2e25d2a0d183992f1aeb Author: Christoph Zwerschke Date: Mon May 10 15:23:38 2021 +0200 Improve grammar in execution error messages (#3068) commit bd5583c6b2e75461dff149e42838f1ba0b543797 Author: Ivan Goncharov Date: Mon May 10 15:10:33 2021 +0300 Flow: add missing names to arguments of function types (#3072) In preparation to TS convertion commit d695f530b3b94e3a37435a3eb5788e8f39b5fe1b Author: Ivan Goncharov Date: Mon May 10 12:43:28 2021 +0300 subscription-test: standardize generator names (#3070) commit 1af561f355d9cb1429b90701c600815f38caf92c Author: Ivan Goncharov Date: Mon May 10 11:55:25 2021 +0300 subscription-test: use separate dummy query type (#3069) commit 513eacc33ed29e389fa6790e3dba00dbc5f9aa83 Author: Lee Byron Date: Fri May 7 23:22:09 2021 -0700 Refine parse and AST to represent ConstValue (#3059) This adds: * ConstValueNode - A subtype of ValueNode which recursively excludes Variables * Improved syntax error when encountering variable in a const value * parseConstValue(): ConstValueNode * isConstValue(): ConstValueNode * Various refinements to AST types to use ConstValueNode (or a type which includes it) to better align to the spec. commit 5579180f4a659f9b6fc3083869b765c6630bcc50 Author: Ivan Goncharov Date: Sat May 8 09:14:22 2021 +0300 mapAsyncIterator-test: check that return value is passed on early return (#3066) commit 960f207390615588111a4cf0238e62403c9c7eed Author: Ivan Goncharov Date: Thu May 6 19:56:35 2021 +0300 mapAsyncIterator: refactor async iterator (#3064) commit 83751a9f638470211c7627e715ea9a77e4ee71a4 Author: Ivan Goncharov Date: Thu May 6 17:55:52 2021 +0300 mapAsyncIterator: refactor async iterator (#3062) commit 9ba6b1739c5b55790b4b0d8d0d122cbc58685fe0 Author: Lee Byron Date: Thu May 6 00:56:58 2021 -0700 Refine getNamedType() for Input and Output types (#3063) This introduces type definitions `GraphQLNamedInputType` and `GraphQLNamedOutputType` as the subsets of `GraphQLNamedType`, and adds function overrides for `getNamedType()` such that if an input or output type is provided, one of these refined subset types is returned. commit 2673bdf851a32a81e1dd609ecaab94b02725a98b Author: Ivan Goncharov Date: Thu May 6 08:52:52 2021 +0300 subscribe-test: general cleanup and simplify test setups (#3058) commit 2a040191db5444b18a5018f5fa1edeb953968066 Author: Lee Byron Date: Wed May 5 20:54:42 2021 -0700 Fix build commit 5010bb8a95a9acd914b7857c1163a5d381aec04c Author: Lee Byron Date: Wed May 5 20:44:46 2021 -0700 Add test for #3061 commit 002fb91b25c035403dbaf785cd04c3d1c6a2e004 Author: Lee Byron Date: Wed May 5 20:42:58 2021 -0700 Improve parser location API (#3061) This replaces manual assignment of `loc` on each node in Parser with a `node()` function. This simplifies the parser and also ensures the `loc` field does not appear at all when `noLocation` is provided. commit a4e9bc9bb8e05916ac926233394a164b5e129062 Author: Ivan Goncharov Date: Wed May 5 19:53:14 2021 +0300 Update deps (#3057) commit 44b32fceec61b6314269c3dc3d5618ec6dbef962 Author: Ivan Goncharov Date: Wed May 5 17:40:29 2021 +0300 Drop Node v15 (#3055) commit dba69acd5764edfe8b4f39118849ba40979677af Author: Ivan Goncharov Date: Tue May 4 22:54:37 2021 +0300 Test with Node v16 (#3054) commit 777c7e9fc564a8aeca9b935b1c786c5c10b40bd8 Author: Ivan Goncharov Date: Tue May 4 20:52:15 2021 +0300 Forbid non-ASCII characters in JS files (#3053) commit 676c775f6dcf5d4261a096cce5fd9dfba49d4861 Author: Ivan Goncharov Date: Tue May 4 14:50:10 2021 +0300 Fix Flow issues with Symbol.asyncIterator (#3043) commit 917befd7a54fe99d6141fa0ed92bc2b82544625f Author: Lee Byron Date: Mon Apr 26 23:59:41 2021 -0700 Generalize defineArguments() (#3050) Fields and Directives both define arguments according to identical logic. This generalizes that and shares the implementation across both constructions. commit 2d48fbbeb8718e4a0152d458145a9fe2111c0f8d Author: Kei Kamikawa Date: Wed Apr 21 00:27:35 2021 +0900 Use specifiedBy instead of specifiedByUrl (#3032) commit b9fd53bfc23124c26954e25de40ebb3b27bf9367 Author: Ivan Goncharov Date: Thu Apr 15 23:49:25 2021 +0300 Remove superficial usages of 'Array.from' (#3042) commit 947ca289828e071743412e53dcb14dfe8169dfc8 Author: Ivan Goncharov Date: Thu Apr 15 16:11:52 2021 +0300 Use correct terminology around iterators and iterable (#3041) commit a75e95b873575434910c215a69ddcc3ac9000ac2 Author: Saihajpreet Singh Date: Wed Apr 14 15:10:22 2021 -0500 simplify predicate-test type (#3039) Co-authored-by: Ivan Goncharov commit 33e3a33107ba59a99123332b7f227bf36016219c Author: Saihajpreet Singh Date: Mon Apr 12 18:02:18 2021 -0500 TS: improve types mapAsyncIterator-test (#3038) commit f1039240e0954273a85e28b05c598865c104778b Author: Ivan Goncharov Date: Mon Apr 12 13:08:54 2021 +0300 Update deps (#3037) commit f58b95349a582ad98c99bc4f5ef70a64251ebdc4 Author: Ivan Goncharov Date: Mon Apr 12 01:36:28 2021 +0300 integrationTests: test package with TS 4.2 (#3036) commit ff5419514feab989531d52d775b1cbe33e6ce51e Author: Ivan Goncharov Date: Mon Apr 12 00:05:55 2021 +0300 printSchema: replace array concat with spead + update comment (#3035) commit 264f758bf650aad67f57a5bd53d6771d61ef6713 Author: Ivan Goncharov Date: Sun Apr 11 23:53:41 2021 +0300 visitor-test: cleanup test for nodes with unknown kinds (#3034) commit 0460fe967fdfe0e541e8bf6b163af4c97518a52a Author: Ivan Goncharov Date: Fri Apr 9 16:50:58 2021 +0300 Drop experimental online parser (#3031) Drop in order to speedup and simplify TS convertion Plan is to clean it up (rewrite code, add tests, etc.) andd merge it back after 16.0.0 release. commit 7f40198a080ab3ea5ff3e1ecc9bf7ade130ec1bf Author: Ivan Goncharov Date: Mon Apr 5 00:54:19 2021 +0300 mapAsyncIterator: move promise resolution into mapResult (#3028) commit 541a058ebe17136118a619d351a9a49bfa9f333c Author: Ivan Goncharov Date: Mon Apr 5 00:25:58 2021 +0300 subscribe: drop mapping of AsyncIterable errors (#3027) commit 179e47912c1559530248fb1b713cfbdd3fad6dca Author: Ivan Goncharov Date: Sun Apr 4 22:23:18 2021 +0300 Switch some of 'Object.keys' to more modern ES6 constructs (#3026) commit 954913b42fd00f97b29f66ec8a75bd624395301e Author: Ivan Goncharov Date: Sun Apr 4 19:17:46 2021 +0300 subscribe: simplify root field extraction (#3025) commit 39581581acc184301cfbb0ee348d0f4b6a21a99f Author: Ivan Goncharov Date: Sun Apr 4 18:53:16 2021 +0300 subscribe: simplify by rewriting as async functions (#3024) commit 814169b3c805e93ca1b0ae216710e633e50ca894 Author: Ivan Goncharov Date: Sun Apr 4 16:55:23 2021 +0300 predicate-test: improve typecheck (#3023) commit 1ee3dc58a439dbd3fe0cd6658e6ad9232216c08f Author: Ivan Goncharov Date: Sun Apr 4 16:52:14 2021 +0300 memoize3: remove unnecessary mixed type (#3022) commit 657605c506af945b63940759d453f5d40db00d38 Author: Ivan Goncharov Date: Sun Apr 4 16:24:45 2021 +0300 gen-version: prettify source code (#3021) commit 7707f856a963be021a091a8f405d682d15186fca Author: Ivan Goncharov Date: Sun Apr 4 14:08:20 2021 +0300 Update deps (#3020) commit 60417a901ad7a71f69f0a7459454da54e0a1833a Author: Ivan Goncharov Date: Sun Apr 4 13:48:04 2021 +0300 inline-invariant: switch to use false instead of 0 (#3019) commit 142ca1ff1f411728624c57b1a0f013cc0d8adf44 Author: Ivan Goncharov Date: Sun Apr 4 13:27:42 2021 +0300 build: run prettier on generated files (#3018) commit 10bd6fec22f5e6aa06b7f7ce4e3c73e7a3a00399 Author: Ivan Goncharov Date: Sat Apr 3 20:21:05 2021 +0300 Update deps (#3017) commit 98feb57b9e0af59b3a0dfa5179565cb3acf4fa9e Author: Ivan Goncharov Date: Fri Apr 2 18:26:39 2021 +0300 printer-test: do more check on kitchen sink tests (#3016) commit 31b442eb0a499e88064a61cd9b131fb60747652c Author: Ivan Goncharov Date: Fri Apr 2 18:21:14 2021 +0300 printer-test: switch to dedentString (#3015) commit 665fc9c8ad8246f66ff672372a21346f6d7143c4 Author: Ivan Goncharov Date: Fri Apr 2 17:44:09 2021 +0300 mapAsyncIterator: simplify abruptClose (#3014) commit 382dfe2138c1ad39734d142a6f0b88010d8f3721 Author: Ivan Goncharov Date: Fri Apr 2 17:40:50 2021 +0300 mapAsyncIterator: simplify mapResult (#3013) commit 6c53a274f50ea7965e92fe314e95cef6bd57c440 Author: Ivan Goncharov Date: Fri Apr 2 17:33:21 2021 +0300 mapAsyncIterator: allow 'rejectCallback' to only be synchronous (#3012) commit 0f3e91f95507a98639d829edc00b5d54e5371935 Author: Saihajpreet Singh Date: Fri Apr 2 09:28:00 2021 -0500 testUtils: refactor out dedentString from dedent (#3010) commit 5ed55b89d526c637eeb9c440715367eec8a2adec Author: Ivan Goncharov Date: Thu Apr 1 16:41:46 2021 +0300 mapAsyncIterator: add default value for 'rejectCallback' (#3011) commit ecf732fe03df2dd5a355cc2c7912245164a48301 Author: Saihajpreet Singh Date: Wed Mar 31 11:05:16 2021 -0500 TS: use proper type for async generator (#3009) commit 953148684f3da79649729376665bd008771452b8 Author: Ivan Goncharov Date: Wed Mar 31 17:43:30 2021 +0300 ESLint: enable 'func-names' (#3008) commit 83525433ed580964764c925de6cd4ed25f419b53 Author: Ivan Goncharov Date: Tue Mar 30 23:18:05 2021 +0300 TS integration test: add check for possibility to refine extension types (#3007) commit 5974fefc461311a0d66b5aa87fe89f05c9a5e03c Author: Ivan Goncharov Date: Tue Mar 30 23:02:12 2021 +0300 ts: Switch extension values to unknown to match Flow types (#3006) commit 47e6bd185eb856e2541337324eac3b09c328b65d Author: Saihajpreet Singh Date: Tue Mar 30 14:46:40 2021 -0500 ts: switch to use ObjMap utility type (#3005) commit b800c57bd9f78ab23774430fc1c14f003bf1585f Author: Saihajpreet Singh Date: Tue Mar 30 13:30:09 2021 -0500 feat: add types for internal Parser class (#3002) commit 673cb95835185377b89fc6f9506941f53bdfe049 Author: Saihajpreet Singh Date: Tue Mar 30 13:29:34 2021 -0500 TS: use `unknown` (TS) for `mixed` (flow) (#3003) commit e0bd06f769d2ca1bc70c66e38d5b89cfb20807d2 Author: Saihajpreet Singh Date: Tue Mar 30 13:28:29 2021 -0500 GraphQLGrammarType: no need to code in d.ts can just export type (#3004) commit 71ba4c63ec07d24f7755796366fef78398185deb Author: Saihajpreet Singh Date: Tue Mar 30 12:42:56 2021 -0500 feat: add .d.ts for jsutils (#3000) commit 58b9cd5e418ea0925362245ba639a72f207b2983 Author: Saihajpreet Singh Date: Tue Mar 30 09:26:01 2021 -0500 fix: discrepancies between Flow and TS types (#3001) commit 2616dc797a8aed516bd51a746dbe015d66160e75 Author: Ivan Goncharov Date: Mon Mar 29 15:52:16 2021 +0300 tests: replace 'invariant' with 'expect' assertion whenever possible (#2999) commit 33c069ce64ebad1379d8c6a7937f98952ad40e63 Author: Ivan Goncharov Date: Mon Mar 29 02:36:03 2021 +0300 Simplify testing AST nodes in buildSchema/extendedSchema tests (#2998) commit 1e46389a1970bb3609f33029cfcf0a41f65ad999 Author: Ivan Goncharov Date: Sun Mar 28 23:13:45 2021 +0300 print/printSchema: remove trailing new line (#2997) Remove special behaviour for printing `DocumentNode` that added trailing new line. This change allows to tools to add newline only if it required by code convention or OS convention. Scripts and CLI tool can return previous behaviour by adding `\n`. commit a6a65b26d78d2656ac3eccce9cd70b15a23258c4 Author: Ivan Goncharov Date: Sun Mar 28 18:22:46 2021 +0300 extensionASTNodes: always populate with empty array (#2996) commit 491ddd50a3aa3ef9a2251d0dcf0dce312b3499ac Author: Ivan Goncharov Date: Sun Mar 28 17:48:59 2021 +0300 introspection-test: fix test to correctly check for exceptions (#2995) commit 326348ea6926dac0a72a4b719d2fec00326211e9 Author: Saihajpreet Singh Date: Sun Mar 28 09:04:23 2021 -0500 fix: update introspection types (#2991) commit d4bcde8d3e7a7cb8462044ff21122a3996af8655 Author: Ivan Goncharov Date: Sat Mar 27 12:33:30 2021 +0200 Update deps (#2993) commit c52b595f7571843efc5f78d9d9cd1760fbfb5366 Author: Ivan Goncharov Date: Fri Mar 26 02:32:07 2021 +0200 flow: Improve typings for exported definitions (#2992) commit d720b5bcfe1e80aedc947773308b56f10e81e31e Author: Ivan Goncharov Date: Thu Mar 25 16:50:17 2021 +0200 Switch instanceOf to be named export (#2990) commit 050c508645782fa5c5773d61cfb983b5e0674cc8 Author: Ivan Goncharov Date: Thu Mar 25 15:25:50 2021 +0200 Switch indexOf to includes whenever possible (#2989) commit 2f876b64b0eac728e6d6dc09b435090a67328757 Author: Ivan Goncharov Date: Thu Mar 25 13:08:50 2021 +0200 Replace 'Array.reduce' with 'for of' (#2988) Results in measurable perfomance increase and significantly lower memory usage in a few benchmarks. commit 494a3d294ab04f65ac3cdac66010d53e002db154 Author: Ivan Goncharov Date: Wed Mar 24 12:25:57 2021 +0200 Synchronise TS typings for graphql.js/execute.js/subscribe.js (#2987) Removal of positional args was done in #2904 but TS typings were not updated. commit 32a053bbf40e3fb713d3e68b82be1a2e94c8dd4d Author: Ivan Goncharov Date: Wed Mar 24 00:52:43 2021 +0200 benchmark: use more readable spelling of V8 flag (#2982) commit a50dbd24e7ee4ca60e4405bb5794385460ddb7db Author: Ivan Goncharov Date: Tue Mar 23 19:39:40 2021 +0200 printSourceLocation: simplifying by using padStart (#2981) commit 911013592710bed36b9c638aeb5081ac1e94d0f8 Author: Ivan Goncharov Date: Tue Mar 23 19:31:01 2021 +0200 internal: simplify 'exec' function (#2978) commit 540f33605ee047ab86e0d9666f4a60526d56ff0f Author: Ivan Goncharov Date: Sat Mar 20 15:03:56 2021 +0200 dedent-test: change test data to pass spell check (#2977) commit 4528057cf4af4abcbc40d747520e0edb769a049a Author: Ivan Goncharov Date: Thu Mar 18 15:44:12 2021 +0200 Remove deprecated `rmdirSync` usage from internal scripts (#2972) commit 00ef21739731d1ea7fc61e4294b5bec5a2e535f2 Author: Ivan Goncharov Date: Wed Mar 17 18:32:41 2021 +0200 benchmark: refactor args parsing code (#2971) commit c581573aa634b1a782ac73043b509b8a7f253f65 Author: Ivan Goncharov Date: Sun Mar 14 01:31:20 2021 +0200 Remove override of `node/global-require` rule for `resources` dir (#2970) commit f8155ac385a47def8eb5d4b41916029dbf2289be Author: Ivan Goncharov Date: Sun Mar 14 01:23:00 2021 +0200 ESLint: cleanup rule overrides (#2969) commit 5c323b99c26bf4fa793563427f01a5ac9e3ce75b Author: Ivan Goncharov Date: Sun Mar 14 00:23:33 2021 +0200 ESLint: Allow 'async' functions (#2968) ATM, minimal supported Node.js version is 12 so we drop this restriction commit 4f4135507f6c9121e6bd3ffb29f946b69af31136 Author: Ivan Goncharov Date: Sun Mar 14 00:20:11 2021 +0200 flow: improve typings of exported definitions (#2967) commit 8109e42dd6527f92cf244653acea12bc4cabe087 Author: Ivan Goncharov Date: Sat Mar 13 20:32:42 2021 +0200 blockString-fuzz: improve `lexValue` typing (#2966) commit afffdfeeb8d2f05b1030cdeeae49a0ffa9139d92 Author: Ivan Goncharov Date: Sat Mar 13 20:04:00 2021 +0200 parser: improve type checking of 'parseTypeReference' function (#2965) commit 26e4568df9d42d5f5a2568f5071fa7dd1bb755e2 Author: Ivan Goncharov Date: Sat Mar 13 19:55:07 2021 +0200 Simplified memoize3 and improve type checking (#2964) commit aa80e1b20999cad2b69a7a6f6d1db28594465f3e Author: Ivan Goncharov Date: Sat Mar 13 19:50:22 2021 +0200 printer: simplify printing of query short form (#2963) commit e6f20dae9205f0096fa2db26cef580683d053705 Author: Ivan Goncharov Date: Sat Mar 13 19:12:29 2021 +0200 flow-typed: fix unresolved types (#2962) commit 3f6034a3376410bbf1b1aa11c1d465a70c446544 Author: Ivan Goncharov Date: Sat Mar 13 17:55:07 2021 +0200 flow-typed: update Mocha typings (#2961) commit eb284011e3a2d11786ed5884d2e5f068c52eeb12 Author: Ivan Goncharov Date: Sat Mar 13 17:43:07 2021 +0200 Update deps (#2960) commit 3e916ef1969eadd2e770af536e7537860b236c81 Author: Saihajpreet Singh Date: Sat Mar 13 09:26:54 2021 -0600 feat: convert Thunk to ThunkArray and ThunkObjMap (#2955) commit 789a98afe963095e47ba5d3891ba33e88c68bbbc Author: Ivan Goncharov Date: Sat Mar 13 16:33:31 2021 +0200 ASTVisitor: use type intersection instead of type union (#2959) commit 2c2d87e7bfff5017cb712aa2febfbdf72dcbdbe5 Author: Ivan Goncharov Date: Fri Mar 12 20:07:28 2021 +0200 visitor: remove 4th form of visitor (#2957) Visitor in 4th form can always be written as 2nd form. This is PR part of general effort to simplify `visit` typings before TS migration. commit 3ce28cef725addeed3d58384e19b93c7b454911e Author: Ivan Goncharov Date: Fri Mar 12 19:43:02 2021 +0200 buildClientSchema-test: correctly wrap test case (#2956) commit fff5f7afdad9afba7ee5ef4b42c5a008afe4247f Author: Saihajpreet Singh Date: Thu Mar 11 14:46:26 2021 -0600 build: use node12 tsconfig (#2954) commit 50b6d97164d9fd734a329000db23c491d896f1d3 Author: Ivan Goncharov Date: Thu Mar 11 21:09:45 2021 +0200 type-validate: inline getAllNodes function (#2953) commit fe5f91e2c41b4d159741f04368945b3df490b0b6 Author: Ivan Goncharov Date: Thu Mar 11 21:00:30 2021 +0200 Restrict Thunks to support only ObjMap and Array (#2952) commit 386921165735914587c8316b9da46140175a2971 Author: Ivan Goncharov Date: Wed Mar 10 18:45:25 2021 +0200 Forbid null & undefined as return value of 'interfaces' thunk (#2951) commit 1df295e105d84aeec410c7c7605d6de94b411c21 Author: Ivan Goncharov Date: Wed Mar 10 17:22:42 2021 +0200 scalars-test: improve typings of function calls (#2948) commit fe9ea6db90a12c88d6372f88b61ca68e7aa3659b Author: Ivan Goncharov Date: Mon Mar 8 12:59:39 2021 +0200 valueFromAST-test: correct typings (#2947) commit 735975d4904c5d9cc93d0c0a02af181e8f02dfba Author: Ivan Goncharov Date: Mon Feb 22 15:22:36 2021 +0200 inspect: improve typings for `toJSON` call (#2938) commit 302f4b9dc7e829be88df5541efc576274806b86f Author: Ivan Goncharov Date: Sun Feb 21 17:45:50 2021 +0200 validateSchema: inline 'getAllNodes' function (#2937) commit 334ceb097c2705d97265c864531a3c8f2f64dcf4 Author: Ivan Goncharov Date: Sun Feb 21 16:40:29 2021 +0200 schema-test: use chai's `keys` instead of undocumented `key` (#2936) commit 5043f75779cca0fb594db14a8ce965d8ca51eedd Author: Ivan Goncharov Date: Sun Feb 21 15:49:59 2021 +0200 VariablesAreInputTypesRule: remove incorrect return type (#2935) commit d0eae6f01d9db840dd690074d1936e0a8a7082f7 Author: Ivan Goncharov Date: Sun Feb 21 02:40:48 2021 +0200 printer: use `wrap` util function in more places (#2934) commit b6b27896f96a626aa92ff1fbf192debfd41fc877 Author: Ivan Goncharov Date: Sun Feb 21 02:23:33 2021 +0200 printer: remove 'addDescription' wrapper (#2933) commit 45e33cefae831a9df2b1a9edebd03a85cdfb33ff Author: Ivan Goncharov Date: Sun Feb 21 02:00:10 2021 +0200 print: remove indentation inside of block strings (#2932) commit 090ba3629ac916a5d3278bba4b855f0c5ce30e39 Author: Ivan Goncharov Date: Sat Feb 20 20:05:09 2021 +0200 visit: remove template arguments for possible nodes (#2931) commit b67ed1759b06d415d1f6ab2201da3b1dc2059a4c Author: Ivan Goncharov Date: Sat Feb 20 19:53:38 2021 +0200 visitor: remove `visitorKeys` argument (#2930) commit 2af9885e5253b2ebbcf54db7df73837e9bac9f36 Author: Ivan Goncharov Date: Sat Feb 20 18:03:28 2021 +0200 integrationTests: always build npm packages before tests (#2929) commit 4498246990036656537357276a6c5ba4771f3017 Author: Ivan Goncharov Date: Fri Feb 19 17:56:18 2021 +0200 TS: Enable integrations tests for extending `GraphQL*Extensions` types (#2925) commit 995ea3a7ace7888502bee669c8dcecda520b0fa3 Author: Saihajpreet Singh Date: Fri Feb 19 03:49:56 2021 -0600 build: commit package-lock for drop support node10 (#2927) commit 0a10230466329327e69c4b50d9d6ead4c44df463 Author: Saihajpreet Singh Date: Fri Feb 19 03:49:21 2021 -0600 refactor: use regexp-exec (#2928) https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-regexp-exec.md commit 4e314be2483f50e657cc67cc7a1dfd37e04e6cce Author: Ivan Goncharov Date: Thu Feb 18 16:59:23 2021 +0200 cspell: disable progress and convert config to YAML (#2924) commit 8168a9a77b4a8e43e898f2d14551afa53b52b743 Author: Ivan Goncharov Date: Thu Feb 18 16:34:13 2021 +0200 Drop support for Node10 (#2923) commit bb58eb95482e5538d94fd70b5a2877b1a8d9bec4 Author: Ivan Goncharov Date: Mon Feb 15 23:06:11 2021 +0200 Update deps (#2922) commit 825ebd312269decd0ac3872a3346d85d5cb6e262 Author: Ivan Goncharov Date: Mon Feb 15 21:44:34 2021 +0200 Deprecate 'getFieldDefFn' arg of 'TypeInfo' and move it last (#2921) commit 920b45a2f1d9fd1322858f8aa56e5fa73959eda0 Author: Ivan Goncharov Date: Mon Feb 15 20:08:41 2021 +0200 Deprecate fragments with variables and reflect that in naming (#2920) commit 0f9d35c87c07fb43c0954d0b64d8eecb5663685b Author: Ivan Goncharov Date: Mon Feb 15 19:39:29 2021 +0200 Remove polyfills for 'Object.values' & 'Object.entries' (#2919) commit 0e52e54050e0da01ceac45f458056a5d54463044 Author: Ivan Goncharov Date: Mon Feb 15 19:25:15 2021 +0200 Drop support for older browsers (#2918) Older browsers can still be supported through transpilation and polyfills commit 31e84849d7b964a3fe61b4a89839087009984f5a Author: Ivan Goncharov Date: Mon Feb 15 19:20:35 2021 +0200 Drop support for non-iteratable ArrayLike objects (#2917) commit 33b14c50531b68ee48edd8f76074be8aed04763e Author: Ivan Goncharov Date: Mon Feb 15 19:16:45 2021 +0200 refactor: replace default exports with named exports (#2916) Co-authored-by: Saihajpreet Singh commit 49ad5d082ffb50b37bb1af9ecf1ee0a41212e2d6 Author: Ivan Goncharov Date: Sun Feb 14 20:03:36 2021 +0200 Drop support for TS before 3.7 (#2915) In preparation to future TS convertion commit b9c38ba169e646b9d21cd84339fa6c6b2cdabea6 Author: Ivan Goncharov Date: Sun Feb 14 19:54:59 2021 +0200 Remove Node's custom inspect function (#2914) commit 311ace5572ff25ad6c47196ff68ba9d8f0fe82e5 Author: Ivan Goncharov Date: Fri Feb 12 16:23:32 2021 +0200 Remove polyfills for Symbol (#2913) commit 5f753fbff5900fb9fd4f51ea4e2206bb16ffa5df Author: Ivan Goncharov Date: Wed Feb 10 08:34:30 2021 +0200 Drop 'Array.from' polyfill (#2912) commit 1898018601c9c8d065a33010d0fa8df47b9c012a Author: Ivan Goncharov Date: Tue Feb 9 18:48:44 2021 +0200 Remove 'isFinite' & 'isInteger' polyfills (#2911) commit 797094bfd19986fb25de95d2faee572243c495ac Merge: aa650618 68334942 Author: Brian Warner Date: Thu Feb 4 17:58:52 2021 -0500 Merge pull request #2908 from graphql/add-easycla Add EasyCLA instructions, replace FB CLA This is a trivial change, so I'll merge it directly. commit 68334942dac705e2b48dbb0c826e34e01fb6e4fb Author: Brian Warner Date: Thu Feb 4 17:49:57 2021 -0500 Fixes to satisfy the linter Signed-off-by: Brian Warner commit 0eb18955d212ca4ba63a5f2406a634876612152c Author: Brian Warner Date: Thu Feb 4 17:45:43 2021 -0500 Add EasyCLA instructions, replace FB CLA Signed-off-by: Brian Warner commit aa650618426a301e3f0f61ead3adcd755055a627 Author: Ivan Goncharov Date: Tue Feb 2 19:00:54 2021 +0200 Remove 'find' polyfill (#2907) commit ddb72644b65a52e25a70c9baa8653bb03d7f9c28 Author: Ivan Goncharov Date: Tue Feb 2 18:56:12 2021 +0200 Convert GraphQLList and GraphQLNonNull into proper classes (#2906) commit dc89262a5ecca0d48b3d5e54d5cb726762e358fd Author: Ivan Goncharov Date: Mon Feb 1 16:43:25 2021 +0200 resolveType: remove support for returning GraphQLObjectType (#2905) commit c0ff68e194d720a4abc8826e0a6561357dcce917 Author: Ivan Goncharov Date: Mon Feb 1 15:39:16 2021 +0200 Remove support for positional args in graphql/execute/subscribe func (#2904) Closes #2301 commit 0d2bd5499bf05921a8dcbfdfc40089a7992e53a4 Author: Ivan Goncharov Date: Sun Jan 31 14:40:29 2021 +0200 Removed parser support for legacy syntax (#2903) commit 3e2e2ccfc0c64e2300394d661eb20268ba792664 Author: Ivan Goncharov Date: Sun Jan 31 14:31:59 2021 +0200 Remove deprecated {GraphQLEnumValue, GraphQLField}::isDeprecated (#2902) commit ec2352a3801e9c9cf462447f79f9d7235f84b757 Author: Ivan Goncharov Date: Sun Jan 31 13:56:17 2021 +0200 Drop support for long deprecated comments as descriptions (#2900) commit 5d9b5bb8a0efec7efe25ca2f50399b9b8b998440 Author: Ivan Goncharov Date: Wed Jan 27 18:33:36 2021 +0200 Remove 'GraphQLSchema::isPossibleType' that was previously deprecated (#2898) commit 4e9c7334531c7b42acdf11d98bf16157bf54d159 Author: Ivan Goncharov Date: Wed Jan 27 18:00:44 2021 +0200 Remove 'findDeprecatedUsages' that was previously deprecated (#2897) commit b1287e4092a9dae0dbde72d4779a3de64c31f7dd Author: Ivan Goncharov Date: Wed Jan 27 17:55:06 2021 +0200 Remove deprecated rule aliases (#2896) commit a546aca77922beb2fee949ea0ad7c9234f7006fd Author: Saihajpreet Singh Date: Wed Jan 27 04:50:39 2021 -0600 ci: migrate master to main (#2881) commit 3bce13f652e4043d940df8eec29f79eef24b6215 Author: Ivan Goncharov Date: Fri Jan 22 22:42:19 2021 +0200 benchmark: fix temp dir creation (#2891) commit 4c560416672c80c6fdc23086398bb78ce00017c4 Author: Ivan Goncharov Date: Fri Jan 22 22:03:40 2021 +0200 Update deps (#2890) commit 57662ae83460bee94d208a971a81ef3b94d7be41 Author: Ivan Goncharov Date: Fri Jan 22 22:00:02 2021 +0200 Simplify isAsyncIterable (#2889) commit f0502f97a5e3934a4c46dad7a53b4f3fdbb5ae70 Author: Ivan Goncharov Date: Mon Jan 18 18:16:31 2021 +0200 Use correct flags for rmdir/mkdir functions (#2886) commit 34ddf388cd57dd99651554e1c241096575cc60fb Author: Ivan Goncharov Date: Sun Jan 17 15:51:47 2021 +0200 Update deps (#2884) commit 16d2535784da070a2c6801100b370ee89f1b0ade Author: Ivan Goncharov Date: Fri Jan 15 16:58:27 2021 +0200 Replace 'localeCompare' with function independent from locale (#2876) Fixes #2869 commit edbe218579889d6c08c6d1942f35218dbad47d54 Author: Saihajpreet Singh Date: Wed Jan 13 10:39:42 2021 -0600 fix: no need to mark param optional if default value is given (#2879) commit 661ff1a6b591eea1e7a7e7c9e6b8b2dcfabf3bd7 Author: Saihajpreet Singh Date: Mon Jan 11 06:21:28 2021 -0600 fix: type annotation cannot appear on a constructor declaration (#2878) commit 998bea680d6e11e1c055a400a887a9539de08f75 Author: Ivan Goncharov Date: Tue Dec 15 09:13:49 2020 +0200 Extract types for normalized configs into named types (#2868) commit cd273ad136d615b3f2f4c830bd8891c7c5590c30 Author: Ivan Goncharov Date: Wed Nov 25 00:26:20 2020 +0200 separateOperations: distinguish query and fragment names (#2859) Fixes #2853 commit 93e26db8ab7d3dff48f6fbdbff7b1464a141bb0d Author: Ivan Goncharov Date: Tue Nov 24 19:51:07 2020 +0200 separateOperations-test: refactor tests to look like snapshots (#2858) commit 3f129b50ac148ee5978fc32eee78fce3377b11c7 Author: Ivan Goncharov Date: Tue Nov 24 12:28:46 2020 +0200 introspection: Add missing support for deprecated input values (#2855) Fixes #2834 commit 8c6e7c7289882dd6b5bca8feaa435e7e6d18dba3 Author: Ivan Goncharov Date: Mon Nov 23 12:24:44 2020 +0200 introspectionFromSchema: enable 'specifiedByUrl' by default (#2852) commit ce03dab844b565cb50746592d9bb1994576960d9 Author: Ivan Goncharov Date: Sun Nov 22 17:16:26 2020 +0200 tests: update 'getIntrospectionQuery' tests to use custom matchers (#2851) commit 139d0f63f19a20077cba7399883e96ec4f0af87c Author: Ivan Goncharov Date: Fri Nov 20 14:40:45 2020 +0200 Update deps (#2850) commit 61c2b013d01666388fc7bd263d39ad62780b5833 Author: Ivan Goncharov Date: Tue Nov 17 01:33:27 2020 +0200 Add tests for supporting Iterable collections across the lib (#2847) commit d6ab262ed87112dbed89c404fab4fd32281b1d27 Author: Rob Richard Date: Mon Nov 16 18:21:02 2020 -0500 README: add instructions on using experimental features (#2849) Co-authored-by: Ivan Goncharov commit 00eab30fb269b6e2a4e8e61d097d3e249319420e Author: Ivan Goncharov Date: Wed Nov 11 17:51:58 2020 +0200 Update deps (#2844) commit cc146bc7d4c7d46950d4b43dcc051bc9eb058bdb Author: Ivan Goncharov Date: Thu Nov 5 16:58:36 2020 +0200 resources: use named groups in RegExp (#2840) commit 6e8ca04aff51a47f8378a234f4649f7aeb73514a Author: Ivan Goncharov Date: Tue Nov 3 22:33:43 2020 +0200 TS: exclude integration tests from root tsconfig.json (#2838) commit a5b95f0c2379916afed77ae21e9321ac19068183 Author: Ivan Goncharov Date: Fri Oct 30 23:30:22 2020 +0200 Flow: remove support for measuring Flow coverage (#2837) commit 49e32ba7c03bbc11819b89b52903b92efdf2031c Author: Ivan Goncharov Date: Fri Oct 30 22:26:19 2020 +0200 CI: test on node 15 (#2836) commit acbc7366ec7f4419072a3352fd11c9d85118f62d Author: Ivan Goncharov Date: Fri Oct 30 22:20:28 2020 +0200 Update deps (#2835) commit 4e722a80ca069ebb37aaf77f9c637dcf490b1c50 Author: Ivan Goncharov Date: Wed Oct 28 16:32:11 2020 +0200 build: add support for experimental releases (#2831) commit 975c150541b990a6b160afea6a8c52d990013f31 Author: Ivan Goncharov Date: Mon Oct 26 18:09:46 2020 +0200 15.4.0 commit 0bf5721b066877522854f1ce22d90c4f5356024c Author: Ivan Goncharov Date: Mon Oct 26 18:00:08 2020 +0200 Update deps (#2827) commit fc5e115d844ba3f07a3b116e2b9a0a946ec87bff Author: Ivan Goncharov Date: Mon Oct 19 23:46:04 2020 +0300 Update deps (#2825) commit 822616f4d7d6ab14b9fad3e92cb00c4076fc71cf Author: Ivan Goncharov Date: Mon Oct 12 19:06:32 2020 +0300 integrationTests: add Flow test (#2819) commit 711425eaf3baa3efa5da10e11ed76f58ec149ad7 Author: Forbes Lindesay Date: Fri Oct 9 21:59:31 2020 +0100 fix: ensure variance of types matches how values are used (#2786) Co-authored-by: Ivan Goncharov Co-authored-by: Arda TANRIKULU Co-authored-by: Arda Tanrıkulu <20847995+ardatan@users.noreply.github.com> commit c44104fe3ccb0b14c2cf4d736c5a979e7b66b482 Author: Ivan Goncharov Date: Fri Oct 9 23:41:19 2020 +0300 Cleanup '__fixtures__' leftovers (#2818) commit 7e79bbe5f2b0e971b5e5f6fe3e7b19c43dea9f35 Author: Ivan Goncharov Date: Sun Oct 4 03:56:01 2020 +0300 Convert fixtures to be JS files (#2816) commit 5d109ec32f60b593b721037cd2944d2c07420006 Author: Ivan Goncharov Date: Sun Oct 4 03:22:04 2020 +0300 Update deps (#2815) commit 607345275f60e07dba1b7156a23b9ddf8b086fc9 Author: Ivan Goncharov Date: Thu Oct 1 19:45:18 2020 +0300 benchmark: extract benchmarks into separate folder and run them on NPM package commit 3aad20bf1cccda59ccb8d855584097fcf7348fef Author: Ivan Goncharov Date: Sun Sep 27 14:16:13 2020 +0300 Update deps (#2810) commit ef2bf2f959dea0823ed64b334fa0bcaf78074b71 Author: Emil Sandstø Date: Thu Sep 24 15:30:19 2020 +0200 Update outdated documentation (#2806) commit b9cf5f3456d0cc3e3182a95f185c45489da5e677 Author: Mats Byrkjeland Date: Mon Sep 21 12:21:59 2020 +0200 Make print() break arguments over multiple lines (#2797) commit c2f97bbea242e5477ab6b10274bef61e1b377ba5 Author: dionisnote Date: Sun Sep 20 17:41:00 2020 +0400 Added check for specific symbols in polyfills/symbols (#2804) Co-authored-by: Ivan Goncharov commit 13ece495bb3fff39185a0ea5c671a28ad27c34f3 Author: Naman Kumar Date: Thu Sep 17 19:51:14 2020 +0530 Adding experimental online parser (#2770) * Adding experimental online parser * Improve Typings * Update grammar structure * Move rules to js * Fix build Co-authored-by: Ivan Goncharov commit 3b10b1703680eeaabc49b14ae473e42cb2f0e827 Author: Ivan Goncharov Date: Thu Sep 17 17:12:02 2020 +0300 integrationTests: remove shell command for copying files (#2802) commit 16009cbcb0109da03f2157a868817b886801095a Author: Ivan Goncharov Date: Mon Sep 14 17:39:53 2020 +0300 benchmark: switch to spawn intead of fork (#2799) commit 156c76ed77dc0d9b2dc3c988264d44763e8334aa Author: Ivan Goncharov Date: Thu Sep 10 10:41:55 2020 +0300 subscribe-test: remove dependency on Node's EventEmitter (#2796) commit 9305c044ae2cb40269f3823710b234bb8bc59c06 Author: Ivan Goncharov Date: Thu Sep 10 02:47:48 2020 +0300 subscribe: correct Flow definitions (#2795) commit 35f6df8693eaf9f484df8566f752a515aee4893b Author: Ivan Goncharov Date: Wed Sep 9 16:45:25 2020 +0300 Update deps (#2794) commit d6e760cf7060217bd25fa934bd104ff2400aad96 Author: Ivan Goncharov Date: Sat Sep 5 04:46:20 2020 +0300 resolveType: add workaround for transformed schemas (#2793) closes #2779 commit 64a5c3448a201737f9218856786c51d66f2deabd Author: Ivan Goncharov Date: Fri Sep 4 04:00:26 2020 +0300 Move `__typename` type resolution tests into appropriate file (#2791) commit b9433b4f7f3937615c587b1c154dac3f5aad8a0a Author: Ivan Goncharov Date: Fri Sep 4 03:56:04 2020 +0300 abstract-test: unify sync and async tests (#2790) commit 01bcc7d9be982226bcf56b8f983f38fd89dced1b Author: Ivan Goncharov Date: Thu Sep 3 23:38:20 2020 +0300 Allow deprecating input fields and arguments (#2733) commit 10127387dc057e578955a03757c24efb4a3b26ef Author: Ivan Goncharov Date: Thu Sep 3 18:31:55 2020 +0300 Update Flow (#2789) commit 4fc25e12f38ab101f8788d6b729b701c6c5e01fe Author: Matt Mahoney Date: Thu Sep 3 11:11:01 2020 -0400 Make specifiedByUrl in IntrospectionScalarType's flow type optional (#2788) commit 419449db77d8226e228d0f1e4911d64634e2ed0e Author: Ivan Goncharov Date: Thu Sep 3 12:51:23 2020 +0300 Update Flow (#2785) commit ef0f1abc3f8829da5ea99d626b6c0432e323d9ef Author: Ivan Goncharov Date: Thu Sep 3 11:32:41 2020 +0300 Change `devAsserts` for checking `source` argument (#2784) Motivation https://github.com/graphql/graphql-js/issues/2503#issuecomment-663626532 commit 3fa32c9856293352b03e6810553076cfce68f26f Author: Ivan Goncharov Date: Wed Sep 2 21:40:39 2020 +0300 LICENSE: Remove year from copyright (#2783) commit 748acff1fc4042a8113e55d719293f3ddcccaf4b Author: Ivan Goncharov Date: Wed Sep 2 21:03:43 2020 +0300 Update deps (#2782) commit c5f3459ad07ef94a3e1c2b0c21121752a91f2b4e Author: Ivan Goncharov Date: Wed Sep 2 20:58:05 2020 +0300 buildASTSchema-test: expend SDL descriptions test (#2781) commit 31d942e875afacec8a8a15132ca3a3f9d50dbe36 Author: Ivan Goncharov Date: Wed Sep 2 15:56:19 2020 +0300 buildASTSchema-test: expend SDL descriptions test (#2780) commit 4f26a6bc28032c068b4db7207ef077aec7c89902 Author: Ivan Goncharov Date: Tue Sep 1 21:13:13 2020 +0300 Add 'resolveOnNextTick' to use in tests (#2778) instead of Node.js specific methods commit fbe8402db3b7751c5b1340886c3b09a7f36aee58 Author: Ivan Goncharov Date: Mon Aug 31 17:16:40 2020 +0300 Remove polyfill for 'flatMap' (#2777) commit e5a2b776acacbb2fa7b03726d9b598aa4a57801b Author: Ivan Goncharov Date: Mon Aug 31 17:05:30 2020 +0300 Flow: add hack to support 'Symbol.asyncIterator' (#2776) commit f3e2954126e0005f7b01b2954071d4a91fd4f2b2 Author: Ivan Goncharov Date: Mon Aug 31 16:48:30 2020 +0300 Move 'isAsyncIterable' into 'jsutils' (#2775) commit ab329e9bd8abcaa9eac6d4fa793df9fd8989a3f6 Author: Ivan Goncharov Date: Mon Aug 31 14:44:46 2020 +0300 isCollection: add test that generator function is not iterable (#2774) commit 0531ecad539f7cc0ccbe29c52f46ffac8688138c Author: Ivan Goncharov Date: Mon Aug 31 14:26:48 2020 +0300 npm: CJS files now require other files using using explicit extensions (#2773) commit c0b911df81d3d81ba8cb899d60b3167cae4ed87b Author: Ivan Goncharov Date: Sun Aug 30 01:30:02 2020 +0300 Update deps (#2771) commit a29adf394447f98d0dd9b5d2958952be4d94023a Author: Ivan Goncharov Date: Sun Aug 30 01:21:48 2020 +0300 Update prettier (#2767) commit 2c319053b642dd8c40452ead4df398c99cb87c0e Author: Ivan Goncharov Date: Sat Aug 29 22:28:10 2020 +0300 parser: simplify a few utility functions (#2766) Also restore coverage back to 100% commit bbd8429b85594d9ee8cc632436e2d0f900d703ef Author: Ivan Goncharov Date: Sat Aug 29 21:45:43 2020 +0300 Flow: add more typings for function arguments and return values (#2765) In preparation for TS convertion since TS doesn't deduce types of local functions from their calls. commit fe27912e56dc257eca720e07fc84a4370236dd9d Author: Ivan Goncharov Date: Thu Aug 27 13:23:39 2020 +0300 Enable 'new-cap' ESLint rule (#2762) commit db57982e372e148687f2e4fe7fe2e0c5ea025d82 Author: Ivan Goncharov Date: Thu Aug 27 12:34:36 2020 +0300 Switch all code to create GraphQLList/GraphQLNonNull instances with new (#2761) commit 388cc9a74a514944d9e4b4e913669505aa393045 Author: Ivan Goncharov Date: Wed Aug 26 22:09:22 2020 +0300 parser: generalize parsing of lists with delimiters (#2760) commit 7afcaba4dc444b8934c4e44d9f57b7db3bc8884c Author: Ivan Goncharov Date: Wed Aug 26 21:58:24 2020 +0300 parser: improve formatting of the comments (#2759) commit fe3040fffe7f34c8f8b8e1cb849f09138debbfab Author: Ivan Goncharov Date: Tue Aug 25 17:13:17 2020 +0300 lists-test: simplify generator test (#2756) commit abcb3b3c52f4ef656d247b8645432ac295c82e7c Author: Ivan Goncharov Date: Mon Aug 24 23:09:37 2020 +0300 lists-test: remove unneeded async (#2755) commit dd52a152f53d2b0922d15f67beba9602895db2d1 Author: Ivan Goncharov Date: Mon Aug 24 04:08:51 2020 +0300 Update Flow (#2754) commit 94dc3348332ab91d00f5207dbc5ee01eb43731b7 Author: Ivan Goncharov Date: Mon Aug 24 03:52:21 2020 +0300 integrationTests: minimise test logs (#2753) commit 53c55330c60529b14df8fa494bfb0f91374c3642 Author: Ivan Goncharov Date: Mon Aug 24 03:17:59 2020 +0300 integrationTests: add TS 4.0 (#2752) commit 12dfd9321f7c2894c40732817670cb7053e3347a Author: Ivan Goncharov Date: Sun Aug 23 17:49:05 2020 +0300 Update deps (#2751) commit d6be64ce566d7db84e8a2b086d71e4d9a9850ff4 Author: Ivan Goncharov Date: Sat Aug 22 15:40:36 2020 +0300 Add 'TypedQueryDocumentNode' TS type (#2749) commit b83a9fe79a04f619b6bf07d63f9c839648d8366e Author: Ivan Goncharov Date: Sun Aug 16 00:23:48 2020 +0300 getBlockStringIndentation: simplify implementation (#2748) commit 6e0bc204b663e30faafcacf5090b7d21df58b76d Author: Adithya Krishna Date: Sun Aug 16 01:24:46 2020 +0530 Update CONTRIBUTING.md (#2747) Co-authored-by: Ivan Goncharov commit 7aab39c6a9df887136de8c3f7d0e9c9995b7319f Author: Ivan Goncharov Date: Thu Aug 13 17:37:24 2020 +0300 blockString-test: add test for not escaping characters (#2745) Closes #2569 commit a9a095e138b52ff4b989773fe9490f2bc7985bdb Author: Ivan Goncharov Date: Wed Aug 12 20:13:52 2020 +0300 parser: Export `Parser` class as unstable API (#2744) Fixes #2741 commit 5d4007c0800cf4ade92351369d173740a2bfef17 Author: Ivan Goncharov Date: Wed Aug 12 20:04:36 2020 +0300 integrationTests: add tests for supported Node versions (#2743) commit 217e530e4fc219d64ebe3dca2057b66d026475e0 Author: Ivan Goncharov Date: Wed Aug 12 09:40:37 2020 +0300 integrationTests: add tests for supported Node versions (#2742) commit 3460684118b55f8b13a33fd6987e76e8c12564af Author: Ivan Goncharov Date: Tue Aug 11 02:10:11 2020 +0300 Update deps (#2739) commit 842eeef487f8bf4179e07259245cd572a14cb877 Author: Ivan Goncharov Date: Sun Aug 9 02:49:51 2020 +0300 list-test: improve test readability (part 3) (#2738) Closes #1178 commit 4adfc6692cc20822845dfa91e1384e96e3e51d53 Author: Ivan Goncharov Date: Sat Aug 8 01:05:46 2020 +0300 list-test: improve test readability (part 2) (#2737) commit 2f86aff9df02175b0b9c84d0bbff8fe2754e86ca Author: Ivan Goncharov Date: Sat Aug 8 00:11:04 2020 +0300 list-test: improve tests readability (#2736) commit cadcef85a21e35ec6df7229b88182a4a4ad5b23a Author: Ivan Goncharov Date: Thu Aug 6 19:04:01 2020 +0300 execute/subscribe: simplify to improve debugging experience (#2731) Also move handling for error that not inherit from Error to `locatedError` commit b7900028e5beceec5b2d7affadda65de02ba895b Author: Dobes Vandermeer Date: Wed Aug 5 10:40:53 2020 -0700 introspectionQuery -> getIntrospectionQuery (#2718) `introspectionQuery` has been deleted and replaced with `getIntrospectionQuery` commit 171fbc142a17d187ab5d2ea7943c2719379ab231 Author: Ivan Goncharov Date: Tue Aug 4 21:38:06 2020 +0300 execute: simplify check for promises inside collections (#2729) commit 7b3241329e1ff49fb647b043b80568f0cf9e1a7c Author: Ivan Goncharov Date: Mon Jul 27 15:07:37 2020 +0300 Remove Flow file annotations & add missing 3rd-party typings (#2724) commit 7f38a5b487c7772edd64b107813223e4cda8b7b8 Author: Ivan Goncharov Date: Sun Jul 26 22:42:08 2020 +0300 Update deps (#2723) commit 19f2c5255280f78874559cab636f73838a01339e Author: Ivan Goncharov Date: Sat Jul 25 16:13:15 2020 +0300 NoDeprecatedCustomRule-test: simplify test cases (#2720) commit 65889192ae28969729385e24e76bbcc04d61e9c6 Author: Ivan Goncharov Date: Wed Jul 22 21:37:48 2020 +0300 Update deps (#2713) commit 6012d28b3b1fe8e002eefed9a3f013d4b352f08d Author: Ivan Goncharov Date: Wed Jul 15 14:39:20 2020 +0300 validation-test: Improve typings (#2710) commit dd3ed1ce455abf2386d31bfef5662f3725f10cd5 Author: Ivan Goncharov Date: Mon Jul 13 02:59:39 2020 +0300 introspection-test: improve testing of trivial resolvers (#2709) commit b14de0396809cf7d65c041879834d889c5b848b7 Author: Ivan Goncharov Date: Mon Jul 13 02:40:28 2020 +0300 introspection-test: simplify tests for description fields (#2708) commit 97de840e859d25a6800b19ec6367ce21074436de Author: Ivan Goncharov Date: Mon Jul 13 01:18:19 2020 +0300 introspection-test: convert schemas to SDL (#2707) commit 96c2d06f2076362c6572871e3027c20625149f00 Author: Ivan Goncharov Date: Mon Jul 13 00:37:58 2020 +0300 buildASTSchema: should match order of default types and directives (#2706) commit 9ad3bbb7219796b577df49c0d74cb8c7c2debd6f Author: Ivan Goncharov Date: Sun Jul 12 16:02:29 2020 +0300 lexer: Fix formatting (#2705) commit 40c7797ab5371452a1cd4dd0ce362d4911eae06d Author: Ivan Goncharov Date: Sun Jul 12 15:55:54 2020 +0300 readToken: improve readability by rearranging character groups (#2704) commit e86b4e49ce3d9be99a8081975b217e2090bdb352 Author: Ivan Goncharov Date: Sun Jul 12 15:23:54 2020 +0300 lexer: inline positionAfterWhitespace function (#2703) commit 0e93146192ceda6bf1a1e95cb571122e8e4ee05e Author: Ivan Goncharov Date: Sun Jul 12 15:10:48 2020 +0300 Improve readability of readToken function (#2702) commit e43d6d529c40b2b505829b7ea464576e287de73b Author: Ivan Goncharov Date: Sun Jul 12 00:45:34 2020 +0300 introspection: simpify 'includeDeprecated' logic (#2701) commit a86ffbbbb0996520e209741860a4c50e73694096 Author: Ivan Goncharov Date: Sun Jul 12 00:29:41 2020 +0300 Deprecate 'isDeprecated' (#2700) Fixes #2614 commit 698d86d2652f2cc13cdffaf94fbe8385451706db Author: Ivan Goncharov Date: Sat Jul 11 00:06:49 2020 +0300 Update deps (#2699) commit 6a5bc0c3fe37826a0c6f0a77a80e6cb50aa2cc78 Author: Ivan Goncharov Date: Fri Jul 10 22:04:44 2020 +0300 list-test: Simplify utility function (#2698) commit 5579fd28c5959cceed557ad631c241d1a3e4aa3c Author: Ivan Goncharov Date: Fri Jul 10 04:27:57 2020 +0300 Cleanup valueFromAST & valueFromASTUntyped tests (#2697) commit e3727fc3d5418f33b2447ca34ccd48d8f6d86aba Author: Ivan Goncharov Date: Fri Jul 10 04:14:18 2020 +0300 GraphQLScalarType: default 'parseLiteral' should handle variables (#2696) Motivation #2657 commit 9da7d354dc2a146415e17952125a7d8be3edca40 Author: Ivan Goncharov Date: Fri Jul 10 01:34:56 2020 +0300 Merge all tests for standard scalars into one file (#2695) commit 0e8804449bd833fe666114bb1040e54c23c74a76 Author: 고태완 <33471826+solidw@users.noreply.github.com> Date: Wed Jul 8 05:34:15 2020 +0900 docs: Changed how to import graphqlHTTP in graphql-express modules (#2693) commit d1f9bd645c5521d1d3e9aaa73e37185f456588c3 Author: Ivan Goncharov Date: Mon Jul 6 17:10:00 2020 +0300 Update deps (#2691) commit c9be8834c366ee014601c56c83c424d860ce5bb0 Author: Ivan Goncharov Date: Mon Jul 6 02:41:17 2020 +0300 Isolate integration tests from repository (#2690) commit 66e068f10f52ced4a1fa265f57bc8c6595ab7a7c Author: Ivan Goncharov Date: Mon Jul 6 00:59:13 2020 +0300 Update ignore files to ignore only top-level files (#2689) commit b7ec154cd1df7083dd0672e436a683b781de7178 Author: Ivan Goncharov Date: Sun Jul 5 21:59:58 2020 +0300 15.3.0 commit 0c660536c5c9f32ef275ef56fc1e93c5b7420c95 Author: Ivan Goncharov Date: Sun Jul 5 21:57:14 2020 +0300 Added new 'FormattedExecutionResult' type (#2688) commit fb042fcee9b3f9c4ae13ba4d8db5b7bd977524c1 Author: Christoph Zwerschke Date: Sun Jul 5 08:00:27 2020 +0200 Make documentation for 'getFieldDef' more accurate (#2687) commit c8b06142cb104c6c9da79a4d11b3309e99496b67 Author: Ivan Goncharov Date: Fri Jul 3 00:40:24 2020 +0300 ESLint: remove 'ts-lint' commits (#2686) commit fe94f5630767c7ee9cdc0369d064cdf9c0ae0703 Author: Ivan Goncharov Date: Fri Jul 3 00:24:58 2020 +0300 workflows: check commit for ignored files (#2685) commit b5c004634c7fcbbe0b74d8c530939c1bbd3efcc0 Author: Ivan Goncharov Date: Thu Jul 2 23:42:17 2020 +0300 Update deps (#2683) commit 38b4f9ebe0076325277689b851d92d4585cb49e1 Author: Daniel Rearden Date: Wed Jul 1 09:00:27 2020 -0400 Sync JSDoc comments with docs changes (#2681) commit 5aba9c9e946e221b4a0a05d69578756a9869928c Author: Ivan Goncharov Date: Tue Jun 30 18:33:13 2020 +0300 mapAsyncIterator-test: replace 'invariant' with expect chains (#2679) commit 11505d72b4332f936f2feea1742bc05441e692cf Author: rmcteggart-r7 Date: Tue Jun 30 16:25:45 2020 +0100 Docs: some language cleanup in readme and API reference (#2680) * Docs: some language cleanup in readme and API reference * Updates to docs language * Fixing grammar in API reference doc commit 1e1d75e9b7914abb66d91bfa0ae1de8612674628 Author: Ivan Goncharov Date: Mon Jun 29 20:14:18 2020 +0300 Update deps (#2678) commit 2fbdcff4c0ac9649c159348321847389fbf1e8f0 Author: Ivan Goncharov Date: Mon Jun 29 15:02:36 2020 +0300 15.2.0 commit 45033beb4f085920af9a2f9a7afb0c43d74e9160 Author: Ivan Goncharov Date: Mon Jun 29 14:53:17 2020 +0300 README: use local references (#2677) commit 7ee63b0672783d31141a967f982d407369930ae6 Author: Benjie Gillam Date: Sun Jun 28 15:36:23 2020 +0100 Change type of extensions from anonymous Record to named interfaces (#2465) commit b489677b6651f90a4564c570c43972f068f40c85 Author: Benjie Gillam Date: Sun Jun 28 15:34:25 2020 +0100 Add parentType to path to avoid path ambiguity (#2669) Co-authored-by: Ivan Goncharov commit 2232ebdef828566f3add3ed2a31709d3c1710c0e Author: Ivan Goncharov Date: Wed Jun 24 05:56:39 2020 +0300 Switch unused imports to type imports (#2674) commit ce3cc24e154623eb4777235b5b7140dfe17397ab Author: Ivan Goncharov Date: Mon Jun 22 22:17:58 2020 +0300 Remove swap file accidentally committed in #2560 (#2672) commit 8f3d09b54260565213a9aa0ce07fe145b2f7eb40 Author: Ivan Goncharov Date: Mon Jun 22 17:32:14 2020 +0300 Added 'executeSync': promise free version of `execute`. (#2671) Fixes #2610 commit 9735ac75254c8156b0830f8a0efa07fb35ad31cf Author: Daniel Rearden Date: Sat Jun 20 15:23:51 2020 -0400 Add NoDeprecatedCustomRule and deprecate findDeprecatedUsages (#2605) commit 00077f13ceb052bf3bca309e17cc0efcb9ae92a7 Author: Daniel Rearden Date: Mon Jun 1 15:55:52 2020 -0400 Add NoSchemaIntrospectionCustomRule commit 1597f5d89cd5350d262180a17d4d236e039af56c Author: Ivan Goncharov Date: Sat Jun 20 20:32:52 2020 +0300 buildSchema: allow to reference introspection types (#2608) commit 58aaa1df30b501b67d6986ea2fc1a8b95ac9fbca Author: Ivan Goncharov Date: Thu Jun 18 22:16:11 2020 +0300 Switch to alternative format for type imports (#2668) commit 275fe5218b3774ce6c68d73b58bae22a1996e319 Author: Ivan Goncharov Date: Thu Jun 18 17:34:44 2020 +0300 Run ESLint on the entire repo (#2667) commit 0e97527aa0a4b438ae351f0ba24bd65388e6f499 Author: Ivan Goncharov Date: Thu Jun 18 17:16:34 2020 +0300 Run cspell on entire project (#2665) commit b511dfc0635cb2ac18e9a850c3d3b066ace4dd64 Author: Ivan Goncharov Date: Wed Jun 17 22:11:05 2020 +0300 Simplify prettier config (#2662) commit df96f2a692d45e978e84741cab3db643a2d1d4d3 Author: Ivan Goncharov Date: Tue Jun 16 23:06:53 2020 +0300 union-interface-test: Improve typings (#2660) commit 0a18798e4d38332f14f9fe6f5ad78b05bc8bdccd Author: Ivan Goncharov Date: Tue Jun 16 22:28:55 2020 +0300 Update deps (#2659) commit c9b2507661398c8c8b42c4d56924792fd8ce2beb Author: Ivan Goncharov Date: Tue Jun 16 22:06:27 2020 +0300 Update Flow (#2658) commit 1fd47c9d032e2ed03320aca7e21767c7cc6de0a3 Author: Ivan Goncharov Date: Mon Jun 15 14:33:52 2020 +0300 Simplify ESLint config (#2656) commit e45fb12be43f25ab107d7f29821dcadfb30bbd2f Author: Ivan Goncharov Date: Mon Jun 15 14:15:20 2020 +0300 tests: Improve type coverage (#2655) Based on #2609 commit 012f9e2dfba5c431a43870aece22580575d72ac9 Author: Ivan Goncharov Date: Mon Jun 15 02:03:43 2020 +0300 Move prettier down in the order of tests (#2654) commit 2736f457b716b250c446b072c910f97e19943568 Author: Ivan Goncharov Date: Sun Jun 14 14:58:58 2020 +0300 Revert "instanceOf: support Deno (#2642)" (#2653) This reverts commit 916e69709f40808469dc1adfa47a989d3f229745. commit d67f1056953e663addac7f4677e028e95fb855ae Author: Ivan Goncharov Date: Sun Jun 14 13:03:16 2020 +0300 integrationTests: suppress warnings from 'npm install' (#2652) commit d1d476c5f99400c7468dd29547abcad4d535f459 Author: Ivan Goncharov Date: Sun Jun 14 00:42:01 2020 +0300 Cleanup TS integration test (#2651) commit 61fc0525a0559ed0409cc597d5cd3875329a07d5 Author: Ivan Goncharov Date: Sun Jun 14 00:30:19 2020 +0300 Remove dtslint check (#2650) commit 64a304b12012abe7f67032cf4e68735456ae2c82 Author: Ivan Goncharov Date: Sat Jun 13 22:31:03 2020 +0300 Integration tests for TS (#2647) commit 5be7ce3bbc3c73392f871b0de66782a39958c9c6 Author: Ivan Goncharov Date: Thu Jun 11 17:13:09 2020 +0300 ExecutionResult: add 'extensions' field (#2644) commit 916e69709f40808469dc1adfa47a989d3f229745 Author: Ivan Goncharov Date: Thu Jun 11 00:15:23 2020 +0300 instanceOf: support Deno (#2642) Motivation #2566 commit 862adb0677088fdc6babfe65bae26bf18c0108de Author: Ivan Goncharov Date: Wed Jun 10 23:18:22 2020 +0300 ci: use '.js' extension for deno build (#2641) commit 4b757201a79fe6cd2e1c140f7f30bb8b76b53599 Author: Ivan Goncharov Date: Wed Jun 10 23:09:58 2020 +0300 CI: use bash to run 'gitpublish.sh' (#2640) commit a723c29344c15c17423b2fc4c3646ce9956858d1 Author: Ivan Goncharov Date: Wed Jun 10 22:33:16 2020 +0300 CI: various fixes in 'gitpublish.sh' (#2639) commit 4a9b8bad6880fee63997913ff7e950014a936873 Author: Ivan Goncharov Date: Wed Jun 10 22:05:50 2020 +0300 CI: fix execution of gitpublish script (#2638) commit 8e835a07209bd3c46fbf7c3f2dd637e04ce4be8f Author: Ivan Goncharov Date: Wed Jun 10 22:00:26 2020 +0300 CI: fix publishing of `npm` and `deno` branches (#2637) commit eb1cfe23c64b6e3dc4211b2768995209a6627854 Author: Ivan Goncharov Date: Wed Jun 10 21:52:30 2020 +0300 CI: add initial support of Deno build (#2636) Motivation #2566 commit 75e0ec7e18a44b51df4ed39a207bbfa0c0cdf723 Author: Ivan Goncharov Date: Tue Jun 9 18:26:03 2020 +0300 Remove unintended 'console.log' (#2630) commit 9058ab46d347c4c134b1f8319e953ed9fcbf0475 Author: Ivan Goncharov Date: Mon Jun 8 23:11:43 2020 +0300 Update deps (#2627) commit f7061fdcf461a2e4b3c78077afaebefc2226c8e3 Author: Ivan Goncharov Date: Sun Jun 7 19:30:24 2020 +0300 15.1.0 commit 66eb9457a3942217ce9ebf79eee66e0b2204eb94 Author: Ivan Goncharov Date: Sun Jun 7 19:28:16 2020 +0300 TS: add TData template argument to ExecutionResult type (#2626) TS specific change. Motivation https://github.com/graphql/graphql-js/pull/2490#issuecomment-639154229 commit 64c0ed6b9b35563deded620ae8edd053de28851b Author: Ivan Goncharov Date: Sun Jun 7 19:23:36 2020 +0300 TS: made `GraphQLError` constructor's second argument optional (#2625) commit 7bf4daf7c89578d6aba559685a732837e293d8ef Author: Ivan Goncharov Date: Sun Jun 7 19:09:48 2020 +0300 ci: fail CI if coverage is not 100% but still upload to codecov (#2624) commit 20a8f555e7eaa5c2fa2fd188abcef83ee8169e7f Author: Ivan Goncharov Date: Sat Jun 6 19:00:48 2020 +0300 TS: sync TS typings with Flow typings (#2623) extracted from #2609 commit e4ecbe04d19a4a5396105dd9ff0c81dbdd5caa75 Author: Ivan Goncharov Date: Sat Jun 6 18:36:17 2020 +0300 getOperationAST: make `operationName` optional (#2622) commit f2c2b78fd937ed94557f8fe80a5418649991fd70 Author: Ivan Goncharov Date: Sat Jun 6 15:56:37 2020 +0300 Moved `Maybe` to `jsutils` folder and remove `tsutils` (#2621) commit ba2216c51dc92836d60238bdb5e166b59a0d4b1e Author: Ivan Goncharov Date: Fri Jun 5 22:16:04 2020 +0300 inline-invariant: stop inserting `// istanbul ignore next` comments (#2620) commit daf628d243364da003b161b31acf62a43cee6e4e Author: Ivan Goncharov Date: Fri Jun 5 18:42:00 2020 +0300 Improve formatting of 'istanbul ignore' comments (#2619) commit b4682e0ef06d434b9f38998a11a10b5be5a13e27 Author: Ivan Goncharov Date: Fri Jun 5 14:43:14 2020 +0300 schema-parser-test: Fix order of properties in expect chain (#2617) commit ae7d5465216dda88629a3f6283c0981fe68da50e Author: Ivan Goncharov Date: Fri Jun 5 02:23:04 2020 +0300 ci: remove Node v13 after it's end of life (#2613) commit b6fcdd647790f5068c682de2af1127489fe0e338 Author: Ivan Goncharov Date: Thu Jun 4 23:57:47 2020 +0300 ESLint: fix updated paths inside comment (#2612) commit 462c489856777c489662327368d0980f87346328 Author: Ivan Goncharov Date: Thu Jun 4 21:30:20 2020 +0300 Rename `eslint-graphql-internal` to `eslint-internal-rules` (#2611) This allows to copy paste this folder into other repos commit fe4f8ebf58768c42dd3309efa1beeacdb8fc5a9f Author: Ivan Goncharov Date: Thu Jun 4 10:19:20 2020 +0300 buildASTSchema: pass empty schema as literal (#2607) Empty schema constructed as `new GraphQLSchema({ directives: [] })` still contains introspection types commit 056a6e4469754ab1d4a5ba62482ace7d7ffc20de Author: Ivan Goncharov Date: Wed Jun 3 17:01:12 2020 +0300 Update deps (#2603) commit d10cf6c24b70d861ddb233272e86e1d5193529c2 Author: Ivan Goncharov Date: Tue Jun 2 19:32:51 2020 +0300 Update dtslint (#2602) commit 019b279c851a40c23d1d77c8ec8e807e1d36c6e4 Author: Ivan Goncharov Date: Tue Jun 2 19:20:21 2020 +0300 ci: update 'cache' action (#2596) commit 4f35752df58d99150ed6a9ba128984f902170537 Author: Ivan Goncharov Date: Sat May 30 12:21:21 2020 +0300 Update deps (#2595) commit eb0120a4d76e9a6b256cfe388715cfbe5ffa1a79 Author: Ivan Goncharov Date: Fri May 29 10:58:25 2020 +0300 Exported `Token` and `Location` as ES6 classes (#2594) Reported here: https://github.com/graphql/graphql-js/pull/2233#issuecomment-621312122 commit d31a3b9c7db4be6b25fb570db2e11d79fb0d0869 Author: Ivan Goncharov Date: Fri May 29 02:11:29 2020 +0300 package.json: remove yarn from engines (#2593) commit a1c7a9bd81dbfc96568ddc7bd3268a59cb3a4d72 Author: Ivan Goncharov Date: Fri May 29 02:07:16 2020 +0300 gitignore: remove unused entry (#2592) commit a3d2e95a4080729767fbdf7e04c4a31d1634f127 Author: Ivan Goncharov Date: Fri May 29 01:53:12 2020 +0300 Update deps (#2590) commit 7a327a6e2045e75c577be924694e6642d3e28e14 Author: Ivan Goncharov Date: Tue May 26 11:20:16 2020 +0300 ts: cleanup definition files (#2587) commit 1dbf65b425f81cac152c5b75efd856920c2c2798 Author: Ivan Goncharov Date: Mon May 25 23:08:02 2020 +0300 ts: used named export for 'Maybe' type (#2586) commit 4b7ab47c3f4ea6be99c3d9754b21fe626f7c7177 Author: Ivan Goncharov Date: Sun May 24 16:27:43 2020 +0300 ts: switch more types to interfaces (#2585) commit 5ceb8a6e9f57fb716abab0b18d6d364e024d7864 Author: Ivan Goncharov Date: Sun May 24 13:35:28 2020 +0300 ts: use `typeof` instead of private types (#2584) commit 4e6eef4cc130fd76c58eb8a0978df23369ca7f4c Author: Ivan Goncharov Date: Sun May 24 13:26:31 2020 +0300 ts: enable more tslint checks (#2583) commit 0e98824d2377be4e7070d51979c75827172981a5 Author: Ivan Goncharov Date: Sun May 24 02:37:23 2020 +0300 ci: add benchmark job (#2581) commit 10bd0d08dd1c30825ed741b748cd2d9e98477570 Author: Ivan Goncharov Date: Sun May 24 02:24:31 2020 +0300 resources: correctly report errors in top level premisses (#2580) commit cf9ee096f62f01c181dfe980a236dfdca1149934 Author: Ivan Goncharov Date: Sun May 24 01:16:45 2020 +0300 Update deps (#2579) commit e796c947119f490e2ae45fe11c72d415bdd15afa Author: Ivan Goncharov Date: Sun May 24 00:22:51 2020 +0300 CI: Fix copy-paster errors in 'fuzz' flow (#2578) commit 47ac276f21598db5690f287f2f0ea41bbdeef4ca Author: Ivan Goncharov Date: Fri May 22 21:22:43 2020 +0300 ESLint: Enable 'dot-notation' rule (#2576) commit 8a0346fbb5ad9bd2b21d6192c15ba36caf1eed43 Author: Ivan Goncharov Date: Fri May 22 15:55:41 2020 +0300 Move fuzzing tests into separate files (#2575) commit 541a44936a91e0fdeb7e8283db85662e0dd77fe7 Author: Ivan Goncharov Date: Fri May 22 13:26:52 2020 +0300 blockString-test: add fuzzing test for 'printBlockString' (#2574) commit 437cc1b9ebbc7390f1916574f588d77984b87d6a Author: Ivan Goncharov Date: Fri May 22 00:50:25 2020 +0300 ESLint: Forbid usage of test utils inside production code (#2573) commit 8be49f63293f7892dfa307902ecdbb5f80ecadb3 Author: Ivan Goncharov Date: Thu May 21 20:50:10 2020 +0300 Move `dedent` into new `__testUtils__` folder (#2572) commit 2a7d449028068297e8a487c5c35d665d8b06f297 Author: Christoph Zwerschke Date: Thu May 21 16:50:54 2020 +0200 Add missing exports for the new specifiedBy directive (#2571) commit 74ce729eddf7c777a1c500d63f1c4fce35e9f1cf Author: Ivan Goncharov Date: Wed May 20 19:35:09 2020 +0300 Enable linting for istanbul ignore comments (#2565) commit c63d64d9ea21187ec51c61e9a5a418d4836feb72 Author: Ivan Goncharov Date: Tue May 19 04:19:58 2020 +0300 package.json: use only exact versions (#2564) commit b1c41f90e821c082b5b3d31bc61ffb6288d5e4e9 Author: Ivan Goncharov Date: Tue May 19 03:11:04 2020 +0300 Update deps (#2561) commit 985a8e31e22f02847dc3d26cff340455e0d8b4a5 Author: Melissa Winstanley Date: Mon May 18 17:09:48 2020 -0700 TS: Fix incorrect enum typing in findBreakingChanges (#2563) commit 15e43b8b1ef47e6407cf1523379a9ac16ec3f0e5 Author: Naman Kumar Date: Mon May 18 13:18:46 2020 +0530 BlockString: print multi line for trailing backslash (#2560) commit e01cfa80a534cf13c693526888fe56e5ec46d86a Author: Christoph Zwerschke Date: Sun May 17 22:44:01 2020 +0200 Create base temp dir for benchmarks if not existing (#2558) commit cf89b852510947c64dbe7fd599124492a8319ad8 Author: Ivan Goncharov Date: Sun May 17 01:56:24 2020 +0300 Fix deployment to 'npm' branch (#2557) commit 161452059e7978047fec47bf377cd1708bbfd7fb Author: Ivan Goncharov Date: Sat May 16 19:23:34 2020 +0300 flowconfig: remove iterall from ignored (#2556) commit 7286b931ca9dcb5b263376794181c54611f0cbde Author: Ivan Goncharov Date: Sat May 16 19:16:17 2020 +0300 Update deps (#2555) commit aa3d8d8a9720a227cfbb0052e64f92fbf6ee496b Author: Ivan Goncharov Date: Sat May 16 19:01:01 2020 +0300 Switch to GitHub Actions (#2553) commit 6cbb494b192df903f267a52770a9f597b057c258 Author: Ivan Goncharov Date: Thu May 14 22:08:03 2020 +0300 Switch to 'package-lock.json' (#2552) commit de9a4b6aff41465d75e0162a97c69d99e3da9f40 Author: Ivan Goncharov Date: Thu May 14 21:39:20 2020 +0300 package.json: change how 'eslint-plugin-graphql-internal' installed (#2551) commit 83e0b8a8ece79f7cf44dcec43d54d29c69fdb7d2 Author: Ivan Goncharov Date: Thu May 14 20:09:58 2020 +0300 resources: cleanup scripts (#2550) commit e7878bc309743d0f0082754712eeeffb26cdd967 Author: Naman Kumar Date: Thu May 14 20:27:00 2020 +0530 [cspell] migrate custom words to upstream dictionaries (#2538) commit 45df65c7c57825918d2dd170ce6803d8b5129bcd Author: Ivan Goncharov Date: Thu May 14 17:09:30 2020 +0300 Update deps (#2549) commit 47345c51f7622b36db1e8efa94ced2545a3dce09 Author: Ivan Goncharov Date: Thu May 14 16:07:50 2020 +0300 cspell: correctly check 'resources' folder (#2548) commit ebcb1df0319b385da2f3d054c7ce7be6d6f7889c Author: Ivan Goncharov Date: Thu May 14 15:35:28 2020 +0300 ts: add missing `schemaDescription` option of `getIntrospectionQuery` (#2547) commit da023bbeb835a28c850d5e61f50bad543f4bd71d Author: Ivan Goncharov Date: Thu May 14 15:26:16 2020 +0300 ESLint: replace deprecated rules with `eslint-plugin-node` (#2545) commit 9032eb1f401dbe8f2ac0f83b0eccf12d838b8ae9 Author: Ivan Goncharov Date: Wed May 13 22:53:15 2020 +0300 Update deps (#2544) commit ea089e016f1526fb5b5137b5f8a8739ec17b322c Author: Ivan Goncharov Date: Wed May 13 16:10:42 2020 +0300 printSchema-test: cleanup and simplify (#2543) commit 9f800d236b08c8344fe453d28b2bd3add38ce812 Author: Ivan Goncharov Date: Mon May 11 17:51:46 2020 +0300 Switch to SDL for validation tests (#2540) commit 21fecc3647214822a95f8b88791ddbb1a4003df5 Author: Ivan Goncharov Date: Sun May 10 17:44:03 2020 +0300 extendSchema-test: improve test coverage (#2537) commit 4da21fa21c800ad91ab4a37fb07425c305610f9b Author: Ivan Goncharov Date: Sun May 10 00:43:22 2020 +0300 Update deps (#2536) commit 13ab792895c7056186fddee552d0db9776c735a3 Author: Ivan Goncharov Date: Sun May 10 00:35:20 2020 +0300 Make 'toJSON' definition explicit (#2535) commit 02d59dcb1bc5ab69077615433e4e278766e6eea1 Author: Ivan Goncharov Date: Sat May 9 18:54:41 2020 +0300 Simplify 'getOperationTypeNode' function (#2534) commit 9d4b433dc2fb151f4b00b5e7c789d75a9fe9841e Author: Matt Farmer Date: Thu May 7 08:37:53 2020 -0700 Add `@specifiedBy` directive (#2276) Co-Authored-By: christopher butcher commit 122b3051b4a8166f1f7bf06cfc4697d89f888806 Author: Joseph Cheung Date: Thu May 7 20:20:33 2020 +0800 Fix #2504 access field astNode's type by optional chaining (#2513) commit 6cd7f9478f0cfce9416f378be4feb33df7752939 Author: Michaël De Boey Date: Wed May 6 13:23:22 2020 +0200 Remove single quotes from Node.js versions (#2531) commit ab282fe5aeaf9048e694fb191e2c3d99249e0f71 Author: Michaël De Boey Date: Tue May 5 13:55:32 2020 +0200 Don't deploy on forks (#2530) commit e2c58be2305e829caa894f6f3b291480682971cb Author: Ivan Goncharov Date: Tue May 5 01:32:44 2020 +0300 Add node v14 to the test matrix (#2529) commit 6dc399dbdd63aa7841da95a20a8e9da905b60e43 Author: Ivan Goncharov Date: Tue May 5 01:06:00 2020 +0300 Enable '@typescript-eslint/no-invalid-void-type' lint rule (#2528) commit 685548f447b798c6b20af7a0fd940a850b0bf290 Author: Ivan Goncharov Date: Mon May 4 18:57:36 2020 +0300 Enable '@typescript-eslint/method-signature-style' lint rule (#2527) commit fd3ee12e3738e7adf01a92a3ceb0d0580375668e Author: Ivan Goncharov Date: Mon May 4 18:52:05 2020 +0300 Update deps (#2526) commit 278bde0a5cd71008452b555065f19dcd1160270a Author: Ivan Goncharov Date: Thu Apr 2 17:43:20 2020 +0300 v15.0.0 commit 57f9854456fefe6db9727188b03b19b05dfa813d Author: Ivan Goncharov Date: Thu Apr 2 17:34:39 2020 +0300 Update deps (#2502) commit 09cee7364d3523c01283e69ce6c1dbd9e7bec997 Author: Ivan Goncharov Date: Thu Apr 2 16:53:39 2020 +0300 Update Flow (#2500) commit a8f73dbfe0f76ff4eec4829a1426019a6df25eb2 Author: Ivan Goncharov Date: Thu Apr 2 15:06:40 2020 +0300 Update prettier (#2499) commit c155ae09e02d42d67373b2c7cae7ee6cf7a05fa2 Author: Ivan Goncharov Date: Thu Apr 2 13:41:17 2020 +0300 Move custom ESLint rules into internal package (#2498) Based on https://github.com/facebook/react/commit/30cce21ae6c4e960ea629908fc8c307e41e2bae8#diff-a7adbbe27ccec89b583ac77c28b521ac commit 157edcb4f7dfe9cb2acd3d82831430d983bbfbcf Author: Ivan Goncharov Date: Fri Mar 20 14:52:27 2020 +0200 TS: remove TS-specific TSource argument for resolveFieldValueOr… (#2491) It's internal function so not a breaking change commit aa4f85e059ea47a5f52cb6e4eb8b3deeeefac706 Author: Ivan Goncharov Date: Wed Mar 18 17:24:29 2020 +0200 TS: remove TS-specific TData from ExecutionResult (#2490) Reverts https://github.com/DefinitelyTyped/DefinitelyTyped/pull/26763 Since we can't gurantee that response match types it was basically glorified type cast. commit 95ad968268773986c338c8820664ca43fc95f7a2 Author: Ivan Goncharov Date: Fri Mar 13 15:12:47 2020 +0200 TS(definition): remove TS-specific TArgs (#2488) Was added in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/32694 Motivation for removal #2481 commit fe878eef98aba23df988e858dbafa029d6351bd1 Author: Ivan Goncharov Date: Fri Mar 6 23:40:08 2020 +0200 Update deps (#2476) commit 63c20097fb28e296066f6654d715456668d91d9c Author: Christoph Zwerschke Date: Fri Mar 6 14:43:52 2020 +0100 schema: fix error message when provided type has no name (#2475) Avoid confusing error messages about "multiple types named undefined". commit 905b7f3b7b0475689be5379dafe3d471071b312a Author: Ivan Goncharov Date: Thu Mar 5 00:46:14 2020 +0200 TS: fix typing for GraphQLField::deprecationReason (#2474) commit 23da3e8ecc57ae843d265462248328929c62dcb6 Author: Christoph Zwerschke Date: Wed Mar 4 17:17:55 2020 +0100 schema-test: fix name of test (#2473) commit 688f93c9153c1b69d522c130200373e75d0cfc7e Author: Ivan Goncharov Date: Mon Mar 2 20:18:16 2020 +0100 isDeprecated: make required on GraphQLField/GraphQLEnumValue (#2469) commit be654b550e4909d26c4e5adadc1d557a358d6543 Author: Christoph Zwerschke Date: Mon Mar 2 18:38:35 2020 +0100 Unite tests for graphqlSync in one place (#2462) commit d409a01bd8dcf97e07fbdb713f35654a4b263dff Author: Ivan Goncharov Date: Mon Mar 2 18:38:04 2020 +0100 Update deps (#2467) commit a5b20430808d7136b88dade3bc276e39335be927 Author: Adnan Labiadh Date: Mon Mar 2 17:12:09 2020 +0100 Docs: fix spelling error in src/README.md (#2463) commit 3f859d4e5e6088deea97193d5106382a901a9c21 Author: Ivan Goncharov Date: Tue Feb 18 18:31:21 2020 +0530 getNullableType: fix TS signature (#2460) partial revert of https://github.com/graphql/graphql-js/commit/23b427cacc3a6d16eb985ea3e5ab9b47d7a295d0#diff-15f6b6c92ff954f80995d31726f89851L477 Reported by @yaacovCR here: https://github.com/yaacovCR/graphql-tools-fork/issues/40#issuecomment-586671219 commit 268888bd1e096d7124e36634e2f84c7fbe9e5fdb Author: Ivan Goncharov Date: Mon Feb 17 18:36:46 2020 +0530 suggestionList: convert strings to arrays before calculation commit 4c10844f6f2ab3e2993d8d5f5f3ed97dce9d3655 Author: Ivan Goncharov Date: Sat Feb 15 20:06:14 2020 +0530 suggestionList: change threshold to be cofficient of input length Steal idea from TypeScript compiler: https://github.com/microsoft/TypeScript/blob/afddaf090ad8e3a4d3501ce91490b5552d1e4a42/src/compiler/core.ts#L1752 commit e545162176b604bac5d593d3bc2b21f41a12bd92 Author: Ivan Goncharov Date: Sat Feb 15 19:25:57 2020 +0530 suggestionList: micro-optiomisations commit 21e544d61123768c91fff3c6782c1886048bf00f Author: Ivan Goncharov Date: Sat Feb 15 14:06:44 2020 +0530 suggestionList: Add early exit for distances about threshold commit 122b741714ab8276e12d6281c9e36ae00a4b82d0 Author: Ivan Goncharov Date: Fri Feb 14 17:56:04 2020 +0530 suggestionList: use only 3 rows instead of full matrix commit bd4deb06029e234e78741d6ca8578eac45872410 Author: Ivan Goncharov Date: Fri Feb 14 17:50:36 2020 +0530 suggestionList: improve readability commit 02cd678e4b5ac5fbe945f7728b7301a363734b4f Author: Ivan Goncharov Date: Fri Feb 14 17:42:31 2020 +0530 suggestionList: fix transposition cost See: https://en.wikipedia.org/wiki/Damerau%E2%80%93Levenshtein_distance#Definition commit 4b4a09d3dbf90e2ba6e93b6dc547d6018697c9e9 Author: Ivan Goncharov Date: Fri Feb 14 17:26:51 2020 +0530 suggestionList: reuse matrix array commit 7a4cbbb1ab9c6ebba7cefb9752ee3fa075eb464a Author: Ivan Goncharov Date: Fri Feb 14 17:01:35 2020 +0530 suggestionList-test: improve readability commit e38ebb36805193c6a72d9ad568aaefda65acdd98 Author: Ivan Goncharov Date: Fri Feb 14 16:33:18 2020 +0530 suggestionList: improve test coverage commit 8152fb61d13d5a66e81f74a2fa942a2df77d61a6 Author: Ivan Goncharov Date: Fri Feb 14 17:18:20 2020 +0530 ESLint: move custom rule into CLI argument (#2458) AFAIK, the are no way to specify `rulesdir` inside '.eslintrc' config because of that IDE can't run ESLint with default CLI options commit ce5eb6c7cb2589c6bb676af156cc94b3eca56f15 Author: Ivan Goncharov Date: Fri Feb 14 16:43:06 2020 +0530 TS: add missing export on 'BuildSchemaOptions' type (#2457) commit 125d3823bc43bbee2ce872c8fcdab4fec412a240 Author: Ivan Goncharov Date: Fri Feb 14 16:35:02 2020 +0530 Update deps (#2456) commit d3bcaba506bfb26f6ca663fa0069dc83d3e77f26 Author: Ivan Goncharov Date: Thu Feb 13 20:16:49 2020 +0530 ESLint: enable 'eslint-import' rules for '.d.ts' files (#2453) commit 384c8e2348a0af33d4d1279159b970cfc012651d Author: Ivan Goncharov Date: Wed Feb 12 19:42:35 2020 +0800 Update deps (#2452) commit db214ce6e6a2ff9b722beee58cd1685afa62f7c0 Author: Ivan Goncharov Date: Mon Feb 10 23:52:01 2020 +0800 v15.0.0-rc.2 commit 93c1f3c31e917abfc6fa258e74938940cdf1de9f Author: Ivan Goncharov Date: Mon Feb 10 00:26:07 2020 +0800 validation: Fix names of internal SDL rules (#2448) Not a breaking change since these rules are internal. commit 7a5e7337fa1d924c1aaa8f9e50e901e8a2231434 Author: Christoph Zwerschke Date: Sun Feb 9 17:24:51 2020 +0100 Adapt some comments after serialization of enums changed (#2450) commit 2d1d4363dcdd143678b4748aa64d9d1cc3cd3d04 Author: Ivan Goncharov Date: Sun Feb 9 01:33:58 2020 +0800 Update deps (#2447) commit 4aa2d0ac3237693ba946d3f6b8e0491b23626dea Author: Ivan Goncharov Date: Sun Feb 9 01:25:05 2020 +0800 UniqueDirectivesPerLocation: check for directive uniqueness in… (#2446) Fixes #2440 #2442 commit f662f95931153db2c0d36659f2a4da4bfbf70c94 Author: Christoph Zwerschke Date: Sat Feb 8 14:27:53 2020 +0100 assertValidName-test: Remove duplicate test (#2445) commit b55b57531cd2b4d4f3f9518b5704f5ab299bc15e Author: Christoph Zwerschke Date: Sat Feb 8 14:27:41 2020 +0100 TypeInfo-test: use proper test name (#2444) commit c9850c1dab8811086e6fd8383508384e538b31fd Author: Ivan Goncharov Date: Sat Feb 8 14:34:54 2020 +0800 NaN values should be checked inside scalar's `serialize` method (#2438) We shouldn't have special casing for NaN since it masks programmer mistakes. Also it makes it imposible to implement custom scalar that can encode NaN. commit 200cb2882ebf9aef4e4cb523c0d944d2d425ae03 Author: Christoph Zwerschke Date: Sat Feb 8 03:41:29 2020 +0100 Fix the test for an async unmet isTypeOf check (#2441) commit ab42b5ebc4b7a13c10a270e6fda29332b43bde56 Author: Christoph Zwerschke Date: Sat Feb 8 03:32:14 2020 +0100 visitor-test: use proper test name (#2443) commit 4288c193fbde4b6e8733e6cbcb34bfa8deab429b Author: Ivan Goncharov Date: Fri Feb 7 01:12:18 2020 +0800 astFromValue: reject non-finite numbers (#2437) commit 4449dde1e58ce18f487b04688d6ba4375c4a793e Author: Ivan Goncharov Date: Fri Feb 7 00:54:06 2020 +0800 Update deps (#2436) commit c2943955ce71d4ae029cd612ad7052ab28d9c7bb Author: Ivan Goncharov Date: Fri Feb 7 00:43:35 2020 +0800 docs: Add note about 'NODE_ENV=production' (#2435) Motivation #2428 commit 096d18b146acaf5dd3cbdc147c2c32823c4cf668 Author: Ivan Goncharov Date: Thu Feb 6 23:26:35 2020 +0800 Benchmark: set 'NODE_ENV=production' before running the benchmarks (#2434) Motivated by #2428 commit 95aa3387b4ae18d31e6bd9211cf7dc13c8328576 Author: Ivan Goncharov Date: Thu Feb 6 22:36:34 2020 +0800 Flow: Remove 'any's or improve their locality (#2433) commit 791be1ae07457701818a5c89dca708053224e897 Author: Ivan Goncharov Date: Thu Feb 6 21:03:16 2020 +0800 parser: simplify parsing of null, boolean and enum values (#2432) commit 04470e0673493bf8fecd99090a361384191a35b1 Author: Ivan Goncharov Date: Thu Feb 6 19:42:49 2020 +0800 buildASTSchema: remove useless code (#2431) commit 9f8c2847dabb820359278c1d0b8c47a12a48d2af Author: Ivan Goncharov Date: Thu Feb 6 17:06:30 2020 +0800 Change 'toConfig' to always return 'extensionASTNodes' as array (#2430) commit 24d5690130798dd590a236cc4b0b95064232bdbb Author: Ivan Goncharov Date: Thu Feb 6 16:57:25 2020 +0800 Simplify 'concatMaybeArrays' (#2429) commit af480089b5fcaa961adb356ef1dca13cf475e75f Author: Ivan Goncharov Date: Wed Feb 5 10:32:58 2020 +0800 Rename 'schemaPrinter.js' to 'printSchema.js' (#2426) commit 9922fe7d96516644aeeed31b178193a40f06740e Author: Ivan Goncharov Date: Tue Feb 4 22:57:22 2020 +0800 nyc: exclude export files added only for deprecation (#2425) commit d72cd3dbb95b80c262dd531f5021400f25b28e09 Author: Ivan Goncharov Date: Tue Feb 4 22:37:34 2020 +0800 isValidNameError: Remove node argument (#2424) If you want to bind error to node please use `locatedError`: ``` const error = isValidNameError(name); if (error) { someFunction(locatedError(error, node)); } ``` commit 4150d1f51360a7981181cfec42a135394c7340f1 Author: Ivan Goncharov Date: Tue Feb 4 22:29:00 2020 +0800 Use nullish coalescing operator in all appropriate places (#2423) commit 468dfb5c9c06418b644cea1b2d7332fb9b73a100 Author: Ivan Goncharov Date: Mon Feb 3 23:42:21 2020 +0800 Use explicit default arguments (#2421) commit 733546126b1728a66b24de2de40fcf3e03995ac2 Author: Ivan Goncharov Date: Mon Feb 3 16:07:58 2020 +0800 Update deps (#2420) commit b883320afb0fae3318afe9da0b0c0da9eed4e6f7 Author: Ivan Goncharov Date: Mon Feb 3 15:09:07 2020 +0800 Add support for adding description to schema (#2419) Implements https://github.com/graphql/graphql-spec/pull/466 commit d680d071b2d568d4fe7f119f23aa37dd3a443920 Author: Ivan Goncharov Date: Thu Jan 30 23:09:28 2020 +0800 introspection: use consistent naming for 'resolve' args (#2418) commit 9d9f606654d12afa37048e04e9a36e65142f033b Author: Ivan Goncharov Date: Thu Jan 30 22:15:14 2020 +0800 schema-parser-test: fix description of a test case (#2417) commit cc4c363487e49b940e7b78b3e7cd8c8f9c8b0eec Author: Ivan Goncharov Date: Thu Jan 30 21:53:38 2020 +0800 introspection: Add support for repeatable directives (#2416) Code is taken from #1541 commit 69c4a09bdcbf382adeb611bc21b3c1dbbc90b191 Author: Ivan Goncharov Date: Thu Jan 30 20:23:26 2020 +0800 findBreakingChanges: add check for removing repeatable from dir… (#2415) Code is taken from #1541 commit 82c2eeaced53f09a2c4d4c395bada1ef132b019f Author: Ivan Goncharov Date: Thu Jan 30 18:14:04 2020 +0800 Update deps (#2414) commit dd95ec2b54281a11b967e97a257f02e3aef31678 Author: Ivan Goncharov Date: Thu Jan 30 15:00:36 2020 +0800 introspection: expose fields/values with empty deprecationReason (#2339) commit 46d64d3d3cecef37d0dd6cb2cfe6d8d2fc3e5a55 Author: Ivan Goncharov Date: Thu Jan 30 10:31:34 2020 +0800 validation: Export rules missing in <14.6.0 using legacy names (#2413) It's recommended to update to 14.6.0 and start using correct exports added in #2400 but if you stuck on the earlier version you can use these exports as a temporary workaround. Note: these exports are deprecated and will be removed in v16 commit 0bcef098073f1a41bc8c87fa482a05d463db52fc Author: Ivan Goncharov Date: Wed Jan 29 17:42:43 2020 +0800 Improve description for lexicographicSortSchema (#2412) Replicates https://github.com/graphql-python/graphql-core-next/commit/c61c65d264044504accaa6d76b21479a2af68205 commit 057510bb76b70f0d2ba4487add54f5d53f4c7d8e Author: Ivan Goncharov Date: Wed Jan 29 16:26:06 2020 +0800 schemaPrinter: preserve order of types (#2411) Fixes #2362 It's a step toward having reversable `buildSchema`: ``` sdl === printSchema(buildSchema(sdl)) ``` At the same time if you need fully predictable SDL output (e.g. to diff schemas) you can achieve this using `llexicographicSortSchema`: ``` printSchema(lexicographicSortSchema(schema)) ``` But if some reason you can't use `lexicographicSortSchema` please open an issue and describe your use case in more details. commit 68a0818b44f96e2ff18eb188eab815084ad8f211 Author: Ivan Goncharov Date: Wed Jan 29 12:55:11 2020 +0800 Schema: keep order of user provided types (#2410) Motivation: #2362 commit 665217848603b147be9b23c60bf3104cd4afbbc1 Author: Ivan Goncharov Date: Tue Jan 28 14:12:16 2020 +0800 schema: Always validate basic config structure (#2408) It introduces small perfomance penalty but simplify writing code around GraphQLSchema a lot. Also good long term solution would be to have separate dev and production (without `devAssert` checks) builds. commit 443b108b18eb27e79d0924a57754195789fe0eab Author: Ivan Goncharov Date: Tue Jan 28 13:48:22 2020 +0800 Fixing double 'Rule' suffix that was accidentally introduced in… (#2407) Big thanks to @trevor-scheer for reporting it here: https://github.com/graphql/graphql-js/pull/2402/files#r371545963 commit 4558f9bba0745139eb241b23e0e5ac191bdfa84d Author: Ivan Goncharov Date: Tue Jan 28 11:03:27 2020 +0800 buildClientSchema-test: remove dependency on order of types (#2406) commit 45892298b9e86b8e8a015ef9b193a1347705ee02 Author: Ivan Goncharov Date: Mon Jan 27 16:11:45 2020 +0800 FieldsOnCorrectTypeRule: improve type coverage (#2404) commit 819750c739a812e664f5f2526f378ca43266b0a1 Author: Ivan Goncharov Date: Mon Jan 27 15:36:58 2020 +0800 Update deps (#2403) commit 80471134f1152c69da2cc27518a127991cc801b9 Author: Ivan Goncharov Date: Mon Jan 27 14:16:39 2020 +0800 Add 'Rule' suffix to all validation rules (#2402) Long awaited change, see this disscussion: https://github.com/graphql/graphql-js/pull/808#issuecomment-294237716 Technically it's not a breaking change since only stuff exported from `graphql` and `graphql/validation` are part of public API. However, many tools/libraries depended on this "internal" imports to blacklist certain rules so in #2399 I added missing exports so now you can import them like so: ``` import { ExecutableDefinitionsRule } from 'graphql/validation'; ``` Also I backported missing exports to `14.6.0` release. If this change broke your code please try to migrate it as shown above and please feel free to open an issue if you need assistance with migration. commit 56daa9c180131bae31f5658a965c214ca8b5f109 Author: Ivan Goncharov Date: Mon Jan 27 12:10:16 2020 +0800 Add missing export for 'ExecutableDefinitionsRule' (#2401) commit 9ad68e9bae3282bff8a09b9be3736d349f79de33 Author: Ivan Goncharov Date: Sun Jan 26 22:56:50 2020 +0800 validation: Add missing rule exports (#2399) commit f7a78f59bcb32fa13314868659227bfb56a9816b Author: Ivan Goncharov Date: Sun Jan 26 22:47:46 2020 +0800 Drop 'babel-polyfill' (#2398) commit 588355e1e98df23e8475bbb6397555450609c013 Author: Ivan Goncharov Date: Sun Jan 26 21:41:44 2020 +0800 Update deps (#2397) commit 46a5ceee921d880913e5cab2d8bd8028571fed68 Author: Ivan Goncharov Date: Sun Jan 26 18:52:28 2020 +0800 Babel: switch to using .babelrc.json as config (#2396) commit 762642eb8e003140567ad3c9fcc28a9d6a8090c0 Author: Ivan Goncharov Date: Sun Jan 26 16:43:21 2020 +0800 FieldsOnCorrectType: implement stable sort order for suggested… (#2395) commit cdf9c835e0be4f8f313c2bd8710daad09e204869 Author: Ivan Goncharov Date: Sun Jan 26 16:26:43 2020 +0800 suggestionList: lexicographically sort options with the same le… (#2394) commit 744c20d7b4c413125190e201c54b42882fc20314 Author: Ivan Goncharov Date: Sun Jan 26 15:53:21 2020 +0800 FieldsOnCorrectType: refactor error message (#2393) commit 36a5052c799f90aaffd9f0c23ad6e10ed0c3da63 Author: Ivan Goncharov Date: Sun Jan 26 13:40:03 2020 +0800 ESLint: enable 'no-unnecessary-type-arguments' check (#2392) commit 82ea9ca26297dbeb6ea2ad18689e0a4869adc14d Author: Ivan Goncharov Date: Sun Jan 26 13:14:44 2020 +0800 buildClientSchema: small code refactoring (#2391) commit 23b427cacc3a6d16eb985ea3e5ab9b47d7a295d0 Author: Ivan Goncharov Date: Sat Jan 25 13:51:31 2020 +0800 ESLint: enable bunch of TS lint rules (#2390) commit d5a1ba8ce7a348860e814f6526feda1111dc018b Author: Ivan Goncharov Date: Fri Jan 24 16:49:38 2020 +0800 ESLint: enable all TS rules that require running compiler (#2388) commit e90d827053206e4193e3708cf0538f26e42fd67d Author: Ivan Goncharov Date: Fri Jan 24 13:21:15 2020 +0800 TS: switch to 'Array<*>' style of array types (#2387) commit f31f5050644c3d2925557be3b285032345e91920 Author: Alexander Knyazev Date: Thu Jan 23 15:12:37 2020 +0000 Change serialization for Int, Float and Boolean to work with objects (#2382) It is good to have an opportunity to pass objects which have valueOf() method in resolvers. For example, I have such objects as "Money", "Price" and so on in my app, and they have valueOf() method which returns a value. commit 9dba58eeb6e28031bec7594b6df34c4fd74459b0 Author: Ivan Goncharov Date: Wed Jan 22 21:01:38 2020 +0800 ESLint: Add all '@typescript-eslint/eslint-plugin' rules to config (#2384) commit be5268e3928c3e7217646a7c9c8921957e99a15c Author: Ivan Goncharov Date: Wed Jan 22 19:37:19 2020 +0800 tests: remove a few invariants (#2383) commit ec46d384e0a865a175b6e0caa0b63147d616525c Author: Ivan Goncharov Date: Wed Jan 22 16:46:36 2020 +0800 ESLint: enable 'import/no-cycle' rule (#2381) commit 4980779097f0b9e8d83b0c79e4645bba4eadc400 Author: Ivan Goncharov Date: Tue Jan 21 10:09:00 2020 +0800 build: mjs files import other files using full paths with exten… (#2379) Motivation #2277 commit 20b0d4199ebb8de8e5fe896954fec335fa97f072 Author: Ivan Goncharov Date: Mon Jan 20 23:57:36 2020 +0800 ESLint: ensure that all packaged code doesn't have any external… (#2378) commit add6c6de5e4940acf2923329f8e2dc7a52070ecc Author: Ivan Goncharov Date: Mon Jan 20 23:55:02 2020 +0800 ESLint: Forbid importing directories (#2377) Motivation #2277 commit d786d90f4e8fc43f92f9f1e1c133a10aa83e764b Author: Ivan Goncharov Date: Mon Jan 20 23:49:07 2020 +0800 ESLint: require empty line between import groups (#2376) commit f0c717c0423cefea6e4d7efab4b60a924b56d441 Author: Ivan Goncharov Date: Mon Jan 20 23:46:01 2020 +0800 ESLint: enable more rules for TS code (#2375) commit d4c82e0849318d045107321c6655c1a5da37b798 Author: Ivan Goncharov Date: Mon Jan 20 23:18:41 2020 +0800 ESLint: enable '@typescript-eslint/no-unused-vars' rule (#2374) commit d6109d648608c246862d3e43c609d088cc1233c5 Author: Ivan Goncharov Date: Mon Jan 20 23:08:35 2020 +0800 ESLint: Enable linting of TS files (#2373) commit 51e3f14eeeaaa62d45c5dc11f4eb0d589a7d3d77 Author: Ivan Goncharov Date: Mon Jan 20 23:02:04 2020 +0800 Restore coverage to 100% (#2372) commit f07ec241d51d7c3fb0263bb3ade1975dc87babc3 Author: Ivan Goncharov Date: Mon Jan 20 22:48:30 2020 +0800 Flow: enable 'sketchy-null-bool' lint rule (#2371) commit d447244fd2cec502dfe36fd0aa6cf5d65d60a382 Author: Ivan Goncharov Date: Mon Jan 20 22:42:06 2020 +0800 Update Babel (#2370) commit a9bf2f52a7ff5338ffa4c6f84e2ee60f01cd7571 Author: Ivan Goncharov Date: Mon Jan 20 22:32:40 2020 +0800 GraphQLError: convert to ES6 class (#2369) commit 1d85e4568710777fe54633c9ecf67bf044220c12 Author: Ivan Goncharov Date: Mon Jan 20 18:37:34 2020 +0800 Define 'toStringTag' directly inside class definitions (#2367) commit f9349e883a22b4234286a3af457c24c0627d923b Author: Ivan Goncharov Date: Mon Jan 20 17:50:56 2020 +0800 eslint-plugin-import: Enable more checks (#2366) commit a1d1d897f4b1b39a84f1aa9f2b07e133d4eba9d5 Author: Ivan Goncharov Date: Mon Jan 20 13:17:33 2020 +0800 Added 'eslint-plugin-import' lint rules (#2365) commit bde5e4a172c91ffb7992f8a7b0242fd80faf8e33 Author: Ivan Goncharov Date: Mon Jan 20 11:36:33 2020 +0800 Remove 'iterall' as dependency. 'graphql' becomes zero dependen… (#2364) We used only couple functions from 'iterall' and it's the only dependency we have at the moment. Having no dependencies significantly simplify ESM builds and Deno support in future Partially resolves: #2277 Bonus: All supported Node versions already natively support Array.from so it should improve perfomance commit c90c9a312ff0cc8d2266247b237d7cff75f9f376 Author: Ivan Goncharov Date: Mon Jan 20 11:06:28 2020 +0800 Use native "Symbol.asyncIterator" in tests (#2363) commit fe05d1b459bff715fd73c09a93d5b96537f3f361 Author: Ivan Goncharov Date: Mon Jan 20 10:39:11 2020 +0800 nyc: measure coverage of all files (except benchmark and polyfi… (#2361) commit 82efc7072ba7662f7cb22e68e622c605854bb506 Author: Ivan Goncharov Date: Sat Jan 18 16:29:51 2020 +0800 Upgrade flow to v0.116 (#2360) commit c429e28446a1eabdd66a09979dd337514696e145 Author: Ivan Goncharov Date: Sat Jan 18 16:20:45 2020 +0800 babel: Switch to static config to enable caching (#2359) commit c54e1411cc287aec8d290f147e025196f4c9bfa1 Author: Ivan Goncharov Date: Sat Jan 18 15:32:41 2020 +0800 Bring coverage to 100% 🎉 (#2358) commit 4d0601b3f22b635bfb442553b064baf464b60292 Author: Ivan Goncharov Date: Sat Jan 18 13:01:53 2020 +0800 subscribe: improve coverage (#2355) commit d951f46af588d43b2b1007e3474433ff4eb24107 Author: Ivan Goncharov Date: Thu Jan 16 23:34:17 2020 +0800 Remove unused "asyncIteratorReject" utility method (#2354) commit b418ad66f972ed693b3bb3fa62aa5e9bbdd2a320 Author: Ivan Goncharov Date: Thu Jan 16 22:48:04 2020 +0800 mapAsyncIterator: improve coverage (#2353) commit 8c7fe9de3f1412b49faa85aab4c626d11e399806 Author: Ivan Goncharov Date: Wed Jan 15 16:59:30 2020 +0800 OverlappingFieldsCanBeMerged: remove excessive caching (#2352) This caching is unneeded since fragment names are always collected into map and does contains duplicates, see: https://github.com/graphql/graphql-js/blob/6c377ac482e61b8179bb7dd0e44fa0ede8e1a91c/src/validation/rules/OverlappingFieldsCanBeMerged.js#L711 commit 0762193fe089e9a13460521e306c31a2d71ab0d9 Author: Ivan Goncharov Date: Wed Jan 15 16:50:00 2020 +0800 ValuesOfCorrectType: improve coverage (#2351) commit 34c5580334332711219c7fd38b65578fc0d7382b Author: Ivan Goncharov Date: Wed Jan 15 11:08:14 2020 +0800 astFromValue-test: improve coverage (#2350) commit 4623c3d5e7c096f7b1648d7ee30dd4a84a8e4153 Author: Ivan Goncharov Date: Wed Jan 15 02:02:39 2020 +0800 valueFromAST-test: improve coverage (#2349) commit 53afba18580c7b6d21cf90e497d78be2bca15113 Author: Ivan Goncharov Date: Wed Jan 15 01:54:52 2020 +0800 valueFromAST: fixed coercing of null variables on non-nullable… (#2348) commit f462347a391ad11481faf3a403bc455c8e55e558 Author: Ivan Goncharov Date: Tue Jan 14 20:42:52 2020 +0800 valueFromAST-test: improve readability (#2347) commit 6c377ac482e61b8179bb7dd0e44fa0ede8e1a91c Author: Ivan Goncharov Date: Tue Jan 14 16:57:29 2020 +0800 Update deps (#2346) commit a6c50deb671ba4197d6370dcca8a717a24d93435 Author: Ivan Goncharov Date: Mon Jan 6 18:43:48 2020 +0700 v15.0.0-rc.1 commit a9b38d73f3b21b3dac1d36c45e3989d66f873a8d Author: Ivan Goncharov Date: Mon Jan 6 14:49:12 2020 +0700 Flow: add missing typings on exports commit 7c3cf9cd58d5cdc4b67e195abf3558dd3b19c5ea Author: Ivan Goncharov Date: Mon Jan 6 13:40:08 2020 +0700 Update deps commit ac3448cd4ad14fac46cfcacd97b0cb74ff94ebdc Author: Ivan Goncharov Date: Mon Jan 6 13:13:16 2020 +0700 Update Flow to v0.115 commit 8057e3946b58ce1d56bcc81d2a14a237ad742fcd Author: Ivan Goncharov Date: Mon Jan 6 12:33:43 2020 +0700 enum: 'parseLiteral/parseValue/serialize' now throw on invalid values Continuation of #1821 commit 1c6b53e23c3d1da472aa9b3c6e6ac30cbbbded1c Author: Ivan Goncharov Date: Sun Jan 5 19:37:03 2020 +0700 Unify arguments naming for parseValue/serialize methods commit 4fcef75248a3db75da6080ed889ea2ce26a29928 Author: Ivan Goncharov Date: Sat Jan 4 22:32:16 2020 +0700 Improve coverage of the entire codebase commit 00495a29c8a921094ac569663940aeccfe0cb056 Author: Ivan Goncharov Date: Sat Jan 4 22:27:48 2020 +0700 OverlappingFieldsCanBeMerged: arguments always have value commit 62532a50531497973d0ec0053c97aa91edcb1220 Author: Ivan Goncharov Date: Sat Jan 4 22:23:46 2020 +0700 Simplify findDeprecatedUsages since "deprecationReason" is always present Also make tests more readable commit 6efefae94797da7852e7f44d694ab68a0b73d789 Author: Ivan Goncharov Date: Sat Jan 4 22:22:07 2020 +0700 coverage: mark ignore statements commit 883ac8d8b664792bcf94b84f7f427a8c51816c54 Author: Ivan Goncharov Date: Sat Jan 4 22:12:30 2020 +0700 Removes default values for required fields in GraphQL*Config types commit e590dd2b6f1d05085fbb057fe357be957378bcfb Author: Ivan Goncharov Date: Sat Jan 4 22:01:27 2020 +0700 coverage: ignore uncovered branches caused by #2203 commit 635a13c12e44edaa8143421eb77cf9ad53db2f6d Author: Ivan Goncharov Date: Sat Jan 4 21:54:57 2020 +0700 coverage: Clearly mark not reachable places in the code commit 642eeafdbea65a5c8f5238547e23cadb31264074 Author: Ivan Goncharov Date: Sat Jan 4 18:23:26 2020 +0700 Extract 'formatError' tests into separate file + improve coverage commit 28511bf33dcae491e8813dd5295f0c9e348151b3 Author: Ivan Goncharov Date: Thu Jan 2 13:53:58 2020 +0700 validateSchema: remove validation arguments uniqueness In both 'GraphQLFieldConfig' and 'GraphQLDirectiveConfig' arguments are specified as map and can't duplicate by definition. commit 0b068999579a9d882a4514890c1fe02da3c58a21 Author: Ivan Goncharov Date: Thu Jan 2 09:55:22 2020 +0700 tests: Transpile tests less aggressively Makes tests easier to debug commit e2a6f237b2b6bb9bc541b766e9ac3d6e9e4654ae Author: Ivan Goncharov Date: Mon Dec 30 21:55:59 2019 +0700 separateOperations: simplify algorithm commit b3b1b04d79847c76c55fd9ea4f352836180eb7cf Author: Ivan Goncharov Date: Mon Dec 30 17:49:28 2019 +0700 tests: in expect chains use '.to.not.' instead of '.not.to.' commit 576682fe691deaab79970ef103f3013508a4c587 Author: Ivan Goncharov Date: Sun Dec 29 14:43:06 2019 +0700 v15.0.0-alpha.2 commit 28b0de0f50b42802a41f1b96ce0b473ef98f0ce8 Author: Ivan Goncharov Date: Sun Dec 29 14:30:20 2019 +0700 Add 'yarn check --integrity' to 'preversion' script commit 8ea11f67b77f835ebd88b1a59716158351e6df6d Author: Ivan Goncharov Date: Sun Dec 29 12:56:49 2019 +0700 gen-changelog: Fix error handling and improve error messages commit 8ddef3331aa2bbf0293fffb7a72acc292fa44bc3 Author: Ivan Goncharov Date: Sat Dec 28 14:15:03 2019 +0700 extendSchema: inline ASTDefinitionBuilder class methods commit 96a4e7489b86e2afc7e2e653ea20d2255fbcd21b Author: Ivan Goncharov Date: Sat Dec 28 12:51:37 2019 +0700 buildSchema: optimise perfomance by extracting 'extendSchemaImpl' commit 3948aa20d9c38c5d4aff06f1b3af2538b20f909a Author: Ivan Goncharov Date: Fri Dec 27 17:01:59 2019 +0700 buildSchema: change implementation to simply extending empty schema commit f93bb6558d63ad0a30236eed16eb3b4baa1be0a8 Author: Ivan Goncharov Date: Fri Dec 27 17:03:46 2019 +0700 Mark 'config' as readonly argument to contructors (#2312) commit 3986defc8ad41d0e2a4cf1a66a4b3b1ba4fdf044 Author: Ivan Goncharov Date: Fri Dec 27 15:55:34 2019 +0700 Update deps (#2311) commit 1283c8431b561c529adfdfc0ade845fad2a09ade Author: Ivan Goncharov Date: Fri Dec 27 13:17:24 2019 +0700 buildSchema/extendSchema: add support for extensions (#2248) Fixes #922 commit fd0a3aac0fea9a41a89eed04db564594df6d023b Author: Ivan Goncharov Date: Fri Dec 27 11:14:15 2019 +0700 buildSchema/extendSchema: improve test coverage (#2310) commit 94b7e7289e4851a7ba045d4705e244f951aa3d74 Author: Ivan Goncharov Date: Fri Dec 27 10:57:51 2019 +0700 extendSchema: remove dead check on number of directives (#2309) `directives` are always array but it can be empty: https://github.com/graphql/graphql-js/blob/2d583c7f5e60853266545628fa71faa7351b1f71/src/type/schema.js#L131 So ATM this statement doesn't check anything. commit 2d583c7f5e60853266545628fa71faa7351b1f71 Author: Ivan Goncharov Date: Thu Dec 26 09:31:05 2019 +0700 extendedSchema-test: make tests self contained (#2308) commit 50da5d33b2a9c4c8f5c6dedf242d8abfb75a2dc3 Author: Ivan Goncharov Date: Wed Dec 25 17:18:24 2019 +0700 Add dots at the end of error messages (#2307) commit 390000eb5425cf24129def35d5e926baf206f93f Author: Christoph Zwerschke Date: Mon Dec 23 08:52:54 2019 +0100 Remove unmatched opening parenthesis in description (#2306) commit 2ae29f3aaff0f6ccfed22a19810ca8ceab70e2ea Author: Christoph Zwerschke Date: Mon Dec 23 08:43:34 2019 +0100 Small optimization in the schema type map reducer (#2305) commit e497731505c206f818ed4c57ea491cdccff424a0 Author: Ivan Goncharov Date: Sat Dec 21 17:56:11 2019 +0700 tests: simplify 'astNode' and 'extensionASTNodes' tests (#2302) commit 5ae523c0f92c88df69db3c4ecc0a13d4d71d8a24 Author: Ivan Goncharov Date: Fri Dec 20 13:35:44 2019 +0700 tests: Switch to using named arguments for `subscribe` calls (#2300) commit bacffcf60c9e0cf61612fa795d121693c32456a8 Author: Ivan Goncharov Date: Thu Dec 19 14:16:20 2019 +0700 Add spellchecker (#2297) commit e4ba457d72d87f6c7ad7115cf4454d4eb97ffc41 Author: Ivan Goncharov Date: Thu Dec 19 13:31:46 2019 +0700 More fixes to make spellchecker happy (#2296) commit 8394beea90cca956d50501ef398b2c5a064df560 Author: Ivan Goncharov Date: Wed Dec 18 12:44:32 2019 +0700 Correct bunch of spelling mistakes (#2295) commit d9d8a3cc49b494797dd233833f57872ba0e02341 Author: Ivan Goncharov Date: Wed Dec 18 11:57:02 2019 +0700 benchmark: make clean build every time (#2294) Caching build resulted in buggy behaviour when updating node version commit 24cfc472d0ae2b9d6460b0bd883772d8e67d0f9e Author: Ivan Goncharov Date: Tue Dec 17 23:59:43 2019 +0700 benchmark: extract 'bold' func for applying ANSI bold code (#2293) commit 47f9e677a75dda7726723f40bd506f6895431e6c Author: Ivan Goncharov Date: Mon Dec 16 20:09:45 2019 +0700 Add node v13 to CI (#2291) commit a4618c786c90c1be9eca241975450ed19df47f44 Author: Ivan Goncharov Date: Mon Dec 16 18:20:13 2019 +0700 Drop Support for Node 8 (#2290) commit a6c252b8640ba929ec8dfb3ac5a6877c759bd717 Author: Ivan Goncharov Date: Mon Dec 16 17:48:56 2019 +0700 Update Flow to 0.114.0 (#2289) commit 9063adee50d033e1333bee9ab9dfa3f6e868dd55 Author: Ivan Goncharov Date: Mon Dec 16 00:40:52 2019 +0700 test: Switch to using named arguments to graphql/execute (#2288) commit 7895fba729f9e9a62fb2cd3347ecaa5566eee255 Author: Ivan Goncharov Date: Mon Dec 16 00:26:51 2019 +0700 tests: Fix style of graphql queries inside string literals (#2287) commit fbed2c2356eeb83d84280ae3c0635eb54e04a419 Author: Ivan Goncharov Date: Sat Dec 14 11:47:37 2019 +0700 Replace all instances of Flow existential type (#2284) See: https://flow.org/en/docs/types/utilities/#toc-existential-type commit 58e2f5fb7c0e6f4e7ab4168030d975de7b1faa92 Author: Christoph Zwerschke Date: Sat Dec 14 05:43:14 2019 +0100 Remove forgotten internal error message functions (#2159) (#2285) commit e9193611fedbcc5193391b4404b6b8a0b698e826 Author: Christoph Zwerschke Date: Sat Dec 14 05:42:02 2019 +0100 Remove duplicate colon in coercion error message (#2286) commit 172c411e0245a36fbc7ad96abe80dc00c10a6a68 Author: Ivan Goncharov Date: Fri Dec 13 13:00:07 2019 +0700 Update deps (#2283) commit 538aa696c66c756af490462310ec31db9d82c319 Author: Matt Farmer Date: Sat Dec 7 04:10:26 2019 -0800 Remove outdated "Live Feedback" section from CONTRIBUTING.modif… (#2280) The `npm run watch` command was removed in commit c3dd670, making this section no longer valid. commit 4d60f40d6d21413854a56843b4980489aa80f56f Author: Matt Farmer Date: Sat Dec 7 03:53:56 2019 -0800 Update TravisCi to run full CI suite on Node 12 (#2279) Update TravisCi to run the full `test:ci` commands on Node 12, which was promoted to LTS on 2019-10-21 ([source](https://nodejs.org/en/about/releases/)). commit 61a07b1480327521d431f081773b82fc83189614 Author: Ivan Goncharov Date: Tue Dec 3 03:15:10 2019 +0200 Resolve import cycle by moving 'visitWithTypeInfo' into 'TypeIn… (#2274) commit 7e1c9edf9fbef44de0b1cb926d69fc95bb5f852a Author: Ivan Goncharov Date: Wed Nov 27 16:14:37 2019 +0200 Enable 'require-await' ESLint check (#2272) commit 5451d5e6e60eae34962172bb7c8b0e732fca62d2 Author: Ivan Goncharov Date: Tue Nov 26 17:44:29 2019 +0200 Update rest of deps (#2271) commit 52157dc5b44597d15d53775db867e9bc0b24aa1f Author: Ivan Goncharov Date: Tue Nov 26 01:34:22 2019 +0200 Enable 'default-param-last' (#2270) commit c4098e19b019b7c0c2e8c7a902438c52f4797f6e Author: Ivan Goncharov Date: Tue Nov 26 00:21:12 2019 +0200 Flow: switch more types to be exact (#2269) commit cadf66aff1dad5a5930a542986482d46a2a82c8f Author: Ivan Goncharov Date: Mon Nov 25 18:21:42 2019 +0200 ESLint: remove options that match default ones (#2267) commit fc327c58965d9766807fdf1bef7bec07da66cb09 Author: Ivan Goncharov Date: Mon Nov 25 17:20:53 2019 +0200 Update ESLint (#2266) commit c444416c1383494a30c77fa12609480e7d764821 Author: Ivan Goncharov Date: Sun Nov 24 21:05:17 2019 +0200 Update Flow to v0.112 (#2265) commit 205c49aa852a8dc3e8da8701d9a5a1b8def6d716 Author: Ivan Goncharov Date: Mon Nov 18 16:05:56 2019 +0200 Update prettier (#2263) commit 70ec03d8a7763ae00e2e33010e37a57ecdc4a61a Author: Pierre Carrier Date: Sun Nov 17 17:50:23 2019 -0500 TS: `introspectionTypes` should be array of `GraphQLNamedType` (#2261) commit ed2563bf0e1fdd5ea54d01ee30abecabc22c9a6b Author: Ivan Goncharov Date: Sat Nov 16 14:20:10 2019 +0100 ESLint: mark unused arguments with underscore (#2259) commit 53df69a2ee01fb6e8f150af98454ec5d95b759b7 Author: Ivan Goncharov Date: Thu Nov 14 18:28:16 2019 +0200 list-test: Remove 'argument' usage (#2258) commit f403ae9868e4d4d9a79f36306984685ce02b4493 Author: Ivan Goncharov Date: Thu Nov 14 18:01:57 2019 +0200 cleanup ESLint config (#2257) commit e9d7fc182b568dd6f06a026e4673838cc5f54b78 Author: Ivan Goncharov Date: Thu Nov 14 17:35:10 2019 +0200 docs: correctly tag code samples (#2256) commit da6411662ab2f7b7f0b6d03502d81a4b4923af1c Author: Benedikt Franke Date: Tue Nov 12 20:38:51 2019 +0100 Fix spelling: heirarchy to hierarchy (#2255) commit 9929e9f7a998e79a30a7bc524b5198114531447d Author: Benedikt Franke Date: Tue Nov 12 19:49:12 2019 +0100 Vary the test case for building client schemas with enum (#2254) Instead of repeating basically the same enum value five times, I changed the test to be less repetitive but have more variance in test scenarios. commit 96132b22758df89c28969e77565225f5cffdccf9 Author: Benedikt Franke Date: Tue Nov 12 00:26:16 2019 +0100 Consistent error messages in buildClientSchema (#2186) Consistent error messages in buildClientSchema commit 30ec30e41b50261b807c000cdc7c187d2dc6237c Author: Ardeshir81 Date: Tue Nov 12 02:10:08 2019 +0330 docs: follow express' best practice (#2252) commit 5b88392a38bb2290400e825a214cf5726a400302 Author: Ivan Goncharov Date: Thu Nov 7 12:54:59 2019 +0200 Update Flow to 0.111 (#2251) commit b9a55cd739b7870f0275296f0c360d6bfed7b848 Author: Ivan Goncharov Date: Thu Nov 7 11:39:00 2019 +0200 Update deps (#2250) commit 06bf19c490ad114e1d161bbae70bbcc799c86215 Author: Ardeshir81 Date: Thu Nov 7 02:48:01 2019 +0330 minor grammar fix (#2249) commit c0cf320d3a569c83166ac93d36b2dfb81ebb5b75 Author: Ivan Goncharov Date: Wed Oct 23 20:43:12 2019 +0300 grammar: 'falsey' => 'falsy' (#2238) https://developer.mozilla.org/en-US/docs/Glossary/Falsy > Sometimes written falsey, although in English usually turning > a word into > an adjective with a -y, any final e is dropped > (noise => noisy, ice => icy, shine => shiny) commit 2f5f71435fc7d5157b36128d4c11de7a56d5ad02 Author: Cameron Rollheiser Date: Wed Oct 23 13:40:59 2019 -0400 chore: Spelling (#2239) I was reading the documentation and noticed this spelling error. commit 658a38d12467a03f2a35dcc2c789761784db10a2 Author: Ivan Goncharov Date: Tue Oct 22 21:35:25 2019 +0300 Update deps (#2237) commit aa4511d682b3c34970076f2bfbc437b1116e99cd Author: Ivan Goncharov Date: Mon Oct 21 23:27:22 2019 +0300 buildASTSchema/extendSchema: unify directive building (#2236) commit 1fe12f4fc80e78db01ecf0a035b2c2e05a6a7e76 Author: Ivo Meißner Date: Mon Oct 21 15:08:28 2019 -0500 Fix typescript definition for getVariableValues (#2224) commit 66ac9632cdaa823df3c7d4caa5b17b87034449e3 Author: Ivan Goncharov Date: Mon Oct 21 20:25:02 2019 +0300 buildSchema/extendSchema: unify AST node processing (#2235) commit 8960d0d8d7b251a8031c988b1f70a3e962bd482c Author: Ivan Goncharov Date: Mon Oct 21 00:09:14 2019 +0300 lexer: convert Token to be an ES6 class (#2234) commit ec5fbb06bc2caaaa9c5659e3a25e5a165819cf91 Author: Ivan Goncharov Date: Sun Oct 20 22:32:44 2019 +0300 parser: convert Location to be an ES6 class (#2233) commit 82a0c336de05b4ab0d24d5557b56135c828fe888 Author: Ivan Goncharov Date: Sun Oct 20 17:15:43 2019 +0300 execute: Convert ExecutionResult to be an exact object (#2232) commit 9663938c7e976914bd55dc3939242dfd36457d4e Author: Ivan Goncharov Date: Sun Oct 20 17:02:22 2019 +0300 Convert more types to be exact objects (#2231) commit ae80dd3763ffd9bb1953349d522a8a3ddf23a5ea Author: Ivan Goncharov Date: Sat Oct 19 22:23:32 2019 +0300 Convert AST nodes types to be exact objects (#2229) commit c76a0786bc15f9c2622988e8017ec1f3d7e8770a Author: Ivan Goncharov Date: Thu Oct 17 20:11:30 2019 +0300 Update deps (#2228) commit 5cf9d31a20e9079a6ba6486623eb8871ba519676 Author: Ivan Goncharov Date: Thu Oct 17 17:26:03 2019 +0300 Update ESLint to v6.5 (#2227) commit 7d24b050e2e321f2973a2de4d2834b8494a6945b Author: Ivan Goncharov Date: Wed Oct 16 21:33:07 2019 +0300 Update to Flow v0.109 (#2226) commit 122f0e4ef7db1baadb8123a9fa6ecb86fa487894 Author: Ivan Goncharov Date: Wed Oct 16 21:00:50 2019 +0300 serialization-test: Don't use 'delete' on test objects (#2225) Resolves errors in Flow 0.109 commit 0eaa5e60bd34d3303fde14ecf328bc7b1cbfa1e9 Author: Ivan Goncharov Date: Wed Oct 16 15:07:19 2019 +0300 printSchema: don't break description lines (#2223) Fixes #2217 commit c7f11f3b95367247cc4ce3adb4c24313d2943c5b Author: Ivan Goncharov Date: Wed Oct 16 12:11:13 2019 +0300 ts: move '*.d.ts' files into 'src' (#2221) commit 2ffa10a09aa0ba7b6b01868336ffda67b288b3d1 Author: Ivan Goncharov Date: Tue Oct 15 17:17:04 2019 +0300 gen-changelog: add support for rebased PRs (#2220) commit bf210fbb31a091eaab37979ecc5c4041e9602e50 Author: Ivan Goncharov Date: Mon Oct 14 22:04:46 2019 +0300 v15.0.0-alpha.1 commit 2e130002d6633498b12b4048a476c1dfa35462c5 Author: Ivan Goncharov Date: Mon Oct 14 22:03:44 2019 +0300 version: Fix version test for alpha & beta releases (#2219) commit 93a2bace884513c7a984b1837928515b9e4bc740 Author: Ivan Goncharov Date: Mon Oct 14 21:38:41 2019 +0300 build: Add support for 'alpha' and 'beta' tags (#2218) commit 12957fc862502ab81d655d3163b7bcd28f5ce767 Author: Ivan Goncharov Date: Mon Oct 14 21:29:56 2019 +0300 Switch Lexer to be a proper class, remove 'createLexer' (#2210) commit 48ea2d3e8df5e4fbbdb5e0ce67c0a3c219b024f8 Author: Mike Marcacci Date: Tue Oct 8 05:45:41 2019 -0700 RFC: Allow interfaces to implement other interfaces (#2084) This is an implementation of the RFC described by spec PR #373 https://github.com/graphql/graphql-spec/pull/373 commit d85fc1186cca57fd3a74b93601a297e811b4bb13 Author: Brian Solon Date: Thu Oct 3 16:10:02 2019 -0400 Fix minor typos in gen-changelog.js (#2212) commit ed3ef8b4a75dfc642255715cd031d400825fc2ca Author: Ivan Goncharov Date: Tue Oct 1 18:00:03 2019 +0300 Remove unused 'ABORT_VALIDATION' constant (#2211) Fixes #2170 commit 730f5cc6e0c7b7994cb11fe1a9785700fa4dc5db Author: Ivan Goncharov Date: Tue Oct 1 17:46:16 2019 +0300 Change 'isSpecified*' & 'isIntrospectionType' accept only correct types (#2196) Fixes #2153 Previous disscussion: https://github.com/graphql/graphql-js/pull/1837#issuecomment-488250420 commit f36ca2548cd13dda53d4e2c6f4084164f562c832 Author: Ivan Goncharov Date: Tue Oct 1 17:10:59 2019 +0300 Lexer: remove passthrough options (#2209) commit 5eb7c4ded7ceb83ac742149cbe0dae07a8af9a30 Author: Enda Date: Tue Oct 1 14:02:15 2019 +0100 Document private functions with @internal tag (#2205) commit 6fc5e4216a1a99224dfee9161a5b7c6927fd6919 Author: Ivan Goncharov Date: Tue Oct 1 15:22:28 2019 +0300 Simplify 'validateObjectInterfaces' function (#2208) commit 01d4cf02f58093a763b8d3c2744ada88e50ea54d Author: Ivan Goncharov Date: Sun Sep 29 21:06:00 2019 +0300 findBreakingChanges: better message for removing standard scalar (#2204) Fixes #2197 commit 21de98ea4855df8c5146580611fda8ad76f52a2f Author: Ivan Goncharov Date: Thu Sep 26 19:14:51 2019 +0300 tstypes: Synchronise TS typings for `GraphQL*` types (#2202) commit 8c7a05373b1d39b54b6e5ad97a3b4882fcf164c7 Author: Ivan Goncharov Date: Thu Sep 26 13:46:30 2019 +0300 Synchronise 'GraphQLDirective' formatting with other definitions (#2201) commit e43de32a6c5b859f206ba7dcfb42a2204ab200bf Author: Ivan Goncharov Date: Thu Sep 26 12:42:19 2019 +0300 tests: simplify 'includes interface's thunk subtypes in the typ… (#2200) commit 5873fd26f60e88c473dea678a7723888f766658b Author: Christoph Zwerschke Date: Wed Sep 25 15:34:14 2019 +0200 Add two more tests to KnownArgumentNames validation rule (#2198) Tests that arguments passed to an argument-less directive are properly reported as an error. commit ed0dfe8afb92d942e20a9b254c87dee01181a0f3 Author: Ivan Goncharov Date: Sun Sep 22 08:26:35 2019 +0300 Remove unussed 'ABORT_VALIDATION' constant (#2193) Fixes #2170 commit 98e52331443f62e450c37ddd9cd4d19e0013146b Author: Ivan Goncharov Date: Fri Sep 20 21:25:40 2019 +0300 Fixes variable values of non-null type with default value (#2192) Fixes #2190 Port of #2191 from `14.x.x` branch commit 3d864890005f76337ef4df99d43fccbae6b574b6 Author: Ivan Goncharov Date: Thu Sep 19 22:03:34 2019 +0300 Scalars: convert errors from 'TypeError' to 'GraphQLError' (#2187) commit dd3b265bfd5dda4dac2ff2e454acc891e0864d83 Author: Daniel Rearden Date: Thu Sep 19 06:20:34 2019 -0400 Update built-in scalar's parseLiteral method to throw TypeError (#1827) commit 06ef5db069cf2f896c51126973c6100a33e1ea7c Author: Wojtek Trocki Date: Tue Sep 17 15:33:50 2019 +0100 Improve documentation for astFromValue (#2182) commit 1a82c3550b59c57b12d179c391e8bbc028753902 Author: Ivan Goncharov Date: Tue Sep 17 17:32:51 2019 +0300 toConfig: allows 'extensionASTNodes' to be undefined (#2184) We should have consistent behaviour for all properties returned by `toConfig` and since `extensions` is optional that mean `extensionASTNodes` should also be optional commit d9cc4b92a35db86c57f0d9e7966cf7b953d0259b Author: Ivan Goncharov Date: Tue Sep 17 16:59:46 2019 +0300 Fix bunch of edge cases with empty strings (#2178) commit 2e1becb22e7ac37a9ed5b665136b92f9d1665c5e Author: Ivan Goncharov Date: Mon Sep 16 17:37:07 2019 +0300 printSchema: support empty descriptions (#2177) commit c6730352d305be4aae0feea950b12f897dc9cadc Author: Ivan Goncharov Date: Mon Sep 16 16:29:56 2019 +0300 parser: Show empty strings in error messages (#2176) commit cb69e09da581ca75b90d55ef3ff1e05aedd7564a Author: Ivan Goncharov Date: Mon Sep 16 15:45:32 2019 +0300 parser: Convert error messages to match common standard of this… (#2175) commit a438dd0677fd1f6b373e96b3cd0840b010a3bda2 Author: Ivan Goncharov Date: Mon Sep 16 11:33:55 2019 +0300 Switch lexer and parser tests to exact match of error messages commit ca1c1dfe0699549c75e1a6c0017bfca11497f654 Author: Lee Byron Date: Tue Sep 10 22:35:21 2019 -0700 RFC: Number lexer lookahead restriction Implements and adds the tests described by https://github.com/graphql/graphql-spec/pull/601 commit cb7d54757092f8340a810377471817c13520a723 Author: Ivan Goncharov Date: Sun Sep 15 20:57:37 2019 +0300 Use explicit comparisons instead of using `Boolean` constructor (#2173) commit 43b7645e3c7f7bcecf6d05222348e799decd73de Author: Ivan Goncharov Date: Thu Sep 12 18:13:38 2019 +0300 Allow empty string as valid 'deprecationReason' (#2167) commit 1756a2f2984e721848ae9308810bfc352ba0aa4e Author: Ivan Goncharov Date: Thu Sep 12 04:00:43 2019 +0300 Update deps (#2166) commit 0d6d9b7120fe72a588e982ad8f7fcdb6c87bbadd Author: Ivan Goncharov Date: Wed Sep 11 21:11:06 2019 +0300 didYouMean: quote suggested values (#2165) commit 10b8e95125a08d64a7d42a292eb3af013aad0ae9 Author: Ivan Goncharov Date: Wed Sep 11 15:41:12 2019 +0300 Unify rest of error messages (#2161) Continuation of #2160 commit 39bcf2bdbfe66e74840bfdb360030c4c54453b1f Author: Ivan Goncharov Date: Wed Sep 11 00:48:01 2019 +0300 Validation: unify error messages (#2160) commit 5d28d3532ff25a11fd24e006cf482179a70e6de3 Author: Ivan Goncharov Date: Tue Sep 10 22:24:55 2019 +0300 Validation: Remove internal functions for error messages (#2159) Makes it easier to review changes in error messages and in general validation tests more readable. Also makes it easier to maintain Flow typings after TS conversion. commit 62a33547a21c9217a477833eb0c64e03869769d2 Author: Ivan Goncharov Date: Mon Sep 9 18:51:32 2019 +0300 validation: Simplify 'ValuesOfCorrectType' rule (#2158) commit 917afec75fc1d0fe6b7c7758d6356f9e61eb5f4d Author: Ivan Goncharov Date: Mon Sep 2 17:38:51 2019 +0300 Errors if empty string is provided as operationName (#2149) commit 6d3b08a0010d4a543ece7bf14963d480ba2e96d9 Author: Ivan Goncharov Date: Mon Sep 2 17:09:40 2019 +0300 GraphQLEnumType: Drop support for 'undefined' custom value (#2148) Motivation: https://github.com/graphql/graphql-js/issues/1383#issuecomment-417147188 Fixes #1367 commit 124ec0b3dfcbfc96a37aa33f19eb0c6b8c1c4f09 Author: Ivan Goncharov Date: Sun Sep 1 22:48:24 2019 +0300 Use consistent naming for config arguments (#2147) commit bd0c240f2253e33eeb8a93e2ab3dd890bc68f699 Author: Ivan Goncharov Date: Sun Sep 1 22:32:04 2019 +0300 Update ESLint to 6.3 + other deps (#2146) commit 609a3b861fb5d015db19fe34296247ef257fa9df Author: Ivan Goncharov Date: Thu Aug 29 18:37:22 2019 +0300 Removes non-standard properties from field objects (#2117) Reverts #2116 commit 4c4df7294b892c14f5f6aa35f946ba962abb0e0d Author: Ivan Goncharov Date: Mon Aug 26 18:12:05 2019 +0300 GraphQLArgument: make 'description' undefined by default (#2132) commit 564e35a997ff81cebd3ea57c937d1c1704697760 Author: Ivan Goncharov Date: Mon Aug 26 18:05:00 2019 +0300 ValidationContext: Remove deprecated 'getErrors' and make 'onEr… (#2130) commit a7cc223099d4f662a133a00e4bc71bf629c6c85e Author: Ivan Goncharov Date: Mon Aug 26 16:59:02 2019 +0300 Remove deprecated 'allowedLegacyNames' property of 'GraphQLSche… (#2129) commit 83d5011df8d5fc466d08517a2d13f9d3fb527161 Author: Ivan Goncharov Date: Mon Aug 26 15:41:45 2019 +0300 Remove deprecated 'coerceValue' function (#2128) commit 2cd9c78f066373a9ff2fb4b339ea762b92900e88 Author: Ivan Goncharov Date: Mon Aug 26 15:11:19 2019 +0300 Remove deprecated 'isValidLiteralValue' function (#2127) commit 2ed618348a0b46ac819d1f5a44fb5095a0b9e0d5 Author: Ivan Goncharov Date: Mon Aug 26 13:01:10 2019 +0300 Remove deprecated 'isValidJSValue' function (#2126) commit 15ae80661ae0f085adf8778d948f65930ba2b06f Author: Ivan Goncharov Date: Mon Aug 26 12:52:08 2019 +0300 Move 'introspectionQuery.js' to 'getIntrospectionQuery.js' (#2125) commit 6b550192e0ce3b458abaec92e4c65d36eeafb7d0 Author: Ivan Goncharov Date: Sun Aug 25 16:22:07 2019 +0300 Remove deprecated 'introspectionQuery' constant (#2124) commit aa514e48564b601b48580f86d1da31cc078a3644 Author: Ivan Goncharov Date: Sun Aug 25 13:52:30 2019 +0300 Update ESLint (#2123) commit a3de506872ead14303f46a3dd4c4ecafab480c36 Author: Ivan Goncharov Date: Sat Aug 24 22:51:42 2019 +0300 Update deps (#2122) commit a1f3bb80303090d3e5d8f49e88c35fc1dbcd8968 Author: Ivan Goncharov Date: Sat Aug 24 21:55:01 2019 +0300 Drop Support for Node 6 (#2121) commit 57232347e71b7b23fbcd4c53c8afca73f89e9cc7 Author: Ivan Goncharov Date: Sun Sep 15 19:20:54 2019 +0300 v14.5.6 commit f80b1d47dd32c1a402dd13753f75eceed018d943 Author: Ivan Goncharov Date: Sun Sep 15 17:57:05 2019 +0300 tstypes: Add missing 'abstractType' argument to `GraphQLTypeRes… (#2171) commit a5e0b64047a494a45c1ad5c78f0400ec217f5abe Author: Christoph Zwerschke Date: Sat Sep 14 20:36:02 2019 +0200 Make onError optional in SDLValidationContext (#2169) commit 38bd33707d2ca02cc07dd5aee70f027a2ea75525 Author: Ivan Goncharov Date: Fri Sep 13 18:14:37 2019 +0300 v14.5.5 commit a53d5b3b67c9a3744b6825966173245b3cc95582 Author: Christoph Zwerschke Date: Thu Sep 12 21:24:21 2019 +0200 Minor fix in extensions-test (#2168) commit c68acd8b5b106dcffe1c99456165a5c30cf8c334 Author: Lee Byron Date: Thu Sep 12 08:42:42 2019 -0700 RFC: Lexing is Greedy (#2163) Adds the test cases described in https://github.com/graphql/graphql-spec/pull/599 Makes the lookahead restriction change necessary for the new tests to pass for numbers, all other tests are already passing. commit 5c42dc69ef0e401fe33137d783fbed50752e5e09 Author: Lee Byron Date: Tue Sep 10 21:40:25 2019 -0700 printLocation: Remove trailing whitespace from empty lines (#2162) commit ff282d7c58897061ae6304440c9037b340c39666 Author: Christoph Zwerschke Date: Fri Sep 6 17:26:53 2019 +0200 Typos (#2157) commit 6609d3942e2ce129ff44c3be24eb7917de444583 Author: Ivan Goncharov Date: Tue Sep 3 21:02:56 2019 +0300 findDangerousChanges: sort fields inside 'defaultValue' (#2151) Fixes #2150 commit 0d2220f0a64238473f4e1c9aa8f73f891d0fd3e0 Author: Ivan Goncharov Date: Thu Aug 29 15:37:35 2019 +0300 v14.5.4 commit d008e962addd1f5de76c00dc65f4fdaed1998e06 Author: Ivan Goncharov Date: Thu Aug 29 13:46:51 2019 +0300 Fix 'isFinite' polyfill resulting in infinite recursion (#2143) commit 37cbb6a3904b31692ed573422c300e12b39a5f8c Author: Jackson Kearl Date: Thu Aug 29 01:46:30 2019 -0700 Mark`options` in getVariableValues(...) optional (#2142) commit 6f341a3ae0d6b3cc4d9136a58fd9272c615c2dba Author: Jackson Kearl Date: Tue Aug 27 15:31:30 2019 -0700 Replace `index` imports with specific paths commit eff2a60994a45edc59b50fd6bc7531e7e97deb32 Author: Jackson Kearl Date: Tue Aug 27 14:05:17 2019 -0700 Add `index.d.ts` as "types" field of package.json. commit 85d4c9940f7113789b3bd1b62606f382ace5472b Author: Ivan Goncharov Date: Tue Aug 27 20:14:45 2019 +0300 Add missing `toObjMap' conversion for `extensions` inside direc… (#2138) commit 8ab65246bbd91527f28b5e98c3ab6946701ecea4 Author: Ivan Goncharov Date: Tue Aug 27 16:52:12 2019 +0300 Flow: fix errors in 'flatMap.js' on old Flow versions (#2137) Fixes #2136 commit 3e9c1910b9907320a3231b8f3235c2bcb8d8af91 Author: Jackson Kearl Date: Tue Aug 27 01:42:23 2019 -0700 `void` => `undefined` in Path.d.ts (#2134) commit 27e855a3591ec2797c993f0e61460b1d3dec5a2b Author: Jackson Kearl Date: Tue Aug 27 01:40:06 2019 -0700 tstypes: Use `any` as BREAK type. (#2135) Otherwise, TS will reposrt errors when a visit function only conditionally returns BREAK (not all paths return a value error) commit 175f989c2324b1de1eb9fb1690201a97129e2325 Author: Ivan Goncharov Date: Mon Aug 26 19:24:14 2019 +0300 Flow: fix warning about unused $FlowFixMe (#2133) commit d884237694ec24a9794cb14445bbea78fca604dc Author: Michael Judd <12mmj2@queensu.ca> Date: Mon Aug 26 10:41:59 2019 -0400 fix: added FlowFixMe on Array.prototype.flatMap (#2131) - Fix for flow-bin 0.96, which complains about flatMap not existing. commit 383f0a2d74c2e1877bcebd4e7b41ea5fe7418ad4 Author: Ivan Goncharov Date: Sat Aug 24 03:42:17 2019 +0300 v14.5.3 commit 162e76ab9f9d12538d1388d1e89f9704af43ac79 Author: Jackson Kearl Date: Fri Aug 23 17:39:19 2019 -0700 Fix relative imports (#2120) commit cb31d3c9ac48b72512dad435092501d4d60e4cc5 Author: Ivan Goncharov Date: Sat Aug 24 01:53:02 2019 +0300 v14.5.2 commit 9c3e816d727c6cbaed278970ec14f61254403bd9 Author: Jackson Kearl Date: Fri Aug 23 15:42:39 2019 -0700 Sync validation TS definitions with flow (#2119) * Sync tstypes/validation TS definitions with Flow Note: not tstypes/validation/rules yet * Sync validation/rules TS with Flow commit 7b9bfdaf502a460268f7230d837244e68d222cf8 Author: Jackson Kearl Date: Fri Aug 23 15:36:49 2019 -0700 Fixup index.d.ts files to reflect Flow (#2118) * Fixup index.d.ts files to refelct Flow * Add back TS version header commit 3104e1f200e78f8027dd06edebe128de88c1685a Author: Ivan Goncharov Date: Sat Aug 24 00:32:59 2019 +0300 Copy non-standard properites from field's config (#2116) Fixes #2114 Partly reverts #2089 commit 43c6657016b8c4ef4db5086bccf79de55aebaea8 Author: Jackson Kearl Date: Fri Aug 23 14:11:27 2019 -0700 Sync utilities TS definitions with flow (#2115) commit 0d8d23902bee8e9eef89ef0ff1bf0056b6eeaa80 Author: Jackson Kearl Date: Fri Aug 23 12:06:39 2019 -0700 Sync tstypes/graphql.d.ts with flow (#2113) commit a482d3b24d7a6d4a8027614ab6304e980548e16f Author: Jackson Kearl Date: Fri Aug 23 11:31:28 2019 -0700 Sync type TS definitions with Flow (#2109) * Sync type TS definitions with Flow Specifically: Add `extensions` field in lots of places Reorder fields Both this and #2106 add Path.d.ts, but they're the same. If theres a merge conflict, just pick one. * `unknown` => `any`, to target TS@2.6 * Widen `introspectionTypes` type to `GraphQLType[]` * use Maybe>> as `extension` type * Remove `ResponsePath` export (now `jsutils/Path`) * More removal of `ResponsePath` commit f29be82ec759f45dec56174c078fb946ecf6874f Author: Ivan Goncharov Date: Fri Aug 23 19:19:48 2019 +0300 v14.5.1 commit 1ea5b34228cecbdee2285f8f63931501852b5d5c Author: Ivan Goncharov Date: Fri Aug 23 19:15:43 2019 +0300 Update deps (#2112) commit 0c3bd822a7e1abd81772e349410e9aa06dc49f8f Author: Ivan Goncharov Date: Fri Aug 23 19:03:31 2019 +0300 Flow lint disable 'deprecated-type' rule (#2111) commit 9366d6dfeda3458e3fa2135e39fe24d0a02e87ce Author: Jackson Kearl Date: Fri Aug 23 05:14:33 2019 -0700 Sync language TS definitions with Flow (#2107) * Sync language TS definitions with Flow * [] => never[], as empty tuple is invalid in TS@2 commit 49f86be0cbd57140173857a8e5d87acfdbd34e5a Author: Jackson Kearl Date: Thu Aug 22 15:39:21 2019 -0700 Sync subscription TS defintions with Flow commit 7d9ad143904f5b79a732282d835407eb4fcac78f Author: Jackson Kearl Date: Thu Aug 22 14:01:45 2019 -0700 Sync execution TS definitions with Flow. Specifically: Create jsutils/Path.d.ts and pull some utility funcs out to there Add typeResolver options commit 37161b296f7c5f2cc97e259fa2545a525da09cad Author: Jackson Kearl Date: Thu Aug 22 11:58:08 2019 -0700 Add .d.ts comments to flow commit d84cfca9e531fb4f8c34f0e275b5fa1b98d710c9 Author: Jackson Kearl Date: Thu Aug 22 11:56:05 2019 -0700 Sync tstypes/errors with flow commit 7b389be745eaeda2a4f9ca33a3db93717f21447e Author: Ivan Goncharov Date: Thu Aug 22 13:37:10 2019 +0300 v14.5.0 commit b68867a19c3dd3194c010a567f5801916c243cd4 Author: Ivan Goncharov Date: Wed Aug 21 21:37:32 2019 +0300 Add README for 'tstypes' folder (#2103) commit d1391eea86caf030f1945a518aeadb6e2d3e7c20 Author: Ivan Goncharov Date: Wed Aug 21 20:22:45 2019 +0300 Add TS typings (#2102) Copied from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/54712a7e28090c5b1253b746d1878003c954f3ff/types/graphql All credits goes to original authors of '*.d.ts' files: @TonyPythoneer @calebmer @intellix @firede @kepennar @freiksenet @IvanGoncharov @DxCx @rportugal @tgriesser @dyst5422 @adnsio @divyenduz @bradzacher @clayne11 @JCMais @langpavel @mc0 @martijnwalraven @jedmao commit 85ae274e3f8a32d81747c75d9e175fba0b24a2fa Author: Ivan Goncharov Date: Wed Aug 21 16:27:53 2019 +0300 Update deps (#2101) commit bb104d9760b255689745aaa00bd49d8a0500a11e Author: Ivan Goncharov Date: Tue Aug 20 20:26:01 2019 +0300 Convert more cycles to 'for..of' (#2100) Since #2099 makes it zero-cost to use 'for..of' it's better to improve code readability and consistency commit 43398646d97c52f8e47ab2f503a226fd04f81bfc Author: Adam Miskiewicz Date: Tue Aug 20 10:05:26 2019 -0700 Validation: Allow to limit maximum number of validation errors (#2074) * [validation] Add "onError" option to allow for custom error handling behavior when performing validation * Swithch to `maxErrors` and code cleanup commit fb06d0b20d9a39acf3c5da0863b283bf9ba2fee4 Author: Ivan Goncharov Date: Tue Aug 20 16:28:17 2019 +0300 Switch all 'for..of' loops to assume they iterating only arrays (#2099) commit 493a9b617c2b9c34f9046f40382cfeaca09373cd Author: Ivan Goncharov Date: Tue Aug 20 12:22:46 2019 +0300 Add 'extensions' to all Type System objects (#2097) Fixes #1527 commit 57e7e1bcc7a300e4a143c8de38093b92c63b6424 Author: Ivan Goncharov Date: Mon Aug 19 11:47:02 2019 +0300 extendSchema-test: replace 'GraphQL*' types with SDL (#2095) commit 68d64021ae928af6497375c079fca1b769168825 Author: Ivan Goncharov Date: Sun Aug 18 23:13:12 2019 +0300 tests: use consistent order of fields in snapshots (#2094) commit 901c4e78cd211f34307d4f80d8beed5fe04808a0 Author: Ivan Goncharov Date: Thu Aug 15 23:57:31 2019 +0300 definitions: make constructed fields non-optional (#2091) Reflects changes in #2089 commit 7782190a4e14d8fa079f2b93cbb2131e6abf9fce Author: Ivan Goncharov Date: Thu Aug 15 00:23:30 2019 +0300 type definitions: Use consistent order for public fields (#2090) commit 0105d92857cc70f7b335b828660cc0dae0d22435 Author: Ivan Goncharov Date: Thu Aug 15 00:18:20 2019 +0300 definition: replace object spread with explicit assignments (#2089) In preparation for #1527 commit b113ef7277e7866f286f1d6e25b94768325a255b Author: Ivan Goncharov Date: Wed Aug 14 00:18:00 2019 +0300 benchmark: collect memory usage per operation (#2088) commit 0cd19038c13216b435d156d4b0191f34e6f41373 Author: Ivan Goncharov Date: Tue Aug 13 23:44:19 2019 +0300 benchmark: use version specific babel (#2087) commit d78b44509b9bb625189048ddc6ab8ad214187939 Author: Ivan Goncharov Date: Tue Aug 13 16:31:54 2019 +0300 GraphQLSchema: simplify `getPossibleTypes` & `isPossibleType` (#2086) commit d9f959e7d2ce569157c5993d66250d5e4961c16c Author: Ivan Goncharov Date: Tue Aug 13 15:03:16 2019 +0300 starWarsIntrospection-test: cleanup + add explanation comment (#2085) commit cd9fc8e6677926e931bde1b6a5be8fbc027aefcb Author: Ivan Goncharov Date: Tue Aug 13 00:35:34 2019 +0300 GraphQLSchema: Remove unneeded recursion during type collection (#2083) commit 89f9f720600dc3e80ef5dcfeb2beafba44c2d3a4 Author: Ivan Goncharov Date: Mon Aug 12 18:10:47 2019 +0300 Convert type definitions subtypes to be exact (#2082) In preparation for #1527 commit f85d9b67576da5d1f23b12b07e30588bd0d8791d Author: Ivan Goncharov Date: Mon Aug 12 13:37:06 2019 +0300 Update Flow to 0.105 (#2080) commit e591e953e970dab6398ae2f135c68f5ca380d729 Author: Ivan Goncharov Date: Thu Aug 8 15:46:32 2019 +0300 Add benchmark for validating invalid query (#2079) Motivated by #2074 commit ebcdfd281c17cc895bda6703ce435ed6c1e29296 Author: Ivan Goncharov Date: Thu Aug 8 00:15:55 2019 +0300 getVariableValues: improve coverage of 'maxErrors' (#2078) commit d4ccf67782647409e018f70eb2694daf861326c0 Author: Ivan Goncharov Date: Wed Aug 7 18:42:03 2019 +0300 validation-test: remove unneeded 'specifiedRules' (#2077) commit 14f260bb91fe58416e038fb444301adb405c24ae Author: Ivan Goncharov Date: Wed Aug 7 12:44:17 2019 +0300 Limits errors in getVariableValues() (#2062) Based on #2037 commit 18371cb8a3d713dac9a6d8cc2c0535d620aca6f8 Author: Ivan Goncharov Date: Wed Aug 7 12:21:58 2019 +0300 coverage: remove not essential 'istanbul ignore's (#2076) commit 6adb527b56bf13e8bee99411d1ee77b9fb6d0dfe Author: Ivan Goncharov Date: Tue Aug 6 19:30:26 2019 +0300 inspect: correctly handle custom objects without class name (#2075) commit 37c527d0f650a426af8d8a63344d91eb5c1a434a Author: Ivan Goncharov Date: Tue Aug 6 15:49:20 2019 +0300 coverage: Fixed coverage bug introduced in #2067 (#2071) commit 5e986eb22528a777e8607c0d04c3f76509f4e222 Author: Christoph Zwerschke Date: Sat Aug 3 23:05:04 2019 +0200 Make npm scripts for prettier run on Windows (#2072) see http://blog.jonasbandi.net/2016/04/crossplatform-npm.html commit 392db5a4a360cff042ff3809e4d85e00914c01a8 Author: Christoph Zwerschke Date: Sat Aug 3 23:03:19 2019 +0200 Simplify parser, avoid extra function call (#2073) commit ce8b4cd1e0ac1eaee817f0a22f7ba3cb4ac2629d Author: Ivan Goncharov Date: Thu Aug 1 13:00:28 2019 +0300 coverage: Fixed coverage bug introduced in #2067 (#2070) commit d130a6067227f541c4f04e5c9de6282f1a7409ed Author: Ivan Goncharov Date: Thu Aug 1 12:10:47 2019 +0300 parser: Inline 'parseExecutableDefinition' to simplify code (#2069) commit b13f283be7fa39303f762dc4586d64d1995f5104 Author: Ivan Goncharov Date: Wed Jul 31 23:10:47 2019 +0300 parser: Extract 'optionalMany' utility function (#2068) commit a5bbe713f4b704247d56616e522f3d855354b974 Author: Ivan Goncharov Date: Wed Jul 31 22:14:43 2019 +0300 Convert all non-reachable exceptions into invariants (#2067) commit e58762afd2bab3abc7e5d40e48158560b27c567d Author: Ivan Goncharov Date: Tue Jul 30 19:46:12 2019 +0300 Use 'invariant' only for real invariants, add 'devAssert' for t… (#2066) commit ebcc754845aee500a41c14842d23a4ca03542ed2 Author: Ivan Goncharov Date: Tue Jul 30 17:58:16 2019 +0300 Remove 'invariant' calls from 'stripIgnoredCharacters' tests (#2065) commit 91a4be28f34cc1bffd97101a1bdb9455f865be56 Author: Ivan Goncharov Date: Tue Jul 30 13:44:07 2019 +0300 invariant: improve code that babel outputs (#2064) commit dea602835a86e9b1b762de89c81f6ba490cd8a88 Author: Ivan Goncharov Date: Tue Jul 30 13:28:24 2019 +0300 Remove useless invariant since 'serialize' is always exist (#2063) commit 168570ff61cb9b7b7c2fcf6c95848919d9f397cd Author: Ivan Goncharov Date: Mon Jul 29 17:10:10 2019 +0300 change 'CoercedVariableValues' to disjoint union (#2061) commit e67f2e5515739295bad006ecde0e6ce5db0dc83d Author: Ivan Goncharov Date: Mon Jul 29 12:37:36 2019 +0300 Using direct imports in test files (#2060) commit 5c9946b0d0e2e082772db4ccd50013caa0b1ed79 Author: Ivan Goncharov Date: Mon Jul 29 00:34:52 2019 +0300 Sort imports in all JS files (#2059) commit fc4058d9fb31aac5516610c251da75ed16321ff8 Author: Ivan Goncharov Date: Sat Jul 27 23:58:34 2019 +0300 flow: Enable 'uninitialized-instance-property' lint (#2058) commit e6725dea2c60469de9c61dee6cc3a2b18112f21d Author: Ivan Goncharov Date: Sat Jul 27 20:19:24 2019 +0300 Update Flow to 0.104 (#2057) commit b82e5a6b5b44b7fd4536ca59ea22262c6f545bdc Author: Ivan Goncharov Date: Sat Jul 27 19:37:34 2019 +0300 buildExecutionContext: simplify errors handling (#2054) commit 52820eb3826461af24952b8c78c76741425349aa Author: Ivan Goncharov Date: Fri Jul 26 01:27:25 2019 +0300 jsutils: Add generic Path implementation (#2053) commit dae9f8711e3dfea5ffd7f1c720de0a8e2c3dd78a Author: Ivan Goncharov Date: Thu Jul 25 14:34:26 2019 +0300 coerceValue: Simplify path printing (#2052) commit 38cee9799088d3e9d50204cbe4a93e88f4890d37 Author: Ivan Goncharov Date: Thu Jul 25 12:57:38 2019 +0300 Make getArgumentValues/getVariableValues algorithm linear (#2051) commit 18f1f79bdedf184b60ddfc9989d4b58029b7f486 Author: Ivan Goncharov Date: Wed Jul 24 20:44:14 2019 +0300 Simplify coercion algorithm in getVariableValues/getArgumentValues (#2050) commit bb07ecccc5c45001d076aa8e6edb1629f3db5db0 Author: Ivan Goncharov Date: Tue Jul 23 18:08:29 2019 +0300 Remove useless check since args are always array (can be empty) (#2049) commit 670bbaca5ed897d0ee2caadbc8ac3a0bbf281b87 Author: Ivan Goncharov Date: Mon Jul 22 17:25:14 2019 +0300 coerceValues: correctly handle NaN and similar values (#2047) commit bbab902eb45635a7f4cd2e643e574937a9b74dc1 Author: Ivan Goncharov Date: Mon Jul 22 13:36:30 2019 +0300 Enable 'flowlint deprecated-type' (#2046) commit 166317ad405c0b084057b5a9b325c220f4d43209 Author: Ivan Goncharov Date: Mon Jul 22 12:51:31 2019 +0300 test: Fully cover 'coerceValue' function with tests (#2045) commit a6f822e426556da66709f392390d2ccc5d959cd1 Author: Ivan Goncharov Date: Sun Jul 21 13:14:22 2019 +0300 Update deps (#2043) commit 2a66440120dc239a9ae0348378e15f076be67a8e Author: Ivan Goncharov Date: Sat Jul 20 21:57:58 2019 +0300 Add tests for parseValue & parseLiteral of std scalars (#2042) commit adb5292aea44baa989f3672d6db05f2949fbc0aa Author: Ivan Goncharov Date: Thu Jul 18 13:55:53 2019 +0300 Update Babel (#2040) commit bad0a69a439faed09a24b3576e87622803b012a1 Author: Ivan Goncharov Date: Wed Jul 17 12:50:54 2019 +0300 benchmark: improve reproducibility (#2039) commit 3cd06f17c85e1b1570db8d2575a8afeea8410cd5 Author: Ivan Goncharov Date: Mon Jul 15 22:57:41 2019 +0300 gen-changelog: remove hardcoded GitHub org and repo (#2035) commit 49d86bbc810d1203aa3f7d93252e51f257d9460f Author: Ivan Goncharov Date: Fri Jul 12 01:49:01 2019 +0300 Cleanup leftovers of CI publishing (#2034) commit 83cb5ff3548ec9beed4e417e4dd27798660f2b51 Author: Ivan Goncharov Date: Fri Jul 12 01:28:27 2019 +0300 Run prettier on all files in repo (#2033) commit 08b85039bb599770c609bb12307eb3eb1c7054dd Author: Ivan Goncharov Date: Thu Jul 11 22:07:25 2019 +0300 ESLint: Enable flowtype/no-existential-type rule (#2032) commit b40291f9061f3d78cb0c03f7b9e845d791bb6d76 Author: Ivan Goncharov Date: Thu Jul 11 21:46:25 2019 +0300 Remove use of existential type in validation tests (#2031) commit ae34ef9529f12fd2a993faf4ac479d54143a7093 Author: Ivan Goncharov Date: Thu Jul 11 21:33:11 2019 +0300 Update deps (#2030) commit 7de6d85798180811d223b9ae680e6dcc1ee2054c Author: Ivan Goncharov Date: Thu Jul 11 19:16:48 2019 +0300 Parser: group internal methods into a class to share lexer & op… (#2028) commit ef288746c3c9d533ea66ddd153fd6fa09d5e718f Author: Ivan Goncharov Date: Thu Jul 11 16:27:56 2019 +0300 Flow: Remove unnecessary type annotations (#2027) commit 17990cb7d7ffe9d085d60ed28988d21d899cad76 Author: Ivan Goncharov Date: Thu Jul 11 00:25:24 2019 +0300 Flow: Remove unussed '$FlowIssue' (#2026) commit d05c983fe3188ade9ccc5e5f9abfd9d37ffb5d92 Author: Ivan Goncharov Date: Wed Jul 10 21:11:59 2019 +0300 Move 'getTokenDesc' into parser (#2025) commit 1fd4a22413daa48a3103a105229a409a7bd4f173 Author: Ivan Goncharov Date: Wed Jul 10 16:17:51 2019 +0300 parser: Remove unnecessary export on internal function (#2024) commit e3b5f820a764966157bd8d61f0cbf7090423736f Author: Ivan Goncharov Date: Wed Jul 10 15:38:12 2019 +0300 parser: simplify 'many' utility function (#2023) commit 639d14d8d6570b3b90dd56f96184e7e3f28d8837 Author: Ivan Goncharov Date: Wed Jul 10 14:16:42 2019 +0300 Update deps (#2022) commit 74311979bff71e678ca1836aef500c70c4f95649 Author: Ivan Goncharov Date: Wed Jul 10 02:30:05 2019 +0300 Benchmark: simplify code (#2021) commit 4600e1d433bb936b6eb8efc2ece430a5728b5fb1 Author: Ivan Goncharov Date: Mon Jul 8 15:10:58 2019 +0300 Benchmark: Inline code from benchmark.js (#2019) commit 758d08a51e5e50d62f28db1787f9c8cfbe1114fe Author: Ivan Goncharov Date: Thu Jul 4 17:00:53 2019 +0300 Travis: Run gitdeploy only on pushes to master (#2016) commit fd97652d3e901b0d03b2429bd28e3cd59f402f7a Author: Ivan Goncharov Date: Thu Jul 4 16:16:28 2019 +0300 Flow: Remove some of the 'existential type' usages (#2015) See: https://flow.org/en/docs/types/utilities/#toc-existential-type commit a5a9aa3d6ceec348f15431e573fe68f05db237a3 Author: Ivan Goncharov Date: Thu Jul 4 15:22:13 2019 +0300 Mark as private to prevent accidential publishing of root 'pack… (#2013) commit 2afbf0b05b0a05175928f070eba86df6f6a97e10 Author: Ivan Goncharov Date: Thu Jul 4 14:55:31 2019 +0300 Fix build after #1467 (#2014) commit d4a1362d45d4cca7c5dd6e5c05058ec4563b1abe Author: Jimmy Jia Date: Thu Jul 4 04:38:20 2019 -0400 Make error handling consistent in createSourceEventStream (#1467) commit 6faa515d6430f9868ab528ecc72e7abc70c80a37 Author: Ivan Goncharov Date: Wed Jul 3 17:56:58 2019 +0300 v14.4.2 commit 1493122310c31c8afdf1182ee6cc864e0e8905a3 Author: Ivan Goncharov Date: Wed Jul 3 17:54:18 2019 +0300 Correctly add modified 'version.js' to release commit (#2011) commit cbd5c95b5edd066d34f0d902c52b590316d530d0 Author: Janosch Müller Date: Wed Jul 3 15:09:46 2019 +0200 Defensively verify that Symbol.for is available (#2009) closes #2007 commit 16db20cda87c3db6358f5fea2bd28b8b673fdc9a Author: Ivan Goncharov Date: Tue Jul 2 21:00:19 2019 +0300 Flow: Remove deprecated 'Function' type (#2008) commit 72bd71e7ecffd8e5ba670ee852032962fcfd4042 Author: Ivan Goncharov Date: Sat Jun 29 15:19:18 2019 +0300 buildClientSchema: add test for missing standard scalar (#2006) Context: https://github.com/graphql/graphql-js/issues/2005 commit 3c54315ab13c6b9d337fb7c33ad7e27b92ca4a40 Author: Ivan Goncharov Date: Sat Jun 29 00:58:56 2019 +0300 v14.4.1 commit fde76bd982c674c097c0b2d6ccd40e088df16e57 Author: Ivan Goncharov Date: Sat Jun 29 00:54:28 2019 +0300 Travis: remove Node.js v11 from test matrix (#2004) commit 7d3fa948dc11443239cdf9d40046807be660f902 Author: Ivan Goncharov Date: Sat Jun 29 00:19:37 2019 +0300 Travis: Disable automatic publishing on NPM (#2003) Since NPM settings require 2FA to publish this package commit edd925b4fbdf59f69c4c7891026b92f4188a80b1 Author: Ivan Goncharov Date: Sat Jun 29 00:04:50 2019 +0300 Mark user-provided 'variableValues' as read-only (#2002) Motivation: https://github.com/graphql/express-graphql/pull/516 commit 9b2e626541f9911c25aa6c95ec2036adf8781f72 Author: Ivan Goncharov Date: Fri Jun 28 23:17:30 2019 +0300 Switch some of arguments from `Array` to `$ReadOnlyArray` (#2001) commit 27f695eef5c22a87ad8fdd290eaa61aec4ed7f40 Author: Ivan Goncharov Date: Fri Jun 28 22:33:25 2019 +0300 dedent: Simplify and remove unused features (#2000) commit 7c20807a246e6eec73a528b3fb195cbf6bd1dc89 Author: Ivan Goncharov Date: Fri Jun 28 13:32:38 2019 +0300 changelog: Remove duplicate PRs (#1999) commit 1710fb0bbb83c1574fda78a2af6bbb804d5d1770 Author: Ivan Goncharov Date: Thu Jun 27 12:48:36 2019 +0300 Add "postversion" step to commit changed files (#1998) commit 16f5ca0e2cce34e636817eeb43196e3dc3524646 Author: Ivan Goncharov Date: Wed Jun 26 19:24:59 2019 +0300 v14.4.0 commit 610de0e7dbfda5cf0acb9b992525e91df25ee65c Author: Ivan Goncharov Date: Wed Jun 26 19:23:42 2019 +0300 Update NPM token inside '.travis.yml' (#1996) commit 4899187ac62ba5f4bfc6ea2cf5c7ff53bb3b05b8 Author: Ivan Goncharov Date: Wed Jun 26 19:09:04 2019 +0300 Improve typings for 'toJSONDeep' function (#1995) commit 2a0dcd9b4b6fe54e66debcc9e5ca2644bb6796e2 Author: Ivan Goncharov Date: Wed Jun 26 18:43:31 2019 +0300 Improve Flow typing for 'memoize3' (#1994) commit e6d2c5a2bda304035323743b33f81da0288a04b6 Author: Ivan Goncharov Date: Wed Jun 26 18:12:42 2019 +0300 Update Flow to v0.102 (#1993) commit 857682a99d0a0e18943d956df62096f13745db9d Author: Ivan Goncharov Date: Wed Jun 26 17:17:09 2019 +0300 Change formatting of '.travis.yml'. Continuation of 2b9d571 (#1992) commit 2b9d5714678701865ac2e57d6783726eee931982 Author: Ivan Goncharov Date: Wed Jun 26 15:26:30 2019 +0300 Change formating of '.travis.yml' to better match output of Tra… (#1991) commit a1b1292690d5f66e565f4f9ea226e1278d4be163 Author: Ivan Goncharov Date: Tue Jun 25 17:55:18 2019 +0300 Update deps commit d8c1dfdc9dbbdef2400363cb0748d50cbeef39a8 Author: Ivan Goncharov Date: Fri Jun 14 17:30:35 2019 +0300 printLocation: Add special support for minified documents commit e171bbc3447def16e062dc557eb40b186db274d9 Author: Ivan Goncharov Date: Fri Jun 14 14:14:42 2019 +0300 printLocation: Use vertical bar as number column delimiter commit b904859fbd6059be8d61e2357dd0f0c0cbab4d1f Author: Christoph Zwerschke Date: Tue Jun 25 13:50:21 2019 +0200 Add test for didYouMean with sub-message (#1988) commit a9a21f3081acfa4740ad392e28239d09befe8b9c Author: Ivan Goncharov Date: Fri Jun 14 12:43:23 2019 +0300 Extract 'printLocation' & 'printSourceLocation' functions (#1984) Context: https://github.com/facebook/relay/pull/2752#issuecomment-498667289 commit 3ddf1483eeecb613837fd434d695a2c69df66a91 Author: Ivan Goncharov Date: Fri Jun 14 12:22:03 2019 +0300 printError shouldn't return trailing new line (#1983) commit 84b416f855c11ae370b7a5f6f1e746ec22027a5f Author: Ivan Goncharov Date: Thu Jun 13 20:06:05 2019 +0300 printError: improve coverage (#1982) commit 3a71d3e8a66c83241469e1a7860bc51351944017 Author: Ivan Goncharov Date: Thu Jun 13 16:46:18 2019 +0300 Move TokenKind into separate file to solve cycle import (#1981) commit 2787f27b01803c8c3d407019442f7f25e814f399 Author: Ivan Goncharov Date: Thu Jun 13 15:14:54 2019 +0300 Correct imports to use direct paths instead of relying on 'index.js' (#1980) commit f6fffa35cee9bca81aa251996b3d7670f61e663d Author: Ivan Goncharov Date: Thu Jun 13 13:50:19 2019 +0300 Flow: switch to new '...' syntax for inexact objects (#1978) See: https://medium.com/flow-type/on-the-roadmap-exact-objects-by-default-16b72933c5cf commit 7eb38eac5fd0583e5c898c390b6e74346ffe47fb Author: Ivan Goncharov Date: Thu Jun 13 12:04:47 2019 +0300 buildClientSchema: improve coverage (#1977) commit a0eaaa90da8514d9908826bf472c0904dfaf6617 Author: Ivan Goncharov Date: Thu Jun 13 10:49:13 2019 +0300 inspect-test: remove $FlowFixMe (#1976) commit a0971256e693c9bc5147789d647b0d038fb07666 Author: Ivan Goncharov Date: Wed Jun 12 17:25:45 2019 +0300 inspect-test: Improve coverage (#1975) commit 91d673f72fedd26707f02305afe02d35ff03dacf Author: Ivan Goncharov Date: Wed Jun 12 16:56:31 2019 +0300 buildClientSchema: add dev check for invalid introspection argument (#1974) Prevents situations like #1970 commit 42ef363cb61c7d33bc4c96889acd60321b03b32b Author: Ivan Goncharov Date: Wed Jun 12 15:56:45 2019 +0300 Extract 'isObjectLike' utility function (#1973) Inspired by https://lodash.com/docs/4.17.11#isObjectLike commit b31099e8c0a8657fe61ca811322e973de89481d4 Author: Ivan Goncharov Date: Wed Jun 12 15:08:17 2019 +0300 inspect: Handle 'null' explicitly (#1972) commit 462ce072c8d2aa36fd407da4158a92c9cebd5fce Author: Ivan Goncharov Date: Tue Jun 11 18:21:17 2019 +0300 Update deps (#1971) commit 61f993604bbc3e0aa2dcfc9191b6f6d4cb060bee Author: Ivan Goncharov Date: Tue Jun 11 16:12:59 2019 +0300 Improve generated changelog (#1969) commit 58cf05be655b6053d42b0ba2e0c2c6e1309e3774 Author: Ivan Goncharov Date: Tue Jun 11 15:56:15 2019 +0300 Add some stats to the 'yarn build' command (#1968) commit 35c68d403cf1020e1d30ea29f0546352d03dd49e Author: Ivan Goncharov Date: Tue Jun 11 00:04:00 2019 +0300 Update LICENSE and remove license header from source files (#1960) commit b57181265b5af1f7f7b59ee27c64ce2092981330 Author: Ivan Goncharov Date: Mon Jun 10 20:54:32 2019 +0300 Add script to generate changelog (#1966) commit 2c7224c32bf35ce97201b181d7b445cf8e49a585 Author: Ivan Goncharov Date: Sun Jun 9 18:47:51 2019 +0300 Added partial support for repeatable directives (#1965) Code is based on #1541 but without introspection changes and without breaking change detection commit 24fa31ad127f9c1d805717ce14e82910d022e563 Author: Ivan Goncharov Date: Sun Jun 9 17:57:06 2019 +0300 Simplify SDLs used in 'buidSchema'/`extendSchema' tests (#1964) commit 2fe20258c7e631372a89486b01dcb339762b1fa3 Author: Ivan Goncharov Date: Sun Jun 9 16:33:56 2019 +0300 buildASTSchema-test: inline SDL in 'buildSchema' calls (#1963) commit ba605709505225c1bce6d929e1cd91f90a3487ad Author: Ivan Goncharov Date: Sun Jun 9 14:57:57 2019 +0300 parser: remove unused token that was returned from keyword match (#1962) commit 9da6594d9f72aa9ce9c3e33d238c8766bfa10bc8 Author: Ivan Goncharov Date: Sun Jun 9 12:54:31 2019 +0300 Update deps (#1961) commit 8d0314d644d652da41669049384ddef74e3ecf52 Author: Ivan Goncharov Date: Fri Jun 7 17:08:31 2019 +0300 Fix URLs to the GraphQL Specification and its repository (#1959) commit fb502ec781f274aa50f472aaad4cee5dcd05efa5 Author: Ivan Goncharov Date: Fri Jun 7 14:54:51 2019 +0300 Remove unnecessary concatenations from template strings (#1957) Became possible after Prettier 1.18 commit 8e9331770b7a4905efffa6e4317d6e236fb0b541 Author: Ivan Goncharov Date: Fri Jun 7 10:25:24 2019 +0300 Update prettier to v1.18.0 (#1956) commit f2c3e96a1441d6615594ae4c172505c09f282c44 Author: Ivan Goncharov Date: Fri Jun 7 09:43:20 2019 +0300 Make 'parseLiteral' optional and use wrapped 'parseValue' by default (#1955) Motivation: https://github.com/graphql/graphql-js/issues/500 https://github.com/graphql/graphql-js/pull/1827#discussion_r280658590 commit b17d5be9e53aaf72928f84d896cfff341a302d4d Author: Ivan Goncharov Date: Thu Jun 6 11:54:19 2019 +0300 Remove "coverage/flow" before every "check:cover" run. (#1953) commit a034dc25945801d034ece76a7b0f022256acd8e9 Author: Ivan Goncharov Date: Thu Jun 6 11:36:01 2019 +0300 tests: replace `invariant` with `assertEnumType` (#1952) Motivation: Improves code coverage commit 27465b2bd574e4496500b61604514ab808fa024d Author: Ivan Goncharov Date: Wed Jun 5 17:56:22 2019 +0300 validateSchema: use 'astNode' from fields/args instead of type's subnodes (#1950) commit b42f8c8c0b6ca234535f5e0c8ec8434fc943d28a Author: Eloy Durán Date: Tue Jun 4 17:42:13 2019 +0200 [printError] Make location formatting IDE friendly (#1949) This is the format used by jest, flow, typescript, and many others. commit c3dd67050eaf8a62fd4907e155e99c6a56bb7066 Author: Ivan Goncharov Date: Mon Jun 3 15:22:51 2019 +0300 Remove 'watch' script (#1947) Modern IDE & editors have specialize pluggings for running Prettier, ESLint, Flow, etc. Also since we moved all Mocha options into config file now you can run subset of tests using 'yarn mocha src/' commit ed74228dc8540e3d2681cb6da473e7ce5edb7850 Author: Ivan Goncharov Date: Mon Jun 3 12:01:41 2019 +0300 validateSchema: validate Input Objects self-references (#1359) commit 71d96d77deb2342191a0b25b9bb3e15b8d2c0eb7 Author: Ivan Goncharov Date: Mon Jun 3 11:49:15 2019 +0300 GraphQLScalarType: make 'serialize' optional with 'identityFunc' as default (#1946) It's logical step since it's what 'buildSchema', 'extendSchema' and 'buildClientSchema' doing anyway: https://github.com/graphql/graphql-js/blob/3d067958a3cbef00f0e5da48b9d9bc61bf9ce3fe/src/utilities/buildASTSchema.js#L403 https://github.com/graphql/graphql-js/blob/3d067958a3cbef00f0e5da48b9d9bc61bf9ce3fe/src/utilities/buildClientSchema.js#L234 commit 3d067958a3cbef00f0e5da48b9d9bc61bf9ce3fe Author: Ivan Goncharov Date: Sun Jun 2 23:50:29 2019 +0300 Extract 'identityFunc' function to be used instead of in place 'x => x' (#1945) In theory should result in slightly small memory footprint and faster execution. In practice, it simplifies testing of scalar's default behaviour. commit f5a975f4bd73b4e1d75690312c02df58dec5f95f Author: Ivan Goncharov Date: Sun Jun 2 22:21:51 2019 +0300 Extract "didYouMean" util function (#1944) commit e8762168367996a53783a6318461bd24af799ffd Author: Ivan Goncharov Date: Sun Jun 2 13:14:49 2019 +0300 Simplify args handling in 'graphql', 'subscribe' and 'execute' funcs (#1943) commit 376f1fdb01c5a441745250c1c5a40ee5a6ba0fcc Author: Ivan Goncharov Date: Sun Jun 2 04:43:42 2019 +0300 Export "SubscriptionArgs" type (#1942) commit acf95e18d61dad3ab4fc96051224c235259aee4d Author: Ivan Goncharov Date: Sun Jun 2 04:03:27 2019 +0300 Speed up "check:cover" by using async exec (#1941) commit 844aab7209d52a67652ebc10a6e1c21b6432abd9 Author: Ivan Goncharov Date: Sun Jun 2 03:14:40 2019 +0300 Allow 'async/await' in 'resources' scripts (#1940) commit ac07bb4919829052ec6fbf673da15929582f97da Author: Ivan Goncharov Date: Sun Jun 2 02:33:10 2019 +0300 Accept normal object as 'variableValues' arg of subscribe functions (#1939) Duplicate #1937 but for 'subscribe' and 'createSourceEventStream' functions commit 09fcb11f6e8cd0789169c020fcc12a1b5c3c47f8 Author: Ivan Goncharov Date: Sat Jun 1 23:29:55 2019 +0300 Allow null value on 'data' property of 'ExecutionResult' type (#1938) commit 8d403ca6f5ff5134ce14e86183776d4be96eb46b Author: Ivan Goncharov Date: Sat Jun 1 23:09:19 2019 +0300 Accept normal object as 'variableValues' arg of 'graphql' function (#1937) Synchronise it with same argument of 'execute' https://github.com/graphql/graphql-js/blob/master/src/execution/execute.js#L102 Plus in most cases result of `JSON.parse` is passed, which is normal object. commit 1512eeb46cb4f75018a0fa286e6f5a7e537c76f2 Author: Ivan Goncharov Date: Sat Jun 1 21:19:13 2019 +0300 Remove dead code since args are always present on fields and directives (#1936) commit 2b2b3955ba8d19a476f94413100a5e235feacbe7 Author: Ivan Goncharov Date: Sat Jun 1 19:34:10 2019 +0300 Update Flow to v0.100.0 (#1935) commit 484a2176d6d34da55df44e7d464c12296a93be57 Author: Ivan Goncharov Date: Sat Jun 1 01:53:45 2019 +0300 Add typings to introspection resolvers (#1934) commit 226be7fff4dfa4cb56aae6df744185ad72ec591c Author: Ivan Goncharov Date: Fri May 31 15:00:13 2019 +0300 Update deps (#1933) commit 4e338db7462af05218012b7c175eccfd7738cdbd Author: Ivan Goncharov Date: Thu May 30 19:57:19 2019 +0300 npmignore: remove all dot files since they already covered by '.*' (#1931) commit f23bb30f81827ba0a5177fc27bb7aef0aceafff7 Author: Ivan Goncharov Date: Thu May 30 19:46:08 2019 +0300 Convert Flow coverage to istanbul format and use nyc for reporting (#1930) commit 5b19aac946a81e1295ddeb08820eb8503e1399cd Author: Ivan Goncharov Date: Thu May 30 19:28:52 2019 +0300 benchmark: create 'exec' wrap for execSync function (#1929) commit 2ac7c6e0c4a428fe3248f37895eacf571a5c216d Author: Ivan Goncharov Date: Wed May 29 18:57:25 2019 +0300 package.json: Rename "check-cover" to "check:cover" (#1928) commit 63ee811d2aa77eea576f008b8ba117fcae84597c Author: Ivan Goncharov Date: Wed May 29 17:39:46 2019 +0300 validation-tests: remove useless parseValue & parseLiteral (#1927) commit 8bf52a87859ca9ffb5fa789a02d17a29832e0204 Author: Ivan Goncharov Date: Wed May 29 11:40:02 2019 +0300 Update deps (#1926) commit 62c7f3be4caeabf05c2bf4c1c3c105cdf327b540 Author: Ivan Goncharov Date: Tue May 28 22:28:13 2019 +0300 Add 'docs' to .npmignore (#1924) commit 31f74475b64145455634fcb5f5f0c6cbfc5114a3 Author: Ivan Goncharov Date: Tue May 28 22:03:28 2019 +0300 Copy 'site/graphql-js' folder from 'graphql.github.io' repo (#1923) Snapshot of https://github.com/graphql/graphql.github.io/tree/4e0f53e4a975302293240cf52ce80c9103851780/site/graphql-js commit 86cfa21cf4dfcda9a112520cf009757470c4522b Author: Ivan Goncharov Date: Tue May 28 20:48:04 2019 +0300 Add "codecov.yml" to .npmignore (#1922) commit 63cc5df54685838c50890891cc48ec181d46cc02 Author: Ivan Goncharov Date: Tue May 28 15:21:57 2019 +0300 Manually concat all static strings (#1921) Makes editing strings easier and clean resulting diffs Plus all modern editors support wrapping of long lines. commit 5eecef2a5cdf9762b1df7382dc971a60ccd1f317 Author: Ivan Goncharov Date: Tue May 28 13:34:56 2019 +0300 Remove trailing spaces from 'Int' and 'Float' descriptions (#1920) commit e1225a070171c2501814c6664c714f362539b230 Author: Ivan Goncharov Date: Tue May 28 12:36:18 2019 +0300 Update GitHub schema (#1919) commit 172b1418b7bf08214c6510baa99cc2ce75049eef Author: Ivan Goncharov Date: Tue May 28 11:04:00 2019 +0300 tests: replace 'printNode' with more high-level 'printASTNode' (#1918) commit dbe85d6d3dff77d3686810ab2dca407643c4402e Author: Ivan Goncharov Date: Mon May 27 15:12:00 2019 +0300 Manually update 'version.js' (#1917) Happened because #1878 was authored before '14.3.1' release but merged after it. Also add 'npm run build' to CI to prevent simular problems in future commit fc0c06c31505b9efb6cdf2690947155401b46071 Author: Ivan Goncharov Date: Mon May 27 13:42:12 2019 +0300 findBreakingChanges: use string representation to compare default values (#1916) Fixes #1567 Closes #1593 commit e2fe67ed7cad521dd465f56183c20c7bcff83c24 Author: Ivan Goncharov Date: Mon May 27 13:05:45 2019 +0300 Add "version" string and parsed "versionInfo" (#1878) Fixes #1726 commit 7d0df0d974a40d14cff2347f80674eed89da3ed0 Author: Ivan Goncharov Date: Mon May 27 12:48:42 2019 +0300 Travis: don't duplicate testing on Node's latest LTS (#1915) commit ac198b9956effebe2a0bafe12ba763b8a21d7400 Author: Ivan Goncharov Date: Mon May 27 12:10:12 2019 +0300 ESLint: Forbid unnecessary backticks (#1914) commit 0e379e64ac5cce44069a9b4fcd75d51dd229add6 Author: Ivan Goncharov Date: Mon May 27 01:14:41 2019 +0300 findBreakingChanges: sort functions in logical order (#1912) commit 516132a364816f932ecc2c34245fa26b53bde187 Author: Ivan Goncharov Date: Sun May 26 21:08:57 2019 +0300 findBreakingChanges: merge funcs and remove duplicated iteration logic (#1911) commit 7e159058908220a6465549e689667d20802a446b Author: Ivan Goncharov Date: Sun May 26 19:33:12 2019 +0300 Replace some "for" cycles with "for of" (#1910) commit 189d976815bcf1ed41df8f1443c7a7630e9f4158 Author: Ivan Goncharov Date: Sun May 26 00:29:05 2019 +0300 findBreakingChanges: reduce duplication by merging some functions (#1909) commit b2aafc4e491d295a6ee07771a43e094986a3d667 Author: Ivan Goncharov Date: Sat May 25 22:04:27 2019 +0300 findBreakingChanges: extract "diff" utility function (#1908) commit d987492475d42b25db89bf067421bb508bc6a134 Author: Ivan Goncharov Date: Sat May 25 21:24:30 2019 +0300 findBreakingChanges: unify how changes are collected (#1907) commit f55c2a34a512afe105b6833183db79e4c97306b9 Author: Ivan Goncharov Date: Fri May 24 19:03:54 2019 +0300 Use 'Object.freeze' consistently on all exported Array/Object constants (#1906) We already using 'Object.freeze' for many constants, e.g.: https://github.com/graphql/graphql-js/blob/8c96dc8276f2de27b8af9ffbd71a4597d483523f/src/language/directiveLocation.js#L13 https://github.com/graphql/graphql-js/blob/8c96dc8276f2de27b8af9ffbd71a4597d483523f/src/language/kinds.js#L13 https://github.com/graphql/graphql-js/blob/dec3cc5d5133118cdb19bb90a0a770c835497835/src/language/lexer.js#L102 It helps issues with Flow since without Object.freeze it assumes that constants can be mutated commit 4f66f3de80324fae6324aaf4bc6e105b160264f5 Author: Ivan Goncharov Date: Fri May 24 18:11:48 2019 +0300 findBreakingChanges: simplify schema iteration (#1905) commit f37b526f92fa70c707cb808ec887ad5f4f9a9b0a Author: Ivan Goncharov Date: Fri May 24 15:36:56 2019 +0300 findBreakingChanges-test: Unify changes snapshots (#1904) commit d1bc6b4205cc1b19ef059bcf7064be9a5ca0924e Author: Ivan Goncharov Date: Fri May 24 15:14:37 2019 +0300 findBreakingChanges: add missing dots to descriptions (#1903) commit bfc5bbb46c3ea2448e8c6ba5e1a3cf9ef404acfb Author: Ivan Goncharov Date: Fri May 24 14:37:43 2019 +0300 findBreakingChanges: Simplify type to string conversion (#1902) commit c906b7c7bb2965429553e23c0122898b6caa0b67 Author: Ivan Goncharov Date: Fri May 24 13:28:58 2019 +0300 findBreakingChanges: extract 'findByName' utility function (#1901) commit d4140766e0d2add0f82b22fe6e6354de4afc0f3c Author: Ivan Goncharov Date: Thu May 23 07:55:48 2019 +0300 v14.3.1 commit 40da47822430cf36a59316e1767f068549068e8e Author: Ivan Goncharov Date: Thu May 23 07:23:42 2019 +0300 Update babel to v7.4.5 (#1900) commit 2fae6e7e5a8325d7da8e525d791f285f18613142 Author: Ivan Goncharov Date: Thu May 23 07:07:54 2019 +0300 findBreakingChanges: Add new tests to improve coverage (#1899) commit ff0afa2e369e079663f9099dd9dc3b0c5f459d0f Author: Ivan Goncharov Date: Wed May 22 21:07:54 2019 +0300 buildClientSchema: include standard type only if it is used (#1809) Details: https://github.com/graphql/graphql-js/commit/183ff32bee4bc23eb23657f79f414c2400ecb06a#r32971387 commit 4bff6d8af28cf58c5338f5a8d63c429bdf5f577e Author: Ivan Goncharov Date: Wed May 22 20:01:59 2019 +0300 findBreakingChanges: simplify checking of wrapped types (#1898) commit ec020fb76474f1b2b0e4ce1cbe050b14debaf545 Author: Ivan Goncharov Date: Wed May 22 19:34:55 2019 +0300 findBreakingChanges-test: Remove unnecessary fields (#1897) commit ab93bf496ac46c704305e71fb1b83a337457eed0 Author: Ivan Goncharov Date: Wed May 22 18:17:01 2019 +0300 findBreakingChanges: Correctly document not reachable statement (#1896) commit 93a3bda26849ad3bf48bf7b3939b7152d56fe604 Author: Ivan Goncharov Date: Wed May 22 15:41:31 2019 +0300 findBreakingChanges: Remove 'export' from internal functions (#1895) Note: Only functions exported by `index.js` are treated as part of Public API https://github.com/graphql/graphql-js/blob/c0cf659d5036d2ec536a8805bc993cf85936d26d/src/utilities/index.js#L124-L130 commit c0cf659d5036d2ec536a8805bc993cf85936d26d Author: Ivan Goncharov Date: Wed May 22 14:11:06 2019 +0300 findBreakingChanges: test only functions that are part of public API (#1893) commit 87c64882f2a9ef2d34c80e0e5a9ba33f76cfd187 Author: Ivan Goncharov Date: Wed May 22 13:54:22 2019 +0300 build: Add new lines to "*.js" and "*.mjs" files (#1892) Makes "*.js" and "*.mjs" consistend with "*.js.flow" files and also prevent diff artifacts, e.g.: https://github.com/graphql/graphql-js/commit/cf36cdbda2e9f884d35c5879e03370aab7a69c24#diff-0e28dd92524e3516b49eb5b753822f10R45 commit e8dfa8b4075ec3c23c404f9f7219c08c16859c68 Author: Ivan Goncharov Date: Wed May 22 13:21:54 2019 +0300 findBreakingChanges-test: remove unneeded 'Query' types (#1891) commit e7c1fde6fab639cd9b5c7337b89e41c0f4749255 Author: Ivan Goncharov Date: Tue May 21 23:53:22 2019 +0300 Enable 'no-prototype-builtins' ESLint rule (#1888) commit dec3cc5d5133118cdb19bb90a0a770c835497835 Author: Ivan Goncharov Date: Tue May 21 23:41:48 2019 +0300 Enable "no-case-declarations" ESLint rule (#1887) commit 827880d7b56d855dbc2e6e055967bec82a25dc23 Author: Ivan Goncharov Date: Tue May 21 18:53:37 2019 +0300 Remove TODO on "no-warning-comments" ESLint rule (#1886) commit cce59e9b52e2882bd82fbbe64bfc2c31313a0eb3 Author: Ivan Goncharov Date: Tue May 21 18:32:41 2019 +0300 Explicitly create Promise using "Promise.resolve" (#1885) commit 41742d4d426dcf4849a84722dfc037e5055498bd Author: Ivan Goncharov Date: Tue May 21 16:48:45 2019 +0300 memoize3: Explicitly pass arguments (#1884) commit 58832ae2468afbf377f9948ed79e09a86098ee2a Author: Ivan Goncharov Date: Tue May 21 16:13:41 2019 +0300 Enable "no-sequences" ESLint rule (#1883) commit 176aa7fba73c95a4d588693741cf7bf4aa38e1b6 Author: Ivan Goncharov Date: Tue May 21 16:04:19 2019 +0300 Enable 'prefer-promise-reject-errors' ESLint rule (#1882) commit b1a39de02248de9ab60fb54ca02a3ffc5278a8cc Author: Ivan Goncharov Date: Tue May 21 13:08:47 2019 +0300 Partly fix "sketchy-null-bool" Flow rule (#1881) commit f01da1b7a5e3e8120f082306c2c3e3a1d04f81fd Author: Ivan Goncharov Date: Tue May 21 12:40:34 2019 +0300 Enable "sketchy-null-mixed" Flow check (#1880) commit c80e36dcf31e3867864a5b86929d147778d3d31d Author: Ivan Goncharov Date: Tue May 21 12:12:21 2019 +0300 Use "isPromise" instead of testing for 'then' property (#1879) commit 4502ab9717387076518845b3df400329e68b05f3 Author: Ivan Goncharov Date: Mon May 20 22:13:22 2019 +0300 Rename 'fs-utils.js' to 'utils.js' (#1877) commit c278744bbae0a29a9fc2148350103c34cbf92cdb Author: Ivan Goncharov Date: Sun May 19 22:34:39 2019 +0300 Enable prettier for "resources/*.js" files (#1875) commit cabfd343e964ea32c611315c9b1ea57a9cfd8275 Author: Ivan Goncharov Date: Sun May 19 21:47:58 2019 +0300 inline-invariant: use template instead of AST (#1876) commit 8263c96e9889a0eb2534ff014da9d87ea9582e25 Author: Ivan Goncharov Date: Sun May 19 19:23:29 2019 +0300 Enable "no-inner-declarations" rule on "resources/*.js" files (#1874) commit fc2873c25a09618b1efa105cd15a8974f5c5fbde Author: Ivan Goncharov Date: Sun May 19 12:16:57 2019 +0300 Fix lint issues in 'resources/*.js' files (#1873) commit 879f6caed14c6fba0d6b51d260f96715e8eb6b6e Author: Ivan Goncharov Date: Sun May 19 11:51:26 2019 +0300 Replace all "var" with "const" & "let" in "resources/*.js" files (#1872) commit 236cb83b1ee87dcd9bdd2e0eb5325ea48d6e3a2e Author: Ivan Goncharov Date: Sun May 19 11:16:33 2019 +0300 Lint JS files inside "resources" folder (#1871) commit abb12852ccd023471ae29e4c1c3240d5373b4add Author: Ivan Goncharov Date: Sun May 19 10:58:03 2019 +0300 Add missing "use strict" (#1870) commit 66e438f822ad97ea693f231ddda1c6539a7c644d Author: Ivan Goncharov Date: Sun May 19 10:11:42 2019 +0300 ESLint: remove useless "parserOptions" options (#1869) commit 413fc905827f39d2f3e9f93007a2a1e317056107 Author: Ivan Goncharov Date: Sat May 18 23:12:46 2019 +0300 Add missing "@noflow" (#1868) commit 0e72b35639cff8abfbf9f84b168da35523939e41 Author: Ivan Goncharov Date: Sat May 18 22:33:08 2019 +0300 ESLint: Simplify exclude for "no-restricted-syntax" rule (#1867) commit ad2110ed2c5e49954c63fb7cea6b16ddde7e98ca Author: Ivan Goncharov Date: Sat May 18 21:30:51 2019 +0300 Enable Flow in "visitor-test.js" (#1866) Fixes #1484 commit 55bb0ebe811929ed8227f09fc813ffb196e35ddb Author: Ivan Goncharov Date: Sat May 18 19:11:48 2019 +0300 Enable Flow on "subscribe-test.js" (#1865) commit 86f2464ea9d1837f796a93fda210bea432293082 Author: Ivan Goncharov Date: Fri May 17 19:16:59 2019 +0300 Drop parser option since Prettier supports Flow by default (#1864) commit b6e63ec73525a60e79e8ad7538025803602a26d3 Author: Christoph Zwerschke Date: Fri May 17 18:08:36 2019 +0200 Fix some typos in stripIgnoredCharacters docs+tests (#1863) commit 110d0c18324402a80c4d6059552124a01ca08feb Author: Ivan Goncharov Date: Thu May 16 01:37:24 2019 +0300 Update 'eslint-plugin-flowtype' (#1862) commit d1d30051f0cd295d72f971540771b77189c92178 Author: Ivan Goncharov Date: Tue May 14 21:33:56 2019 +0300 Update deps (#1861) commit 69094390d3c5a997d498e2afea507afb76a9a0f9 Author: Ivan Goncharov Date: Mon May 13 14:09:55 2019 +0300 Update deps (#1856) commit b65ff6db8893c1c68f0f236c4b2d663e6c55f5ef Author: Ivan Goncharov Date: Wed May 8 20:50:53 2019 +0300 Add 'yarn check --integrity' to CI tests (#1855) To prevent situations similar to: https://github.com/graphql/graphiql/pull/797 commit 4bd1a114f6e061677255e6aba8f5ebc48579851e Author: Ivan Goncharov Date: Tue May 7 13:02:37 2019 +0300 v14.3.0 commit 972a150ba87b2de4a43c32562d8846975fd1b504 Author: Ivan Goncharov Date: Tue May 7 12:57:03 2019 +0300 Update Flow to 0.98.1 (#1852) commit e90a5cabdc63c6ebbeb69b16e2272801eaafa253 Author: Ivan Goncharov Date: Tue May 7 00:11:46 2019 +0300 nyc: Switch config from JSON to YAML and move args from package.json (#1851) commit d69c533f9077979e47789e96ff388c717e6633ea Author: Christoph Zwerschke Date: Mon May 6 10:25:13 2019 +0200 Add comment to make test better understandable (#1850) commit 9ab5dfbbae0cb6e08b2e16d2d22b4eb1f94375fc Author: Ivan Goncharov Date: Sun May 5 19:03:30 2019 +0300 Update deps (#1849) commit e0fbf9091635e3e30d078822e6137d6600d7b7a2 Author: Ivan Goncharov Date: Fri May 3 17:10:24 2019 +0300 Remove Flow workaround for const arguments (#1848) commit ccbbb2961cb701740982a76189c6145d28093e89 Author: Christoph Zwerschke Date: Fri May 3 15:51:32 2019 +0200 isSpecifiedDirective should not assume Directive type (#1837) These can now both be used as standalone tests. Also added some unit tests for these predicates. commit d6c973a8eea20f5b6e361c6136ee1b7bf8bea4c2 Author: Ivan Goncharov Date: Thu May 2 15:45:22 2019 +0300 Adapt benchmark to the new build script (#1845) commit 316e24e9803d8ce1581090e84ef0eabf86263e85 Author: Ivan Goncharov Date: Thu May 2 15:35:23 2019 +0300 Correctly trap errors in shell scripts (#1844) commit 22f07194d74c19da1639b16e144c0f183391d72f Author: Ivan Goncharov Date: Wed May 1 19:02:56 2019 +0300 Fix "npm run build" on Node 10 (#1843) commit ec206fc2675b99ebde72eb38ee0ec023e0e2b0b7 Author: Ivan Goncharov Date: Wed May 1 18:46:12 2019 +0300 Terminate shell scripts if any subcomand terminated (#1842) commit c11ccba96f5b9b267dad7ffe264582fe816ced1b Author: Ivan Goncharov Date: Wed May 1 17:11:22 2019 +0300 Make single 'build.js' to handle NPM package build (#1841) commit 1023264408a3c36a21f8330ddb88eea6efb9583d Author: Ivan Goncharov Date: Wed May 1 16:48:42 2019 +0300 ESLint: enable 'arrow-body-style' rule (#1840) commit cd80f94edc584c5cf3258d27b6f91ab3b72f0cce Author: Ivan Goncharov Date: Mon Apr 29 23:01:04 2019 +0300 ESLint: enable all low-hanging rules and mark rest as TODO (#1839) commit ce832eef31ee136140757f397c2478e696d10fcb Author: Ivan Goncharov Date: Mon Apr 29 19:52:29 2019 +0300 Mark all ESLint rules that conflict with Prettier (#1838) commit 6dfc94cc2aafcbf8727908dea4a99a8ec799da0f Author: Ivan Goncharov Date: Mon Apr 29 17:37:25 2019 +0300 Use Flow shorcut for importing types and enable related ESLint rules (#1836) commit dfcdce789aaf7ba599a5b6e6c6de25f1c8cda934 Author: Ivan Goncharov Date: Sat Apr 27 09:23:22 2019 +0300 Flow: Enable "sketchy-number" lint rule (#1834) commit fe1a035a8be54c2fef77c8be344b7747cee7c224 Author: Ivan Goncharov Date: Sat Apr 27 09:01:42 2019 +0300 List Flow lint rules and enable low-hanging fruits (#1833) commit 09940fbd1c561ab6fa9d1d7bcbe16d90a76eace5 Author: Ivan Goncharov Date: Sat Apr 27 08:53:00 2019 +0300 show flow warnings and fixes all reported ones (#1832) commit 09ed81624d3420ac782681e6ee086547df281ed7 Author: Ivan Goncharov Date: Sat Apr 27 08:03:28 2019 +0300 Speed up flow check (#1831) commit 201e5526e2b1963b76ee8be762a7a45128117895 Author: Ivan Goncharov Date: Sat Apr 27 07:24:04 2019 +0300 Update deps (#1830) commit 0b1b53a87ec66181201b77f6d684dc5eb53374bc Author: Ivan Goncharov Date: Thu Apr 25 20:08:42 2019 +0300 ci: add Node v12 (#1829) commit 294eba2e29779b190e6bf666f861b57051245adc Author: Ivan Goncharov Date: Thu Apr 25 17:27:31 2019 +0300 build: generalize ignore patter to include all '__*__' dirs (#1828) commit 86f6e821c803d7f1e22a99d7d22aab63c6c9f957 Author: Ivan Goncharov Date: Tue Apr 23 17:28:55 2019 +0300 Synchronise and fix styling of "index.js" files (#1826) commit a9e87ce3f31393e824544aa9d98ff17ccb745629 Author: Ivan Goncharov Date: Tue Apr 23 16:28:23 2019 +0300 Add missing exports for createLexer, syntaxError and locatedError (#1825) commit 83ccbe2cf4ae9a2d38323a68563060a1b0d28057 Author: Ivan Goncharov Date: Tue Apr 23 12:50:19 2019 +0300 Update deps (#1824) commit 3c0c09b805f0a52fe6855c45fa1ffba02abbec9f Author: Ivan Goncharov Date: Mon Apr 22 16:11:40 2019 +0300 Add 'package-lock.json' to ignored files (#1822) commit 77c36183ff46d7d8853f8d6fe1051ebd59d89392 Author: Ivan Goncharov Date: Wed Apr 17 16:28:28 2019 +0300 Update deps (#1820) commit 38b9935430c34d8c700a1cc463a4f039739ce71d Author: Ivan Goncharov Date: Wed Apr 10 18:18:28 2019 +0400 Update deps (#1818) commit b8a0f3b9a9fc7057acb8e91327818b37f0eaf406 Author: Christoph Zwerschke Date: Mon Apr 8 00:53:36 2019 +0200 Add JSDoc for typeResolver to the graphql() function (#1816) commit 8aef229cb29031eb475e3d647ad94c8d19b72461 Author: Ivan Goncharov Date: Thu Apr 4 17:48:10 2019 +0300 Update 'eslint-plugin-flowtype' to v3.5.1 (#1814) commit f56905bd6b030d5912092a1239ed21f73fbdd408 Author: Ivan Goncharov Date: Thu Apr 4 01:23:03 2019 +0300 Update babel to v7.4.3 (#1813) commit 081db43fc3b05bd93e9317ea1de011b521c5a216 Author: Ivan Goncharov Date: Tue Mar 26 15:04:42 2019 +0200 Add `stripIgnoredCharacters` utility function Heavily based on work done by @rybon in #1628. Solves #1523. commit 280edb6836d2885820d339db752c42117b4153cb Author: Ivan Goncharov Date: Tue Mar 26 15:02:30 2019 +0200 Extract 'getBlockStringIndentation' function commit 3e849625b8974ea0f8e11271b818386c0c4b093e Author: Ivan Goncharov Date: Tue Mar 26 14:59:52 2019 +0200 Add 'isPunctuatorToken' to internal API commit ce23444ade0114d5fd39250b38f50b5da64694ff Author: Ivan Goncharov Date: Tue Apr 2 11:07:59 2019 +0300 Update Flow to 0.96 (#1812) commit 0a98379455964a906549ac54ca838b93616b919f Author: Ivan Goncharov Date: Sun Mar 31 19:36:10 2019 +0300 buildSchema/extendSchema: test standard scalars (#1810) Background: https://github.com/graphql/graphql-js/commit/183ff32bee4bc23eb23657f79f414c2400ecb06a#r32971387 commit d2ffd7c0aa3488c7aaadc7610fe6102d6c4e8c07 Author: Ivan Goncharov Date: Sun Mar 31 15:04:02 2019 +0300 v14.2.1 commit 3c79bed721b6e038d8d2bf68aeaef8005bb7f348 Author: Ivan Goncharov Date: Sun Mar 31 15:03:09 2019 +0300 buildClientSchema: Revert breaking change introduced in #1677 (#1808) More details here: https://github.com/graphql/graphql-js/commit/183ff32bee4bc23eb23657f79f414c2400ecb06a#r32971387 commit f28955552dd4cea6c12aca7e0ae2030c0a039fcd Author: Ivan Goncharov Date: Sun Mar 31 13:49:46 2019 +0300 Update to ESLint 5.16 (#1807) commit c1376e3aa113c118c17115e17978dd6d86ab6ffe Author: Ivan Goncharov Date: Fri Mar 29 13:09:12 2019 +0200 Enable Flow on more test files (#1806) commit 13218588b57fb447dc321c402b3da54efbeb0739 Author: Ivan Goncharov Date: Tue Mar 26 21:06:32 2019 +0200 v14.2.0 commit 0b5e95556ef8334416a1dcb97084c1cc0a21ff5e Author: Christoph Zwerschke Date: Sun Mar 24 22:20:08 2019 +0100 Tiny simplification in the parser code (#1801) commit 0d2c01d888cc2cc2ccae75286e72ebf69efebd28 Author: Ivan Goncharov Date: Sun Mar 24 08:36:58 2019 +0200 Update deps (#1800) commit 329f35718d1e8683995f682f0805250aec37ce9d Author: Ivan Goncharov Date: Fri Mar 22 23:09:12 2019 +0200 Rename 'MaybePromise' to 'PromiseOrValue' (#1798) Suggested by @martijnwalraven `MaybePromise` name confuses users into thinking: `execute`/`graphql` returns either Promise or null/undefined. Also in our codebase we use `[Mm]aybe*` to represent optional things, e.g.: https://github.com/graphql/graphql-js/blob/8c96dc8276f2de27b8af9ffbd71a4597d483523f/src/language/visitor.js#L353 https://github.com/graphql/graphql-js/blob/8c96dc8276f2de27b8af9ffbd71a4597d483523f/src/language/printer.js#L244 commit 84ea1c98858054cdfd6089f65bc5c229a8deaea2 Author: Ivan Goncharov Date: Thu Mar 21 09:53:58 2019 +0200 Update to Babel 7.4.1 (#1797) commit fe0705f3fcf46a863a26c2a0d7dcfe5585827fd6 Author: Ivan Goncharov Date: Wed Mar 20 09:37:24 2019 +0200 Update deps (#1796) commit c83412f19e88fda4815a26340127d938fd4f3b2f Author: Ivan Goncharov Date: Sat Mar 16 13:57:51 2019 +0200 Switch 'check-cover' to use Flow's 'batch-coverage' cmd (#1795) commit 26da75ed9a365aab3ea5ada5abac2d9acfc1e0ac Author: Ivan Goncharov Date: Fri Mar 15 21:25:58 2019 +0200 Update Flow to v0.95 (#1794) commit ffccf3f3362c304fd18e2132609dbc7e8d94e968 Author: Ivan Goncharov Date: Fri Mar 15 04:21:44 2019 +0200 inspect: Add test for circular object as result of custom inspect commit 13757768686ab452d528d4b0a261bb1216f2faab Author: Ivan Goncharov Date: Thu Mar 14 13:00:07 2019 +0200 inspect: detect circular objects commit 97a2e98a60f7f63c7bf5085d48f172e1916d5417 Author: Ivan Goncharov Date: Thu Mar 14 11:40:56 2019 +0200 inspect: Correctly handle custom inspect returning `this` commit ad35c41ebc6205d39a6ed496c9a1fb5089b7790d Author: Ivan Goncharov Date: Mon Mar 4 19:20:59 2019 +0200 inspect: Limit maximum depth of printed objects commit 68058b24c9e2227fd89c4e86fd6399dbde2ef3f9 Author: Ivan Goncharov Date: Sun Mar 3 22:33:35 2019 +0200 inspect: move implementation into `formatValue` commit b3d9a5cf358b0259b01d0c43d2b4fc112d74651d Author: Ivan Goncharov Date: Sun Mar 3 21:44:49 2019 +0200 inspect: Limit maximum number of printed items to 10 commit b699cfc54cfeefdb20bbad7e99b6c2c4c36aaf04 Author: Ivan Goncharov Date: Fri Mar 15 08:12:57 2019 +0200 Update deps (#1793) commit a001adb67b08a98ce176f8848f04170f1f91d2fe Author: Christoph Zwerschke Date: Fri Mar 15 03:28:05 2019 +0100 Duplicate fields in deep inputs not validated properly (#1791) (#1792) commit b8eb8de714e38e414d4e36ae01aea161b352eb13 Author: Ivan Goncharov Date: Mon Mar 11 04:41:44 2019 +0200 Fix test case description (#1785) Reported by @zonr here: https://github.com/graphql/graphql-js/commit/323f2d2d2763b2f0502cc55beaa6ccaf89d8f423#r32669772 commit 8c96dc8276f2de27b8af9ffbd71a4597d483523f Author: Ivan Goncharov Date: Mon Mar 11 04:18:15 2019 +0200 Remove year from LICENSE headers (#1670) commit 2daa0ed05e5d8f3675f2d6b44d786578ea5b56cf Author: Christoph Zwerschke Date: Sun Mar 10 23:14:49 2019 +0100 Fix grammar in error message (#1782) commit 36d13aec6e47d4c42f922159cfa837dbec5fe3cb Author: Christoph Zwerschke Date: Sun Mar 10 23:10:33 2019 +0100 Add directive predicates tests and fix test names (#1781) commit 15b707ade23f196805a22f6aaed1b5ed77e481ed Author: Ivan Goncharov Date: Mon Mar 11 00:07:29 2019 +0200 Prettier: normalize line ending to git standard (#1777) commit d2e29e9bfceaec0b6f66d4336dafd6ade543840d Author: Christoph Zwerschke Date: Thu Mar 7 23:58:42 2019 +0100 Minor spelling errors in PossibleTpyeExtensions (#1778) commit 38b01afc56456b972a1202048b6e00cd95b49291 Author: Ivan Goncharov Date: Thu Mar 7 18:12:56 2019 +0200 Update deps (#1776) commit 514e7d54d5eecd445737af74353f6777a7cf472f Author: Aaron Ross Date: Tue Mar 5 09:17:03 2019 -0500 fix out of range return check for charCodeAt in lexer (NaN instead of null) (#1772) According to the [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt#Return_value), `String.prototype.charCodeAt` will only ever return a `number` or `NaN`, never `null`. This PR updates that check in each of the 4 places that it occurs. commit d0aaa389bcee3e839f96f901ab56bbccd468c31c Author: Ivan Goncharov Date: Mon Mar 4 19:25:10 2019 +0200 Update deps (#1768) commit 9dc9a56e174371c12c4b69a32d4b1e571f96c346 Author: Ivan Goncharov Date: Sun Mar 3 21:42:12 2019 +0200 Use non-capturing group inside RegExp (#1767) commit 92cfd86aadbf105f3df82ecbdd7e04b4fd9b7cd1 Author: Christoph Zwerschke Date: Sun Mar 3 18:48:23 2019 +0100 Minor code simplification in validation rules (#1764) I think the control flow is a little bit better readable and cleaner that way. commit 24f1dc74b0523396404c82a6e3347e51436c721a Author: Christoph Zwerschke Date: Sun Mar 3 18:24:50 2019 +0100 Fix validator test names (#1765) commit 49fc99e310dee84ac41ada8e17fc7845285e1411 Author: Ivan Goncharov Date: Sun Mar 3 19:22:06 2019 +0200 Update ESLint to 5.15 (#1766) commit 68f4d0778fd8c08933ef5c64359de9e4b8981943 Author: Christoph Zwerschke Date: Sat Mar 2 22:04:47 2019 +0100 Fix typos in UniqueOperationTypes test (#1763) commit fc5a67946d81a30d3f1fd49086a0e94bcfab3478 Author: Ivan Goncharov Date: Fri Mar 1 18:18:38 2019 +0200 Update Flow to 0.94 (#1759) commit 0addc5b43009be9a1429cddaafc3d32b333e1bf9 Author: Ivan Goncharov Date: Fri Mar 1 16:02:25 2019 +0200 Tests: 'expect(...).to.eql' => 'expect(...).to.deep.equal' (#1758) commit fbd9c4700a3dd6d72c9190d25d0e5c223dbfe444 Author: Ivan Goncharov Date: Fri Mar 1 15:48:34 2019 +0200 GraphQLError: don't wrap single node in array (#1757) commit 8013c0dc2bbdd18000847a85f0f99f234487eabf Author: Ivan Goncharov Date: Fri Mar 1 01:04:45 2019 +0200 Speedup parser (~50%) by using 'slice' and 'charCodeAt' directly (#1756) commit 4116e2fc4fe36688f683258388f4a2d52076d199 Author: Ivan Goncharov Date: Tue Feb 26 17:09:57 2019 +0200 Update deps (#1754) commit 1be6d0ccd8919d4d0b10fe37ca3abba0ea52e87f Author: Ivan Goncharov Date: Fri Feb 22 00:47:31 2019 +0200 Update deps commit 961dab320ba579b8639d218c041b6bd6b7f6664d Author: Ivan Goncharov Date: Thu Feb 21 19:54:14 2019 +0200 Unify 'printBlockString' tests in correct place commit cdef6a9638136440d87ec7f581e11ca0b6bd03d7 Author: Ivan Goncharov Date: Thu Feb 21 19:06:53 2019 +0200 blockString-test: extract 'joinLines' util function commit f0c3ff4bc12a9ec9ab54fb4d6fe4db5365986d02 Author: Ivan Goncharov Date: Thu Feb 21 17:55:27 2019 +0200 Rename 'blockStringValue.js' to 'blockString.js' commit ded32618cc17c3a42a79da09dd1f0516ceb85103 Author: Ivan Goncharov Date: Thu Feb 21 17:51:46 2019 +0200 Unify 'print' and 'printSchema' output for block strings commit 34d934e98d29f869d6078725436df0b702177967 Author: Ivan Goncharov Date: Thu Feb 21 17:43:56 2019 +0200 Rename 'blockStringValue' => 'dedentBlockStringValue' commit 2554a3b3b8485e24f49d8a05b6043ce9e37b4217 Author: Ivan Goncharov Date: Thu Feb 21 00:50:42 2019 +0200 Simplify benchmark by using more low-level API from 'benchmark.js' (#1750) commit 7786a2524b759401142be1eb0999df4a55f1672b Author: Ivan Goncharov Date: Wed Feb 20 12:19:18 2019 +0200 Inline 'beautify-benchmark' + heavy refactoring (#1748) Also fixes https://github.com/Fishrock123/beautify-benchmark/issues/3 commit f205c99c676bb71b9c5c043e574a5c96856fc265 Author: Ivan Goncharov Date: Tue Feb 19 22:13:18 2019 +0200 Use ESLint cache for local development (#1747) commit 6ffacd06c5e95da77081cc4b6bd96362630ba2fd Author: Ivan Goncharov Date: Tue Feb 19 14:39:01 2019 +0200 Use ESLint cache to speedup watch (#1746) commit 072b14dfa3653dee931478bef6ba02bf17dc4fa7 Author: Ivan Goncharov Date: Tue Feb 19 13:17:17 2019 +0200 Do not run duplicating parser step on watch (#1745) commit 7c57ffc8daaf2b42e50503d5282eb439ee48dfdf Author: Ivan Goncharov Date: Tue Feb 19 04:38:35 2019 +0200 Remove 'yarn t' in favor of 'yarn mocha' or 'npm run mocha' (#1744) commit 28be9be0415adb4b8a113bd678792c263b2386b0 Author: Ivan Goncharov Date: Tue Feb 19 04:29:22 2019 +0200 Move Mocha config into .mocharc.yml (#1743) commit c282aae0b3b3aaea5ec4d2a31d8169d948cf144a Author: Ivan Goncharov Date: Tue Feb 19 03:39:03 2019 +0200 Update to Mocha v6 (#1742) commit a579c26f748c060afe3e05742b29ba9cae06067d Author: Ivan Goncharov Date: Sun Feb 17 19:28:26 2019 +0200 Update ESLint to v5.14 (#1741) commit 6187a2ec68f809d8d81bf7411975d3cca8ff362a Author: Ivan Goncharov Date: Sun Feb 17 14:51:20 2019 +0200 Update deps (#1740) commit 3172421baa7c9da5d64192e73974e44517248614 Author: Ivan Goncharov Date: Fri Feb 15 17:00:21 2019 +0200 Move list of supported targets into separate file (#1739) commit df358775c3010269d870c7b1a8b6126c5f42fa82 Author: Ivan Goncharov Date: Fri Feb 15 02:48:26 2019 +0200 Update nyc (#1738) commit 3bf7ab0673dc4ba21a3e550309250f2349795656 Author: Ivan Goncharov Date: Fri Feb 15 02:32:58 2019 +0200 Remove custom mocha timeout (#1737) commit 5acd58712c8f0d37045461b8f3d4ca1555e2a0d1 Author: Ivan Goncharov Date: Fri Feb 15 02:19:17 2019 +0200 Speedup visitor test on kitchenSinkQuery (#1736) commit 5d6973512a3e97a76b2ea6d88194e8e234e499f2 Author: Ivan Goncharov Date: Thu Feb 14 21:13:17 2019 +0200 Simplify checking of args inside visitor tests (#1735) commit 0736269cdfd7afa8e2e2b8caf130f8ea8f02f470 Author: Ivan Goncharov Date: Thu Feb 14 17:39:12 2019 +0200 Use AST abbreviation consitently (#1734) Should be consistent with public API, e.g. buildASTSchema commit 7e2199aa5b678ef071e1baf910fd58d0ba32766f Author: Ivan Goncharov Date: Thu Feb 14 16:04:08 2019 +0200 General cleanup of definition tests (#1733) commit 02e9f008d61a287fba8a925c59bb313673e27499 Author: Ivan Goncharov Date: Thu Feb 14 12:52:45 2019 +0200 Update Flow to 0.93 (#1732) commit a84775aabfd5cfb4db2b7337bf599fbf1384e1fb Author: Ivan Goncharov Date: Wed Feb 13 01:08:48 2019 +0200 Update 'eslint-plugin-flowtype' (#1731) commit 4b55f10f16cc77302613e8ad67440259c68633df Author: Ivan Goncharov Date: Tue Feb 12 21:56:51 2019 +0200 Allow for long string literals inside tests (#1730) commit 3caf46c8cf08e6092c12061fa18f4f21b3ea07ca Author: Ivan Goncharov Date: Tue Feb 12 18:02:18 2019 +0200 Remove useless positive isTypeOf tests, since this function is optional (#1729) commit 2112217a6293ad2e024b3d48f9f0c08238968f1c Author: Ivan Goncharov Date: Tue Feb 12 16:42:08 2019 +0200 Unwrap type definition tests (#1728) commit 2ab5232f3c688b5965e5ce014b1d091ed61b3864 Author: Ivan Goncharov Date: Mon Feb 11 00:44:40 2019 +0200 Group type definitions tests by type kind (#1725) commit 55c03fbaa79c3e7575352e55f5028f15570b576c Author: Ivan Goncharov Date: Sun Feb 10 21:39:43 2019 +0200 Add missing toStringTag into GraphQLList and GraphQLNonNull (#1724) commit 2fcd55eb88a0a9ed560ad94b8c2f072bf9167f40 Author: Ivan Goncharov Date: Sun Feb 10 21:20:00 2019 +0200 Move 'Object.toString' test to the appropriate files (#1723) Move 'Object.toString' tests to the appropriate files commit 948c9cf0b7881742cbc2a8219e54edeb09458b23 Author: Ivan Goncharov Date: Sun Feb 10 20:48:03 2019 +0200 Remove duplicating NonNull test (#1722) commit 271e23e13ec093e7ffb844e7ffaf340ab92f053e Author: Ivan Goncharov Date: Fri Feb 8 20:02:58 2019 +0200 definition tests: simplify NonNull and List tests commit 65a499a39faf785fe302c9622da08e195d3d7524 Author: kommander Date: Fri Feb 8 11:25:49 2019 +0100 Fix error message typo for extend types commit 0f3c1777100e9606f5e0e9b509e6e2a807b137ad Author: Ivan Goncharov Date: Thu Feb 7 16:57:19 2019 +0200 Move schema related test to "schema-test.js" + cleanup (#1719) commit d55f6d364ada22c122c718ddf74951b20ef0b17b Author: Ivan Goncharov Date: Thu Feb 7 00:08:06 2019 +0200 Make all "not reachable" look and work the same (#1718) commit c32d2d8a6d149ae01cbcf6cfa244db644fdf8122 Author: Ivan Goncharov Date: Wed Feb 6 18:20:40 2019 +0200 NonNull tests: Use SDL to create test schema (#1717) commit 82851fcbf21c7eedbbf220f3fcd49fb548c90f55 Author: everdimension Date: Tue Feb 5 19:18:02 2019 +0300 Improve error message for missing required argument in field or directive (#1554) commit 7fa94cd62439c86f1ee8f7986d522074bdb51dd6 Author: Ivan Goncharov Date: Tue Feb 5 12:37:57 2019 +0200 Update deps (#1714) commit be2408e57c23df3e9ef60ed4cce02e49368fe58b Author: Ivan Goncharov Date: Mon Feb 4 18:17:23 2019 +0200 Update deps (#1712) commit f2a0c640bb90ed7d92d5ced236f632680aa04774 Author: Ivan Goncharov Date: Sun Feb 3 19:25:56 2019 +0200 tests: remove useless parseLiteral & parseValue callbacks (#1711) commit f21acaed9db0da781e7612fe90fc12805d249880 Author: Ivan Goncharov Date: Sun Feb 3 18:37:26 2019 +0200 Simplify "Type Map: includes input types only used in directives" test (#1710) commit d98f40c591182449496186e9cf437ed23552f47e Author: Ivan Goncharov Date: Sun Feb 3 18:04:04 2019 +0200 Parser: use "any" util fn to parse object literal (#1709) commit 9cf372fa050fac258d06ac9996aa7d2944445c26 Author: Ivan Goncharov Date: Sun Feb 3 17:16:41 2019 +0200 buildASTSchema: test building of empty types (#1708) commit ebec940f108d156ff5d2dc870c1292d70de9a8cf Author: Ivan Goncharov Date: Sun Feb 3 11:47:47 2019 +0200 printSchema: Fix printing of empty types (#1707) commit 34b7ced883ff813a1d2d13c5fd58ba8158d69b60 Author: Ivan Goncharov Date: Sun Feb 3 11:05:06 2019 +0200 Cleanup unnecessary Query types from printSchema tests (#1706) commit 56ad8a1f986404fdc8e7d5804ca131e9e7c92d3b Author: Ivan Goncharov Date: Sun Feb 3 10:36:07 2019 +0200 Use isLeafType instead of isEnumType & isScalarType combo (#1705) commit 96c826d00e62f0de67f868e78a26f913e383e5c5 Author: Ivan Goncharov Date: Fri Feb 1 21:40:10 2019 +0200 Update ESLint (#1704) commit 213c8a722486dec9d5ce203f147df36a3a43b491 Author: Ivan Goncharov Date: Fri Feb 1 17:46:57 2019 +0200 Add Flow typing for 'print' function (#1702) commit 7947145017dd2b1527a61b81e6aa6e4036c678b8 Author: Ivan Goncharov Date: Fri Feb 1 00:43:43 2019 +0200 Update Flow and other deps (#1700) commit 6bf2b4407adb74dcdf55dd0a577f36a15979d090 Author: Ivan Goncharov Date: Wed Jan 30 19:00:49 2019 +0200 Update deps (#1699) commit f1c9b8221eedcdf24a78b2656e86eca12bddde1c Author: buoyantair Date: Tue Jan 29 18:58:41 2019 +0530 Documentation for explicitly mentioning ObjectTypes (#1679) * Documentation for explicitly mentioning ObjectTypes Based on the discussion at #1413 * Minor typo/fix * Edit example doc for schema definition - provide more clear example /w interfaces & types - rewrite to note with more clarity - move the note above the note on directives * clarify documentation * Remove unwanted star commit e2dec8459cc6266d1e40e5ebeecfde45f6a96e25 Author: Ivan Goncharov Date: Tue Jan 29 13:11:02 2019 +0200 Fix missing schema's astNode when schema was defined inside extension (#1698) commit c680b6c5dbee18b881ed7d5d27790c0418e91f88 Author: Ivan Goncharov Date: Mon Jan 28 19:03:37 2019 +0200 Remove Flow workaround in buildASTSchema (#1697) commit 784e71ba0c979fcbee9f653b505c9d7067f5e95b Author: Ivan Goncharov Date: Mon Jan 28 17:04:41 2019 +0200 Improve coverage for lexicographicSortSchema (#1696) commit afc6b7c04708068e3733d8e85882e4b2e4ef58e5 Author: Ivan Goncharov Date: Sun Jan 27 22:32:19 2019 +0200 Remove excessive cache inside buildSchema and extendSchema commit f57a01ede069cdfd551946b31096c7235f5308ea Author: Ivan Goncharov Date: Sat Jan 26 23:10:07 2019 +0200 Use consistent naming in buildSchema and extendSchema sources commit 0324ba9647715f7e80b6975dd7dd5d295d955dbc Author: Ivan Goncharov Date: Mon Jan 28 01:21:58 2019 +0200 Make codecov less spammy (#1694) Make codecov less spammy commit 8cd3150ec062c5d9296c67f9cb2de93b68041547 Author: Ivan Goncharov Date: Fri Jan 25 20:57:13 2019 +0200 Move coverage upload to .travis.yml (#1693) commit 2cf7cddff7c6cfcb704c81eadce586d6060e86a4 Author: Ivan Goncharov Date: Fri Jan 25 17:34:04 2019 +0200 Run full CI only on node LTS (#1692) commit d49460f0d69fe529f60fcf853c7a984a6d6b7155 Author: Ivan Goncharov Date: Fri Jan 25 16:01:57 2019 +0200 Disable coverage on deprecated 'isValidJSValue' function (#1673) commit 5fc3faf549388e59d196644585e61dc2994de6c6 Author: Ivan Goncharov Date: Fri Jan 25 12:38:12 2019 +0200 Improve code coverage reporting (#1689) commit 005e96c66e1d6db8df601879ddc6c59aaa196e05 Author: Ivan Goncharov Date: Fri Jan 25 00:30:13 2019 +0200 Temporary migrate tests from node 11.7 to 11.6 to fix codecov (#1690) Fixes #1682 commit ff041cef5b1c20230b03f198090c4430a84be7de Author: Ivan Goncharov Date: Thu Jan 24 14:55:47 2019 +0200 Add polyfill for 'flatMap' (#1686) commit 27691d82c6268f9a612cc572b0b825c489a92016 Author: Matt Mahoney Date: Wed Jan 23 17:41:45 2019 -0500 Fix codecov in yarn.lock (#1688) commit 4ed25af3afbf4093fcd54f51209cd7aff3225473 Author: Matt Mahoney Date: Wed Jan 23 17:27:19 2019 -0500 Switch from coveralls to codecov for Travis CI (#1687) * Switch from coveralls to codecov for Travis CI * move to devDepencies commit 6af5a0c2cc50347ec4b4f435eb46dc26172bb674 Author: Ivan Goncharov Date: Wed Jan 23 18:08:37 2019 +0200 Update deps (#1685) commit ba7b8c1a5500bce7eb2e52b4ab7311fad965e908 Author: Ivan Goncharov Date: Tue Jan 22 23:52:19 2019 +0200 extract flatMap function out of extendSchema implementation (#1684) commit c2bc19badebd208ff21849e8f579e7034631af42 Author: Ivan Goncharov Date: Tue Jan 22 14:33:59 2019 +0200 Remove excessive cache inside lexicographicSortSchema (#1681) commit bdfd1c63e0b45fc48b9c52c2b652680049d76322 Author: Ivan Goncharov Date: Mon Jan 21 17:24:05 2019 +0200 buildClientSchema: move inner functions to follow return (#1678) commit 183ff32bee4bc23eb23657f79f414c2400ecb06a Author: Ivan Goncharov Date: Mon Jan 21 16:49:54 2019 +0200 Remove excessive cache inside buildClientSchema (#1677) commit f1f173043cc781d62568b4083f376437632c6689 Author: Ivan Goncharov Date: Sun Jan 20 15:26:08 2019 +0200 Update deps (#1676) commit fd308ceb72a90a3903411a830da46adcd1156177 Author: Ivan Goncharov Date: Tue May 1 21:27:21 2018 +0300 Allow providing custom default type resolver commit 898cf20a33c7abeaac2602de710d646b7c4b1758 Author: Ivan Goncharov Date: Sun Apr 29 11:21:47 2018 +0300 Make 'defaultResolveType' to match GraphQLTypeResolver type. commit 92e647ce756695ec6443169dd492bfa1dbb4f1a7 Author: Ivan Goncharov Date: Fri Jan 18 23:28:59 2019 +0200 [RFC]Add 'toConfig' method (#1331) `toConfig` is intended to help with schema transformation by minimizing the amount of code you need to write and maintain, e.g. [recreateType](https://github.com/apollographql/graphql-tools/blob/4e68230c10a9fd1c6cb601869aa3a1ff8f9f0b90/src/stitching/schemaRecreation.ts#L33) from `graphql-tools`. commit 5b17d41aa4c9095f21a256461cb4097829b3c9b5 Author: Sebastian Herrlinger Date: Fri Jan 18 18:54:55 2019 +0100 Inspect non-error types to produce helpful error messages for failing resolvers (#1600) Inspect non-error types to produce helpful error messages for failing resolvers (even though you should not throw literals, ever) commit 4abedd384ffaff9dd91331b3a19a55708d5691e6 Author: Ivan Goncharov Date: Fri Jan 18 16:11:55 2019 +0200 Remove useless if inside 'getAllSubNodes' function (#1672) commit 301e5aa7a576a9b0c853008c7a5484205b5c31d8 Author: Ivan Goncharov Date: Thu Jan 17 22:38:59 2019 +0200 Update Flow to 0.91.0 (#1671) commit b3d1f7b53afa2ab6e8b776fe6b7dc4fa2260759a Author: Ivan Goncharov Date: Thu Jan 17 13:36:44 2019 +0200 Parser: Better names for parser util functions (#1547) Based @OlegIlyenko suggestion: https://github.com/graphql/graphql-js/pull/1545#issuecomment-427196059 commit 7dd2b2bed841b9fd0c40c328826363ec79cc65c4 Author: Matt Mahoney Date: Wed Jan 16 14:05:48 2019 -0500 14.1.1 commit 51c67dc98a1f267121cbff1f1ef26722b353a41a Author: Matt Mahoney Date: Wed Jan 16 13:42:37 2019 -0500 Update travis api_key for npm deploys (#1667) * Update travis api_key for npm deploys * Modify less of the file, include email commit 7fe9985eeb2237b7d47f560bf8f3a3f06a3c3ae2 Author: Ivan Goncharov Date: Wed Jan 16 18:57:11 2019 +0200 Remove usage of Flow placeholder argument + cleanup (#1669) commit da61380e4728da6090850a61300d86979d8a8b15 Author: Matt Mahoney Date: Tue Jan 15 17:50:09 2019 -0500 14.1.0 commit 4de99f7be0bff55cc4ca4c1e3a2982877028b7e5 Merge: 37c022de 0a731a53 Author: Matt Mahoney Date: Tue Jan 15 16:30:30 2019 -0500 Merge branch 'OneCyrus-feat_listTypeForError' commit 0a731a53137495f617283f8e12b28177fa106110 Author: Matt Mahoney Date: Tue Jan 15 16:28:27 2019 -0500 Prettier and fix tests commit a6676dc67680fb783664def665056f0f3e396946 Merge: 37c022de b747bb4d Author: Matt Mahoney Date: Tue Jan 15 16:16:04 2019 -0500 Merge branch 'feat_listTypeForError' of https://github.com/OneCyrus/graphql-js into OneCyrus-feat_listTypeForError commit 37c022def5c33778382976e48bec4f2fbf4a1768 Author: Ivan Goncharov Date: Tue Jan 15 17:27:02 2019 +0200 buildClientSchema: add missing tests for introspection validations (#1666) commit 3fef0d4c710290d061e657e66826a24b5594a0f8 Author: Ivan Goncharov Date: Tue Jan 15 13:35:54 2019 +0200 Enable Flow on buildClientSchema tests (#1665) commit 68765877fa3647704eb48bdf791652f6d3f3f864 Author: Ivan Goncharov Date: Mon Jan 14 23:35:41 2019 +0200 Move $DisableFlowOnNegativeTest to more precise locations (#1664) commit b747bb4d9e84c546532b61725a3aa6220ee9c263 Author: Daniel Gut Date: Mon Jan 14 21:45:04 2019 +0100 changed type error message commit 8d7a5fd8013232d0f8664c7c431671a830f74329 Author: Ivan Goncharov Date: Mon Jan 14 19:10:02 2019 +0200 Merge schema validation tests with other schema tests (#1663) commit 6741ac20af33984c368e4f83fac1acf88b09530b Author: Ivan Goncharov Date: Mon Jan 14 11:52:39 2019 +0200 Add tests for GraphQLDirective (#1662) commit d48e48132abfc95cc5de71497759fa2feb36d5a2 Author: Ivan Goncharov Date: Mon Jan 14 00:36:56 2019 +0200 Move isInputType & isOutputType test to rest of predicates test (#1661) commit 4cdc8e2a283e5e551cc462fbd00b0ce01c9126af Author: Ivan Goncharov Date: Sun Jan 13 13:20:41 2019 +0200 Update Flow to 0.90.0 (#1660) commit 9f85d511a12d148fac610f27daf2f4cb23c7a9f9 Author: Ivan Goncharov Date: Thu Jan 10 23:02:50 2019 +0200 Remove excessive invariants (#1658) commit 0818c185da2a4c38b69c0eee684142616143bb5a Author: Ivan Goncharov Date: Thu Jan 10 17:30:08 2019 +0200 ignore .nyc_output dir (#1657) commit 9e404659a15d59c5ce12aae433dd2a636ea9eb82 Author: Ivan Goncharov Date: Thu Jan 10 17:02:30 2019 +0200 Move polyfills into separate dir and exclude them from coverage (#1656) commit 46dc16346ab4bff2de705ac247ebe29738ee3dad Author: Ivan Goncharov Date: Thu Jan 10 16:06:46 2019 +0200 Use 'Array.prototype.find' if available (#1655) commit 6ea1a1483d101c627b417d2552b5fd29c19b6476 Author: Ivan Goncharov Date: Wed Jan 9 15:17:49 2019 +0200 Enable Flow on definition tests (#1654) commit 49383b2c7b8a1fc27d990692c5cdb85270913ddf Author: Ivan Goncharov Date: Wed Jan 9 12:36:40 2019 +0200 Update deps (#1653) commit 0786b6b0894d99ef53b0a911e0f4fb3bb09f292c Author: Ivan Goncharov Date: Wed Jan 9 12:09:05 2019 +0200 Switch schema validation tests to Flow (#1652) commit ded38593d566104990b5053ac8bddbb2a0051e54 Author: Ivan Goncharov Date: Mon Jan 7 12:34:29 2019 +0200 Added 'jsutils/mapValue' (#1651) Based on: https://github.com/lodash/lodash/blob/master/mapValue.js commit 9a43d477fe5acc9170fb6dcbf2002fdafa903e0a Author: Ivan Goncharov Date: Sun Jan 6 23:49:42 2019 +0200 Simplify args definition (#1650) commit 126b5727e35526cf01893bb547e7c923ae72c8c1 Author: Ivan Goncharov Date: Sun Jan 6 22:42:08 2019 +0200 Convert a few cycles to use objectValues (#1649) commit c0327307e4be9067c394e2470badacdcbe44d383 Author: Ivan Goncharov Date: Sun Jan 6 22:03:50 2019 +0200 Use custom polyfill for 'Array.find' (#1648) commit 67c5d7c0ef6689352adefb6a9d58a41bf2fec438 Author: Ivan Goncharov Date: Sun Jan 6 20:39:15 2019 +0200 Add analog of 'Object.entries' to simplify and speedup iteration (#1647) commit 0df0553ba75eb38adef49b4ac7f34a1528903b13 Author: Ivan Goncharov Date: Sat Jan 5 21:58:11 2019 +0200 Remove unnecessary use of hasOwnProperty (#1646) commit 4c1cd0f3acffb3708ffa24b8cd0cb4c5e6bd36f6 Author: Ivan Goncharov Date: Sat Jan 5 02:15:45 2019 +0200 Update ESLint (#1645) commit 7a27ef19f4dcf528ad5295eb0a1ebaa1a07e2edc Author: Ivan Goncharov Date: Sat Jan 5 00:27:44 2019 +0200 Make "orList" function more readable (#1644) commit e6a3f08cc92594f68a6e61d3d4b46a6d279f845e Author: Ivan Goncharov Date: Fri Jan 4 03:29:06 2019 +0200 Extract check for possible extensions into a separate rule (#1643) commit 59d9f17e323ffe543b343322c8df2961bcf2bd7a Author: Ivan Goncharov Date: Thu Jan 3 16:24:31 2019 +0200 Move kitchenSink files into __fixtures__ (#1642) commit 1632bd607203b99f68c36e9786bc28b24ae904c4 Author: Ivan Goncharov Date: Thu Jan 3 13:31:41 2019 +0200 Correctly handle custom inspect fn that returns object value (#1641) commit aba1066387b85b1eb302f456acb4a41792ef2787 Author: Ivan Goncharov Date: Thu Jan 3 01:26:48 2019 +0200 Use 'TokenKind' enum inside lexer/parser tests (#1640) commit fc3e2e31050d08853259b426a1eb8fb061d7fb8e Author: Ivan Goncharov Date: Tue Jan 1 03:01:10 2019 +0200 Update deps (#1638) commit 42db579a59199eb610c533822bf64dfd76ab46f3 Author: Pavel Lang Date: Mon Dec 31 06:42:07 2018 +0100 Fix: Handle new lines inside block string correctly (#1637) * test(lexer): test if lexer advance line after block string * fix(lexer): advance line, update lineStart inside block string fix #1636 * test(lexer): more multiline block string cases commit 1ba33fc58577ef7a5ad6ea9a6bd408dff5b4c410 Author: Ivan Goncharov Date: Fri Dec 28 02:42:06 2018 +0200 Cleanup schema validation check obsolete by #1633 commit 0737212567a394caccc92f26a0705869f9e4ee3b Author: Ivan Goncharov Date: Fri Dec 28 02:14:09 2018 +0200 Extract check for unique enum value names into separate rule commit 6be63f0fda6947a228d7119bdd17000831d688df Author: Ivan Goncharov Date: Thu Dec 27 22:48:31 2018 +0200 Extract check for unique field names into separate rule commit bac6838e3cb177687f9de847ac7ad03c8a7f470f Author: Ivan Goncharov Date: Tue Dec 25 16:51:43 2018 +0200 buildSchema/extendSchema: use type names to resolve types commit 9b777b17414f59178d4119d77edc0357a8dddd24 Author: Ivan Goncharov Date: Mon Dec 24 14:42:18 2018 +0200 Update ESLint commit 3b9ea61f2348215dee755f779caef83df749d2bb Author: Ivan Goncharov Date: Mon Dec 24 05:08:44 2018 +0200 Validation: add support of SDL to KnownTypeNames commit 070121c604aab62a214faa667d9aa1731518d84b Author: Ivan Goncharov Date: Sun Dec 23 21:12:10 2018 +0200 Simplify buildASTSchema implementation commit 9b7a8af43fc0865a01df5b5a084f37bbb8680ef8 Author: Ivan Goncharov Date: Sun Dec 23 21:08:52 2018 +0200 Extract check for unique operation types into separate rule (#1624) commit 09a58007c1c05dc965f060379cdd6c953dc080e4 Author: Ivan Goncharov Date: Sun Dec 23 02:19:02 2018 +0200 Enable Flow on a few more tests (#1623) commit bfa29fcd6e10857f6c5847b792f6381f08920aa1 Author: Ivan Goncharov Date: Sat Dec 22 22:33:54 2018 +0200 Update Babel Includes fix for https://github.com/babel/babel/issues/9192 commit c1745228b2ae5ec89b8de36ea766d544607e21ea Author: Ivan Goncharov Date: Wed Dec 19 13:33:17 2018 +0200 Extract check for unique directive names into separate rule commit 257797a0ebdddd3da6e75b7c237fdc12a1a7c75a Author: Ivan Goncharov Date: Tue Dec 18 17:47:46 2018 +0200 Extract check for unique type names into separate rule commit 51eda7b7ced9193a5834c76c3803002e3af67f99 Author: Ivan Goncharov Date: Wed Dec 19 16:53:14 2018 +0200 Enable Flow on validation tests + Refactoring (#1618) commit 0390da969ccf96c60ef7f665c238bf6528b2a8c1 Author: Ivan Goncharov Date: Mon Dec 17 00:35:27 2018 +0200 Updated all http URLs to https (#1616) commit 68c2fade1fc09372fda74c30b4bd3fb40452641c Author: Ivan Goncharov Date: Sun Dec 16 03:16:50 2018 +0200 build: use babel env to configure module type commit 2c853a59f68d668a69f5a18b892d8a02c95b4958 Author: Ivan Goncharov Date: Sun Dec 16 02:00:18 2018 +0200 Mark all 'resources/*.js' files as strict and @noflow commit e18c60c7c760c2dcdaa2cd27bbc32adc9cc915c9 Author: Ivan Goncharov Date: Sun Dec 16 00:58:49 2018 +0200 Run prettier on all scripts/configs JS code commit 8749c4dc6c383a183321870d9f219c625885b196 Author: Ivan Goncharov Date: Sun Dec 16 00:28:03 2018 +0200 Remove '@babel/plugin-proposal-class-properties' plugin commit c035b3c26b68fff3cd493b2bd3732f1c0456054a Author: Ivan Goncharov Date: Sat Dec 15 23:23:56 2018 +0200 Initialize all class properties in constructor commit 149d8876bd51f7df4917e9115a798e14f24309db Author: Ivan Goncharov Date: Sat Dec 15 22:06:57 2018 +0200 Remove @babel plugins already include by 'preset-env' (#1613) Remove @babel plugins already included by 'preset-env' commit 2f5dcb2756e672435015f7d9747b9511ac986f9a Author: Ivan Goncharov Date: Sat Dec 15 19:37:18 2018 +0200 Update babel commit a8c0a32d3696a707cae072140359822f08f1f808 Author: Ivan Goncharov Date: Sat Dec 15 19:32:42 2018 +0200 Travis: use latest LTS for deploy commit 302c2a3ca5553d2aba7cf77b69d1b71b7b988fe6 Author: Ivan Goncharov Date: Sat Dec 15 19:29:55 2018 +0200 Test on Node 11 (#1611) commit 1adfa77d6ac8acc82ce3160f573bed832b3f9674 Author: Daniel Gut Date: Sat Dec 15 12:16:16 2018 +0100 fix lint error commit 3f2dd27385c70ce5e1112e3b7002cf9234a57120 Author: Daniel Gut Date: Sat Dec 15 12:11:07 2018 +0100 add type name to information commit d7c85a477fdeb12d747412589f611ae7d3b4a43c Author: Ivan Goncharov Date: Fri Dec 14 17:50:02 2018 +0200 Support custom inspect through 'nodejs.util.inspect.custom' symbol Fixes #1599 See https://nodejs.org/api/util.html#util_custom_inspection_functions_on_objects commit 80766eddc951df796ba17846e77f3cba51b495d4 Author: Ivan Goncharov Date: Wed Dec 12 16:32:35 2018 +0200 Tests: throw on Node's deprecation warnings commit de956517a0920abcdf7b88524ef9ce7e153f99df Author: Ivan Goncharov Date: Thu Dec 13 21:20:39 2018 +0200 Update Flow to 0.89 (#1607) commit 6c7b938daebf4d4607ea8b577ff0afbfb12917df Author: Ivan Goncharov Date: Thu Dec 13 20:59:11 2018 +0200 Rename exported functions to match filenames (#1606) commit 963d8bce113c99c0c566a2b2bd9738da08da2b4c Author: Jason Kuhrt Date: Wed Dec 12 08:20:33 2018 -0500 Update README.md (#1603) commit afb95ae5f68b61d2581a1895ae4a30953076effd Author: Ivan Goncharov Date: Wed Dec 12 02:39:52 2018 +0200 Update deps (#1602) commit c1ca546704018e9630dd87db0dbb59d5ac3de501 Author: Ivan Goncharov Date: Wed Dec 12 01:48:30 2018 +0200 Enable Flow check on a several test files + Cleanup (#1601) commit 84c3c404bc456d80947ac6af660c900add4e4787 Author: Ivan Goncharov Date: Thu Dec 6 14:07:50 2018 +0200 Switch directive tests to use 'execute' with named arguments (#1598) commit 97568af33516f189e50da7e8234f5799d4b4121b Author: Ivan Goncharov Date: Thu Dec 6 02:12:36 2018 +0200 Update Babel to '7.2.0' (#1597) commit 9b0c16c604dce6013a42fc090971f217db5ce6f1 Author: Ivan Goncharov Date: Thu Dec 6 02:04:41 2018 +0200 Enable Flow on executor test + cleanup (#1596) commit e279d97b1febca2679f91c5120f04eefb4873f99 Author: Ivan Goncharov Date: Mon Dec 3 13:37:07 2018 +0200 Update prettier (#1595) commit 7f2490ca19ac2605f821dd26c793021a7edf8183 Author: Tim Suchanek Date: Sun Dec 2 22:31:04 2018 +0100 fix(README): Use https in graphql.org url (#1594) Switch to https commit 93efa963809390b11cb563b313362a5a1690fce1 Author: Matt Mahoney Date: Sat Dec 1 17:26:44 2018 -0500 ASTValidation covers all validation rules that do not use Schema (#1568) commit 28a9a1777764a7d3311b4c568149c9423f4cb200 Author: Ivan Goncharov Date: Fri Nov 30 16:08:12 2018 +0200 Update Flow to 0.87 (#1590) commit b32e4602fce21df0c373eeb0696e57eb09052458 Author: Ivan Goncharov Date: Fri Nov 30 15:38:02 2018 +0200 Switch buildClientSchema tests to SDL (#1589) commit 00ecb65d3fdf828a3c7ec4e919febfe713ccd338 Author: Ivan Goncharov Date: Thu Nov 29 20:25:54 2018 +0200 Cleanup buildASTSchema tests (#1587) commit 58f691b94f6fe46fb5972bb79bbfe0b82f7f3562 Author: Ivan Goncharov Date: Sat Nov 24 03:07:52 2018 +0200 Switch test schema from GraphQLSchema to SDL (#1585) commit 64ff409f4593736ed6ad68415ed7945745ff74f2 Author: Ivan Goncharov Date: Thu Nov 22 01:15:03 2018 +0200 Validation tests: Remove unussed parser options (#1583) commit f0ae3f4c0ba469c8f2147f8d12c9e670313b865c Author: Ivan Goncharov Date: Wed Nov 21 16:33:18 2018 +0200 Enable Flow typings on errors tests + Fix typing for Error constructor (#1582) commit 5384d218539dbb6bb39b25e0b7a5dcdd69ad8a11 Author: Ivan Goncharov Date: Tue Nov 20 17:41:12 2018 +0200 Fix test description (#1581) Reported by @zonr here: https://github.com/graphql/graphql-js/commit/2adbe2267a5d2e3be6e61e6dfb47b7af08f4e7ac#r31145022 https://github.com/graphql/graphql-js/commit/2adbe2267a5d2e3be6e61e6dfb47b7af08f4e7ac#r31145021 commit 958eb961513de1147c19508d66f97920c26e99e5 Author: Ivan Goncharov Date: Tue Nov 20 17:30:49 2018 +0200 Add missing assertDirective and assertSchema (#1580) commit 89912086c8001acb8e1745a06f8a7304366a9c05 Author: Ivan Goncharov Date: Tue Nov 20 16:43:18 2018 +0200 Enable Flow typings on some of utilities tests (#1578) commit 35cb32b5401242b55bd9eebb4fe446a19aba6961 Author: Ivan Goncharov Date: Mon Nov 19 13:33:24 2018 +0200 Enable Flow typings on some of Execution tests (#1576) commit 64b194c6c9b9aaa1c139f1b7c3692a6ef851928e Author: Ivan Goncharov Date: Fri Nov 16 15:11:38 2018 +0200 Migrate variable tests to internal inspect (#1573) Motivated by Node 11.0.0 significant change in the output format, see https://github.com/nodejs/node/commit/f4e4ef5cad#diff-c1778ece12049a0e08c6f646c02c10d7R1632 We need to support all LTS versions, so it's better to use our own `inspect` implementation. commit c39072f842a71b2d62dd82ec3188131f5c0d3819 Author: Ivan Goncharov Date: Thu Nov 15 15:37:41 2018 +0200 Update deps (#1572) commit 0ea7b5192cd3e3f55352d276ece87a83add7c68b Author: Jan Kassens Date: Tue Nov 13 19:15:29 2018 -0800 Upgrade to flow 0.86.0 (#1570) commit 383c0d16b062d06b54ab29a841e762db92f296dd Author: Jan Kassens Date: Tue Nov 13 19:15:13 2018 -0800 Upgrade to prettier 1.15.2 (#1571) commit f529809f5408fb9a343e669ea4d4851add3df004 Author: Ivan Goncharov Date: Sun Nov 4 09:01:16 2018 +0200 Extend kitchen-sink examples (#1455) I was wondering if there is any place beyond definitions of query variables where directives would be useful and wanted to use kitchen sink as a playground. But currently, it lacks a lot of language features so I updated it. commit 6a69bbb133d2553c67b2c1252100cb26000e81ee Author: Kevin Sullivan Date: Sat Nov 3 22:47:17 2018 -0500 Fix error when printing a `FieldDefinition` AST node without `arguments` field (#1548) * Fix error when printing a `FieldDefinition` AST node without arguments * Generalize solution commit 46b41f787159be6fa7d22ff89795f5bd3782b687 Author: Ivan Goncharov Date: Mon Oct 29 01:49:55 2018 +0200 Update dependencies (#1563) commit 7fff8b73474df2f43a0b981d179e7c3cd28637c5 Author: Ivan Goncharov Date: Wed Oct 24 13:13:46 2018 +0300 Fix test description (#1559) Reported by @zonr here: https://github.com/graphql/graphql-js/commit/461392db1eb05b21dc8b048ac352ea2fb37bdbbd#r31021840 commit 2d1b06b4f41f9f4eff6cf4de3b74620300a191e5 Author: Ivan Goncharov Date: Tue Oct 23 19:55:38 2018 +0300 Fix comments to reflex current behaviour (#1558) Lexer: Fix comments to reflex current behaviour commit c93d7dae6133eff7c8d2b2384e310428395101bd Author: Ivan Goncharov Date: Tue Oct 23 12:58:58 2018 +0300 Update deps (#1555) commit d1e0abfe608367ff0b5694762e95c48ac62f9a16 Author: Ivan Goncharov Date: Mon Oct 22 15:50:39 2018 +0300 Switch schema parser tests to use dedent (#1550) commit 6f70c862e38e227de4ad474806eb606e742f5fb5 Author: Ivan Goncharov Date: Fri Oct 12 12:24:53 2018 +0300 Update Flow to 0.83 (#1551) commit 3aef662373d07500e20709a410ed25840e6d5985 Author: Ivan Goncharov Date: Fri Oct 12 00:16:14 2018 +0300 Call 'toJSON' if present for ID and String serialize (#1520) Fixes #1518 commit 26c9874107e65f19576aae0a32638287820f68aa Author: Ivan Goncharov Date: Fri Oct 5 18:37:59 2018 +0300 Parser: Add 'skipKeyword' function (#1545) based on 'expectOptionalKeyword' from #1541 commit 3296b720f850c1c4fa57df654938ae6a525480f2 Author: Ivan Goncharov Date: Fri Oct 5 17:15:14 2018 +0300 Configure majority of undecided ESLint rules (#1544) * Configure majority of undecided ESLint rules * Address @mjmahone review comment commit e720baa0fd57bea2ce3adf1d8ae14357e73b2fbd Author: Ivan Goncharov Date: Fri Oct 5 11:31:03 2018 +0300 Replace custom ESLint rule with builtin (#1546) commit 252e73720e4b57be562583275f4140e78a4c2942 Author: Matt Mahoney Date: Thu Oct 4 17:58:07 2018 -0400 [Spec] Move variable definition directive off of experimental flag (#1540) commit 94b38446d1650aef6884e3e16682d5b2266c93ea Author: Ivan Goncharov Date: Wed Oct 3 18:06:49 2018 +0300 Update deps (#1542) commit 0a1817ecec98e97fba4d355151112ec4006ba816 Author: Ivan Goncharov Date: Tue Oct 2 23:49:51 2018 +0300 Add integrity hashes to yarn.lock (#1538) The field was added in yarn@1.1.0. See yarnpkg/yarn#5042 for more information. It fully compatible with previous versions of Yarn commit dec24f9ed2c9c3ded0aab97af756f9e0b75142da Author: jjergus Date: Thu Sep 27 08:54:38 2018 -0700 add testcases for nested list coercion (#1528) commit 19ea592a58d3244f925cd9d18352a0fbe40f5a53 Author: Ivan Goncharov Date: Wed Sep 26 11:04:08 2018 +0300 Configure majority of undecided relues for 'eslint-plugin-flowtype' (#1532) commit 787422956c9554d12d063a41fe35705335ec6290 Author: Ivan Goncharov Date: Wed Sep 26 10:17:35 2018 +0300 Explicitly annotate (@flow/@noflow) every JS file (#1533) It's the first step towards #1484 and also enables additional ESLint rules. commit d7594f3f608df9701463fd903681483d871f7cc9 Author: Ivan Goncharov Date: Fri Sep 21 17:58:00 2018 +0300 Update deps (#1529) commit 3789a877c9ca6757c2c69ec965ea7dfb87f741eb Author: Ivan Goncharov Date: Tue Sep 18 04:31:05 2018 +0300 Fix more typos (#1526) commit b731468f20fb4b66eec88624a8291557a766831a Author: Ivan Goncharov Date: Tue Sep 18 04:30:34 2018 +0300 Update deps (#1525) commit 046e724f341be532f2905621c0b9a0bad12ebac6 Author: Ivan Goncharov Date: Fri Sep 14 14:06:32 2018 +0300 ESLint: enable recommended rules (#1515) Based on this list: https://github.com/eslint/eslint/blob/caeb223c4f7b0b6fe35e5348ae0df4c6446b5bed/conf/eslint-recommended.js commit 3e1c3d4a6294f3b30ae7bc44a4b969940847e905 Author: Ivan Goncharov Date: Mon Sep 10 18:12:08 2018 +0300 Automatically setup npm publish tag (#1502) Prevents issues similar to #1375 See: https://docs.npmjs.com/files/package.json#publishconfig commit ab4e495b2c148d51cba634faf39bbcdb72de884f Author: Ivan Goncharov Date: Mon Sep 10 18:11:01 2018 +0300 ESLint: Disable rules conflicting with Prettier (#1514) commit 3595ea922613f3e13a07185407dd70ed45de7a66 Author: mmahoney Date: Thu Sep 6 14:09:13 2018 -0700 14.0.2 commit d1c4e7d0c86bcc921c778ad692e644c828d017bd Author: Ivan Goncharov Date: Thu Sep 6 22:12:03 2018 +0300 Add missing ESLint rules as comments (#1503) Idea is to first add all of them as comment and than enable on per rule basis. commit 7a94fac8c2e68476ed556bdf21d87686c449e74f Author: Ivan Goncharov Date: Thu Sep 6 21:34:27 2018 +0300 Rearrange ESLint rules, extracted from #1503 (#1511) Context: https://github.com/graphql/graphql-js/pull/1503#issuecomment-419167396 > I think the re-order should be a separate PR: that way, it's clear in this PR which rules we want to add, commit 6b033c2619595ede2cb193030ad2ec74b597d3d8 Author: Ivan Goncharov Date: Thu Sep 6 20:47:09 2018 +0300 Prevent infinite loop on invalid introspection (#1509) commit 6963fc8844f030498cb46360c2fd9e05f6819e48 Author: Ivan Goncharov Date: Thu Sep 6 20:45:57 2018 +0300 Benchmark: always assume schema is valid (#1510) commit 84d05fc5c288f2c20df20cf7f60ee356fa6a2cdb Author: Ivan Goncharov Date: Thu Sep 6 13:28:06 2018 +0300 Run spell checker on all JS files (#1506) commit c8a57923f8fada5e303052a7126d4b1f435894a4 Author: Ivan Goncharov Date: Thu Sep 6 13:27:18 2018 +0300 buildClientSchema: Throws when missing directive locations (#1507) commit e36368e475c38039ec03fd26b273bd52003dfad4 Author: Ivan Goncharov Date: Thu Sep 6 13:27:02 2018 +0300 Export "ValidationRule" type (#1504) Intended to be used here: https://github.com/graphql/express-graphql/blob/ab2262fa60f9f6e38a626642f08573c7698628a6/src/index.js#L84 And in other similar tools that accept validation rules. commit ea9dcfb200556f1a4d6f95cc43784a3e8bfd864f Author: Lee Byron Date: Wed Sep 5 13:33:04 2018 -0700 14.0.1 commit 1f44c59ef8d436ce53c6464f4bdad26fb2e43ba4 Author: Robinson Aizprua Date: Wed Sep 5 12:42:31 2018 -0500 update package.json file to support node 9.x (#1508) * update package.json file to support node 9.x Some of use are using node 9.x * Allow all node versions >= 6.x commit 5b1ac593af967fb562dabc872749739a20e96474 Author: Christoph Zwerschke Date: Tue Sep 4 23:03:29 2018 +0200 Minor typo/spelling fixes (#1505) commit 213d8442d352dc59c02c18049384053250325f42 Author: Ivan Goncharov Date: Tue Sep 4 10:21:40 2018 +0300 Add missing keywords (#1501) See: https://docs.npmjs.com/files/package.json#keywords Fixes: https://www.npmjs.com/package/graphql#license commit fdb4633ce7198b14f9322cd64f50fd91b6349eef Author: Ivan Goncharov Date: Mon Sep 3 22:19:01 2018 +0300 Cleanup 'jsutils/inspect' function (#1499) commit 8682f57095b38742ef2aae24915d5f26be8ab97d Author: Ivan Goncharov Date: Mon Sep 3 22:10:34 2018 +0300 Cleanup formatting of string literals (#1498) commit 5d56adbd92e2d915ae7225bbc13e59df835132cc Author: Ivan Goncharov Date: Mon Sep 3 22:08:45 2018 +0300 Update deps (#1500) commit 6eec989f89a81bf81b8f0cdb6ceebf55d6edd93a Author: Matt Mahoney Date: Thu Aug 30 10:51:17 2018 -0400 14.0.0 commit 527e05af40fc2881147fbcc7a44523e8cf3f6fd1 Author: Ivan Goncharov Date: Thu Aug 30 17:39:12 2018 +0300 Correct error message about resolve specified on input fields (#1496) Fixes #709 commit c2dfccf5a8777a5b6db45eeade63ecf08c86ab13 Author: Ivan Goncharov Date: Thu Aug 30 03:07:10 2018 +0300 Exclude __fixtures__ from dist (#1494) commit f4dee2803c22f7e5fde913b9743cc6de345bb871 Author: Ivan Goncharov Date: Thu Aug 30 01:41:27 2018 +0300 Allow to add optional args to fields implemented from interfaces (#1493) I reviewed all `isNonNullType` calls and it the last one that needs to be fixed to complete #1274 commit 0adece9acd6316887f35fc39d141c68c69e2b101 Author: Ivan Goncharov Date: Wed Aug 29 21:20:58 2018 +0300 Correctly detect required/optional args/fields (#1492) Disscussed here: https://github.com/graphql/graphql-js/pull/1465#issuecomment-413699023 commit 74d1e941af54a8c8d0faef063ee7460aebdd8084 Author: Ivan Goncharov Date: Wed Aug 29 18:02:53 2018 +0300 Fix formatting, mostly leftovers from Prettier conversion (#1491) commit 0c45ddf1e5392385c41df63a693e88506cb10606 Author: Ivan Goncharov Date: Wed Aug 29 18:02:19 2018 +0300 Fix link and description of supported Markdown (#1490) See: http://facebook.github.io/graphql/June2018/#sec--deprecated commit 463174438d913bc0a2bf16a8b36b27d2fc3a66a1 Author: Ivan Goncharov Date: Tue Aug 28 23:21:15 2018 +0300 Validate directive arguments inside SDL (#1463) commit be4262270a807967a16b973a61d988ebef282f06 Author: Ivan Goncharov Date: Tue Aug 28 23:20:00 2018 +0300 Update deps (#1489) Babel 7.0.0 🎉 commit f474a4ec3abccbeed3813c4e0dbdc047481d0672 Author: Christoph Zwerschke Date: Tue Aug 28 19:18:55 2018 +0200 Add unit tests for isRequired predicates (#1486) commit 350a7d257848c3a01b8f4a61b6f71aa91c56aff4 Author: Ivan Goncharov Date: Tue Aug 28 09:39:01 2018 +0300 Remove "--optional runtime" that was dropped in Babel v6 (#1485) commit 76e37d5183d14d8a3bbf48ea10e3cc14a4df274d Author: Ivan Goncharov Date: Mon Aug 27 01:06:54 2018 +0300 Convert more object types to be exact (#1483) commit 046400602f871b2c89ac7f63a1382f6f99e5c69f Author: Ivan Goncharov Date: Sun Aug 26 01:17:45 2018 +0300 Update babel & conver "targets" to browserslist format (#1481) commit 0b1d3de25c3fc7d05239e2788b3c01bd5e7b53fa Author: Ivan Goncharov Date: Sun Aug 26 01:15:45 2018 +0300 Add missing deprecation comments (#1482) commit 46437050b0a2428a6783e75705fbb69ef38adf35 Author: Ivan Goncharov Date: Sun Aug 26 00:45:12 2018 +0300 Benchmark: replace shell scripts with JS code (#1470) In order to have a better discussion around #1463 we need to add benchmarks for `validate` and `validateSDL`. I split out refactoring part into this PR. commit f68e8e27f604bb3670095afc7d5d37599a2304ba Author: Ivan Goncharov Date: Sat Aug 25 18:31:21 2018 +0300 Add benchmarks for GQL and SDL validation (#1471) commit afe6d347829dcaa121198591ddb83bd4eb625056 Author: Ivan Goncharov Date: Sat Aug 25 08:46:16 2018 +0300 Remove unneeded "options" from package.json (#1473) commit f0f791bc72a8c94bdf695c7667caf7341034118e Author: Ivan Goncharov Date: Wed Aug 22 19:11:28 2018 +0300 Update deps (#1477) commit 06b246fe713ce987dc5094bd042f47aef51c4a99 Author: Ivan Goncharov Date: Sun Aug 19 18:22:49 2018 +0300 Update deps (#1472) commit 36dc1492dc8a6917e5327ef5d98e6662e6e15825 Author: Ivan Goncharov Date: Fri Aug 17 13:56:16 2018 +0300 Add 'isRequredArgument' & 'isRequredInputField' predicates (#1465) commit 7cfd6865cebdca1c1760246a5c132babb791b7d7 Author: Matt Mahoney Date: Sun Aug 12 11:42:38 2018 -0400 Fix typo in AST predicates (#1462) commit f4f15b386b6d5b8438a9a97b72f01c12c3c49964 Author: Ivan Goncharov Date: Sun Aug 12 01:42:30 2018 +0300 import only GraphQLError instead of entire folder (#1460) Similar to all other imports import GraphQLError from the specific file. commit 4fd9260efa247d60f74f3ebc259c8a3c2b03af61 Author: Ivan Goncharov Date: Fri Aug 10 09:46:19 2018 +0300 Add Node Predicates (#1459) For SDL validation rules I need to distinguish type definition node from type extension nodes. \+ I saw same in couple other projects, e.g. `relay`: https://github.com/facebook/relay/blob/04aac482538b83548c25e878205ecc1a581bcb25/packages/graphql-compiler/core/GraphQLSchemaUtils.js#L198-L203 commit bce300f9db68a738dd30d2b8be81efb30b78690c Author: Ivan Goncharov Date: Wed Aug 8 19:09:38 2018 +0300 Use invariants instead of throwing Errors (#1457) commit 1ac0bf8eaaa8bc554ceeda8b4f137553d470850c Author: Matt Mahoney Date: Wed Aug 8 11:39:20 2018 -0400 Fixup: add Experimental note to variable-directive tests (#1458) commit cb0097c70632b2296ff6b36e15be31c46136cee2 Author: Ivan Goncharov Date: Wed Aug 8 18:00:25 2018 +0300 Reuse 'many' for parsing document (#1456) commit 3fdf240234445789b6b876e39f2bb9ed3a977387 Author: Matt Mahoney Date: Wed Aug 8 10:10:50 2018 -0400 VariableDefinition Directives: hide behind experimental flag (#1454) commit 1d7efa98e6190c5221106f8261c9bc5adeba97ca Author: Matt Mahoney Date: Tue Aug 7 11:37:55 2018 -0400 [RFC] Allow directives on variable definitions (#1437) * [RFC] Allow directives on variable definitions * Make parser expect const directives, and move to match position with InputValueDefinition * Adding to introspection query, and the KnownDirectives validation rule commit 3217802f6ea52619b635be72ef51a52bb6becbed Author: Ivan Goncharov Date: Tue Aug 7 16:51:28 2018 +0300 Generate error per duplicate schema def + Extend tests (#1451) commit 92d8edd372c915ca8b0bb4a89e4ba72523105259 Author: Ivan Goncharov Date: Tue Aug 7 16:50:53 2018 +0300 Update deps (#1453) commit 2b0345fec99cc318b96cfe5bb3dcb23dd360c257 Author: Ivan Goncharov Date: Tue Aug 7 13:55:58 2018 +0300 Fix imports in 'watch' script (#1452) commit c847a45a0efc71f821d777da6121e32edde853e8 Author: Ivan Goncharov Date: Mon Aug 6 18:03:15 2018 +0300 Remove unused dev dependencies (#1450) commit 38760a9f4bb5b4dd483c56d035615c301826c503 Author: Ivan Goncharov Date: Mon Aug 6 00:40:17 2018 +0300 [RFC]SDL validation (#1438) Discussed in #1389 commit d40e418b88d6063efead8f3f137237e102c9f060 Author: Ivan Goncharov Date: Sun Aug 5 23:02:09 2018 +0300 Fix "watch" command. Remove 'babel-node' (#1449) commit c3292db017a6f20c8249f525b452d20e76ab6fae Author: Ivan Goncharov Date: Sun Aug 5 21:18:54 2018 +0300 Remove some unneeded 'any' (#1448) commit 9f7faaa32c8400f926b45b5611ab8d36dd936fac Author: Julia Qiu Date: Fri Aug 3 19:07:58 2018 -0700 Fix typo in runtime type exception (#1447) * Fix typo in runtime type exception * fix test commit 0a9a533b2eca0f98feb8a730cd4a340393161dc2 Author: Ivan Goncharov Date: Sat Aug 4 00:06:07 2018 +0300 Split out 'ASTValidationContext' (#1446) Splited from #1438 commit de34ff888c2fd5433eadfd0cc8ee6d0510d477a5 Author: Ivan Goncharov Date: Thu Aug 2 23:02:33 2018 +0300 Update deps (#1444) commit 055e689b23267f68d41f6d9374919ec6e76d46f7 Author: Ivan Goncharov Date: Thu Aug 2 23:00:40 2018 +0300 Drop Node 9 support (#1445) See: https://github.com/nodejs/Release#end-of-life-releases commit 81719749e01f030cfb3a01a97e7e4bfc534bb08f Author: Ivan Goncharov Date: Thu Aug 2 22:56:01 2018 +0300 Convert 'GraphQL*Config' to exact types (part 2) (#1443) Continuation of #1391 commit a1ee52a41c4dd3d7ad45b175d1e33076468752d9 Author: Ivan Goncharov Date: Wed Aug 1 10:50:50 2018 +0300 Allows to add schema definition missing in the original schema (#1441) Split out from #1438 Allows to inject directives and types into SDL-based schema: ```js import { GrapQLDateTime } from 'somepackage'; let schema = new GraphQLSchema({ types: [GrapQLDateTime], }); const ast = parse(` type Query { timestamp: DateTime } `); schema = extendSchema(schema, ast); ``` ```js let schema = new GraphQLSchema({ directives: [ new GraphQLDirective({ name: 'onSchema', locations: ['SCHEMA'], }), ], }); const ast = parse(` schema @onSchema { query: Foo } type Foo { bar: String } `); schema = extendSchema(schema, ast); ``` commit 732c90fe54893265b18d455cb7b765d8406fe6c5 Author: Ivan Goncharov Date: Tue Jul 31 16:42:32 2018 +0300 Test absence of name clash between type names and directives (#1440) Split out from #1438 commit b101bf6d7e4dbc89379ec52e43999cefbaa3bbe2 Author: Ivan Goncharov Date: Tue Jul 31 16:32:54 2018 +0300 Improve typings for validation functions (#1439) Split out from #1438 commit 3124fa32dc77c5844bf74ebc07e38239ad78e856 Author: Ivan Goncharov Date: Mon Jul 30 01:52:50 2018 +0300 Unify optional callbacks validation (#1411) commit e124ca870a57ee85cf73a77863e69889bc11737d Author: Ivan Goncharov Date: Thu Jul 26 23:40:31 2018 +0300 Remove unused arguments to cycleOuput (#1434) Artifact from: https://github.com/graphql/graphql-js/blob/176076c8a674e7e718998a6519b327098ff6d457/src/utilities/__tests__/buildASTSchema.js#L23 commit 5abe152cfc1554056ecd3db5ac784b1beb5ba8fe Author: Ivan Goncharov Date: Thu Jul 26 21:55:11 2018 +0300 Prevent infinite recursion on invalid unions (#1427) * Small refactoring * buildSchema: Fix infinite loop with recursive union * extendSchema: Fix infinite loop with recursive union commit 77aa6a9a5e6dde9aae2691d0a4d900418cb4eb0e Author: Ivan Goncharov Date: Thu Jul 26 21:51:10 2018 +0300 Inline intermediate 'visitUsingRules' function (#1430) commit 183c532172b0624e6366523b940f6e9af872a300 Author: Ivan Goncharov Date: Thu Jul 26 21:49:25 2018 +0300 BREAKING: Remove support for deprecated directive locations (#1429) Continuation of #1385 commit fec220b01c264195941ce5d3b9514125b4ada2cc Author: Ivan Goncharov Date: Wed Jul 25 18:41:00 2018 +0300 Merge duplicated imports (#1432) commit 6b95e5038327699a4659e22882e17218656b8a76 Author: Ivan Goncharov Date: Wed Jul 25 13:02:03 2018 +0300 Add missing 'type' prefixes to imports (#1431) commit 3828c20b4d9e7a9ad7cdd63379fd16ce4a55a58e Author: Ivan Goncharov Date: Fri Jul 20 04:02:10 2018 +0300 Scalar coercion cleanup (#1414) * Cleanup + restrict Boolean serialize coercion to numbers * Make coercion code more explicit. * Address review comments * fixing const num that's not const commit f373fed171ec21a871ae86c5a0cac7bfeb2bacad Author: Ivan Goncharov Date: Wed Jul 18 18:38:51 2018 +0300 Cleanup after #1373 rebase (#1425) commit f8438f73baa64d8047fd766a8f38e169198ff141 Author: Ivan Goncharov Date: Wed Jul 18 18:13:16 2018 +0300 Eslint config cleanup (#1424) * Replace deprecated ESLint rules See: https://eslint.org/docs/rules/#deprecated * ESLint: switch `0`, `1` and `2` to `off`, `warn` and `error`. * Simplify no-async rule * Cleanup disable comments * Switch ESLint config to YAML See: https://eslint.org/docs/user-guide/configuring#configuration-file-formats commit d57bdc79303e0928dbc20b4be080adeb9f366aae Author: Ivan Goncharov Date: Tue Jul 17 20:47:31 2018 +0300 Validate schema use new extension ast nodes (#1410) * Switch 'forEach' to 'for of' * Add 'getAllSubNodes' utility function * validateSchema: use nodes from new extensionASTNodes properties Fixes #1387 commit e6c36e0725ea0aabad1a19c68e54180fb7092e3a Author: Ivan Goncharov Date: Tue Jul 17 20:46:01 2018 +0300 Replace all 'Array.forEach' with 'for of' cycle (#1423) commit 4124b61bc00cf4d0fbe21fd9ff0a4cac7a6519c4 Author: Ivan Goncharov Date: Tue Jul 17 00:21:10 2018 +0300 Fix memory leak in buildSchema/extendSchema (#1417) commit 508760ee4e543be93c5315a00155813e14836a8f Author: Ivan Goncharov Date: Tue Jul 17 00:11:15 2018 +0300 Disable eslint rules that can conflict with prettier (#1421) Continuation of 40f73fd Rules was disabled using this tool: https://github.com/prettier/eslint-config-prettier#cli-helper-tool commit 7219e51ffc5e76ffc96d75d2ecde1181d4bdb69e Author: Ivan Goncharov Date: Tue Jul 17 00:10:20 2018 +0300 Update deps + switch to fixed versions in package.json (#1418) * Use fixed versions in 'package.json'(except iterall) * Update dependencies commit 830907b0cb4f56d5c2a52e9cf5c7134d9816c365 Author: Ivan Goncharov Date: Mon Jul 16 23:15:48 2018 +0300 Switch GraphQLScalarType methods to callbacks (#1412) commit 00e40d1cdc83b54d1b6a8088688d7facd4c4276e Author: Jonathan Cardoso Machado Date: Mon Jul 16 16:27:34 2018 -0300 findBreakingChanges tests: use buildSchema when possible (#1406) * test(findBreakingChanges): use buildSchema when possible Instead of generating the schema by using the Type constructors, use buildSchema with the correct SDL for each test. * fix(prettier): run prettier against findBreakingChanges-test.js * test(findBreakingChanges): reorder types on SDL to make them more readable * long-lines of args are one-arg-per-line commit 04fddf8d5f45eeff05773e356be7b9d0f745a626 Author: Ivan Goncharov Date: Mon Jul 16 21:41:10 2018 +0300 Add missing extend scalar tests (#1395) commit d3020b1068be20278256f8c5ec7c1919baaa8fd7 Author: Ivan Goncharov Date: Fri Jul 13 20:39:17 2018 +0300 Make introspectionFromSchema options argument optional (#1408) commit d30cd0cbd613582cffe283600e4148d1054533b6 Author: Ivan Goncharov Date: Fri Jul 13 20:38:06 2018 +0300 Benchmark: skip schema validation (#1401) commit 4bccc3f252026fa86610cc9860a7122868f7d198 Author: Ivan Goncharov Date: Sat Jun 30 23:22:44 2018 +0300 Fix trailing space from #1400 (#1409) commit c1659079bda01f33e987647dc1ec44752bf64437 Author: Christoph Zwerschke Date: Fri Jun 29 02:36:25 2018 +0200 Document the contextValue argument (#1400) * Document the contextValue argument * Update graphql.js A little bit more commit 7a5a9ab61d8a533cf7779066c524051bf65d62f2 Author: Ivan Goncharov Date: Fri Jun 29 03:33:14 2018 +0300 Update Flow to 0.75 + other deps (#1402) * Update to Flow '0.75' * Update deps commit 926e4d80c558b107c49e9403e943086fa9b043a8 Author: Ivan Goncharov Date: Fri Jun 29 03:32:34 2018 +0300 Mark more stuff as deprecated (#1396) commit 4f92f55a74477fde3b00eb99f9a37f1ff2d1bd0d Author: Christoph Zwerschke Date: Thu Jun 21 14:48:31 2018 +0200 Fix extend schema test (#1398) * Fix test name * Minor fix in extendSchema-test commit c8c94376217eb7003f1e0dc828a27c63b2d7b6ef Author: Christoph Zwerschke Date: Wed Jun 20 22:29:55 2018 +0200 Fix test name (#1397) commit 9b7807a8ff20c6f2565577af8d90530acc49230d Author: Ivan Goncharov Date: Thu Jun 14 12:15:39 2018 +0200 Convert 'GraphQL*Config' to exact types (#1391) commit 8a097e561228ad304a8d61c8c448321e744a1786 Author: Ivan Goncharov Date: Thu Jun 14 12:12:51 2018 +0200 extendSchema: add support for extending scalars (#1392) commit f9e6d81181615848d09ff644bd8b367b32d48c2b Author: Ivan Goncharov Date: Thu Jun 14 08:48:41 2018 +0200 Fix `extensionASTNodes` assigment (#1390) * Cleanup extendSchema tests * Fix 'extensionASTNodes' assigment commit 3521e1429eec7eabeee4da65c93306b51308727b Author: Lee Byron Date: Tue Jun 12 10:54:30 2018 -0700 BREAKING/BUGFIX Strict coercion of scalar types (#1382) * BREAKING/BUGFIX Strict coercion of scalar types This no longer accepts incoming variable values in a potentially lossy way, mirroring the existing behavior for literals. This fixes an issue with GraphQL.js being not spec compliant. This is breaking since servers which used to accept incorrect variable values will now return errors to clients. Serialization of values is not affected in the same way, since this is not a client-visible behavior. As a bonus, this adds unique serialization and coercion functions for the ID type, allowing to be more restrictive on numeric types and un-stringable object types, while directly supporting valueOf() methods (ala MongoDB). The changes to how the ID type serializes and coerces data could be potentially breaking. Fixes #1324 * Updates from review. Simplified ID serialization and added similar logic to string serialization commit 626b7a91d17434cf6ef07ddddd5bfcc49d70f912 Author: Lee Byron Date: Tue Jun 12 10:52:42 2018 -0700 BREAKING: Remove deprecated introspection fields (#1385) These fields are holdovers from the first version of the spec, before directives had more control over their exact location and could be located in more places. This is potentially breaking to any clients which relied on these fields, which will need to migrate to use the spec-compliant `locations` field before upgrading to a version including this patch commit 4dc81fb224f7e08f6781a8b1a27a8cafbffb6358 Author: Lee Byron Date: Tue Jun 12 10:52:10 2018 -0700 Add deprecation notices with explicit removal versions (#1386) Some methods have been marked as deprecated for a while - add explicit versions for each. As recommended in #1383, this marks long deprecated methods as to be removed in v15, and newly deprecated options (legacy sdl) to be removed in v16 commit f7261960700abad567c452a24efe5343c8c19bb4 Author: Ivan Goncharov Date: Tue Jun 12 07:08:13 2018 +0300 Refactor NoFragmentCycles rule (#1381) commit f2070c8169617b949b17c1929d27e46454a1d90a Author: Lee Byron Date: Sun Jun 10 23:15:34 2018 -0700 Improve the inspect() function. (#1380) As well as use it in more places, replace use of JSON.stringify, and ensure validation rule message formatters expect strings instead of types. commit faeea7ff86c56c5a71ba7c17fa1eccad8cf9de95 Author: Matt Mahoney Date: Mon Jun 11 00:04:13 2018 -0400 Json serialize types (#1378) * Schema definitions now JSON serializeable * Remove commented-out code * Keep flow definitions with toJSON and inspect * Factor out into utility function, change applyToStringTag naming to match Also realized we weren't doing the same thing for directives, so fixed that as well. commit 023c555e01e24396f226d8ce486c827ba8aa6a92 Author: Lee Byron Date: Sun Jun 10 20:31:59 2018 -0700 Simplify #1297 commit 9925e5022162b681c7647a147c47ca8e6124a930 Author: Matt Mahoney Date: Fri Jun 8 16:44:09 2018 -0400 Allow interfaces to have no implementors (#1376) * Allow interfaces to have no implementors Reverts #1277, and implements spec removal from #459. While it's an open question whether this validation is good, we need to provide an upgrade path for schemas that currently do not satisfy this validation rule. * Update test to accept unimplemented interface commit 409d6dd125dcf265c68ffc3f6401011254e9ab76 Author: Matt Mahoney Date: Thu Jun 7 18:53:44 2018 -0400 Bump RC version to publish on npm (#1374) commit 84f41aadcfe3f86833d3f37914c995416091d9f1 Author: Matt Mahoney Date: Thu Jun 7 17:24:26 2018 -0400 14.0.0-rc.1 (#1364) If you're a third-party library used by others who may also use `graphql-js`, I do not recommend take a dependency on this RC: there will be a few additional breaking changes, such as a fix for #1324 . commit 45ecb530eff5c44327a13bac355513dc6a38aff8 Author: Matt Mahoney Date: Thu Jun 7 17:11:49 2018 -0400 Merge extendType functionality changes from #1322 (#1373) * Extend the extend functionality * Fix flowtype * Extract logic from _makeInputValues to its own function * Fix lint and minor refactors * Fix type error due to copy & paste * Fix array syntax * Fix test more verbose * Removed unnecessary check * Extend directive * Moved new tests into existing tests * Fix lint errors * Added missing description * fix enum value error test commit 43c0d46ac9a279a1c3be9c8592381e2a99eec209 Author: Ivan Goncharov Date: Thu Jun 7 21:04:03 2018 +0300 fix imports (#1372) commit f9b0bae8c3d0b289617136442adc9b4bfbf5c21c Author: Ivan Goncharov Date: Thu Jun 7 21:03:16 2018 +0300 Add simple test for `instanceOf`. (#1370) commit ae23c901c5699287c3e870a6fc7d6180049a8eb9 Author: Ivan Goncharov Date: Tue Jun 5 21:45:37 2018 +0300 Handle NaN as input value (#1369) commit 85971a277c4e7782e9be38d102bd6562dedf7804 Author: Ivan Goncharov Date: Tue Jun 5 08:38:41 2018 +0300 Add test for enum custom values as input args (#1267) commit 3473ca53517f6df9a3b02a744bcc56f2de097710 Author: Ivan Goncharov Date: Tue Jun 5 07:47:34 2018 +0300 Reject Infinity supplied as Int or Float value (#1365) commit 85b4f580c5fe9efe8baf8433d78ca9607f302b2e Author: Ivan Goncharov Date: Tue Jun 5 02:43:59 2018 +0300 __allowedLegacyNames: Use empty array instead of undefined properties (#1259) commit e79faaa5c440edbb5aed885f49bfdd13130966dd Author: Brielle Harrison Date: Mon Jun 4 16:42:42 2018 -0700 Add support for Symbol.toStringTag (#1297) **Changes** * Add static and instance property getters for Symbol.toStringTag for each exported class. **Purpose** Being able to compare class and class instances via internal class type as per the definition and usage of Symbol.toStringTag allows other libraries to validate types during runtime in this manner. It also prevents them from having to patch the live values in their own codebases. **Contrived Example** With no modules and vanilla JavaScript we should be able to do something like the following. ```javascript let type = new GraphQLObjectType({name: 'Sample'}); if (({}).toString.call(type) === '[object GraphQLObjectType]') { // we have the right type of class } ``` However, with libraries such as `type-detect` or `ne-types` the code can look far cleaner. ```javascript // type-detect let type = require('type-detect') let obj = new GraphQLObjectType({name:'Example'}) assert(type(obj) === GraphQLObjectType.name) // ne-types let { typeOf } = require('ne-types') let obj = new GraphQLObjectType({name:'Example'}) assert(typeOf(obj) === GraphQLObjectType.name) ``` There are a lot of libraries out there, despite doing nearly the same thing in all cases, that support the usage of `Symbol.toStringTag` and by adding support for that in the base GraphQL classes, all of these libraries can be used with GraphQL. commit 10e80d05dcad55e0e08806512250c65ed55fcfc8 Author: Ivan Goncharov Date: Mon Jun 4 21:09:21 2018 +0300 instanceOf: Check that one of the names in non-empty string (#1357) Fixes #1356 commit bc03768b4b3ca181af163bdb8616ee0c46ef7be3 Author: Aaron Wong Date: Sat Jun 2 15:39:03 2018 -0400 Upgrade babel and associated plugins to v7 (#1350) * Upgrade babel and associated plugins to v7 Ignore __tests__ folders in babel transpilation * Add new yarn.lock for changed deps commit 68577079930e24da9c25b6c3f8fcadd488d94014 Author: Ivan Goncharov Date: Fri Jun 1 12:42:20 2018 +0300 Scalars: reject array serialization/coercion (#1336) Working on #1333 I noticed that you can pass arrays as scalars in a query variable, e.g. [SWAPI example](http://graphql.org/swapi-graphql/?query=query%20(%24id%3A%20ID)%20%7B%0A%20%20person(personID%3A%20%24id)%20%7B%0A%20%20%20%20name%0A%20%20%7D%0A%7D&variables=%7B%0A%20%20%22id%22%3A%20%5B1%5D%0A%7D) This PR is based on #925 but fixing same issue for types other than `String` e.g. ```js Number([1]) // 1 ``` commit ddb3ffc57ecccefa3e66357b6e948e3ba75af411 Author: Ivan Goncharov Date: Fri Jun 1 12:17:44 2018 +0300 Updated Flow, Prettier and other dependencies (#1362) commit eb8ef7afd8f9c5c833ee413b98284221058feac0 Author: Ivan Goncharov Date: Fri Jun 1 11:09:53 2018 +0300 Babel 7 preparation: Switch babel config to JS (#1348) It's the first step towards Babel 7: #1266 Based on this article: https://fatfisz.com/blog/using-babelrc-js-today commit 324768a6aaf68dd6667b888a6e151d4c47ec7073 Author: Ivan Goncharov Date: Fri Jun 1 04:57:02 2018 +0300 Errors: fix how error messages represent arrays (#1333) * Errors: fix how error messages represent arrays * Add test for invalid return from 'resolveType' commit 0a30b62964efe16e3e87b0e8fea40bc9665f9393 Author: Ivan Goncharov Date: Fri May 25 00:44:31 2018 +0300 Run tests on node 10. Drop support for node 4.0 (#1338) commit f3ebab8f85e44d74064c557b88a3a44ee80aee92 Author: Ivan Goncharov Date: Thu May 24 01:40:20 2018 +0300 CI: fix nyc doesn't proxy error status from mocha (#1353) commit 4aca994d2b0447293ee700e687d333daf4113589 Author: Ivan Goncharov Date: Wed May 16 20:51:57 2018 +0300 Visitor: fix description of "ancestors" arg + test (#1250) * Visitor: fix description of "ancestors" arg + test * Make test more explicit commit 7199b3ddd6af83bc08db0de5659b4bea22a8222d Author: Christoph Zwerschke Date: Wed May 16 19:44:10 2018 +0200 Minor simplification in extendSchema (#1349) commit 0276d685b51262686c841763ba0b6e71103f64f3 Author: Ivan Goncharov Date: Mon May 14 20:20:33 2018 +0300 extendSchema: Use consistent naming + inline 'getExtendedType' function (#1327) commit 2592e1293c650eef1e06760ce85fb29f125568b9 Author: Ivan Goncharov Date: Fri May 11 23:41:44 2018 +0300 Coverage: Switch isparta to nyc (#1342) commit 6d7e08becb08065744fa08c7a7d3b167c0cd4862 Author: Ivan Goncharov Date: Fri May 11 23:30:07 2018 +0300 Fix npm@6 warnings about deprecated "prepublish" (#1340) commit ef585e9db8d161e715dfaa4e70c1ed2efa58294c Merge: 2eccaadf 69cf8a89 Author: Matt Mahoney Date: Fri May 11 11:34:16 2018 -0400 Merge pull request #1345 from graphql/get-operation Expose getOperationRootType(schema, operationNode) commit 69cf8a89a329e08638e60eee053282711278abdb Author: mmahoney Date: Thu May 10 17:39:44 2018 -0400 Switch to exporting getOperationRootType commit d8da198d9072662eaaea7ed64c6065be7249d3bb Author: mmahoney Date: Thu May 10 15:38:01 2018 -0400 Expose getOperationType(operation) on GraphQLSchema We're finding we frequently do switch statements on an OperationDefinition's operation to pull the right type out of the schema. This hardens that approach: if for some reason we added a new operation kind, you could just update this function, rather than all the callsites that match on the operation type. commit 2eccaadfa95f3e50f5d0d1aba42c419a70c61fc5 Author: Ivan Goncharov Date: Mon Apr 30 23:40:46 2018 +0300 Don't call global fieldResolver on introspection fields (#1329) Fixes #1015 commit 4c6e0a94fa66e7a8d4649dadca80a69637713186 Author: Ivan Goncharov Date: Mon Apr 30 23:35:42 2018 +0300 Fix extend schema from #1314 (#1323) * Simplify + fix Flow types * Fix 'extensionASTNodes' for schema extended twice * Replace 'getAll*Nodes' with generic 'getAllNodes' function * Correctly report error for invalid root type in extended schema commit 4ac4bf47a680c364cd3d8986e1881bb4273b1ede Author: Ivan Goncharov Date: Mon Apr 30 23:28:05 2018 +0300 printError: fix padding of line numbers (#1328) * Use dedent for print error tests * printError: Add tests for padding of line numbers * printError: fix padding of line numbers commit a65e84b9c06df98030e76d705ab79a72a6e6a24b Author: Jan Kassens Date: Sat Apr 28 22:48:39 2018 -0700 Upgrade flow to 0.71.0 (#1330) commit ae5b163d2e6c124107fa0971f6d838c8a7d29f51 Author: Lee Byron Date: Mon Apr 23 16:50:20 2018 -0400 Execute: use consistent name for execution context (#1318) commit b58697d8e91de91265cbebe48906e0c29b48b28b Author: Lee Byron Date: Mon Apr 23 16:50:02 2018 -0400 Also unify contextValue commit 30d062cedd687c1f662d9e87e08d35d61c2a50ce Merge: 1d07ebf 4db01f3 Author: Lee Byron Date: Mon Apr 23 16:47:31 2018 -0400 Merge branch 'exeContextName' of https://github.com/APIs-guru/graphql-js into APIs-guru-exeContextName commit 4db01f3febb495cd28ca7300d76da8118efd8b4b Author: Lee Byron Date: Mon Apr 23 13:43:20 2018 -0700 Addendum commit 571f2bc97f2671f21483fdec1949e9ca7946a3b2 Author: Lee Byron Date: Mon Apr 23 13:42:41 2018 -0700 Address review commit 0195b30c89b7b259741ee845276db01db0bb27ef Author: Ivan Goncharov Date: Sat Apr 21 17:30:35 2018 +0300 Execute: use consistent name for execution context commit 1d07ebfc10773c431e4d9ae9c35bc11f8d940c01 Author: Lee Byron Date: Mon Apr 23 16:37:46 2018 -0400 Cleanup contain subset (#1317) Squashed commit of the following: commit 5ca694025f75ba9c52d9db5a61e834b828d93185 Author: Lee Byron Date: Mon Apr 23 16:37:25 2018 -0400 Rebase and generalize helper commit 118fb7872a80ff1fe416ca2c68464d3c4a896dc7 Author: Ivan Goncharov Date: Fri Apr 20 12:37:45 2018 +0300 Replace 'containSubset' with 'locationsToJSON' commit 68dc47afa1de8d93e3c812e7c94ead440581134d Author: Ivan Goncharov Date: Thu Apr 19 18:18:14 2018 +0300 Remove containSubset commit 4b734a440e96710a7fb452a04f1e16118057fadc Author: Ivan Goncharov Date: Mon Apr 23 22:41:10 2018 +0300 Update flow(0.70), prettier(1.12) and other dependencies (#1319) commit 5dc773eaf16180a68c9bfe720b0405c283883d94 Author: Lee Byron Date: Mon Apr 23 15:39:12 2018 -0400 RFC: SchemaExtension (#1314) * RFC: SchemaExtension This adds support for https://github.com/facebook/graphql/pull/428 spec proposal. So far this just adds language support and updates validation rules to be aware of this new ast node. I'll follow up with support in `extendSchema()` and tests. * Support extendSchema() * Formatting edits * Add parsing and validation tests * Adjust grammar rules to match spec definitions commit 3cb450059d58f45dff95867a0674d7588be64933 Author: Lee Byron Date: Wed Apr 18 21:24:55 2018 -0400 Exports ast types which should be exported (#1315) commit 32e2f33fd6c799ccf072c6e24ca2eb9384ceaa17 Author: Ivan Goncharov Date: Thu Apr 19 02:57:18 2018 +0300 Make "nonnull-test.js" more explicit (#1311) * Simplify non-null tests * Remove 'check' function and write test directly * containSubset => deep.equal * Change order of errors because of #1286 * remove excessive async/await commit d708da2b0d6c4603cefd33cc3d1e81bcccf032ca Author: Lee Byron Date: Wed Apr 18 17:19:23 2018 -0400 Notes about browser use mention webpack and rollup support and dual-module support. Closes #1272 commit 60c03ab23852074896fd9134c24c46ba595bf014 Author: Lee Byron Date: Wed Apr 18 17:01:26 2018 -0400 Remove spurious reference to `process`. Fixes #1257 commit 69d90c601ad5a6f49c06b4ebbc8c73d51ef03566 Author: Ivan Goncharov Date: Wed Apr 18 23:45:47 2018 +0300 Execute: simplify + speedup (#1286) * Remove 'completeValueWithLocatedError' * Execute: move promise resolution to the completeValueCatchingError * Remove fat arrow function * Execute: rewrite executeFields to use for-in instead of reduce * Extract locatedFieldError function * extract handleFieldError function * Address @leebyron review comments commit c8358f8f5b7a8b0463ee3a34d0f3b8ebf6ad40d8 Author: Moti Zilberman Date: Wed Apr 18 23:42:50 2018 +0300 Mark all modules as having no side effects for bundling (#1312) commit 367e3072fa19460d7a13bfdca73ffa1209ea98da Author: Ivan Goncharov Date: Wed Apr 18 23:40:28 2018 +0300 Test: Cleanup unneeded returns and async/await (#1310) * Remove excessive 'return' from tests * Remove unneeded async/await commit 4d2438a26c1027825b201d0f68bd4854c88ece0d Author: Lee Byron Date: Wed Apr 18 16:38:56 2018 -0400 SPEC/BUG: Ambiguity with null variable values and default values (#1274) This change corresponds to a spec proposal (https://github.com/facebook/graphql/pull/418) which solves an ambiguity in how variable values and default values behave with explicit null values, and changes validation rules to better define the behavior of default values. Otherwise, this ambiguity can allows for null values to appear in non-null argument values, which may result in unforeseen null-pointer-errors. In summary this change includes: * **BREAKING:** Removal of `VariablesDefaultValueAllowed` validation rule. All variables may now specify a default value. * Change to `VariablesInAllowedPosition` rule to explicitly not allow a `null` default value when flowing into a non-null argument, and now allows optional (nullable) variables in non-null arguments that provide default values. * Changes to `ProvidedRequiredArguments` rule (**BREAKING:** renamed from `ProvidedNonNullArguments`) to no longer require values to be provided to non-null arguments which provide a default value. * Changes to `getVariableValues()` and `getArgumentValues()` to ensure a `null` value never flows into a non-null argument. * Changes to `valueFromAST()` to ensure `null` variable values do not flow into non-null types. * Adds to the `TypeInfo` API to allow referencing the expected default value at a given AST position. commit 54f631ff3238affdddb4dc736fc282b620d70b15 Author: Ivan Goncharov Date: Sat Apr 7 02:46:19 2018 +0300 Match exact set of errors in schema validation tests (#1307) * Revert "expect subset of errors" This reverts commit 46f9f09c67de815ac512a2a7ac7256ecd9f9112b. * Match exact set of errors in schema validation tests commit 0bb47b229a369370e5698d820dd8626c6546df49 Author: Ivan Goncharov Date: Sat Apr 7 02:42:23 2018 +0300 formatError: put all extensions inside 'extensions' property (#1284) * formatError: put all extensions inside 'extensions' property * Address @leebyron review comments commit 92cb4a039fd0fd8181c4fc16a7caefb8f41fcbe5 Author: Ivan Goncharov Date: Fri Apr 6 04:43:24 2018 +0300 Error: make 'path' and 'locations' enumerable only if present (#1305) * Error: make 'path' and 'locations' enumerable only if present Also cleanup tests from 'undefined' and 'containSubset'. * expect subset of errors commit 6d59003f41e62115d7ec0502c43130f860fbf214 Author: Ivan Goncharov Date: Fri Apr 6 01:58:40 2018 +0300 Replace containSubset with native chai checks (#1306) * expect.to.containSubset => expect.to.contains * Replace expect.to.containSubset with expect.to.deep.nested.property commit fb2f23942d1cd3e008255394bcbe6710c7c223ad Author: Ivan Goncharov Date: Fri Apr 6 00:49:39 2018 +0300 locatedError: correct definition to pass Flow 0.68 check (#1292) commit 43ff3e35c699d1b6260126465b84810678d4543e Author: Matt Krick Date: Tue Apr 3 20:53:13 2018 -0700 fix #1277 ensure interface has at least 1 concrete type (#1280) * fix #1277 ensure interface has at least 1 concrete type * fix tests * update error message * fix lint * remove impossible schema invariant and test * lint * test for unimplemented interfaces commit 6f16ba293f55c13741448c2181e0ed925e87d790 Author: Jan Kassens Date: Fri Mar 30 20:31:04 2018 -0700 Upgrade eslint (#1304) commit db27cb0e847f6c71f3223748548a403e2f6e5fe4 Author: Jan Kassens Date: Fri Mar 30 20:26:39 2018 -0700 Upgrade to flow-bin@0.69.0 (#1303) commit 296cbd95743f45908e589c7f54fd52add24f65df Merge: 4dfb993c a5d25f06 Author: Jan Kassens Date: Fri Mar 30 20:25:34 2018 -0700 Merge pull request #1302 from kassens/upgrade-prettier Upgrade to prettier@1.11.1 commit a5d25f062706673a0d847bf07835561114d6278e Author: Jan Kassens Date: Fri Mar 30 20:20:22 2018 -0700 Upgrade to prettier@1.11.1 commit 4dfb993c7c4e50d9954a1346480e0400d6a3db38 Author: Ivan Goncharov Date: Fri Mar 30 01:49:54 2018 +0300 Execute: Remove excessive arguments (#1268) commit 920fb874bb0da804529095e25c4a7f1e17efb269 Author: Lee Byron Date: Thu Mar 29 13:31:58 2018 -0700 Fix printing of ASTs of argument definitions with descriptions. (#1301) Descriptions were not separated on their own lines, which made for technically parseable but hard to read output. Fixes #1285 commit 433774dd64d43718bc7ac327fb7e5f2bcca0fe8f Author: Ivan Goncharov Date: Thu Mar 29 22:39:36 2018 +0300 Fix `execute` deoptimisation caused by GraphQLEnumType (#1288) commit bf3d27c10f3a05b30b36bf8ad361c679132ef7fb Author: Ivan Goncharov Date: Thu Mar 29 22:34:38 2018 +0300 Lexer: unify unexpected character errors (#1289) commit 0d7a3539aa73206d5ed43d9f44e0ed893f025f4c Author: Ivan Goncharov Date: Thu Mar 29 22:31:47 2018 +0300 mocha >= 4.0 correctly reports unhandledRejection on its own (#1299) See: https://github.com/mochajs/mocha/issues/2879 commit f995c1f92e94d9c451104b6a0db8034165ef8640 Author: Jan Kassens Date: Fri Mar 16 13:52:42 2018 -0700 0.13.2 commit 3fe5deea739cc0e118ed0ed5e7dfa49308bc6437 Merge: 70f008e4 207a2fd8 Author: Jan Kassens Date: Fri Mar 16 13:08:57 2018 -0700 Merge pull request #1290 from samwgoldman/master Update to Flow v0.68 commit 207a2fd8125cb2d80dc69c23311880864fc775d7 Author: Sam Goldman Date: Fri Mar 16 11:42:23 2018 -0700 Update to Flow v0.68 Summary: This version of Flow erorrs on unknown properties. I extended the error suppression comment to support versioned suppressions, since this is only an error after 0.68. Test Plan: flow Reviewers: leeb Subscribers: Tasks: Tags: commit 70f008e4e195d295f5f7cc9eaaac32d5e2d085e3 Author: Ivan Goncharov Date: Fri Mar 9 11:18:16 2018 +0200 Remove redundant Flow type casts (#1278) commit 1fbd7ecfa7633817a81bd560bd8d80211e913f05 Author: Ivan Goncharov Date: Fri Mar 9 11:17:00 2018 +0200 Throws descriptive error when non-type used instead of interface (#1282) commit fb27b92a5f66466fd8143efc41e1d6b9da97b1f4 Author: Jannis Pohlmann Date: Wed Mar 7 20:21:02 2018 +0100 Merge wrappers into type/definition to fix circular imports (#1275) (#1276) commit 4a9e37ad754307a656961b373bf1eda95fc95a5e Author: Ivan Goncharov Date: Tue Mar 6 21:35:54 2018 +0200 Cleanup variables test (extracted from #1267) (#1273) * Cleanup tests + switch serialization to 'util.inspect' * Extract `executeQuery` function * Unify query formatting commit 8913bf0e91789752d2a65179a53de40067a6a41d Author: Lee Byron Date: Mon Mar 5 13:23:13 2018 -0800 Remove unused dev dependencies Follow up to #1269 commit fbcda23e278c3428e13b60cd8eabcaad4f81079d Author: Lee Byron Date: Mon Mar 5 12:21:52 2018 -0800 Add nested nullable test in VariablesInAllowedPositions test commit 65fb6ae81f18e9901506f85459f79b4e149871e5 Author: Ivan Goncharov Date: Mon Mar 5 21:05:11 2018 +0200 buildSchema: Make options optional (#1270) commit 323f2d2d2763b2f0502cc55beaa6ccaf89d8f423 Author: Ivan Goncharov Date: Mon Mar 5 21:04:36 2018 +0200 Tests: Remove excessive dependencies and async/await (#1269) commit a62eea88d5844a3bd9725c0f3c30950a78727f3e Author: Ivan Goncharov Date: Wed Feb 28 03:38:27 2018 +0200 Unify extending of type system (#1261) commit 261b99b0a643561ccfb217fe8ac0c2ac16b2c5d3 Author: Benjamin Woodruff Date: Tue Feb 27 12:23:33 2018 -0800 Eliminate circular dependency in validation rules (#1263) `validation/validate.js` depends on all of the rules, and all of the rules depend on `ValidationContext`, which was previously exported by `validation/validate.js`. This moves `ValidationContext` out of `validate.js` to resolve this. Circular dependencies are fine, but they tend to slow down flow, since it moves more work to the merging phase, and the merging phase isn't as fast as the inference phase. As a result, this should make flow marginally faster. This does have a minor breaking change: `graphql/validatation/validate` no longer exports `ValidationContext`, but `graphql/validation` still does. I can add an export to `validate.js` to preserve that behavior, but it's a minor change to a non-public API, and graphql-js has broken these things in the past. commit 499a75939f70c4863d44149371d6a99d57ff7c35 Author: Lee Byron Date: Tue Feb 20 23:28:27 2018 -0500 Replace getPromise with isPromise (#1255) * Replace getPromise with isPromise Simplifies logic within the executor, uses the %checks predicate from Flow * Improve flow types commit fb3257cd2c2c429632a73c8acadd0bef864d1989 Author: Lee Byron Date: Tue Feb 20 22:44:46 2018 -0500 Update iterall and flow v0.66 (#1254) Fixes for latest version of flow. Closes #1253 commit c2c01e7be734f5fa3e18033c8afae892efe6e093 Author: Lee Byron Date: Tue Feb 20 17:30:33 2018 -0800 Covariant MaybePromise Since Promise is Covariant, this should also be. Solves flow errors when trying to introduce MaybePromise into more places within the executor. commit 5ec393efc6918cad906b93f3f71d842547b70563 Author: mohawk2 Date: Tue Feb 20 21:18:48 2018 +0000 Benchmark introspecting a schema built from SDL in a supplied file. (#1163) * Benchmark introspecting a schema built from SDL in a supplied file. Use it like so: ```shell yarn run benchmark ```` Additionally there is a profile command which runs the benchmark with `--prof`: ```shell yarn run profile ```` Note that on Ubuntu 16.04 this requires: ```shell sudo apt install linux-tools-common gawk linux-tools-generic linux-tools-4.10.0-35-generic sudo sh -c 'echo 1 >/proc/sys/kernel/perf_event_paranoid' ``` On my laptop it produces this: ``` $ yarn run benchmark > graphql@0.12.3 benchmark /home/osboxes/graphql-js > babel-node ./resources/benchmark/run.js introspectionQuery x 24.59 ops/sec ±3.87% (45 runs sampled) ``` * Move into benchmark tests commit 81512407f8db5ac1fba1e59c4dce41c8feb68821 Author: Lee Byron Date: Tue Feb 20 15:07:11 2018 -0500 Benchmark task (#1251) This adds a benchmark task inspired by #1167 and #1163. Invoke with `yarn benchmark`. Allows filtering down which benchmark to run, ala jest, and supplying which revisions to run against. commit 86d33b49a92eda05ee9ca7b3a6fe3a449a21de4c Author: Lee Byron Date: Fri Feb 16 15:19:40 2018 -0500 Allow buildSchema() to take options. (#1249) buildSchema() is essentially just short hand for buildASTSchema(parse()), however since both of these composed functions accept options, it's nice to allow buildSchema() to accept options as well - it accepts the combined set of options which it passes to both functions. This also names and exports the options for buildASTSchema() such that they can be used in the same way by third party code. commit 31ae8a8e8312494b858b69b2ab27b1837e2d8b1e Author: Lee Byron Date: Thu Feb 15 17:24:40 2018 -0500 0.13.1 commit 2c58b262138359c03fe59bef182e356a2d64e779 Author: Ivan Goncharov Date: Fri Feb 16 00:22:12 2018 +0200 Make 'ASTDefinitionBuilder' responsible only for build types from AST (#1230) * Make 'ASTDefinitionBuilder' responsible only for build types from AST * Address review comments. * Simplify extendType() * Fix flow errors commit 65afbaf76648d910637f1a3de44ee40aa554bc8c Author: Lee Byron Date: Thu Feb 15 17:14:58 2018 -0500 Use .mjs for module code (#1244) * Writes .mjs instead of .js for esmodules code. * Moves .mjs out of ./module into the top level since it no longer conflicts with .js Fixes #1217 commit d640f9fa059afd8aa9e1b3727facecbf7bf0dbe8 Author: Lee Byron Date: Thu Feb 15 15:59:58 2018 -0500 Update to latest release of iterall commit 7e6898465131be522666bcbdf71d8c8f2d85e5d2 Author: Lee Byron Date: Wed Feb 14 16:44:17 2018 -0500 Fix outdated reference to old license commit b4f2955fa56d19c955578111dc24f12c6d65fdfb Author: Eloy Durán Date: Wed Feb 14 15:51:57 2018 -0500 More allowed legacy names (#1235) * Allow legacy names when building AST schema. * Always store allowed legacy names on schema. * Allow additional legacy names when extending a schema. * Standardise schema validation options. * Allow legacy names in client schemas. * Add test coverage for schema validation options. * Simplify value merge * Add test * Trailing space * Recycling this value means we need to be read-only strict commit 14fde90f5845fc1bfe241ac43001ecfb798ee699 Author: Ivan Goncharov Date: Wed Feb 14 22:22:12 2018 +0200 simplify extendSchema tests (#1242) commit ebdac97fc5aac73a76341938648af2b4045328e3 Author: Ivan Goncharov Date: Wed Feb 14 22:02:23 2018 +0200 ISSUE_TEMPLATE: Fix 'facebook/graphql' link (#1243) commit 81db4101853924327c53b2fe389b4ab032cd178d Author: Christoph Zwerschke Date: Mon Feb 12 22:30:08 2018 +0100 Remove duplicate test (#1240) commit 3493edd23027d2a7ab016b80b4206e3bd0ff731a Author: Matt Mahoney Date: Mon Feb 12 16:29:26 2018 -0500 Export ExectuableDefinitionNode (#1241) commit f2534a1a229ecc97d318053fa7bcf563b6a296df Merge: 98751e47 0487302f Author: Matt Mahoney Date: Mon Feb 12 12:08:56 2018 -0500 Merge pull request #1237 from gdi2290/patch-1 export isValidNameError commit 0487302f66b9b15cf3877f0d4a0f99ef6578ef72 Author: PatrickJS [tipe.io] Date: Fri Feb 9 17:05:23 2018 -0800 Update index.js commit 135619c41bd9b3c6971f026a2a846967e397d28e Author: PatrickJS [tipe.io] Date: Fri Feb 9 17:05:04 2018 -0800 export isValidNameError commit ee93a917b0e37fc1929016b6cdf404118e54ba0f Author: PatrickJS [tipe.io] Date: Fri Feb 9 16:38:58 2018 -0800 export isValidNameError commit 8f81f0a2bfbe243b5117f048f870750abe1354f7 Author: PatrickJS [tipe.io] Date: Fri Feb 9 16:38:34 2018 -0800 export isValidNameError commit fdccce3f174b65ff33d8981385d67c2dad5eff7b Author: PatrickJS [tipe.io] Date: Fri Feb 9 16:37:31 2018 -0800 export assertValidName and isValidNameError commit 98751e473fd7a02c514af48218d87d26daadb5f5 Author: Lee Byron Date: Thu Feb 8 14:49:30 2018 -0800 Strict const args (#1233) Now that we're `@flow strict` we can remove some unnatural patterns for telling flow that we expect function args to be const. commit 5fe39262a308df944a87cc85b225228e7556aaa4 Author: Ivan Goncharov Date: Fri Feb 9 00:15:55 2018 +0200 Update flow + "@flow strict" (#1229) * Update Flow to 0.65.0 * Replace '@flow' with '@flow strict' * Partial revert of #1160 * lexicographicSortSchema: Remove workarounds for non-const args * Reduce scope of change * Reduce scope of change commit 7b9287501869f9f53e12ecdcb471a8e76636294e Author: Lee Byron Date: Thu Feb 8 14:12:26 2018 -0800 Remove special case in assertValidName (#1232) This __configs__ special case for assertValidName is no longer necessary now that we have the allowedLegacyNames mechanism. commit 2986c2d49b73023a7d988445187fd55a4f0dec14 Author: Lilly Wang Date: Thu Feb 8 14:33:08 2018 -0500 Allow interface type extensions (#1222) * Allow interface type extensions * Do not extend object types that implement the interface * Added more tests in schema validation after interface extensions * Added more test cases to extendSchema, removed some tests from validate commit 974ebab8f44601fafeef43b369170d06bb8be0a6 Author: Ivan Goncharov Date: Thu Feb 8 21:30:09 2018 +0200 Add more 'buildASTSchema' tests + cleanup (#1228) * Add more 'buildASTSchema' tests + cleanup * rm extra dedents commit f0eced97874a516fd33aeba002e10c6dae7fd9bf Author: Lee Byron Date: Thu Feb 8 11:10:55 2018 -0800 Bump to latest dev dependencies (#1231) commit 5f50543f7608d52403b1440d1a617626f412a63f Author: Lee Byron Date: Wed Feb 7 11:09:04 2018 -0800 0.13.0 commit 4b96a86ae8091454cef12a16b72fa989283d4775 Author: Eloy Durán Date: Wed Feb 7 13:51:47 2018 -0500 Maintain allowed legacy names when extending a schema. (#1226) * Maintain allowed legacy names when extending a schema. * .slice() is a more canonical copy * Update extendSchema-test.js * Move schema local to test commit 312daa596e161c9f23bb8d326a1e797a44fdd301 Author: Ivan Goncharov Date: Wed Feb 7 20:47:58 2018 +0200 Switch introspection tests to graphqlSync (#1225) commit b333b30b238d040d6a8cf959d54f037ee26ae2c6 Author: Ivan Goncharov Date: Fri Feb 2 00:08:58 2018 +0200 Fix spelling, "lexographicSortSchema" => "lexicographicSortSchema" (#1220) commit 360fa06e43fed32b63fba99b353515e7b56eee20 Author: Lee Byron Date: Tue Jan 30 17:37:12 2018 -0800 Travis job include condition tweak commit f4e104d31db19a535569858818aa9054f21b184e Author: Lee Byron Date: Tue Jan 30 17:07:54 2018 -0800 Improve travis runs (#1219) * move script description to package * colocate package scripts * skip deploy job for PRs commit b39f728c0f51be440e17173150fa12b81e76dc09 Author: Lee Byron Date: Tue Jan 30 08:58:55 2018 -0800 0.13.0-rc.1 commit 5578fb9a01a6b5700d3621dd24dace70deb11d23 Author: Lee Byron Date: Mon Jan 29 13:57:17 2018 -0800 Simplify build steps (#1216) This consolidates copying of flat files into the build step. This also removes "contributors" from the package since that's super outdated and no longer relevant. commit 40481f1b68b4b3010fdbc5fe7d761d3afcfefef0 Author: Lee Byron Date: Mon Jan 29 13:31:03 2018 -0800 Update to latest dependencies (#1215) commit 6a1eddf1dee41d4c49c337cc68816d88f44e4421 Author: Ivan Goncharov Date: Mon Jan 29 22:51:12 2018 +0200 Add 'lexographicSortSchema' (#1208) commit a722af779bcf6996bfa4eb17592a91dd62465f56 Author: Lee Byron Date: Mon Jan 29 12:04:10 2018 -0800 Fix #1205 - Use multi-line block for trailing quote (#1212) * Fix #1205 - Use multi-line block for trailing quote * Fix Travis build on #1212 (#1213) Made the exact same changes as in #1211 commit 6dc634bf4ad0ae009bdfb8d723f0a08475ac4f08 Author: Lee Byron Date: Fri Jan 26 16:57:40 2018 -0800 Follow up to #1211 commit bd8aa362efc2dcafb54ed1b7286577a6ee7b4c59 Author: Ivan Goncharov Date: Sat Jan 27 02:49:12 2018 +0200 Add 'objectValues' JS util function (#1209) commit a725633a1409df4d7ab46b39d992582d395b279d Author: Ivan Goncharov Date: Sat Jan 27 02:44:38 2018 +0200 Remove redundancy in 'schemaPrinter' tests (#1211) commit fa1341f2b8fb6c5da23827d3d9ce39093698025b Author: Lee Byron Date: Fri Jan 26 15:35:29 2018 -0800 Fix #1210 - SourceLocation is a type, not a value commit bc33f2e5382f454f8576e23e9a604c929d21e013 Author: mohawk2 Date: Tue Jan 23 00:31:48 2018 +0000 More accurate check for cache-hit in memoize3 (#1207) `WeakMap.get` returns `undefined` on cache miss. Checking for false instead of `undefined` will give a false cache-miss and recalculate when a false value is returned by the memoised function. commit d518c717083567fe06070c73c1c8692a87142442 Author: Lee Byron Date: Thu Jan 18 17:26:53 2018 -0800 Add node v9 to test matrix (#1206) commit 6d1af9f53255e1f35f458f62b703dacdba86d05b Author: Lee Byron Date: Thu Jan 18 16:51:07 2018 -0800 Update all dependencies (#1204) commit 17a0bfd5292f39cafe4eec5b3bd0e22514243b68 Author: Ivan Goncharov Date: Fri Jan 19 01:57:37 2018 +0200 Cleanup Enums (#1201) * Convert 'Kind' to object and expose 'KindEnum' * Create 'TokenKindEnum' type. * Move 'literalTok' outside of 'readToken' * Avoid using enums as runtime values Enum values are best left as representative opaque values, so we should avoid `value.length`. Minor variable name changes to preserve existing formatting * Which makes literalTok uncalled commit b3787bb2ebadcc37674fe1a8a0f83de6698ea532 Author: Christoph Zwerschke Date: Thu Jan 18 20:54:38 2018 +0100 Improve dedent (fixes #1202) (#1203) * Improve dedent utility tag function used for tests Changed the behavior of the function to not have the undocumented side effect of converting the string to its escaped (raw) form any more, and to also consider tabs in addition to spaces. Also added unit tests for the dedent function and adapted existing tests that were depending on the old behavior of the function. * Show test output as printed, avoid double backslash * Test that dedent properly supports interpolation * Make expected output in dedent-test easier to read commit 6f151233defaaed93fe8a9b38fa809f22e0f5928 Author: Christoph Zwerschke Date: Fri Jan 12 02:04:38 2018 +0100 Fix typos in dedent code (#1200) commit 1158cd49a05b4034c1bf5fa8c7623f5a45fe3ca6 Author: Lee Byron Date: Thu Jan 11 16:57:30 2018 -0800 Execute serially supporting sync execution. (#1198) Refactors executeFieldsSerially to return MaybePromise Fixes #1195 commit 358df97ac00f6abf7591277853e0e828a13a28bb Author: Lee Byron Date: Tue Jan 9 19:35:39 2018 -0800 Perf: memoize collectSubfields (#1130) * Perf: memoize collectSubfields Collecting subfields occurs after resolving a field's value and before resolving subfield values. This step collects fragment spreads and checks inline fragment conditions. When fetching a list of things, this step is computed with the same inputs and expecting the same outputs for each item in the list. Memoizing ensures the work is done at most once per type returned from a list. I tested this against the introspection query (which is both synchronous and complex) against a large schema and saw a ~15%-25% reduction in runtime. In practice I don't expect most queries to see this level of speedup as most queries are limited by backend communication and not execution overhead. * Include context in memoization, Factor out memoize3 commit 3848c75ce4886dbe45fa41550c31f0f6fdaf0b0c Author: Tim Griesser Date: Tue Jan 9 20:19:47 2018 -0500 Allow optionally specifying Args on GraphQLFieldResolver (#1197) commit 80aae9985c9b1ddd206a58a1384fca486e5fb477 Author: Ivan Goncharov Date: Tue Jan 9 02:22:01 2018 +0200 Fix print of block string with leading space and quotation (#1190) commit 50d499e1892eecbdf3d6ed3d8fa10df084e25150 Author: Lee Byron Date: Mon Jan 8 14:39:02 2018 -0800 Allow use of legacy names for schema validation (#1194) This offers an escape hatch for schema that are defined with legacy field names that were valid in older versions of the spec and no longer are via an explicit white-list. Fixes #1184 commit 740b7fae02368b1ea24f9e12a62502c49cd9fb95 Author: Ivan Goncharov Date: Mon Jan 8 23:39:29 2018 +0200 Export 'GraphQLSchemaConfig' & 'GraphQLDirectiveConfig' types (#1193) commit 87c1bc3e783f0f85ba3ba0a1b4479a0c3e6ba0c7 Author: Jan Melcher Date: Mon Jan 8 21:38:09 2018 +0100 getTypeMap() does not include input types used in directives (#1189) * Add failing test for directive's input types in getTypeMap() * Include directive argument types in getTypeMap() * Fix lint. Convert to reducer to solve flow issue. commit f082e24b12a53adaa6b2e2683f361dd388afbdaf Author: Jimmy Jia Date: Mon Jan 8 14:18:46 2018 -0500 Fix docstring for GraphQLError.extensions (#1176) commit 863fe2b9bfac689904f3640e912730766cf8a809 Author: Ivan Goncharov Date: Mon Jan 8 21:04:24 2018 +0200 Add 'introspectionFromSchema' utility function (#1187) Based on #1114 by @mjmahone commit 802e5186b56acee79ec4615c7f4161eb23abe5b3 Author: mohawk2 Date: Mon Jan 8 17:24:42 2018 +0000 Update printSchema for recent SDL change to `implements`. (#1179) Added test to prevent future regressions. Updated existing also. commit 652c0323ea2265fd1d001a9ee36fe9232369b75f Author: Ivan Goncharov Date: Mon Jan 8 19:23:47 2018 +0200 Simplify 'BooleanValue' print (#1180) commit 9e52e12870b9bae582d850b9561e9e35ddc8f713 Author: Ivan Goncharov Date: Mon Jan 8 19:23:19 2018 +0200 Fix 'astFromValue' to correctly handle integers and strings (#1181) commit b03cd111e94e7dbd43b0c892cda6f3fbe2f2c01b Author: mohawk2 Date: Mon Jan 8 17:19:15 2018 +0000 DRY with NonNull of Object tests (#1183) * reorder to group, reword descriptions consistently * rename fields for consistent sync vs promise * unify throw/return null * unify sync/promise * make throw-expect be errors-patch as data always same commit 67f947e69e6d3e3be4ff14629d809d7b0c361da1 Author: Ivan Goncharov Date: Mon Jan 8 19:17:57 2018 +0200 Update prettier (#1191) Code changes are due to: https://github.com/prettier/prettier/pull/3299 commit fd4a69cd748193160b3c35b1924f62590b1f4f11 Author: Ivan Goncharov Date: Thu Dec 21 02:20:11 2017 +0200 Printer: create special function to add description (#1175) commit 94234c8ce0a33cd8d884d0fced3d7d107db8f8aa Author: Lee Byron Date: Wed Dec 20 14:59:15 2017 -0800 Only trigger "one instance of graphql" error in DEV environments. (#1174) This ensures the additional checking for multiple graphql instances only occurs in non-production builds. Not only does this improve the performance for production builds, it also solves a spurious error case for minified builds: Since this additional check compares the `.name` of the constructors as a proxy for determining if two classes are representationally equal, minified builds may result in spurious false-positives if class names are minified to single-character names and those characters are likely to conflict. This doesn't require `process` to exist (defaulting to the non-production mode), but bundlers like Webpack should consider using a stripping transform (see: https://webpack.js.org/guides/production/#specify-the-environment) in production builds if they also use a minifier. commit 674e3c7e26642ee9dfeea036718aa5636ce9c0d5 Author: Mikhail Novikov Date: Wed Dec 20 22:43:42 2017 +0200 Add test case for failing parsing (#1166) * Add test case for failing parsing * Update expected token locations commit c496fb72510a8da8f55ccf4c4cc9c49cfd0b656b Author: Lee Byron Date: Wed Dec 20 12:42:20 2017 -0800 RFC: SDL - Separate multiple inherited interfaces with `&` (#1169) This replaces: ```graphql type Foo implements Bar, Baz { field: Type } ``` With: ```graphql type Foo implements Bar & Baz { field: Type } ``` With no changes to the common case of implementing a single interface. This is more consistent with other trailing lists of values which either have an explicit separator (union members) or are prefixed with a sigil (directives). This avoids parse ambiguity in the case of an omitted field set, illustrated by #1166 This is a breaking change for existing uses of multiple inheritence. To allow for an adaptive migration, this adds a parse option to continue to support the existing experimental SDL: `parse(source, {allowLegacySDLImplementsInterfaces: true})` commit b03b19c7d7b37b656d51de66178271f9191102db Author: Lee Byron Date: Wed Dec 20 11:55:51 2017 -0800 Parse option: allowLegacySDLEmptyFields (#1171) This offers a slightly smoother adoption path for existing code that uses the legacy empty field sets. commit 70cb8270e780d5790d7a95a8c58427ed407b7a06 Author: Lee Byron Date: Wed Dec 20 11:55:13 2017 -0800 Update to latest SDL grammar formatting (#1172) Just a minor change in formatting to match comments and function names to spec text commit ced8ad52601f55049f449ad673e12f289b098fbc Author: Ivan Goncharov Date: Wed Dec 20 21:09:56 2017 +0200 Update "babel-cli" package to enable '--inspect-brk' option (#1170) See: https://github.com/babel/babel/commit/0230dc50670771416406f9375eb57bf5adad17cc commit 8173c24dba61c5e032e4abd518729a5591b3076c Author: Sashko Stubailo Date: Tue Dec 19 10:21:30 2017 -0800 Bring back `getDescription` export (#1165) We were using this in graphql-tools with graphql@0.11, would be nice to get it exported again! Update buildASTSchema.js Fix formatting Add types for getDescription Export getDescription from the root commit 63a948897a705d890d6f45876bfdc8390d9e9133 Author: mohawk2 Date: Tue Dec 19 00:54:39 2017 +0000 DRY with MaybePromise (#1164) commit 81a88eb348d1661fd32c5d3059b0d8e55da3d589 Author: Lee Byron Date: Sat Dec 16 20:25:22 2017 -0800 0.12.3 commit 72b8e1b39a42fff30bc0864752e2995a7f17b487 Author: Lee Byron Date: Sat Dec 16 20:23:09 2017 -0800 Do not include lock files in deployed package commit e6a8e3149b03654291397d4a0c99d70845de004e Author: Lee Byron Date: Sat Dec 16 20:09:41 2017 -0800 0.12.2 commit 8c2693c49c11f1d1049f0868d731dc827bc5ebd4 Author: Lee Byron Date: Sat Dec 16 20:08:37 2017 -0800 Unify build scripts to all rely on `npm run build` (#1161) While `npm run build` prepares a module-aware package, we don't actually deploy one. This fixes that and avoids future issue by unifying the three build scripts in use. commit 0071110a280d9bb6c3731c4ef48da690df6368ce Author: Lee Byron Date: Sat Dec 16 20:04:41 2017 -0800 Add special case for legacy servers. (#1162) Much older versions of GraphQL use `__configs__` as part of a pseudo-introspection meta programming layer. While this is technically against the spec, this adds temporary support. commit 0d66e29c6c90fbd324e825ed0d6641fc0fd0b51f Author: Lee Byron Date: Sat Dec 16 18:39:13 2017 -0800 Increase test run time further for slow machines commit a471980d04b5bc4d530b1b044a5232fcf3c8fe84 Author: Lee Byron Date: Sat Dec 16 18:32:12 2017 -0800 0.12.1 commit 68ec835ee3c9e1543996598669c6774cab5b9166 Author: Lee Byron Date: Sat Dec 16 18:29:06 2017 -0800 Remove flow option experimental.const_params (#1160) Merges #1157 Codebases which don't enable this experiment show flow errors commit d11883e0d803dad19be2331f6444c0be9ac0866c Author: Lee Byron Date: Sat Dec 16 18:20:53 2017 -0800 Increase test timeout threshold to avoid spurrious CI failure commit 026870cea09853c92e6f3d67606b58055668c69e Author: Lee Byron Date: Sat Dec 16 17:57:11 2017 -0800 Upgrade to support flow 0.61 (#1158) commit 8bd9fda6905e7245e751c9e9c79fb3d7b5499ada Author: Lee Byron Date: Sat Dec 16 17:56:30 2017 -0800 visit return any instead of mixed. (#1159) Changing this from the (untyped) any to mixed is too severe a breaking change. Changing back to any ensures the visitor functions themselves remain checked but does not cause downstream usage to fail. commit 9d8b2977e4bc776ba1f9f76d6dbcf45255d50cd0 Author: Lee Byron Date: Fri Dec 15 18:32:44 2017 -0800 0.12.0 commit 1f9761808e3fa8fd617599820e0dd85cca57087c Author: Lee Byron Date: Fri Dec 15 18:27:23 2017 -0800 Flow type visitor and validation rules. (#1155) Inspired by #1145 commit b283d9b5b62934eeae6204f6bbf9fae8ae85a722 Author: Lee Byron Date: Fri Dec 15 15:21:46 2017 -0800 Add suggestions for invalid values (#1153) For misspelled enums or field names, these suggestions can be helpful. This also changes the suggestions algorithm to better detect case-sensitivity mistakes, which are common commit f2368989b19b7bef4e516282379cf26c6d963127 Author: Ken Leland III Date: Fri Dec 15 17:31:32 2017 -0500 Find breaking directive changes (#1152) * find removed directives * added missing semi * set > array for lookups * find removed directive arguments * find added non-null directive arguments * find removed locations for a directive * detect removed locations from directives in a schema * mv findDangerous::new functions to findBreaking * s/Argument/Arg * minor refactor, introducing Schema::getDirectiveMap() * make detector changes live * lint: Arrow function should not return assignment * move getDirectiveMap to findBreakingChanges.js * moved getArgumentMap to findBreakingChanges.js * yayee for keyMap! * noop * noop commit c4e301d9fedfc42a568f3670f5a11187cb7881db Author: Ivan Goncharov Date: Fri Dec 15 23:09:10 2017 +0200 Fix path argument. Enchance visit test to validate all arguments (#1149) commit 0765be3baf8913a7b3562c5678824896d266ccc2 Merge: c70f5cc4 de40c223 Author: Matt Mahoney Date: Fri Dec 15 09:53:56 2017 -0500 Merge pull request #1150 from mohawk2/fix-watch-lint Make `npm run watch` linting work right commit c70f5cc444f9301175a69e8c17567b91547a85bd Merge: ada56fe0 8d1ae25d Author: Matt Mahoney Date: Fri Dec 15 09:50:20 2017 -0500 Merge pull request #1148 from APIs-guru/noMaxLen Remove eslint comments unnecessary after 40f73fd commit de40c2231baf0d6c80d4d5970ca54197f504d01d Author: Ed J Date: Fri Dec 15 10:16:19 2017 +0000 Make `npm run watch` linting work right commit 8d1ae25de444a9b544a1fdc98e138ae91b77057c Author: Ivan Goncharov Date: Fri Dec 15 00:51:37 2017 +0200 Remove eslint comments unnecessary after 40f73fd commit ada56fe02302c226a8638a0e2e06803ccf6d8307 Author: Lee Byron Date: Thu Dec 14 13:56:41 2017 -0800 Validate literals in a single rule with finer precision (#1144) This generalizes the "arguments of correct type" and "default values of correct type" to a single rule "values of correct type" which has been re-written to rely on a traversal rather than the utility function `isValidLiteralValue`. To reduce breaking scope, this does not remove that utility even though it's no longer used directly within the library. Since the default values rule included another validation rule that rule was renamed to a more apt "variable default value allowed". This also includes the original errors from custom scalars in the validation error output, solving the remainder of #821. Closes #821 commit 1aa12df1633a8eca1543ccc5d481bb3dc9a19175 Author: Lee Byron Date: Thu Dec 14 13:44:49 2017 -0800 Simplify Unknown Args Validation (#1147) TypeInfo has a utility this should be using. commit ce0a4b9c76423edaddc2d9c65661189d0dba77cd Author: sam-swarr Date: Thu Dec 14 15:50:44 2017 -0500 Add experimental support for parsing variable definitions in fragments (#1141) commit f39b0fd9696caccf7557575f950ea544a124063a Author: Ivan Goncharov Date: Thu Dec 14 04:07:01 2017 +0200 Re-enable eslint redeclare check for rest of file (#1140) commit 1d90ad2b9711b9bc2ce5e84c5415e61c64692147 Author: Lee Byron Date: Wed Dec 13 15:26:02 2017 -0800 Robust type info (#1143) There are possibilities for errors during validation if a schema is not valid when provided to TypeInfo. Most checks for validity existed, but some did not. This asks flow to make those checks required and adds the remaining ones. Important now that we allow construction of invalid schema. commit 461392db1eb05b21dc8b048ac352ea2fb37bdbbd Author: Lee Byron Date: Tue Dec 12 20:35:29 2017 -0800 Move schema validation into separate step (type constructors) (#1132) This is the second step of moving work from type constructors to the schema validation function. commit cddcad3f58ee6d5f275378f58c0eaa602856382e Author: Lee Byron Date: Tue Dec 12 17:15:28 2017 -0800 Address recent SDL spec changes (#1139) This should be the last set of spec changes for a standardized SDL commit 7e147a8dd60496505cd5d491fb7126b2319095c9 Author: Lee Byron Date: Mon Dec 11 20:32:00 2017 -0800 Expose flow type for typeFromAST and fix exposed bug commit 2adbe2267a5d2e3be6e61e6dfb47b7af08f4e7ac Author: Lee Byron Date: Mon Dec 11 20:10:28 2017 -0800 Better Predicates (#1137) Introduces new predicate and assertion functions for each kind of type mirroring the existing ones for the higher order types. It also includes predicates for directives and schema. This should remove the need to use `instanceof` in any usage of GraphQL.js This consolidates the checking of instances which generalizes the cross-realm/multiple-module check so that the clearer error message is provided in nearly all scenarios, reducing confusion. This also replaces nearly all `instanceof` with new predicate functions internally. Fixes #1134 commit 5b62e07ec691db2e479ee371d1982788da473aeb Author: Lee Byron Date: Mon Dec 11 16:37:43 2017 -0800 Follow up to #1136 which removes a "*" type commit d707c2eb8894df7384398e8dba1da91e27af6ea0 Author: Lee Byron Date: Mon Dec 11 16:24:45 2017 -0800 Improve flow types for execute logic commit 5e6a5b9bd95485287430cae048a22d06d2eaa3f9 Author: Lee Byron Date: Mon Dec 11 16:16:32 2017 -0800 Covariant Wrapping Types (#1136) **Semi-breaking: Those using flow should change from `new GraphQLList(t)` and `new GraphQLNonNull(t)` to `GraphQLList(t)` and `GraphQLNonNull(t)`** Because class constructors are contravariant since flow/js lacks a "finally" keyword, we need to use functions to represent covariance in GraphQLList and GraphQLNonNull. By having wrapping types be covariant, we can enable more checks and have more accurate predicates for refining types in GraphQL utilities. commit 40f73fdb4167e5659b132037eb644d5b7e711126 Author: Lee Byron Date: Mon Dec 11 15:28:11 2017 -0800 No more max-len, in prettier we trust commit 2536f144e30fb33aadec3916dfb728043fae573b Author: Lee Byron Date: Mon Dec 11 12:54:24 2017 -0800 Preserve original coercion errors, improve error quality. (#1133) This is a fairly major refactoring of coerceValue which returns an Either so it can return a complete collection of errors. This allows originalError to be preserved for scalar coercion errors and ensures *all* errors are represented in the response. This had a minor change to the logic in execute / subscribe to allow for buildExecutionContext to abrupt complete with multiple errors. commit 2d08496720088dbe65ebea312c8526bd48fb8ee8 Author: Lee Byron Date: Fri Dec 8 16:42:13 2017 -0800 Always extract extensions from the original error if possible commit ad599ffde4ef5123fbd820abc5764d3d612409d0 Author: Lee Byron Date: Fri Dec 8 16:40:01 2017 -0800 Add %checks to utility null/invalid checkers commit b374965c6597dade6080095994c457836a495bf6 Author: Lee Byron Date: Fri Dec 8 12:48:18 2017 -0800 Fix printError/locations for multiple nodes. (#1131) If a GraphQLError represents multiple nodes across files (could happen for validation across multiple parsed files) then the reported locations and printError output can be incorrect for the second node. This ensures locations are derived from nodes whenever possible to get correct location and amends comment documentation. commit f6e781dcf866848c5432db04de45aca502185cc6 Author: Lee Byron Date: Thu Dec 7 21:41:30 2017 -0800 Remove duplicate dedent definition commit 819a59c2d0d365ea262fe1e75f09c6193bea5b1f Author: Lee Byron Date: Thu Dec 7 17:55:52 2017 -0800 Validate schema root types and directives (#1124) This moves validation out of GraphQLSchema's constructor (but not yet from other type constructors), which is responsible for root type validation and interface implementation checking. Reduces time to construct GraphQLSchema significantly, shifting the time to validation. This also allows for much looser rules within the schema builders, which implicitly validate while trying to adhere to flow types. Instead we use any casts to loosen the rules to defer that to validation where errors can be richer. This also loosens the rule that a schema can only be constructed if it has a query type, moving that to validation as well. That makes flow typing slightly less nice, but allows for incremental schema building which is valuable commit 5fec485087c7d644ef4844017350df87b17998c6 Author: Lee Byron Date: Thu Dec 7 17:18:27 2017 -0800 New: printError() (#1129) Lifted from / inspired by a similar change in #722, this creates a new function `printError()` (and uses it as the implementation for `GraphQLError#toString()`) which prints location information in the context of an error. This is moved from the syntax error where it used to be hard-coded, so it may now be used to format validation errors, value coercion errors, or any other error which may be associated with a location. commit 96f92f300460d212145a14d225d3baf9bd27bab5 Author: Lee Byron Date: Thu Dec 7 14:02:45 2017 -0800 Improve aggreate NullableType and InputType flow types (#1128) Mirrors the structure of OutputType flow type, reduces the use of `*`. commit 6104a758c312ea954fea2c699cf5b096484f5593 Author: Lee Byron Date: Thu Dec 7 11:32:37 2017 -0800 Fix unhandled error when parsing custom scalar literals. (#1126) Fixes #910 This factors out the enum value validation from scalar value validation and ensures the same try/catch is used in isValidLiteralValue as isValidJSValue and protecting from errors in valueFromAST. commit 9b9c7ad62283d395cabf9f60de488b4662e1b770 Author: Mari NAKANO Date: Thu Dec 7 17:40:51 2017 +0900 fix broken link on README.md (#1125) * Include test that printSchema includes non-spec directives. Closes #1072 * fix broken link on README.md commit 007407deb0953fc95b8a341c064c42ec83124bc2 Author: Lee Byron Date: Wed Dec 6 23:31:53 2017 -0800 Include test that printSchema includes non-spec directives. Closes #1072 commit a56e6abc5186d291a56a6cb8f3cf8d83f2753bab Author: Lee Byron Date: Wed Dec 6 23:24:37 2017 -0800 Closes #1071 commit 8e15b1f33455e4e1a5e9b634add9bd5530b2c7cb Author: Lee Byron Date: Wed Dec 6 22:13:27 2017 -0800 .github directory with issue template commit a3a130c4725cf5742a245431bdbe1ecc04a56146 Author: Lee Byron Date: Wed Dec 6 19:37:37 2017 -0800 Fix subscription tests commit 238e50a00384447df635a40111db8b381dedb7e6 Author: Lee Byron Date: Wed Dec 6 19:28:37 2017 -0800 Another follow up to #1117 to comply with #1121 commit ab34d3f1ff9d5b9d367cad9ba7663162ed2a1f10 Author: Lee Byron Date: Wed Dec 6 17:41:58 2017 -0800 Allow constructing GraphQLError with single node. (#1123) A common case is encountering an error which blames to a single AST node. Ensure the GraphQLError constructor can handle this case. commit 73b804bd46fcda4606a833cbdd9835d1ee917807 Author: Lee Byron Date: Wed Dec 6 17:08:00 2017 -0800 Improve error message for duplicate schema commit fed961040e4d53c46bc1d85b48beba2303a7929c Merge: 98aa4122 34a53cb1 Author: Lee Byron Date: Wed Dec 6 16:36:20 2017 -0800 Merge branch 'kassens-validate' commit 34a53cb18866527714f67a4490b1dc8fb8b06463 Merge: 0244af41 bd814521 Author: Lee Byron Date: Wed Dec 6 15:41:42 2017 -0800 Merge branch 'validate' of https://github.com/kassens/graphql-js into kassens-validate commit 98aa412257de76d41a0c605911ad7ce44edce2b9 Author: Lee Byron Date: Wed Dec 6 15:53:02 2017 -0800 Readonly AST: Use $ReadOnlyArray (#1122) This is the second step of #1121 to ensure AST are readonly, marking all arrays as $ReadOnlyArray. commit 0244af4107918a0513c564be5f762d8a339f5dca Author: Lee Byron Date: Wed Dec 6 15:13:22 2017 -0800 Follow up to #1117 to comply with #1121 commit 2e09b81fc2517efba7c58dfa42ede55b62fa7914 Author: Lee Byron Date: Wed Dec 6 14:40:28 2017 -0800 Update to flow v0.60 commit d0bb4d8c2cbedfb80f0c400294f6977e5082ee28 Author: Lee Byron Date: Wed Dec 6 14:01:47 2017 -0800 SDL Spec changes (#1117) This adds the recent changes to the SDL proposal. commit 8e0c599ceccfa8c40d6edf3b72ee2a71490b10e0 Author: Lee Byron Date: Wed Dec 6 13:48:42 2017 -0800 Read-only AST types (#1121) **Potential breaking change: Where previously AST would produce `null`, it now produces `undefined`** This tightens up the AST types to produce readonly covariant fields, $ReadOnlyArray in a couple places (not AST yet, perhaps in a future PR), and replaces `field?: ?Rule` with `field?: Rule` to exclude the possibility of `null` from `undefined` for optional rules, reducing complexity. commit f2c96b0456ac62a21f524f2b51a014646c5a2bbb Author: Lee Byron Date: Wed Dec 6 11:48:18 2017 -0800 Test: Missing subscription field should not be an "internal error" (#1106) A remaining issue with subscriptions is attempting to subscribe to a missing field. The existing implementation creates an internal error which is an improper blame since there is no possibility to fix it internally - it is an issue with the query. Since there is no clear consistent behavior relative to query/mutation operations (which simply skip over unknown fields), and the corner-case where this occurs should deal with the error - this changes the internal error to an external yielded GraphQL error. Note: we still require a spec change since there is an ambiguity of this exact scenario. commit c1eca362926522c6f7313663a9615afbbb25eee2 Author: Ivan Goncharov Date: Wed Dec 6 19:37:05 2017 +0200 Export GraphQLArgs (#1118) commit 07984e610a440283ce94c4a2e554d16bb8c3a934 Author: Ivan Goncharov Date: Wed Dec 6 19:35:48 2017 +0200 Test that introspection results are always sync. (#1120) commit cf0ded854516d3130a3edca8333c50ada67c383b Author: Lee Byron Date: Tue Dec 5 18:08:43 2017 -0800 Subscriptions: report resolver errors during initialization (#1107) * Subscriptions: report resolver errors during initialization Expanding on the tests to cover all forms of subscription resolver errors. * WIP fixing this: I think part of the issue is resolveFieldValueOrError not applying the same error-catching behavior to Promises. This causes different tests to fail, so I'll investigate those next. * Ensure asErrorInstance is used for located errors commit f2475ce4cba3b24b7482e80ca098a88d0eec8761 Author: Lee Byron Date: Tue Dec 5 17:03:18 2017 -0800 Flow: Readonly errors (#1116) This uses $ReadOnlyArray and `+` properties to ensure Errors are read-only, removing some use of `*`. commit f6a2de271cf32977908422ea2a1989432ce09ab4 Author: Lee Byron Date: Tue Dec 5 15:54:51 2017 -0800 RFC: Synchronous execution (#1115) * RFC: Synchronous execution **This is a breaking change. Existing uses of execute() outside of async functions which assume a promise response will need to wrap in Promise.resolve()** This allows `execute()` to return synchronously if all fields it encounters have synchronous resolvers. Notable this is the case for client-side introspection, querying from a cache, and other useful cases. Note that the top level `graphql()` function remains a Promise to minimize the breaking change, and that `validate()` has always been synchronous. * Include graphqlSync top level function * Include tests for graphqlSync commit f59f44a06ab4d433df4b056d150f79885b62243f Author: Lee Byron Date: Mon Dec 4 15:40:52 2017 -0800 Improve introspection types + new getIntrospectionQuery() (#1113) This adds a new function `getIntrospectionQuery()` which allows for some minor configuration over the resulting query text: to exclude descriptions if your use case does not require them. It also updates the flow types to remove exact types for the kinds of `__Type` since they will have other fields that would be `null`. commit c1d795c84307c9418afc5196e5ac0f948c1586cc Author: Lee Byron Date: Mon Dec 4 14:04:10 2017 -0800 Prettier (#1112) Closes #1081 commit 4a6c8ca703c3e7e8250c3c3c502935995f91e915 Author: Lee Byron Date: Mon Dec 4 12:41:48 2017 -0800 Fix infinite loop on invalid queries in OverlappingFields (#1111) `OverlappingFieldsCanBeMerged` would infinite loop when passed something like ```graphql fragment A on User { name ...A } ``` It's not `OverlappingFieldsCanBeMerged`'s responsibility to detect that validation error, but we still would ideally avoid infinite looping. This detects that case, and pretends that the infinite spread wasn't there for the purposes of this validation step. Also, by memoizing and checking for self-references this removes duplicate reports. Closes #780 commit 134184e2817dbdd017ea2ee791fa94ce4de892e6 Merge: 74d5bf54 ce937da8 Author: Lee Byron Date: Mon Dec 4 11:39:34 2017 -0800 Merge branch 'APIs-guru-predicates' commit ce937da863cf596b482d9439b260792820b1a47c Merge: 74d5bf54 92042711 Author: Lee Byron Date: Mon Dec 4 11:39:21 2017 -0800 Merge branch 'predicates' of https://github.com/APIs-guru/graphql-js into APIs-guru-predicates commit 74d5bf54d1e75b6ef224cb731d0fd09a51c86c36 Author: Lee Byron Date: Mon Dec 4 10:09:23 2017 -0800 Update to match SDL changes (#1102) This changes the parsing grammar and validation rules to more correctly implement the current state of the GraphQL SDL proposal (https://github.com/facebook/graphql/pull/90) commit fa2df7efca9fba38ed7e5fd922be64f6e114f35e Author: Christian Joudrey Date: Mon Dec 4 13:07:07 2017 -0500 Fix typo in block string lexer test (#1108) commit 8f2db6ac8952a27520ccd95be7969efcef6e30eb Author: Ivan Goncharov Date: Mon Dec 4 20:06:24 2017 +0200 Fix `yarn` cmd. check the length of npm_config_argv in prepublish (#1110) commit 92042711e4dc4cdfafd4dda66869b5f08b4b5660 Author: Ivan Goncharov Date: Wed Jun 21 15:37:53 2017 +0300 Add predicates to for built-in types. commit 9e6d32af108abc979d07f4aac3b52808b019dabd Author: Lee Byron Date: Fri Dec 1 18:56:36 2017 -0800 Remove redundant tests commit d28ad39fb45a1976b443fcb3f7305b972216a5e1 Author: Lee Byron Date: Fri Dec 1 18:44:50 2017 -0800 spelling commit 8038cef8386e8538063ebf24ea737cb0ec702a70 Author: Lee Byron Date: Fri Dec 1 18:18:44 2017 -0800 Add a couple extra subscription tests for early errors commit 0b2e81c768cd4da96082cec07a973b2017dcbe97 Author: Ivan Goncharov Date: Sat Dec 2 02:45:02 2017 +0200 Allow to extend GraphQL errors with additional properties (#928) commit f2430c6752b2a52a685636e6a545e8025d4f5bf7 Merge: e5a21fe2 23b398f3 Author: Lee Byron Date: Fri Dec 1 16:37:48 2017 -0800 Merge branch 'APIs-guru-unifyBuildSchema' commit 23b398f300b9dc8bcfa8d5298ecd1cccb41d925d Merge: e5a21fe2 57ba5802 Author: Lee Byron Date: Fri Dec 1 16:37:31 2017 -0800 Merge branch 'unifyBuildSchema' of https://github.com/APIs-guru/graphql-js into APIs-guru-unifyBuildSchema commit e5a21fe215b41aa792c119e8062f75ed7ef84eab Author: Lee Byron Date: Fri Dec 1 15:59:30 2017 -0800 Export ES6 modules (#1105) Alternative to #939 which requires less alteration of existing build config and dist file layout Enables tree shaking for Rollup/Webpack Closes #939 commit 22183692df2115ecc4e48e109edf09bbca170af0 Author: Lee Byron Date: Fri Dec 1 15:26:42 2017 -0800 (Potentially Breaking) Allow serializing scalars as null. (#1104) This changes the check for null/undefined to a check for undefined to determine if scalar serialization was successful or not, allowing `null` to be returned from serialize() without indicating error. This is potentially breaking for any existing custom scalar which returned `null` from `serialize()` to indicate failure. To account for this change, it should either throw an error or return `undefined`. Fixes #1057 Closes #1066 commit 5083a23c0b457d551c790d93dc7be846167a23ff Merge: 82787e76 fd49f45c Author: Lee Byron Date: Fri Dec 1 14:54:19 2017 -0800 Merge branch 'APIs-guru-addNodesToErrors' commit fd49f45c726c21bff2783dfda8c69cd6f9494aed Merge: 82787e76 9da6e06b Author: Lee Byron Date: Fri Dec 1 14:52:52 2017 -0800 Merge branch 'addNodesToErrors' of https://github.com/APIs-guru/graphql-js into APIs-guru-addNodesToErrors commit 82787e76ad79b336861cd40180f1a98e9db77703 Merge: a3afb988 db4cfdc3 Author: Lee Byron Date: Fri Dec 1 14:52:11 2017 -0800 Merge branch 'aolesky-nullable_change_warning' commit db4cfdc31d1b4a824a95118196843841bccfdf4f Merge: a3afb988 c167f26f Author: Lee Byron Date: Fri Dec 1 14:51:12 2017 -0800 Merge branch 'nullable_change_warning' of https://github.com/aolesky/graphql-js into aolesky-nullable_change_warning commit 9da6e06bfaffd0a0d4a58364172396b82c0ab6d6 Author: Lee Byron Date: Fri Dec 1 14:37:12 2017 -0800 Flow refine null condition commit 48261feaa1f79ae59d6417e7f23b619567c0cb65 Author: Lee Byron Date: Fri Dec 1 14:30:24 2017 -0800 Explicit nulls commit a3afb988850076aa5d192f7044e00b3763832dd7 Author: Ivan Goncharov Date: Sat Dec 2 00:15:39 2017 +0200 improve legibility of subscribe function (#1042) Appy changes from 4fbfd22 on 'subscribe' function commit 646516134cce8be7423ffd24412c046123d03e12 Author: mohawk2 Date: Fri Dec 1 22:10:58 2017 +0000 make buildObjectDef more robust (#1053) * test handle introspected schema with invalidly null interfaces * Reformat test to more clearly indicate "missing" commit c1b6b328be55a4bb0392c9e041832ed446fe4814 Author: Terry Date: Sat Dec 2 06:09:29 2017 +0800 Check isDeprecated instead of deprecationReason in printDeprecated (#1035) * Check isDeprecated instead of deprecationReason in printDeprecated * Formatting commit ebb31ec3cd211bb93002d4b0a41f0fbe3c4d0fe9 Author: Ivan Goncharov Date: Sat Dec 2 00:00:36 2017 +0200 Correct types for 'path' & 'parentType' of GraphQLResolveInfo (#1033) * Correct types for 'path' & 'parentType' of GraphQLResolveInfo * Explicit void for path * Explicit void for prev path commit c650f301a89aa51a50c9ce9a6060c378d6b14aff Author: Lee Byron Date: Fri Dec 1 13:45:40 2017 -0800 Support for union types when using buildSchema (#947) Closes #947 Squashed commit of the following: commit 8d19d2634d728abfe61a50070259c588096343e2 Author: Lee Byron Date: Fri Dec 1 13:45:24 2017 -0800 Clean up existing tests and improve error messages commit 95018b1a8484dea64f29faf48f111a3906df348e Author: Lee Byron Date: Fri Dec 1 13:29:45 2017 -0800 Move resolveType __typename checking into defaultResolveType commit 1af7646053dd426d9fe43e10e6ecd3ab7c1905a8 Author: jonbretman Date: Thu Jul 13 11:16:40 2017 +0100 Adds support for resolving union/interface types when using a generated schema commit 714ee980aa17a4de42013d49a9839d43493d109e Author: Lee Byron Date: Fri Dec 1 12:54:07 2017 -0800 Squashed commit of the following: Closes #903 commit 0062abf30446a43245e2a5562d147d2761c13e17 Author: Lee Byron Date: Fri Dec 1 12:49:38 2017 -0800 Amends this PR with a few additions: * Generalizes building a value from an AST, since "scalar" could be misleading, and supporting variable values within custom scalar literals can be valuable. * Replaces isNullish with isInvalid since `null` is a meaningful value as a result of literal parsing. * Exports this new utility from the top level commit 0ca6cf0d7f4c251d704efee7b20c82dd899c4d09 Merge: 37717b8 78e69d6 Author: Lee Byron Date: Fri Dec 1 11:57:55 2017 -0800 Merge branch 'astValueToData' of https://github.com/APIs-guru/graphql-js into APIs-guru-astValueToData commit 78e69d6f4fa2c1cef441c1aa72672eb6158c2da7 Author: Ivan Goncharov Date: Sun Jun 11 01:07:47 2017 +0300 Fix 'serialize' stub used in buildASTSchema commit a0688c6157aff35abd32936136ffc59290ac8d43 Author: Ivan Goncharov Date: Fri Jun 9 23:24:55 2017 +0300 Provide reasonable default version of 'parseLiteral' commit 313d66e3ec009af8b727a544ff65cca7b7797048 Author: Ivan Goncharov Date: Fri Jun 9 23:22:49 2017 +0300 Add test for building client schema with default value on custom scalar commit 37717b8a6e2549ac1ce73acb936d98dba7b14d09 Author: Lee Byron Date: Thu Nov 30 12:46:59 2017 -0800 RFC: Descriptions as strings. (#927) As discussed in https://github.com/facebook/graphql/pull/90 This proposes replacing leading comment blocks as descriptions in the schema definition language with leading strings (typically block strings). While I think there is some reduced ergonomics of using a string literal instead of a comment to write descriptions (unless perhaps you are accustomed to Python or Clojure), there are some compelling advantages: * Descriptions are first-class in the AST of the schema definition language. * Comments can remain "ignored" characters. * No ambiguity between commented out regions and descriptions. Specific to this reference implementation, since this is a breaking change and comment descriptions in the experimental SDL have fairly wide usage, I've left the comment description implementation intact and allow it to be enabled via an option. This should help with allowing upgrading with minimal impact on existing codebases and aid in automated transforms. commit bf4a25a33a62280e82680518adc279e34ec816e0 Author: Lee Byron Date: Thu Nov 30 12:28:53 2017 -0800 Remove notes about subscription being experimental commit 72421378550cf51b13c6db59b8fc912591fd1a4b Author: Lee Byron Date: Thu Nov 30 10:56:28 2017 -0800 Add additional number lexing test commit f9e67c403a4667372684ee8c3e82e1f0ba27031b Author: Lee Byron Date: Thu Nov 30 09:11:12 2017 -0800 Improvements to printing block strings commit 7a7ffe4e6d0f93806389808cc2abc95682270b1b Author: Angly Cat Date: Thu Nov 30 11:25:15 2017 +0600 Uniform parsing of queries with short-hand syntax with regular queries (#1094) * Fix parsing of regular queries by making the parser return the same result as with short-hand syntax queries * Add test to prevent future regressions * Default to empty array when parsing * Empty array for variable definitions in tests commit 1f6b64e34f640ef49a17d01ed78d3301779705ac Author: Ivan Goncharov Date: Thu Nov 30 07:24:47 2017 +0200 Fix how TypeInfo handles inline fragments without type (#1041) commit 997bd8fba7812425e240ef3df0bcde1db3ce9509 Author: Andy Trevorah Date: Thu Nov 30 05:11:15 2017 +0000 fix elasticsearch errors being mistaken for graphql errors (#1090) commit aea5964fc2596f8815bf7252a26872e96acf3230 Author: Lee Byron Date: Wed Nov 29 21:00:20 2017 -0800 RFC: Block String (#926) * RFC: Multi-line String This RFC adds a new form of `StringValue`, the multi-line string, similar to that found in Python and Scala. A multi-line string starts and ends with a triple-quote: ``` """This is a triple-quoted string and it can contain multiple lines""" ``` Multi-line strings are useful for typing literal bodies of text where new lines should be interpretted literally. In fact, the only escape sequence used is `\"""` and `\` is otherwise allowed unescaped. This is beneficial when writing documentation within strings which may reference the back-slash often: ``` """ In a multi-line string \n and C:\\ are unescaped. """ ``` The primary value of multi-line strings are to write long-form input directly in query text, in tools like GraphiQL, and as a prerequisite to another pending RFC to allow docstring style documentation in the Schema Definition Language. * Add RemoveIndentation() to the lexer for multi-line strings. * blockStringValue commit fed3ef58fde674fa96d79879eb4dfc24a0ba1db0 Merge: 2419c3dc 424194da Author: Matt Mahoney Date: Tue Nov 21 12:04:23 2017 -0500 Merge pull request #992 from excitement-engineer/interface-expansion-dangerous Adding an interface to a type is now a dangerous change. commit 424194da1b91b403a6cff8812ef6fbceebdd6c71 Author: Matt Mahoney Date: Tue Nov 21 11:52:50 2017 -0500 Additional trailing comma commit eb135801f2db36583ce6697e9fd1305c12843a46 Author: Matt Mahoney Date: Tue Nov 21 11:51:31 2017 -0500 Trailing commas missed in conflict resolution commit 7ba2d33de199476e772f0f623769089d7489feec Author: Matt Mahoney Date: Tue Nov 21 11:49:17 2017 -0500 Trailing space issue from my conflict resolution commit d7e3d5b9a4e51e74e89f97e161d81a5070d057af Merge: aeb8949c 2419c3dc Author: Matt Mahoney Date: Tue Nov 21 11:39:53 2017 -0500 Merge branch 'master' into interface-expansion-dangerous commit c167f26f089fe1db714e4005103c47c7f3a8a213 Author: Alec Olesky Date: Mon Nov 20 16:28:39 2017 -0500 Detect added nullable input field or added nullable argument commit bd8145218d9ff3a8790ab01525a88264742a4024 Author: Jan Kassens Date: Fri Nov 3 09:23:58 2017 -0700 Prototype of validate step commit 2419c3dc9596a031e6df87810d2f64111a4ae3f8 Author: Matt Mahoney Date: Fri Nov 3 22:33:44 2017 -0400 More strict typing for Introspection Schema types (#1082) * Make Introspection types read-only, split Input vs Output types where possible * Lint fixes * NonNull and List keep their TypeRef names * Remove typehints I was using to track down flow failure * Make suggested changes commit 8f6582c57d6ba8e898220c472e0606d5a6255995 Merge: 1017befa d76bf12f Author: Jan Kassens Date: Fri Nov 3 10:07:50 2017 -0700 Merge pull request #1078 from kassens/flow Update to flow 0.58 commit d76bf12f6b66ba5fbc1a66b3b1681d8eef56631a Author: Jan Kassens Date: Fri Nov 3 08:49:42 2017 -0700 Update to flow 0.58 commit 1017befa7270cc0f074308056cea6115be498a99 Merge: ef9af631 46e60379 Author: Greg Hurrell Date: Mon Oct 30 10:54:21 2017 -0700 Merge pull request #1070 from gj/patch-1 Fix typos commit 46e603792b4ad113a495c52e97599e8cab11519a Author: Gabe Jackson Date: Mon Oct 30 02:19:22 2017 -0400 Fix typos commit ef9af6311e92e10b4bef9234217c412de7bb28ff Author: Lee Byron Date: Fri Oct 13 14:20:23 2017 -0700 Improve errors when receiving bad introspection data (#1063) I've seen a few examples of passing bad introspection data to buildClientSchema() result in a hard to understand internal error. This instead prints a more understandable error which includes a print out of the bad value in question. Hopefully this aids debugging. This also adds a comment to the description of this function recommending that the "errors" field of a server response be checked before continuing to avoid partial results. commit 6e7d51d6c8fb9ed66d93510fa49477a05dd751af Merge: a9ab37d0 b52c65aa Author: Greg Hurrell Date: Fri Oct 13 15:51:05 2017 +0100 Merge pull request #1058 from aortbals/fix-process-undefined Check if `process` is defined (for usage in the browser) commit a9ab37d09afa50197f2654068e395d456965a87f Merge: e236ca23 4319ba1f Author: Greg Hurrell Date: Fri Oct 13 15:49:06 2017 +0100 Merge pull request #1061 from puradox/master docs: Fix possible typo commit 4319ba1f7ccb35ff4a14d270bfebc37a12108c2a Author: Sam Balana Date: Thu Oct 12 09:23:29 2017 -0700 docs: Fix possible typo The argument to the GraphQLList class should be of type GraphQLType, but the docs of GraphQLList does not reflect this. In this case, `Person` is undefined, when it *probably* should have been `PersonType`. commit b52c65aac872efcc50b8ffa221996cf156d600de Author: Aaron Ortbals Date: Fri Oct 6 13:06:46 2017 -0500 fix: avoid process is undefined error when used in the browser commit e236ca23e26bff89de2e05cc95ba179d253662fd Author: Lee Byron Date: Tue Oct 3 11:09:28 2017 -0700 0.11.7 commit 36b3407c2509822edd5762ffcdef7ac3d56d15d4 Author: Lee Byron Date: Tue Oct 3 11:08:25 2017 -0700 Return normal objects for args and vars. (#1056) This is a follow up to #1048 which addresses an issue where flow typed resolver functions would need to be aware of the fact that arguments were prototype-less. That's something we maintain for internal usage, but is more burdensome for external use. Instead, this is just more cautious when using these values internally, using hasOwnProperty, but now returns prototypefull objects to user code. Also follows up with a few additional conversions to ObjMap, such that the only remaining uses of `{[string]: mixed}` are for variables and arguments. commit efcfae616254bab5d391fd7cecd5f1422c754157 Author: Greg Hurrell Date: Fri Sep 29 09:38:14 2017 -0700 0.11.6 commit ec25e758f8c786b0b9ac22e223fafe489304a0e4 Merge: 01365675 a7c42061 Author: Greg Hurrell Date: Fri Sep 29 09:36:48 2017 -0700 Merge pull request #1052 from wincent/glh/bump Upgrade iterall dependency commit a7c420617bbfaffb4548244accd181fba34cce68 Author: Greg Hurrell Date: Fri Sep 29 09:29:12 2017 -0700 Upgrade iterall dependency Pulls in necessary fix for breakage in 1.1.2: https://github.com/leebyron/iterall/commit/325e8ff9e7cd966156688d2012b16f3a588b886a commit 01365675cc0b3e6c1387fcdbf209ed63298a8db2 Author: Hyo Jeong Date: Thu Sep 28 22:07:01 2017 -0700 0.11.5 commit 9a9de3effa03f46b1092c6e08c61d13cb4052c94 Author: Hyo Jeong Date: Thu Sep 28 22:03:47 2017 -0700 fix flow errors by annotating null prototypes (#1048) commit a501a9cc819bf7657d30e9cfc66ab0fc724c326e Author: Lee Byron Date: Tue Sep 26 12:16:30 2017 -0700 0.11.4 commit 3afa9928f10eef2da8f8ded0e6637e277b7d976d Author: Lee Byron Date: Tue Sep 26 11:40:37 2017 -0700 Update to iterall@1.1.2 with memory leak fix commit 4f5e351c2afb28e4ae3a44eae76d45d895ff3aa2 Author: Lee Byron Date: Tue Sep 26 11:28:09 2017 -0700 Relicense as MIT (#1046) Read about this change: https://medium.com/@leeb/relicensing-the-graphql-specification-e7d07a52301b * Change LICENSE to MIT * Change all source headers to refer to MIT * Remove PATENTS file * Update README.md and CONTRIBUTING.md to refer to MIT and remove reference to PATENTS * Update package.json to MIT * Update build and deploy resources to not distribute PATENTS file. commit eb01a23c578d949ccea2fa2b350e65a3893e6895 Merge: b84b69fd 7086160e Author: Greg Hurrell Date: Fri Sep 8 15:45:34 2017 -0700 Merge pull request #1027 from APIs-guru/excuteArgs Add missing ExecutionArgs export commit 7086160eb3eca1c0e23fe2a0cacd92d8c946b1e0 Author: Ivan Goncharov Date: Thu Sep 7 16:40:39 2017 +0300 Fix issues uncovered by enabling Flow commit 3c74e0b1637359d462c30ed9a98e822defe97b5f Author: Ivan Goncharov Date: Thu Sep 7 16:31:36 2017 +0300 Add missing '@flow' and unify comments style commit 56c2e42d498526efdaad31d163df16a2f979f7a7 Author: Ivan Goncharov Date: Thu Sep 7 16:10:30 2017 +0300 Add missing ExecutionArgs export commit b84b69fd723e703f089f6524db9851341aa98d50 Author: Lee Byron Date: Tue Sep 5 22:25:34 2017 -0700 0.11.3 commit 4fbfd22b08a987d39f826335904dd816da1d5717 Author: Lee Byron Date: Tue Sep 5 22:21:53 2017 -0700 Follow up: improve legibility of graphql/execute fns commit fee8abbec3ceec260747bf2869b3540790de42dd Author: Lee Byron Date: Tue Sep 5 22:18:02 2017 -0700 Revert "Simplify args processing in "graphql" and "execute" functions" This reverts commit 58ac464f8528ed4da2fe278d4f32dba311b4e2b5. Legibility improvements commit 61272b477e09045da50af4a4c45dbf3fcdc4bf77 Author: Marshall Roch Date: Tue Sep 5 22:14:46 2017 -0700 Update to flow 0.54 (#1026) * Update to flow 0.54 * Semis commit 87934f6efec6625b64d0400e8543b904099f452e Merge: 96a869af 58ac464f Author: Greg Hurrell Date: Tue Sep 5 15:42:25 2017 -0700 Merge pull request #1025 from APIs-guru/simplifyArgs Simplify args processing in "graphql" and "execute" functions commit 58ac464f8528ed4da2fe278d4f32dba311b4e2b5 Author: Ivan Goncharov Date: Tue Sep 5 22:19:14 2017 +0300 Simplify args processing in "graphql" and "execute" functions commit 97b009d4c8a9970ba249c508e7b00082bb10696d Author: Ivan Goncharov Date: Tue Aug 22 21:08:06 2017 +0300 Simplify operationTypes validation commit 96a869af951e7b7216e7b79ccfcb170b779ad4e9 Author: Greg Hurrell Date: Tue Aug 29 06:49:04 2017 -0700 0.11.2 commit 275471ec78dc78d389a87d448f5380b858bbc5e2 Merge: 4a378b95 3530f125 Author: Robert Zhu Date: Mon Aug 28 14:11:18 2017 -0400 Merge pull request #1012 from graphql/async-map-value-flow Fix flow error in mapAsyncIterator commit 3530f12537adf4baa579eff5a39205ec9f5962dd Author: Robert Zhu Date: Mon Aug 28 13:35:38 2017 -0400 Assign rejectCallback to temporary const variable commit 0f3698cf96e342177a619f532fa9e1523565201a Author: Robert Zhu Date: Mon Aug 28 12:22:40 2017 -0400 Add comment to explain redundant null check for rejectCallback commit 78219d6f791075c479563d2e24cdd3174248f5eb Author: Robert Zhu Date: Sun Aug 27 18:10:48 2017 -0400 Fix flow error in mapAsyncIterator commit 57ba58029748f1e0cee5ee2ebbae80c3031a8a38 Author: Ivan Goncharov Date: Wed Aug 23 01:08:38 2017 +0300 Remove duplicated code from buildASTSchema and extendSchema commit 4a378b952a29e37b55241ee645c055c298b1c55f Merge: 31ebb1fc 84e0ad88 Author: Robert Zhu Date: Sat Aug 26 11:40:52 2017 -0400 Merge pull request #1010 from wincent/glh/lint Add linter error preventing use of `async` outside the test suite commit 84e0ad88d0885ff442fa0991bc0586684cda4af4 Author: Greg Hurrell Date: Fri Aug 25 22:34:40 2017 -0700 Provide more context in lint error message commit 31ebb1fccc3ebd7966f4f6ca5f7b24679636d98f Merge: 8ef2d04d 7b3152f4 Author: Greg Hurrell Date: Fri Aug 25 21:30:03 2017 -0700 Merge pull request #1009 from wincent/glh/header Add a missing license header commit 31cb269e763fb8268b7238f6833a828d60df4deb Author: Greg Hurrell Date: Fri Aug 25 21:24:33 2017 -0700 Add linter error preventing use of `async` outside the test suite We want to keep the runtime dependency footprint small, so that means avoiding use of `async` at runtime (which creates a dependency on the Regenerator runtime). There is no built-in eslint rule for this, so we make a custom one. Test plan: Add an `async` function to a file, run `yarn run lint` and see: graphql-js/src/subscription/subscribe.js 288:1 error async functions are not allowed outside of the test suite no-async ✖ 1 problem (1 error, 0 warnings) Note that no errors are issued for the `async` functions in the test suite. Closes: https://github.com/graphql/graphql-js/issues/1008 commit 7b3152f4019f91137bba535a0d483deec6734367 Author: Greg Hurrell Date: Fri Aug 25 21:23:09 2017 -0700 Add a missing license header commit 8ef2d04d4d51517d715c02df4138329e4a06cfc2 Author: Greg Hurrell Date: Fri Aug 25 17:54:12 2017 -0700 0.11.1 commit 8b5476a30350352cc89f2c4ff22ca5f1157fcf60 Merge: d7a80b6e 609af804 Author: Greg Hurrell Date: Fri Aug 25 17:53:00 2017 -0700 Merge pull request #1007 from wincent/glh/graphql-update-fix Rewrite createSourceEventStream to avoid use of `async` commit 609af80473cac5d79a74ba17356378c298d439f3 Author: Greg Hurrell Date: Fri Aug 25 17:20:51 2017 -0700 Rewrite createSourceEventStream to avoid use of `async` We should avoid a runtime dependency on `async` support because we want the graphql package to work in as many contexts as possible with minimal configuration. As of 0779c36f9ba621d2d4a045, even a simple invocation usage of the package like the one in the tutorial (http://graphql.org/graphql-js/) will cause an error in the absence of the regenerator runtime: ReferenceError: regeneratorRuntime is not defined Rather than depending on the runtime, let's just rewrite the function to not use `async`. In order to do this, we have to drop the use of the `await` keyword inside the function and make it explicitly return a promise. Flow and tests pass. There is a fair bit of whitespace-only change in this, so you may want to view the diff without it (with `git diff -b` or even `git diff -w` for example). Closes: https://github.com/graphql/graphql-js/issues/1006 commit d7a80b6e643b9988572626851e90d2f1b4e8b782 Author: Greg Hurrell Date: Fri Aug 25 13:14:31 2017 -0700 0.11.0 commit d3fd6c3fd3369b354e79499c07f94e1d62fb5f79 Merge: 0eb070fe d9178f4c Author: Greg Hurrell Date: Wed Aug 16 10:53:12 2017 -0700 Merge pull request #994 from APIs-guru/cleanupBuildAstSchema remove dead code from buildASTSchema commit d9178f4c1c420e414f8bd63f724133424118acfc Author: Ivan Goncharov Date: Wed Aug 16 11:40:10 2017 +0300 remove dead code from buildASTSchema commit 0eb070fed365095666847d5402e759ebe5854e64 Author: Dirk-Jan Rutten Date: Mon Aug 14 04:36:43 2017 +0200 Expanded findBreakingChanges test with missing case. (#993) commit 0779c36f9ba621d2d4a04539fec257cbbc5fe9e4 Author: Robert Zhu Date: Sun Aug 13 21:58:02 2017 -0400 Update subscribe function to return a Promise of AsyncIterator or ExecutionResult (#918) * Report or Reject when encountering Errors. Currently the `subscribe()` function throws Errors, however this is awkward when used along with async functions which would expect a rejected iteration to represent failure. Also GraphQLErrors should be reported back to the client since they represent client-provided errors. Updates test cases to represent this new behavior. Includes a new utility `asyncIteratorReject`, and extends the behavior of `mapAsyncIterator` to help implement this. * Subscriptions: Respond with error when failing to create source If a subscribe resolve function throws or returns an error, that typically indicates an issue to be returned to the requesting client. This coerces errors into located GraphQLErrors so they are correctly reported. * Subscriptions: Test source errors and execution errors. After discussion in #868, decided that errors emitted from a source event stream should be considered "internal" errors and pass through. However errors encountered during GraphQL execution on a source event should be considered "field" or "query" errors and be represented within that Response. * Update subscribe signature to return a promise of AsyncIterator/Error/ExecutionResult * Throw errors instead of returning them from Subscribe() * Lint, refactor error mapper and add comments * Report or Reject when encountering Errors. Currently the `subscribe()` function throws Errors, however this is awkward when used along with async functions which would expect a rejected iteration to represent failure. Also GraphQLErrors should be reported back to the client since they represent client-provided errors. Updates test cases to represent this new behavior. Includes a new utility `asyncIteratorReject`, and extends the behavior of `mapAsyncIterator` to help implement this. * Subscriptions: Respond with error when failing to create source If a subscribe resolve function throws or returns an error, that typically indicates an issue to be returned to the requesting client. This coerces errors into located GraphQLErrors so they are correctly reported. * Subscriptions: Test source errors and execution errors. After discussion in #868, decided that errors emitted from a source event stream should be considered "internal" errors and pass through. However errors encountered during GraphQL execution on a source event should be considered "field" or "query" errors and be represented within that Response. * Update subscribe signature to return a promise of AsyncIterator/Error/ExecutionResult * Throw errors instead of returning them from Subscribe() * Lint, refactor error mapper and add comments * Update test case assertions for stream errors to be more precise * Add test case for wrong variable types * Fix lint error (extra spaces) * Fix multi-line doc block format * Minor edits * Trim trailing whitespace commit 24a5038585200da4ad7d92cf12ec4c100621f305 Author: Robert Zhu Date: Sun Aug 13 21:32:31 2017 -0400 Throw TypeError when coercing an array into a GraphQLString (#925) * Throw TypeError when coercing an array into a GraphQLString * Add coerceString to GraphQLString serialize flow commit 85bfd13b5c63b4896d7643f8cd37a4f918fc5261 Author: Ivan Goncharov Date: Mon Aug 14 04:25:37 2017 +0300 Export "ExecutionArgs" type (#988) commit 26023b30ff8dd083bdf60f2415909f18ebdda502 Author: Dirk-Jan Rutten Date: Mon Aug 14 03:23:32 2017 +0200 Adding a type to a union is now a dangerous change. (#991) commit aeb8949c7ef273c25c8dd8ef7166633393ffba0b Author: Dirk-Jan Rutten Date: Sat Aug 12 14:41:47 2017 +0200 Adding an interface to a type is now a dangerous change. commit 6953f9714b785bbcd89f0103fd73401c06d5f6fe Author: Greg Hurrell Date: Mon Aug 7 10:54:24 2017 -0700 Freshen yarn.lock commit b860b6f40765bd9747048ab63e15f30038f2b439 Merge: b6a46a02 c1561800 Author: Greg Hurrell Date: Mon Aug 7 10:53:48 2017 -0700 Merge pull request #987 from graphql/greenkeeper/eslint-4.4.1 Update eslint to the latest version 🚀 commit c15618001e6bf3d4f81810d6c9c78a237222721a Author: greenkeeper[bot] Date: Mon Aug 7 16:24:33 2017 +0000 chore(package): update eslint to version 4.4.1 commit b6a46a025c5fa6e90a06e753fbe145f4c15bea9c Merge: 0e7d4607 bb987680 Author: Greg Hurrell Date: Mon Aug 7 08:30:29 2017 -0700 Merge pull request #984 from excitement-engineer/enum-dangerous-change Adding a value to an enum is now a dangerous change. commit 0e7d4607754927dd9b07543e66960b2b3ad37f53 Author: Greg Hurrell Date: Mon Aug 7 08:24:11 2017 -0700 Freshen yarn.lock commit 7984f129120696b0be5732177343667f5ad3f330 Merge: d49c3553 ee57e281 Author: Greg Hurrell Date: Mon Aug 7 08:23:12 2017 -0700 Merge pull request #985 from graphql/greenkeeper/eslint-4.4.0 Update eslint to the latest version 🚀 commit d49c35534922623277f4819622927a49db03c8ff Merge: d518e4c9 cbaf79c5 Author: Greg Hurrell Date: Mon Aug 7 08:22:57 2017 -0700 Merge pull request #983 from graphql/greenkeeper/chai-4.1.1 Update chai to the latest version 🚀 commit ee57e281da3fe7a1bd0e1369ab1858c5cac0c578 Author: greenkeeper[bot] Date: Sat Aug 5 17:25:43 2017 +0000 chore(package): update eslint to version 4.4.0 commit bb98768023a7821324f2a08941f1364e221862ae Author: Dirk-Jan Rutten Date: Sat Aug 5 18:33:37 2017 +0200 Adding a value to an enum is now a dangerous change. commit cbaf79c5005930cb94a506878945b73b984d5986 Author: greenkeeper[bot] Date: Sat Aug 5 07:49:17 2017 +0000 chore(package): update chai to version 4.1.1 commit d518e4c9df5e189cf1346fdea3c166be384e3e6d Author: Greg Hurrell Date: Thu Aug 3 11:02:45 2017 -0700 Freshen yarn.lock commit 2c0639cc2a9d72da642602907a8ed0f1f70ce57a Merge: 738dcdb6 e067f527 Author: Greg Hurrell Date: Thu Aug 3 11:01:43 2017 -0700 Merge pull request #982 from graphql/greenkeeper/flow-bin-0.52.0 Update flow-bin to the latest version 🚀 commit e067f527d30d8bc87c37aba64f46e66992d1d950 Author: greenkeeper[bot] Date: Wed Aug 2 20:20:01 2017 +0000 chore(package): update flow-bin to version 0.52.0 commit 738dcdb6de9b15bee7f985c28997f2da355d4926 Author: Greg Hurrell Date: Tue Aug 1 10:06:15 2017 -0700 Freshen yarn.lock commit 80032a471708c1c8327a914347bbe0127e2b0add Merge: 34e61d83 07a293c6 Author: Greg Hurrell Date: Tue Aug 1 10:05:46 2017 -0700 Merge pull request #976 from graphql/greenkeeper/mocha-3.5.0 Update mocha to the latest version 🚀 commit 07a293c65dba1727aae70d903924e547cce6b33d Author: greenkeeper[bot] Date: Mon Jul 31 20:49:37 2017 +0000 chore(package): update mocha to version 3.5.0 commit 34e61d83e378e569ed5d28380953163f8e1f6348 Author: Greg Hurrell Date: Thu Jul 27 16:54:13 2017 -0700 Freshen yarn.lock commit 381e0c3bb8e4ba145626a4471768f1d9cc30c925 Merge: 6e1bf84b 9a631269 Author: Greg Hurrell Date: Thu Jul 27 16:53:35 2017 -0700 Merge pull request #972 from graphql/greenkeeper/flow-bin-0.51.1 Update flow-bin to the latest version 🚀 commit 9a63126925dd522960d1a7e0d4c3c2fa258fdf7e Author: greenkeeper[bot] Date: Thu Jul 27 21:54:10 2017 +0000 chore(package): update flow-bin to version 0.51.1 commit 6e1bf84b12ceec68617af03ddea5d580b9082a78 Author: Greg Hurrell Date: Tue Jul 25 14:12:17 2017 -0700 Freshen yarn.lock commit 29f9e1a922cde1c7119154ea62df24e971e111e6 Merge: 4992cfdf 01033b1e Author: Greg Hurrell Date: Tue Jul 25 14:11:45 2017 -0700 Merge pull request #969 from graphql/greenkeeper/eslint-plugin-babel-4.1.2 Update eslint-plugin-babel to the latest version 🚀 commit 01033b1e40a5d073e9a9b32fce2f71318ff3e20b Author: greenkeeper[bot] Date: Tue Jul 25 20:55:50 2017 +0000 chore(package): update eslint-plugin-babel to version 4.1.2 commit 4992cfdfe1ffb38891558f734609245f59b76419 Merge: 676ba7d0 ab0d6554 Author: Greg Hurrell Date: Mon Jul 24 10:22:28 2017 -0700 Merge pull request #965 from APIs-guru/findDangerousChanges Add missing export for "findBreakingChanges" function commit ab0d6554799d04564bba324bb6b7c566b44e89ac Author: Ivan Goncharov Date: Mon Jul 24 18:40:53 2017 +0200 Add missing export for "findBreakingChanges" function commit 676ba7d0b15306839ddc97d7222abc0492336987 Author: Greg Hurrell Date: Mon Jul 24 09:19:56 2017 -0700 Freshen yarn.lock commit c0c642225dc308efb1421586c78edb5519d0ad76 Merge: 18fcb2f1 28b26963 Author: Greg Hurrell Date: Mon Jul 24 09:19:21 2017 -0700 Merge pull request #963 from graphql/greenkeeper/flow-bin-0.51.0 Update flow-bin to the latest version 🚀 commit 28b26963985bc72b9149cb78c9d6217e232d5f8f Author: greenkeeper[bot] Date: Sat Jul 22 00:00:58 2017 +0000 chore(package): update flow-bin to version 0.51.0 commit 18fcb2f1b5f04c04303b57eff734489077633610 Author: Greg Hurrell Date: Fri Jul 21 14:20:23 2017 -0700 Freshen yarn.lock commit 90fe57b9bd495bf5f8c3bf99380ed1b49517dce7 Merge: 9a8ded8f f6601198 Author: Greg Hurrell Date: Fri Jul 21 14:19:40 2017 -0700 Merge pull request #961 from APIs-guru/directives-descr-extend Fix directive description lost in extendSchema commit f660119829aa280b2d209141610661b5c2938497 Author: Greg Hurrell Date: Fri Jul 21 14:19:03 2017 -0700 Tiny tweak to wording commit 9a8ded8fe29d6f22ee0d5c35745413c9a341e991 Merge: 6938c1ab bf7555fe Author: Greg Hurrell Date: Fri Jul 21 14:15:25 2017 -0700 Merge pull request #962 from graphql/greenkeeper/eslint-4.3.0 Update eslint to the latest version 🚀 commit bf7555fe7cf1e289732b9f34d94c2d0500c6fb56 Author: greenkeeper[bot] Date: Fri Jul 21 16:38:22 2017 +0000 chore(package): update eslint to version 4.3.0 commit 68cccd3fc3f064b9978ca6ee9fb99f657fcf0658 Author: Roman Hotsiy Date: Fri Jul 21 13:52:32 2017 +0200 fix directive description lost in extendSchema commit 6938c1ab65264616805889c6e19fb3b74ce95658 Author: Daniel Woelfel Date: Mon Jul 17 10:09:55 2017 -0700 0.10.5 commit 713e0e8dc5f4f4782578312b0184ae2f29738b8a Merge: b42a8eab 65924428 Author: Daniel Woelfel Date: Mon Jul 17 10:00:28 2017 -0700 Merge pull request #951 from dwwoelfel/errors-fix Fix incorrect column number in errors commit 65924428ef8c70b4c7ff9801c10179dadc9f1f39 Author: Daniel Woelfel Date: Mon Jul 17 09:47:39 2017 -0700 fix incorrect column number in errors commit b42a8eab5c2cb4c826e891bbc8a63dcabd7625bf Author: Daniel Woelfel Date: Fri Jul 14 15:12:48 2017 -0700 0.10.4 commit e319bdfabe95cd01ca83f95fb3986b456dee5a53 Merge: dc6ab96d 501f2c0f Author: Greg Hurrell Date: Fri Jul 14 13:56:57 2017 -0700 Merge pull request #949 from dwwoelfel/error-context Account for query's offset in file for errors commit 501f2c0fa2cc6c4226bc92c3b9c26cb5f23184a7 Author: Daniel Woelfel Date: Fri Jul 14 13:32:32 2017 -0700 cleanup commit 250e6f0f0d134dc0f23f395fc425ae2cd797030f Author: Daniel Woelfel Date: Fri Jul 14 13:29:15 2017 -0700 Add an invariant to check the locationOffset commit 8da92035bdd6279503d3d2e15149475ab159ad45 Author: Daniel Woelfel Date: Fri Jul 14 13:21:39 2017 -0700 1-indexed columns and account for column in error commit b176d679306fa96f9ac960fc992364bc0f0aeebe Author: Daniel Woelfel Date: Fri Jul 14 10:17:09 2017 -0700 location -> locationOffset commit dc6ab96d46526eed99e9fa78bb1abcd0971490cc Author: Greg Hurrell Date: Fri Jul 14 08:08:50 2017 -0700 Freshen yarn.lock commit c4479f76dc3785e73646509bc09d9fc3851f2ff6 Merge: 62d11211 ebc7cfc6 Author: Greg Hurrell Date: Fri Jul 14 07:57:06 2017 -0700 Merge pull request #948 from graphql/greenkeeper/flow-bin-0.50.0 Update flow-bin to the latest version 🚀 commit 42e9492e1b0b7fd2250e2c4f6589cbe0147dbdf7 Author: Daniel Woelfel Date: Thu Jul 13 20:34:42 2017 -0700 wincent's feedback commit a5307b7cd3de3c2ec49d1cc5e39a30e9879524ed Author: Daniel Woelfel Date: Thu Jul 13 18:36:21 2017 -0700 Account for query's offset in file for errors commit ebc7cfc6605b0b6f36cf4b8e1ccf876ba145d222 Author: greenkeeper[bot] Date: Thu Jul 13 20:22:41 2017 +0000 chore(package): update flow-bin to version 0.50.0 commit 62d1121198a6168ffff3e64fb59bb691129c194e Author: Greg Hurrell Date: Wed Jul 12 14:23:41 2017 -0700 Freshen yarn.lock commit bac02c5dfb00163fce68b47ef506d1013c798843 Merge: 61d1003c b408677f Author: Greg Hurrell Date: Wed Jul 12 14:22:56 2017 -0700 Merge pull request #945 from graphql/greenkeeper/chai-4.1.0 Update chai to the latest version 🚀 commit 61d1003ce1f68f9859078243ca2bfef0df80d302 Merge: 1be3c7d2 b1846a36 Author: Greg Hurrell Date: Wed Jul 12 14:22:39 2017 -0700 Merge pull request #946 from baer/feature/remove-extraneous-transformation Remove extraneous transformation commit b1846a3643ca890457491f6523b05f0609336c63 Author: Eric Baer Date: Wed Jul 12 12:04:08 2017 -0700 Remove extraneous transformation commit 1be3c7d222f92c849c860e487e40af384eed95c9 Author: Greg Hurrell Date: Tue Jul 11 17:52:31 2017 -0700 Freshen yarn.lock commit 5580b2ad1c0d823a06ae1906fae8d8bcc56330e8 Merge: 8ca24075 e6410545 Author: Greg Hurrell Date: Tue Jul 11 17:50:49 2017 -0700 Merge pull request #944 from graphql/greenkeeper/eslint-plugin-flowtype-2.35.0 Update eslint-plugin-flowtype to the latest version 🚀 commit b408677f559dfac798021822cab5bdad05375e2d Author: greenkeeper[bot] Date: Wed Jul 12 00:36:49 2017 +0000 chore(package): update chai to version 4.1.0 commit e6410545c66fc2a45924419062d661b2870caf63 Author: greenkeeper[bot] Date: Tue Jul 11 12:22:59 2017 +0000 chore(package): update eslint-plugin-flowtype to version 2.35.0 commit 8ca2407510a2a4bdf6c7515c27d9489fc53d1067 Author: Greg Hurrell Date: Mon Jul 10 10:49:38 2017 -0700 Freshen yarn.lock commit 25ae8c1d0e7e5f70bc8afae706b9150ab7167f91 Merge: 831598ba 66f7740f Author: Greg Hurrell Date: Mon Jul 10 10:49:12 2017 -0700 Merge pull request #942 from graphql/greenkeeper/eslint-4.2.0 Update eslint to the latest version 🚀 commit 66f7740f4ce687263dc680e56f78697051a42e2d Author: greenkeeper[bot] Date: Sun Jul 9 02:24:50 2017 +0000 chore(package): update eslint to version 4.2.0 commit 831598ba76f015078ecb6c5c1fbaf133302f3f8e Author: Ivan Goncharov Date: Wed Jul 5 21:13:46 2017 +0300 Add support for directives applied on IDL & Schema (#746) * Switch Enum tests to not depend on JSON representation If we add additional fields (e.g. astNode) into values of enum these test will be broken. * Add 'astNode' & 'extensionASTNodes' fields to type definitions * Make 'buildASTSchema' assign 'astNode' to types * Make 'extendSchema' assign 'astNode' & 'extensionASTNodes' commit 68b5d22c99330c01c5dcccc1bc45811160226097 Merge: 11f776bd b1f56c7e Author: Greg Hurrell Date: Mon Jul 3 10:24:14 2017 -0700 Merge pull request #880 from baer/feature/use-babel-preset-env Use babel-preset-env commit 11f776bdfa0a9747c4046e596e8262a6485b3fab Author: Greg Hurrell Date: Fri Jun 30 13:27:59 2017 -0700 Freshen yarn.lock commit f75d7bfb47f9b2b5c6e80cb110532c9ab143c325 Merge: 073e55a2 8da6a164 Author: Greg Hurrell Date: Fri Jun 30 13:27:17 2017 -0700 Merge pull request #934 from graphql/greenkeeper/eslint-plugin-flowtype-2.34.1 Update eslint-plugin-flowtype to the latest version 🚀 commit 8da6a1643b91cc512fcc521244bb6e0a11c0a3a1 Merge: 5f378f83 073e55a2 Author: Greg Hurrell Date: Fri Jun 30 13:16:02 2017 -0700 Merge branch 'master' into greenkeeper/eslint-plugin-flowtype-2.34.1 commit 073e55a23af8077bee095f1bd2b365cb98a46175 Merge: e4a0a108 0b8c8480 Author: Greg Hurrell Date: Fri Jun 30 13:15:32 2017 -0700 Merge pull request #933 from graphql/greenkeeper/flow-bin-0.49.1 Update flow-bin to the latest version 🚀 commit e4a0a108a3838a3ec1ee50b73819bd0a4e10f1ba Merge: 99518f1a 17c8e41c Author: Greg Hurrell Date: Fri Jun 30 13:15:15 2017 -0700 Merge pull request #935 from kassens/inline-invariant Inline invariant transform commit b1f56c7e868846c4a5fe7b4016622f85f12e8455 Author: Eric Baer Date: Fri Jun 30 16:07:44 2017 +0530 Update package.json to remove unneeded deps commit b0e857d3e6f598caa147428580a136c4fd27f9b9 Author: Eric Baer Date: Thu May 25 12:29:25 2017 -0700 Update .babelrc to use babel-preset-env commit 8a35e6e8702bbb49b6fa06252ffbef8e6b7f25ff Author: Eric Baer Date: Fri Jun 30 16:06:47 2017 +0530 Add babel-preset-env dependency commit 17c8e41c9c3a59c699758640923aefd76ea9dd30 Author: Jan Kassens Date: Wed Jun 28 20:14:31 2017 -0700 Inline invariant This makes the format string of `invariant` lazily evaluated similar to what the React transforms do. This makes loading a large schema noticeably faster. Internal benchmark: https://phabricator.intern.facebook.com/P57579506 commit 5f378f83e9a57bc76b4415d9e6b5c8a553cac36f Author: greenkeeper[bot] Date: Wed Jun 28 21:21:28 2017 +0000 chore(package): update eslint-plugin-flowtype to version 2.34.1 commit 0b8c8480e34fd817a5f97ae4e3a06f427d7ac408 Author: greenkeeper[bot] Date: Wed Jun 28 16:49:52 2017 +0000 chore(package): update flow-bin to version 0.49.1 commit 99518f1ab176f779b517cd67a93cb16b40ed746f Merge: 135715de 2cbf52a5 Author: Greg Hurrell Date: Mon Jun 26 08:27:34 2017 -0700 Merge pull request #932 from graphql/greenkeeper/eslint-4.1.1 chore(package): update eslint to version 4.1.1 commit 2cbf52a5f319650f38e1371a1db9320a908e28b1 Author: Greg Hurrell Date: Mon Jun 26 08:03:22 2017 -0700 Fix space-before-function-paren lint This is a new lint error that we're seeing since upgrading eslint. commit f80d38cb2e6e45d0a04918e62dcbd22550027061 Author: Greg Hurrell Date: Mon Jun 26 08:02:25 2017 -0700 Don't lint for indent The new version of eslint complains about our indentation in over 600 places; let's just turn that off rather than tweaking the settings, as we'll imminently switch to Prettier for formatting anyway. commit ebe42d6117839fec66cead2ff1e6d6d156a3f225 Author: Greg Hurrell Date: Mon Jun 26 08:00:25 2017 -0700 Don't refer to "ecmaFeatures" in eslintrc Required in order to complete the upgrade. commit 8dc20ecc2f506bc0d4c04f8d87fbab21baa914ba Author: Greg Hurrell Date: Mon Jun 26 07:52:55 2017 -0700 Freshen yarn.lock commit ac7ade02402b717c540832f424588eff8f65938f Author: greenkeeper[bot] Date: Mon Jun 26 01:18:09 2017 +0000 chore(package): update eslint to version 4.1.1 Closes #929 commit 135715dee3fdc817320c65938d009bc7a5a8aaff Merge: 6998c377 8869e517 Author: Greg Hurrell Date: Mon Jun 26 07:48:05 2017 -0700 Merge pull request #931 from gjtorikian/patch-1 Capitalize the H commit 6998c37774d36d1e50c0d3a32d8479a3ad2c37c6 Merge: f2d2d24f 06dd14e1 Author: Greg Hurrell Date: Mon Jun 26 07:47:41 2017 -0700 Merge pull request #930 from graphql/greenkeeper/sane-2.0.0 Update sane to the latest version 🚀 commit 8869e517f70ec4d9212014111ed363b3a94fb76e Author: Garen Torikian Date: Sun Jun 25 17:45:13 2017 -0400 Capitalize the H commit 06dd14e17bd8999b4906bf945a63379e35dabe07 Author: greenkeeper[bot] Date: Sun Jun 25 00:47:37 2017 +0000 chore(package): update sane to version 2.0.0 commit f2d2d24f62304d318c59e97fc2cfd335f5536d51 Author: Lee Byron Date: Tue Jun 20 14:44:39 2017 -0700 Node v7 has been supplanted by Node v8 (#921) Node v7 has been supplanted by Node 8 commit 70b8827388f10a8cd866b82f323b9be0f402fecb Author: Lee Byron Date: Tue Jun 20 13:54:57 2017 -0700 0.10.3 commit ff4338daadb7f86e0d0700faff086dd46cbfb7b2 Author: Lee Byron Date: Tue Jun 20 13:51:27 2017 -0700 Fix rearranged schema printing (#920) * Revert "Sort fields before printing to get a more stable diff" This reverts commit 3d8facaed9b82a1316a5903c78fc2aa5438e0ec1. * Revert "update tests" This reverts commit e0fb70392cb5313daa3db6ee390203d537cb77bb. commit 6a85e88655e196773bf35c1b16bc22315ab127ff Author: Lee Byron Date: Tue Jun 20 13:30:44 2017 -0700 0.10.2 commit a1f63083fb1abb7cb3d57754ae41a54c8ff4b382 Author: Lee Byron Date: Mon Jun 19 11:47:07 2017 -0700 Closes #904 Squashed commit of the following: commit c4bc312d59215ca09f0b612b559bd240e87361e6 Author: Lee Byron Date: Mon Jun 19 11:45:48 2017 -0700 Follow-ups, rename method to match others, fix broken test. commit 84a58a1e3e5df3d1cb9c402f4b12aa24d56ee5a7 Merge: 93c0b25 ab5f5ca Author: Lee Byron Date: Mon Jun 19 11:35:37 2017 -0700 Merge branch 'getDirectiveArgsMap' of https://github.com/APIs-guru/graphql-js into APIs-guru-getDirectiveArgsMap commit ab5f5caec7a99fdd79fe99d34fbae0a62719e8a1 Author: Ivan Goncharov Date: Mon Jun 12 13:31:10 2017 +0300 Add 'getDirectiveArgs' function commit 93c0b25337206e6abfeabc46737c85d5c55a9830 Author: Roman Hotsiy Date: Mon Jun 19 21:27:34 2017 +0300 Fix identation (#916) * Add dedent jsutil * Fix identation in tests interpolation strings commit fa44c335a186f52d318e661e6c9d9f16cd00575a Author: Ivan Goncharov Date: Fri Jun 16 03:11:58 2017 +0300 Unify how 'kinds' are imported (#902) commit 1aa08c1db7acb81dd3b9079eca7327501d806f2d Author: Lee Byron Date: Thu Jun 15 17:05:32 2017 -0700 Freshen yarn.lock commit f787d9fe4599f67f7a99b228e61af9e5b292f976 Author: Michael Gillen Date: Thu Jun 15 18:03:29 2017 -0600 Added printIntrospectionSchema to exports (#905) Docs at http://graphql.org/graphql-js/utilities/ say "You can import either from the graphql/utilities module, or from the root graphql module" and lists printIntrospectionSchema, yet it is not exported via the root module. commit a4c2c5ac19da52414c2c5d3a763b066b1b3970ba Merge: 680685dd 627d2dee Author: Robert Zhu Date: Thu Jun 15 10:50:43 2017 -0400 Merge pull request #909 from graphql/greenkeeper/flow-bin-0.48.0 Update flow-bin to the latest version 🚀 commit 680685dd14bd52c6475305e150e5f295ead2aa7e Author: Lee Byron Date: Wed Jun 14 15:13:52 2017 -0700 Second pass after #907 (#911) This adds a bit of cleanup after #907 for post-commit review: * Removes unnecessary `peek()` * Adds leading pipe support to directive locations * Removes some redundant tests * Orders tests so similar tests remain together commit 627d2dee745446368e404cc83271158444e061a5 Author: greenkeeper[bot] Date: Wed Jun 14 12:14:45 2017 +0000 chore(package): update flow-bin to version 0.48.0 commit 3aa2a731c7c74b2e7b30597a0fe585d5500f0d4b Merge: c4f26569 7fc9fc0b Author: Robert Zhu Date: Tue Jun 13 19:15:37 2017 -0400 Merge pull request #907 from alexandrebodin/allow-union-type-begining-pipe Add support for leading vertical bar in union types commit 7fc9fc0ba1d8f253a6c5876d71e61ad29aed91d6 Author: Alexandre BODIN Date: Wed Jun 14 00:37:41 2017 +0200 Add doucle bar testing commit 4cb3ff008906c0a08833c0dc7e54cfbb65a4b459 Author: Alexandre BODIN Date: Wed Jun 14 00:30:32 2017 +0200 Add use cases with ending vertical bar or empty list of types throwing commit e0d1fc3c92739c42363fc91a0d833e07ad352e17 Author: Alexandre BODIN Date: Tue Jun 13 23:48:30 2017 +0200 Add support for beginning pipe un union types commit c4f26569acdb9a7dfbceb48b9786b46d65a4b11b Author: sam-swarr Date: Wed Jun 7 18:31:38 2017 -0400 Add more functionality to findBreakingChanges (#874) commit b95ae7db4ebdbf3b6d68024561a5c5cc052535d3 Merge: 44931311 9767186e Author: Greg Hurrell Date: Mon Jun 5 13:57:42 2017 -0700 Merge pull request #896 from graphql/greenkeeper/chai-4.0.2 Update chai to the latest version 🚀 commit 9767186e578175794b5b47a003afce62f44c9455 Author: Greg Hurrell Date: Mon Jun 5 13:51:15 2017 -0700 Fix issues with latest chai upgrade commit eac32891aaa23f4846b9b4ceece27fe20224dd2e Author: Greg Hurrell Date: Mon Jun 5 13:44:05 2017 -0700 Freshen yarn.lock commit f84c002bd5f626c352941d3c95c871d952cc4201 Author: greenkeeper[bot] Date: Mon Jun 5 19:48:39 2017 +0000 chore(package): update chai to version 4.0.2 commit 44931311bcfe92865d7ff92d805628a74de7e14b Author: Greg Hurrell Date: Mon Jun 5 13:43:15 2017 -0700 Freshen yarn.lock commit 055c5d2b2f0b1044c60625a59027543c152f33e9 Merge: 0de76ca1 95414fc6 Author: Greg Hurrell Date: Mon Jun 5 10:16:12 2017 -0700 Merge pull request #891 from shnellpavel/master add test cases to check support of negative floats and ints commit 0de76ca11ccb70168507120d2263bda4ff211c30 Merge: f5dd099b c008858a Author: Greg Hurrell Date: Tue May 30 11:29:33 2017 -0700 Merge pull request #890 from graphql/greenkeeper/eslint-plugin-flowtype-2.34.0 Update eslint-plugin-flowtype to the latest version 🚀 commit f5dd099be4ac3de6ac2a1830c46e5202d6e63356 Merge: 94a591f5 870967a3 Author: Greg Hurrell Date: Tue May 30 11:27:54 2017 -0700 Merge pull request #889 from tberman/master Sort fields before printing to get a more stable diff commit 95414fc644761ad482211da0172831311d0712df Author: Shnell Pavel Date: Wed May 31 00:48:39 2017 +0700 add test cases to check support of negative floats and ints commit c008858a32a6f7b56300d812acc789a82c60b3f6 Author: greenkeeper[bot] Date: Tue May 30 15:22:47 2017 +0000 chore(package): update eslint-plugin-flowtype to version 2.34.0 commit 870967a3fb828a3463711fd2278044cba90901a2 Author: Todd Berman Date: Sat May 27 17:07:29 2017 -0700 fix broken test on master commit e0fb70392cb5313daa3db6ee390203d537cb77bb Author: Todd Berman Date: Sat May 27 14:11:10 2017 -0700 update tests commit 3d8facaed9b82a1316a5903c78fc2aa5438e0ec1 Author: Todd Berman Date: Sat May 27 13:53:02 2017 -0700 Sort fields before printing to get a more stable diff commit 94a591f5d6b9e4313116457d3637f7cade250ed3 Author: Lee Byron Date: Fri May 26 17:11:37 2017 -0700 Improve error message for bad return from subscribe resolver After asserting AsyncIterable is required, show what was received instead. commit 86009a68cdd09a7f3078e53a6c99397a7561d5f5 Author: Lee Byron Date: Fri May 26 15:52:37 2017 -0700 Fix trailing commas commit 86d54967d07bc7d0bcec40b0748cd65722114de0 Author: Eric Baer Date: Fri May 26 15:41:03 2017 -0700 Add basic README for subscriptions (#884) * Add basic README for subscriptions * Add subscription to main README and make docs linkable * Update link paths * Correct small typo commit 73839cd9ca08523adb2dd3e43bd829f956ed66e1 Author: Lee Byron Date: Fri May 26 15:00:57 2017 -0700 0.10.1 commit 60ee0b7c533f5e7effbc82dd3c1cebc0aa504a9a Author: Hyo Jeong Date: Fri May 26 13:50:14 2017 -0700 fix flow errors from turning on const_params experimental flag (#885) commit da8fe62bb3b6bc22a0ec936c5fc75da6885dc9d3 Author: Lee Byron Date: Thu May 25 22:14:42 2017 -0700 Follow up to #883 commit 508aa3a2b6a1d38edc1044763d2901feb12b2ea0 Author: Lee Byron Date: Thu May 25 22:12:02 2017 -0700 Refactor executeOperation (#883) This ensures failures related to buildExecutionContext() yield a GraphQL Result with errors rather than a thrown error from execute(), and handles top level error catching and nulling within executeOperation() instead of execute() for better alignment to spec text. This helps align to the idea that internal errors throw and GraphQL user errors are returned within the GraphQL Result. commit 1c4477c50d0ce4bded3654015060ca00335b9f57 Author: Lee Byron Date: Thu May 25 19:26:20 2017 -0700 Spec compliance: Validation error on multi-field subscription (#882) As per the spec, a subscription should simply use the first field defined, and not make any other assertions during the Subscribe operation. Instead, a validation rule should detect this and report it. commit 0fe29729e6e5c41dafb6795e3fc6c9ba8b962ad2 Author: Lee Byron Date: Thu May 25 18:38:05 2017 -0700 Refresh yarn.lock commit 0cc5a385e634e876f6d5a681f7bf80aeb0359fcc Author: greenkeeper[bot] Date: Thu May 25 18:37:35 2017 -0700 chore(package): update flow-bin to version 0.47.0 (#881) commit 064a85cac08ca3440ffb586419d4b923e80f57e0 Author: Lee Byron Date: Thu May 25 18:32:53 2017 -0700 Simplify .gitignore This removes the cruft that's grown over time in the .gitignore file with a message about how to create global .gitignore files. As discussed in #879 commit 797e7e3a175a56f85cf2ca07d2c26bb4a154f5e6 Author: Greg Hurrell Date: Thu May 25 14:22:40 2017 -0700 0.10.0 commit 845a45bd85603258916f60b828e50defc46178ca Merge: 87b24ee1 fe5f5445 Author: Greg Hurrell Date: Thu May 25 14:17:21 2017 -0700 Merge pull request #878 from gabelevi/flow Avoid new Flow errors with v0.47.0 commit fe5f5445c14076aff98035a8414ebb49a5e25fa6 Author: Gabe Levi Date: Thu May 25 09:20:33 2017 -0700 Flow v0.47.0 finds 3 errors in master. This is important to fix, because the graphql npm module ships with types, so anyone who uses the graphql npm module will get errors when upgrading to Flow v0.47.0. The new errors [look like this](https://gist.github.com/85d7f03510760dd223e968d2e92e7712). When investigating, I found that `typeFromAST()` was doing something a little odd. I believe it was trying to declare itself as an overloaded function, but instead it was declaring an overloaded function and then shadowing it with the exported function. When it's properly fixed, it exposes 26 errors, which is a little much for me to fix right now. So instead, I'm sabotaging its type completely. commit 87b24ee17a59b213318b9112b92c0c3a64fece32 Author: Greg Hurrell Date: Wed May 24 13:33:07 2017 -0700 Freshen yarn.lock commit 704a97dc482c79f55637d776a30c7f8b7a8c7374 Merge: 1ff49325 0f186de0 Author: Greg Hurrell Date: Wed May 24 13:32:19 2017 -0700 Merge pull request #877 from graphql/greenkeeper/mocha-3.4.2 Update mocha to the latest version 🚀 commit 0f186de0e5fb424a813c417c05e0f4b70388df55 Author: greenkeeper[bot] Date: Wed May 24 16:29:28 2017 +0000 chore(package): update mocha to version 3.4.2 commit 1ff493250d412cfa5e4bfb6e8c7f50993e0b42ef Author: Greg Hurrell Date: Mon May 22 18:14:24 2017 -0700 Freshen yarn.lock commit e989de89f0e88a5f1a40802e3124b8c52fe210c3 Merge: f6f26fd9 9811d06d Author: Greg Hurrell Date: Mon May 22 18:12:23 2017 -0700 Merge pull request #875 from graphql/greenkeeper/sane-1.7.0 Update sane to the latest version 🚀 commit 9811d06dc1be711285a92fda64564903f0532daf Author: greenkeeper[bot] Date: Mon May 22 22:06:46 2017 +0000 chore(package): update sane to version 1.7.0 commit f6f26fd96fbc4359dbb7c601407edd768176c46f Author: Lee Byron Date: Sun May 21 02:25:55 2017 +0200 Handle abrupt closing in mapAsyncIterator() (#870) This adds proper behavior when the mapping function throws an error (As discussed in #868). commit 50504b90b94a1bfbd2982ff9390b8813f8cbdfc2 Author: Lee Byron Date: Fri May 19 02:14:50 2017 +0200 remove unnecessary null arguments in test commit 562ceadff6953fc76e4227078ca5bb132d830bba Author: Lee Byron Date: Fri May 19 01:02:45 2017 +0200 Allow providing an object of arguments to graphql(). (#867) As well as execute() and subscribe() Closes #356 commit 1b419594df3927753b818e211815ef77f2313ddf Author: Lee Byron Date: Thu May 18 18:57:20 2017 +0200 Allow graphql() to accept a Source instance. (#866) This fixes a use case when using named graphql files as a source of truth when calling the graphql() function, using those names in reporting. Potentially unit-test breaking: may change the error message content from using parse() directly. commit bf352a846a2144421bdd5b33b6e862716cded4ed Author: Lee Byron Date: Thu May 18 18:55:04 2017 +0200 json is hard commit 5510c759ebac2ac9b3c8d0b25d573da7162f0a19 Author: Lee Byron Date: Thu May 18 18:25:04 2017 +0200 Allow providing custom default field resolver. (#865) This adds an argument to `execute()`, `createSourceEventStream()` and `subscribe()` which allows for providing a custom field resolver. For subscriptions, this allows for externalizing the resolving of event streams to a separate function (mentioned in #846) or to provide a custom function for externalizing the resolving of values (mentioned in #733) cc @stubailo @helfer commit e56f9d50c26f5ceaca29477e7b87b2757e40098b Author: Lee Byron Date: Thu May 18 17:29:29 2017 +0200 Fix: OverlappingFieldsCanBeMerged on js keyword named fields (#864) Replaces all places where `{}` is used as an empty string map with `Object.create(null)`. commit d4222f9d64d3b82d95eb657d7904b4b1cc5841ca Author: Tim Ryan Date: Thu May 18 11:09:45 2017 -0400 Adds message to stack trace of GraphQLError. (#718) * Adds message to stack trace of GraphQLError. * Fix typo in comment * Trailing spaces commit 57b073a0fffa04bea2a31f08ac02bcc52db51519 Author: Lee Byron Date: Thu May 18 16:40:41 2017 +0200 Add void returns to constructors (#863) Fixes #857 This fixes an issue where flow implicitly types new Class as `any` if the constructor is not typed to return `void` (https://github.com/facebook/flow/issues/2748). commit c493b061d30cbfc6539a2986f8ca6012c27100c3 Author: Lee Byron Date: Thu May 18 16:37:27 2017 +0200 Skip cleanup during master builds commit 87c087f4ad102611f8577e592afb37ab7b2b403a Author: Lee Byron Date: Thu May 18 16:09:09 2017 +0200 Fix deploy script on master builds (#862) commit 4b78d0d0be6d737090613f28a5736cda2b1d6301 Author: Lee Byron Date: Thu May 18 15:52:08 2017 +0200 Adds `isValidValue` and `isValidLiteral` to Scalar and Enum types. (#861) Used for more semantically correct validity checking after #848 commit ff845f7856defd9f9873a10e8b6a12387f073f18 Author: Brian Beck Date: Thu May 18 06:04:31 2017 -0700 Fix input coercion to allow null-valued Enums as arguments (#848) * Fix input coercion to allow null-valued Enums as arguments * Add tests for ArgumentsOfCorrectType with null and undefined Enum values commit 387b41a96c04012cdf92c724309989001c5984b7 Author: Lee Byron Date: Thu May 18 14:59:00 2017 +0200 Simplify subscriptions. (#860) There was a secondary function in subscribe.js which doesn't correspond to a spec function or provide much value. It was an artifact of an earlier implementation. Collapsing it into the defined createSourceEventStream makes the alignment to spec more clear. It also moves this function below `subscribe` in the file, making its purpose more clear. commit d657e99ef56c065b7ddf6d60a9131c9efa8aa054 Author: Lee Byron Date: Thu May 18 14:40:23 2017 +0200 Spec compliance: coercion of Int values (#837) This fixes an issue with coercing Int values when provided a floating point value which disagrees with the spec definition. Updates test cases which were along the same incorrect line. Note: this is technically a breaking change Fixes #827 commit 312017cb61beb4b018d0de1cf75f03ba2e9e7530 Author: Uri Goldshtein Date: Thu May 18 15:39:39 2017 +0300 feat(subscriptions): added code comments (#858) * feat(subscriptions): added code comments * Fix up comments commit d00fbe9a8cbdaa8da1b71f9722bc68f8da972863 Author: Lee Byron Date: Thu May 18 14:29:41 2017 +0200 Do not export internal method visitUsingRules Instead, use `validate` for all similar use cases, ensuring proper invariants run first. commit a13abf7340d650ddda6d13de483f72668b3b0dae Merge: 65ab0a8e 5f25f53b Author: Lee Byron Date: Thu May 18 00:13:39 2017 +0200 Merge pull request #846 from apollographql/subscriptions Subscriptions support commit 65ab0a8e4c36d3297077a9d9873262ce8b262c30 Merge: 20d05a67 43714db4 Author: Lee Byron Date: Wed May 17 23:41:07 2017 +0200 Merge pull request #856 from graphql/travis-stages Use new Travis CI stages instead of travis-after-all commit 43714db4444768a192d6fad1f717d6b865ecfbaf Author: Lee Byron Date: Wed May 17 23:02:07 2017 +0200 Use new Travis CI stages instead of travis-after-all commit 20d05a67de1ab2a26ff90dfc841ada6bbd166161 Author: Lee Byron Date: Wed May 17 22:53:26 2017 +0200 New travis deploy key commit 5f25f53bfedee361e66ee2af1f789ba6c0f6f776 Author: Urigo Date: Wed May 17 22:47:24 2017 +0300 feat(subscriptions): added test for multiple subscribers for the same subscription commit 54ca9889e1d7095c90593d9a76048791384c8a05 Author: Urigo Date: Wed May 17 22:36:17 2017 +0300 feat(subscriptions): minor fixes commit a76e7a3ed5ff2c88096d62c32701330221dc0c40 Merge: e3f695c8 8abef414 Author: Urigo Date: Wed May 17 22:32:35 2017 +0300 Merge branch 'master' into subscriptions commit 8abef41446dcd889d0f819b40ecae04ec997413c Author: Lee Byron Date: Wed May 17 18:35:37 2017 +0200 Update to latest version of iterall Also updates babelrc and eslintrc to support upcoming async generator functions. commit e3f695c87048543c564975a41dd605ec0c0fc659 Author: Urigo Date: Tue May 16 15:34:38 2017 +0300 feat(subscriptions): added `subscribe` to field flow type commit d75c779064ded1f8d1e7adae947dd482306d8c16 Merge: c0d27eb6 3a5444ac Author: Greg Hurrell Date: Mon May 15 10:00:28 2017 -0700 Merge pull request #852 from wincent/glh/spelling Fix typo in comments: simplist → simplest commit 3a5444ac7b75daf1d8135029ce2ed853449f12b1 Author: Greg Hurrell Date: Mon May 15 09:50:06 2017 -0700 Fix typo in comments: simplist → simplest commit c0d27eb6870ac6a057b84fc7635b9244a520be4f Author: Greg Hurrell Date: Mon May 15 09:49:47 2017 -0700 Freshen yarn.lock commit c859437989d0ad2c47b87c7c2b03e5561dfb00e8 Merge: 09fd0e2a 2bc98f9f Author: Greg Hurrell Date: Mon May 15 09:40:49 2017 -0700 Merge pull request #851 from graphql/greenkeeper/mocha-3.4.1 Update mocha to the latest version 🚀 commit 09fd0e2aa4ce83d7e1eafc5759f82ebc94b9f59e Merge: 7287c7cc fd843209 Author: Greg Hurrell Date: Mon May 15 09:40:17 2017 -0700 Merge pull request #849 from graphql/greenkeeper/eslint-plugin-flowtype-2.33.0 Update eslint-plugin-flowtype to the latest version 🚀 commit 2bc98f9f25be10ccc93c5a2c99abdbcd356a8c95 Author: greenkeeper[bot] Date: Sun May 14 23:02:27 2017 +0000 chore(package): update mocha to version 3.4.1 commit 0d8380fe5e2cad2240029fc12ffd4344894549ea Author: Urigo Date: Sun May 14 17:16:55 2017 +0300 feat(subscriptions): export getSubscriptionEventSource commit e989ae5a32aae6e7ef0f6ab0eb2caa20d5314aa1 Author: Urigo Date: Sun May 14 17:14:04 2017 +0300 feat(subscriptions): split subscribe function commit ba0f60e52610fbc1e781c22eda41a7022af9dcc6 Author: Urigo Date: Sun May 14 16:52:43 2017 +0300 feat(subscriptions): added test cases for querying multiple subscription fields and multiple schema subscriptions commit 0dd3ce3e656b76dfc3886a12c459aaa396ed4a27 Author: Urigo Date: Sun May 14 16:18:45 2017 +0300 feat(subscriptions): added error handling and fixed tests commit fd84320904f51e65ee7a3c57ff1f45563176cc2b Author: greenkeeper[bot] Date: Sun May 14 10:53:53 2017 +0000 chore(package): update eslint-plugin-flowtype to version 2.33.0 commit 7287c7ccecc58c97a3745a2db64f1bd5ae1ea7a2 Merge: 5fee9b5e 7d00990f Author: Lee Byron Date: Fri May 12 11:38:17 2017 -0700 Merge pull request #838 from APIs-guru/fieldsOrder Make 'errors' top property in the response object. commit 5fee9b5ed48756e706aa758812e5cc601c952b8d Author: Greg Hurrell Date: Thu May 11 11:25:12 2017 -0700 Freshen yarn.lock commit 3ba1852a5b0e2eff13d77badeab8b0a05268925b Merge: 7ae99505 b3237126 Author: Greg Hurrell Date: Thu May 11 11:24:43 2017 -0700 Merge pull request #847 from graphql/greenkeeper/flow-bin-0.46.0 Update flow-bin to the latest version 🚀 commit b32371260955cb9fc0dc95eb7255affc3cb56ec8 Author: greenkeeper[bot] Date: Wed May 10 15:31:02 2017 +0000 chore(package): update flow-bin to version 0.46.0 commit 1242665edab298d79c32ee9f5a94a39240370339 Author: Urigo Date: Thu May 4 19:22:14 2017 +0300 feat(subscriptions): added unit tests commit 74a7dc6f20b832575c15a7f188a4d2e5333a2a92 Author: Urigo Date: Wed May 3 22:03:35 2017 +0300 feat(subscriptions): expose `subscribe` in the bundle commit b8a3c74f1ef26fef1325e08a0cc5a85faa3f7a71 Author: Lee Byron Date: Tue Apr 25 22:06:16 2017 -0700 Minor refactoring of execute.js to make it more clear that most of subscribe.js is calling existing functions. commit 18826e10142e3c33fbbf9ec52dd6bf3351174754 Author: Lee Byron Date: Mon Apr 24 20:40:25 2017 -0700 Rough take on subscriptions commit 7ae995057148e6ec0a753eae3a4fd29855ad0feb Merge: 3c0a5366 e9640950 Author: Greg Hurrell Date: Tue May 2 17:57:59 2017 -0700 Merge pull request #744 from turadg/prevent-type-dupes Forbid duplicate type definitions commit 3c0a536688ae53df362c9777170e91aa66114760 Author: Greg Hurrell Date: Mon May 1 17:19:50 2017 -0700 0.9.6 commit bcbab0f7adf7fdb184d3eeb46ac763b420d4fcc3 Author: Greg Hurrell Date: Mon May 1 17:18:30 2017 -0700 Regenerate yarn.lock This was generated with a "^" version range, which I changed for consistency with the other deps, but forgot to re-run `yarn`. commit 7ddd8dd44cb7f8a3a9f7a760d5ab76ac91802931 Merge: 90336858 04e368bb Author: Greg Hurrell Date: Mon May 1 16:47:27 2017 -0700 Merge pull request #839 from graphql/no-name-warning [RFC] Environment var to silence warning about invalid names. commit 04e368bb870b1d66813b53995b8aaed064fb8cba Author: Greg Hurrell Date: Mon May 1 16:46:11 2017 -0700 Kill errant blank line commit 163fbb4a8295559d3eedc5257d38cbb5e2ca7f4f Author: Greg Hurrell Date: Mon May 1 16:39:01 2017 -0700 Add tests for assertValidName Tested with and without GRAPHQL_NO_NAME_WARNING in the environment. commit 423200f004700227068b864f9499a4e5ea6a0ae5 Author: Lee Byron Date: Mon May 1 11:41:52 2017 -0700 [RFC] Environment var to silence warning about invalid names. This provides an opt-out of a spec compliance naming style for legacy schema commit 7d00990f1bf8bfea284b033e5a57f3fcbffc5bf5 Author: Ivan Goncharov Date: Tue Apr 25 21:25:52 2017 +0300 Make 'errors' top property in response object. commit 903368586e8c3097774e2ef2643d10e1bf2d1496 Author: Lee Byron Date: Fri Apr 28 19:31:08 2017 -0700 0.9.5 commit 5b06511061871eacbdb94ff57f2d74aa04aaa2f8 Merge: d7fe6613 b013e730 Author: Lee Byron Date: Fri Apr 28 19:04:04 2017 -0700 Merge pull request #836 from graphql/fix-832 Allow for nullish values when defining enums commit b013e73084c7c012527a3d44f215f46d1f8465ae Author: Lee Byron Date: Fri Apr 28 18:53:25 2017 -0700 Allow for nullish values when defining enums Fixes #832 commit d7fe6613af5ecb2c90f367425c8faa74474dc69f Merge: a9d1f208 333c2486 Author: Lee Byron Date: Fri Apr 28 18:47:22 2017 -0700 Merge pull request #695 from graphql/type-checks Use flow %checks to reduce occurance of :any commit 333c2486653aa226d67e7e8319b4b5e489914665 Author: Lee Byron Date: Fri Jan 27 12:30:17 2017 -0800 Use flow %checks to reduce occurance of :any This uses a pre-release flow feature to provide predicate functions with more type checking power. It also breaks apart some functions into multiple declare function statements for cases where more specific input types result in more specific output types. commit a9d1f2081ce6bcedeb7da8806d3ae3f605ebc542 Author: Lee Byron Date: Fri Apr 28 18:34:51 2017 -0700 Refresh yarn.lock commit 6e8d57d1d4a215d9731c2120c4c6101518607a30 Merge: 6e3494da fe9dd17a Author: Lee Byron Date: Fri Apr 28 18:33:14 2017 -0700 Merge pull request #835 from graphql/greenkeeper/iterall-1.1.1 fix(package): update iterall to version 1.1.1 commit 6e3494dafe56453ebeee9d5709ca20465dd99862 Merge: e37b8bca 62a7ad0b Author: Lee Byron Date: Fri Apr 28 18:28:20 2017 -0700 Merge pull request #807 from APIs-guru/visitor Export getVisitFn function commit e37b8bca922cba990527b42f9c3903a35a261304 Merge: 5f6ce909 817d266e Author: Lee Byron Date: Fri Apr 28 18:27:55 2017 -0700 Merge pull request #831 from graphql/greenkeeper/coveralls-2.13.1 Update coveralls to the latest version 🚀 commit 5f6ce9095d1aaf7fccd749475e7d5b34b87cb12c Merge: d18a10dd c3f5ab82 Author: Lee Byron Date: Fri Apr 28 18:26:48 2017 -0700 Merge pull request #834 from graphql/export-validate-with Allow passing custom TypeInfo to validate() commit fe9dd17a8b0c182474c27479a3637d45b97eb5f9 Author: Lee Byron Date: Fri Apr 28 18:25:02 2017 -0700 Allow any version of iterall commit d18a10dd9e3deedc099db688312f12ba4953a365 Merge: 604bf1ab f43c5db3 Author: Lee Byron Date: Fri Apr 28 18:22:46 2017 -0700 Merge pull request #833 from APIs-guru/fixErrorMsg Fix grammar inside error message. commit c3f5ab82d2fd284fb757f1528c9cc47bb84af883 Author: Lee Byron Date: Fri Apr 28 18:21:12 2017 -0700 Allow passing custom TypeInfo to validate() This is motivated by cases where you want to supply a custom TypeInfo instance when validating a document. commit 9a9987bbde2893bd76c32d0997a15c277e9a226f Author: greenkeeper[bot] Date: Fri Apr 28 21:31:07 2017 +0000 fix(package): update iterall to version 1.1.1 Closes #828 https://greenkeeper.io/ commit 62a7ad0b61ce22507225ca559f9cfe99bed81e25 Author: Ivan Goncharov Date: Fri Apr 14 13:23:43 2017 +0300 Export getVisitFn function commit f43c5db3726900275cd0aa979edc379cdfc06807 Author: Ivan Goncharov Date: Fri Apr 28 20:11:44 2017 +0300 Fix grammar inside error message. Suggested by @smolinari here: https://github.com/graphql/graphql-js/pull/812#issuecomment-297898875 commit 604bf1aba08e27fe973e19f7114f6201add1ba26 Author: Lee Byron Date: Thu Apr 27 17:01:37 2017 -0700 0.9.4 commit e3c708a3d3b5ff24f51182c748ea670803c0b298 Merge: 5e17f83e b4606596 Author: Lee Byron Date: Thu Apr 27 17:00:07 2017 -0700 Merge pull request #728 from APIs-guru/uniq_interfaces Forbid object to declare that it implements same interface twice. commit 5e17f83e9bde4b3755355f76627e8bac08e70ba0 Merge: 126cd6dc 7893dba6 Author: Lee Byron Date: Thu Apr 27 16:57:49 2017 -0700 Merge pull request #813 from APIs-guru/uniq_union Forbid to define duplicated member types in Union commit b460659611ff34b93df939975fcdaeb47b3ec748 Author: Lee Byron Date: Thu Apr 27 16:57:36 2017 -0700 Use hashmap instead of array find commit 7893dba6becdde1ef9819291f618136a8b9e1c85 Author: Lee Byron Date: Thu Apr 27 16:53:52 2017 -0700 Use a hashmap instead of array find commit 13ba225e80565d1c29dea032c00769cf7ac432ac Author: Lee Byron Date: Thu Apr 27 16:50:39 2017 -0700 rm unnecessary change commit 126cd6dc548ec243be351b4f7733b0918fb60392 Merge: 5caf176e a5a91267 Author: Lee Byron Date: Thu Apr 27 16:49:20 2017 -0700 Merge pull request #829 from graphql/graphql-error-constructor Add constructor to GraphQLError class flow type commit 5caf176e6395aa04edac2a3282934cf48d9d7f30 Merge: 4abde6e8 916c47e6 Author: Lee Byron Date: Thu Apr 27 16:46:15 2017 -0700 Merge pull request #812 from APIs-guru/enumNames Forbid 'true', 'false' and 'null' as names for Enum value commit a5a912670317f3415d592bcab75fcd132ba29570 Author: Lee Byron Date: Thu Apr 27 16:39:22 2017 -0700 Add constructor to GraphQLError class flow type Since GraphQLError is declared then defined separately, Flow might infer that the constructor is not being used correctly via wrong arity, or might not detect improper use if an incorrect type is provided. This fixes that by adding a contructor to the declared type. Also bumped the version of flow to ensure this change passes both the existing and most recent flow version commit 817d266eee053edcb01f6e5edbcca23f4bd073c8 Author: greenkeeper[bot] Date: Thu Apr 27 20:47:26 2017 +0000 chore(package): update coveralls to version 2.13.1 https://greenkeeper.io/ commit 4abde6e8844623757936631564c4efe4603c8a1c Author: Caleb Meredith Date: Tue Apr 25 19:21:18 2017 -0400 Fix GitHub syntax highlighting (#753) commit c87fbd787c2b04c478f9535225d56cfea5a710cc Author: Greg Hurrell Date: Mon Apr 24 11:39:16 2017 -0700 Freshen yarn.lock commit 6ceb5a5bf16da219b1f48acb5122a924198aece8 Merge: 08d6885c 10e7b938 Author: Greg Hurrell Date: Mon Apr 24 11:38:08 2017 -0700 Merge pull request #824 from graphql/greenkeeper/mocha-3.3.0 Update mocha to the latest version 🚀 commit 08d6885cb0f69cbb719aa7b21a472e827640e265 Merge: 3f509505 aea5c456 Author: Greg Hurrell Date: Mon Apr 24 11:37:55 2017 -0700 Merge pull request #823 from graphql/greenkeeper/flow-bin-0.44.2 Update flow-bin to the latest version 🚀 commit 10e7b938d7dff265c25152a9cd35a97ec007b39a Author: greenkeeper[bot] Date: Mon Apr 24 09:36:29 2017 +0000 chore(package): update mocha to version 3.3.0 https://greenkeeper.io/ commit aea5c456dabb0ad8337e7c2774581ad104ba317f Author: greenkeeper[bot] Date: Sun Apr 23 13:20:23 2017 +0000 chore(package): update flow-bin to version 0.44.2 https://greenkeeper.io/ commit 3f509505b561cf8f7914e6b6f3ff28fbef29bd9a Author: Greg Hurrell Date: Fri Apr 21 15:23:01 2017 -0700 Freshen yarn.lock commit 2b406cc5fa23c6709423cb87b8d05ba088b61fc5 Merge: dda7c4a9 ff3bd464 Author: Greg Hurrell Date: Fri Apr 21 15:21:57 2017 -0700 Merge pull request #822 from graphql/greenkeeper/babel-eslint-7.2.3 Update babel-eslint to the latest version 🚀 commit ff3bd46405c47f6d3e942a4acafb39f6748dbff0 Author: greenkeeper[bot] Date: Fri Apr 21 21:37:21 2017 +0000 chore(package): update babel-eslint to version 7.2.3 https://greenkeeper.io/ commit dda7c4a9abf8306a1bbc646a4394a74e63dd369f Merge: 1bd1de65 5f3f511d Author: Angel Gomez Date: Thu Apr 20 14:46:38 2017 -0700 Merge pull request #818 from AGS-/update-readme-yarn Update README.md to use yarn commit 5f3f511dceb1235cec9540e631a0804f096b2d37 Author: Angel Gomez Date: Thu Apr 20 14:39:58 2017 -0700 Update README.md commit bb377772d181d44d04b0eb98df5ff00ffadc8a88 Author: angel.gomez Date: Wed Apr 19 23:23:30 2017 -0700 Update README.md to use yarn commit 1bd1de65a6c921e55f0dcb145f2f85e5d3025831 Author: Greg Hurrell Date: Wed Apr 19 08:07:21 2017 -0700 Freshen yarn.lock commit 3a33085d65d5d4327119796a4d8bbfd1d65ea95f Merge: 1eb41dda 26d5d30e Author: Greg Hurrell Date: Wed Apr 19 08:06:34 2017 -0700 Merge pull request #816 from graphql/greenkeeper/eslint-plugin-flowtype-2.32.1 chore(package): update eslint-plugin-flowtype to version 2.32.1 commit 26d5d30e351747b3e2eed69220bbee6deb4cdc27 Author: greenkeeper[bot] Date: Wed Apr 19 14:35:44 2017 +0000 chore(package): update eslint-plugin-flowtype to version 2.32.1 Closes #815 https://greenkeeper.io/ commit 1eb41dda699138c0a56de2fa937e7b9e5499949a Author: Greg Hurrell Date: Tue Apr 18 13:08:34 2017 -0700 Freshen yarn.lock commit 96e52c03ac1ec02550bef22b88b3ada43474027a Merge: bacd4127 de20d6ff Author: Greg Hurrell Date: Tue Apr 18 12:58:45 2017 -0700 Merge pull request #814 from graphql/greenkeeper/eslint-plugin-flowtype-2.31.0 Update eslint-plugin-flowtype to the latest version 🚀 commit de20d6ff8c011d7a8a0d1f86f3bf507bd8b36d18 Author: greenkeeper[bot] Date: Tue Apr 18 17:19:23 2017 +0000 chore(package): update eslint-plugin-flowtype to version 2.31.0 https://greenkeeper.io/ commit e13834b8026ad9abba7ee5eaadfad119cafd69d3 Author: Ivan Goncharov Date: Tue Apr 18 02:34:17 2017 +0300 Forbid to define duplicated member types in Union For details please see this PR: https://github.com/facebook/graphql/pull/266 commit 8234f4eb3084d1cdfefa082f5af9a9733b1c027b Author: Ivan Goncharov Date: Sun Feb 26 21:15:46 2017 +0200 Forbid object to declare that it implements same interface twice. For details please see this PR: https://github.com/facebook/graphql/pull/262 commit 916c47e63bddda2633788b71f3b1464782fa7754 Author: Ivan Goncharov Date: Tue Apr 18 00:31:31 2017 +0300 Forbid 'true', 'false' and 'null' as names for Enum value commit bacd412770f4c21f40d403d605420e9f4fd9ed2f Merge: 5cdf9a47 e2f40191 Author: Greg Hurrell Date: Mon Apr 17 07:36:52 2017 -0700 Merge pull request #810 from jwulf/patch-1 Fix minor spelling error commit e2f40191045d4ae51dd1ef7cb9f27be7b9a65d88 Author: Joshua Wulf Date: Sun Apr 16 23:12:36 2017 +1000 Fix minor spelling error commit 5cdf9a47e63e8e91fc032a3dec7167d4bf32c4d2 Merge: ca70f600 2b94926f Author: Lee Byron Date: Fri Apr 14 14:38:21 2017 -0700 Merge pull request #808 from graphql/export-rules [RFC] Export all validation rules directly commit 2b94926ff62430f3679f2eb590dc4f8c6f594302 Author: Lee Byron Date: Fri Apr 14 13:53:44 2017 -0700 [RFC] Export all validation rules directly It's become relatively standard to create a whitelist or blacklist of validation rules, and reaching into the package per rule can get messy. This exports all the rules at the higher levels of submodule and module as well to make this easier. For explaination of whitelist of blacklist: ```js // Whitelist import { specifiedRules, ScalarLeafs } from 'graphql'; // A ruleset which only runs one rule. const whitelistRules = [ ScalarLeafs ]; ``` ```js // Blacklist import { specifiedRules, ScalarLeafs } from 'graphql'; // A ruleset which only runs all but one rule. const blacklistRules = specifiedRules.filter(rule => rule !== ScalarLeafs); // Note: the wrong way to do a blacklist would be to import and specify all // but one rule. That's a whitelist and would fail to pick up any added // validation rules that may be amended to spec in the future. ``` commit ca70f6004ca0f847d00a98169cfa85acf4d35559 Author: Greg Hurrell Date: Thu Apr 13 09:52:51 2017 -0700 Freshen yarn.lock commit 722f11dcc7e7f254ba263c928fb12427b9ad2ba6 Merge: 15e49bba 87fd5c47 Author: Greg Hurrell Date: Thu Apr 13 09:51:57 2017 -0700 Merge pull request #806 from graphql/greenkeeper/flow-bin-0.44.0 Update flow-bin to the latest version 🚀 commit 87fd5c47282d6344a4b1f862ae573d9499182d84 Author: greenkeeper[bot] Date: Thu Apr 13 16:13:16 2017 +0000 chore(package): update flow-bin to version 0.44.0 https://greenkeeper.io/ commit 15e49bba00377827fc37084edd92b8cf488b1fa7 Merge: 1407c057 4554cdf8 Author: Greg Hurrell Date: Wed Apr 12 10:52:45 2017 -0700 Merge pull request #803 from wincent/glh/deprecation Silence eslint deprecation warning commit 4554cdf8fb3c747404c47f4881b32f4562d53432 Author: Greg Hurrell Date: Wed Apr 12 10:48:35 2017 -0700 Silence eslint deprecation warning Silences: The babel/no-await-in-loop rule is deprecated. Please use the built in no-await-in-loop rule instead. commit 1407c057b1d6f0d6492eed23a4a41402346f440b Author: Greg Hurrell Date: Wed Apr 12 10:35:37 2017 -0700 0.9.3 commit b6b2a59515b1aae82ebaffcee42172c842cda59b Author: Greg Hurrell Date: Wed Apr 12 10:34:49 2017 -0700 Freshen yarn.lock commit 12d42a56416e708627b82a98af20b292aba0adbf Merge: 0a56e283 04b3cdae Author: Greg Hurrell Date: Wed Apr 12 10:34:00 2017 -0700 Merge pull request #802 from graphql/greenkeeper/babel-eslint-7.2.2 Update babel-eslint to the latest version 🚀 commit 0a56e283511d330ab163fdbb2234732c4500a09e Merge: 490dc494 c52949d7 Author: Greg Hurrell Date: Wed Apr 12 09:28:20 2017 -0700 Merge pull request #800 from joelgriffith/bugfix/find-breaking-arg-changes Moving from raw instance check to name checks in `findBreakingArgChanges` commit 04b3cdae6004f003b91c16c6f10db526ed725689 Author: greenkeeper[bot] Date: Wed Apr 12 16:17:59 2017 +0000 chore(package): update babel-eslint to version 7.2.2 https://greenkeeper.io/ commit c52949d7b3d9c1c65100b81a329e0126fe93ba6b Author: Joel Griffith Date: Wed Apr 12 08:48:44 2017 -0700 Tests to prevent this bug from happening again commit 3277a1b01cc46e0277016ef9a45b9d067cbe319b Author: Joel Griffith Date: Tue Apr 11 16:55:11 2017 -0700 Flow fixes commit 28da1f06a784c4a848711c6625f114854687d84f Author: Joel Griffith Date: Tue Apr 11 16:13:16 2017 -0700 Moving from raw instance check to name checks commit 490dc494ac0bdc45c5d762811b8fc3d796dae3a8 Author: Greg Hurrell Date: Mon Apr 10 10:02:04 2017 -0700 Freshen yarn.lock commit 8f06fdaf4dd8488c007ecdf2c91cc77a825b0e2f Merge: bb51c1ad d09f84cd Author: Greg Hurrell Date: Sat Apr 8 15:26:38 2017 -0700 Merge pull request #795 from graphql/greenkeeper/babel-cli-6.24.1 Update babel-cli to the latest version 🚀 commit d09f84cd4144f76634f71d6817106a8471ce810b Author: greenkeeper[bot] Date: Sat Apr 8 22:07:53 2017 +0000 chore(package): update babel-cli to version 6.24.1 https://greenkeeper.io/ commit bb51c1ad26c970af93a3d6ad4bb646f0301c340f Author: Greg Hurrell Date: Sat Apr 8 14:50:00 2017 -0700 Freshen yarn.lock commit 8dd926c265b60c89b5215881fdf348c1339efdf9 Merge: 43740270 0a778cef Author: Greg Hurrell Date: Sat Apr 8 14:34:31 2017 -0700 Merge pull request #794 from graphql/greenkeeper/babel-plugin-transform-es2015-classes-6.24.1 Update babel-plugin-transform-es2015-classes to the latest version 🚀 commit 0a778ceff82ced30ca8f095d4ade990893acf06e Author: greenkeeper[bot] Date: Sat Apr 8 21:25:27 2017 +0000 chore(package): update babel-plugin-transform-es2015-classes to version 6.24.1 https://greenkeeper.io/ commit 43740270ee34dbab65e13e91023652edc2329f06 Merge: 6b1ea8de 9ea7a4ba Author: Greg Hurrell Date: Sat Apr 8 14:20:56 2017 -0700 Merge pull request #793 from graphql/greenkeeper/babel-plugin-transform-es2015-object-super-6.24.1 Update babel-plugin-transform-es2015-object-super to the latest version 🚀 commit 9ea7a4ba2498e26c6dede88f626e9c2b35ce53c5 Author: greenkeeper[bot] Date: Sat Apr 8 21:00:42 2017 +0000 chore(package): update babel-plugin-transform-es2015-object-super to version 6.24.1 https://greenkeeper.io/ commit 6b1ea8de2d13edb82c7e1923591ad70343402b28 Merge: 693f369c 196650f7 Author: Greg Hurrell Date: Sat Apr 8 13:35:48 2017 -0700 Merge pull request #792 from graphql/greenkeeper/babel-plugin-transform-class-properties-6.24.1 Update babel-plugin-transform-class-properties to the latest version 🚀 commit 196650f7aa26f02e7e53faf628900f88a36f0021 Author: greenkeeper[bot] Date: Sat Apr 8 20:20:18 2017 +0000 chore(package): update babel-plugin-transform-class-properties to version 6.24.1 https://greenkeeper.io/ commit 693f369c0f18c6b5aced6b675f0d9f348bbdb9e8 Author: Greg Hurrell Date: Sat Apr 8 13:04:45 2017 -0700 Freshen yarn.lock commit 382f99ddab9777758ed206c1c3b101bcbb2f9742 Merge: b3454eca bb4ae29c Author: Greg Hurrell Date: Sat Apr 8 13:04:24 2017 -0700 Merge pull request #791 from graphql/greenkeeper/babel-plugin-transform-es2015-function-name-6.24.1 Update babel-plugin-transform-es2015-function-name to the latest version 🚀 commit b3454eca7b75ef4cb14e1b11fcefaa829be4b4f1 Merge: 5635b110 e6447b5d Author: Greg Hurrell Date: Sat Apr 8 13:04:12 2017 -0700 Merge pull request #790 from graphql/greenkeeper/babel-plugin-transform-es2015-parameters-6.24.1 Update babel-plugin-transform-es2015-parameters to the latest version 🚀 commit 5635b1104e19e47c8d4f61dafe58620e7b945a72 Merge: 551277ee f593b3bf Author: Greg Hurrell Date: Sat Apr 8 13:03:59 2017 -0700 Merge pull request #789 from graphql/greenkeeper/babel-plugin-transform-es2015-modules-commonjs-6.24.1 Update babel-plugin-transform-es2015-modules-commonjs to the latest version 🚀 commit bb4ae29ce222be497be91c743676475f8f7feaf1 Author: greenkeeper[bot] Date: Sat Apr 8 19:53:20 2017 +0000 chore(package): update babel-plugin-transform-es2015-function-name to version 6.24.1 https://greenkeeper.io/ commit e6447b5d5ce50501fa7e68f4810146644b12dc42 Author: greenkeeper[bot] Date: Sat Apr 8 18:22:57 2017 +0000 chore(package): update babel-plugin-transform-es2015-parameters to version 6.24.1 https://greenkeeper.io/ commit f593b3bf303c262a015aa9432a8a1233fb6c9475 Author: greenkeeper[bot] Date: Sat Apr 8 17:23:06 2017 +0000 chore(package): update babel-plugin-transform-es2015-modules-commonjs to version 6.24.1 https://greenkeeper.io/ commit 551277ee28ff6e09b8cb3a211d0874484ae8257d Author: Greg Hurrell Date: Sat Apr 8 09:48:54 2017 -0700 Freshen yarn.lock commit 70129f1a2affb7b9f1bdd9842c9cd2e6e11b5a26 Merge: dc9cd5d7 53af8a9b Author: Greg Hurrell Date: Sat Apr 8 09:48:35 2017 -0700 Merge pull request #788 from graphql/greenkeeper/babel-plugin-transform-es2015-block-scoping-6.24.1 Update babel-plugin-transform-es2015-block-scoping to the latest version 🚀 commit 53af8a9b0c304f23239f82e626d01e41d304eabf Author: greenkeeper[bot] Date: Sat Apr 8 16:08:36 2017 +0000 chore(package): update babel-plugin-transform-es2015-block-scoping to version 6.24.1 https://greenkeeper.io/ commit dc9cd5d7afff6a10922002ba23b8f5e64fe2cf36 Author: Greg Hurrell Date: Sat Apr 8 08:52:47 2017 -0700 Freshen yarn.lock commit 44976f13728b119e83591314a5e2f8f7d1d2526e Merge: 1e85ae09 4dd3c3c6 Author: Greg Hurrell Date: Sat Apr 8 08:52:25 2017 -0700 Merge pull request #787 from graphql/greenkeeper/babel-plugin-transform-es2015-computed-properties-6.24.1 Update babel-plugin-transform-es2015-computed-properties to the latest version 🚀 commit 4dd3c3c6e76828249bb3ddd701c371a88115e3b5 Author: greenkeeper[bot] Date: Sat Apr 8 14:34:26 2017 +0000 chore(package): update babel-plugin-transform-es2015-computed-properties to version 6.24.1 https://greenkeeper.io/ commit 1e85ae09f7aa96c691a676b5094039863a7544c5 Author: Greg Hurrell Date: Sat Apr 8 07:24:37 2017 -0700 Freshen yarn.lock commit ea1d05a03441e9ad15bd14d2e2f7c039b80ecee1 Merge: 846da726 6de00413 Author: Greg Hurrell Date: Sat Apr 8 07:24:07 2017 -0700 Merge pull request #786 from graphql/greenkeeper/babel-plugin-transform-es2015-duplicate-keys-6.24.1 Update babel-plugin-transform-es2015-duplicate-keys to the latest version 🚀 commit 846da7261bbe44d664018d71c1c0e9ac14f65ffa Merge: b9bf8b81 916725e9 Author: Greg Hurrell Date: Sat Apr 8 07:23:53 2017 -0700 Merge pull request #785 from graphql/greenkeeper/babel-plugin-transform-regenerator-6.24.1 Update babel-plugin-transform-regenerator to the latest version 🚀 commit b9bf8b81d1b22a95ff8c072d9dae91d42c0f0cde Merge: f138546f bc8cc981 Author: Greg Hurrell Date: Sat Apr 8 07:23:29 2017 -0700 Merge pull request #784 from graphql/greenkeeper/babel-plugin-transform-es2015-shorthand-properties-6.24.1 Update babel-plugin-transform-es2015-shorthand-properties to the latest version 🚀 commit bc8cc981e8e425f19a30823117a2a964c5eca84d Author: greenkeeper[bot] Date: Fri Apr 7 21:24:07 2017 +0000 chore(package): update babel-plugin-transform-es2015-shorthand-properties to version 6.24.1 https://greenkeeper.io/ commit 6de004132c5e63dacd13c596b845057087f3e483 Author: greenkeeper[bot] Date: Fri Apr 7 19:13:51 2017 +0000 chore(package): update babel-plugin-transform-es2015-duplicate-keys to version 6.24.1 https://greenkeeper.io/ commit 916725e9ff4d4ea77a392a9b23424106d16093ca Author: greenkeeper[bot] Date: Fri Apr 7 15:31:15 2017 +0000 chore(package): update babel-plugin-transform-regenerator to version 6.24.1 https://greenkeeper.io/ commit f138546f168d47796c6826e5300d37e1f69c71be Author: Greg Hurrell Date: Thu Apr 6 08:47:31 2017 -0700 Freshen yarn.lock commit 142cf6b276787e87dc8f404a2393655e93e2c1d9 Merge: ed7c8fde 9988c82a Author: Greg Hurrell Date: Thu Apr 6 08:47:11 2017 -0700 Merge pull request #781 from graphql/greenkeeper/flow-bin-0.43.1 Update flow-bin to the latest version 🚀 commit 9988c82a9a611e79b3a7d50611b385b3969f76dd Author: greenkeeper[bot] Date: Thu Apr 6 15:28:07 2017 +0000 chore(package): update flow-bin to version 0.43.1 https://greenkeeper.io/ commit ed7c8fde729780408bc704d22f9d3c0f020c3ec0 Author: Greg Hurrell Date: Tue Apr 4 10:07:12 2017 -0700 Freshen yarn.lock commit 88f2508d67ad42b9c47d2d9be9db5fc2f8a0fb89 Merge: bc9095bd d32e2c70 Author: Greg Hurrell Date: Tue Apr 4 10:06:45 2017 -0700 Merge pull request #779 from graphql/greenkeeper/flow-bin-0.43.0 Update flow-bin to the latest version 🚀 commit d32e2c70226f32aee42f4cbb106947e1c9304194 Author: greenkeeper[bot] Date: Tue Apr 4 15:40:08 2017 +0000 chore(package): update flow-bin to version 0.43.0 https://greenkeeper.io/ commit bc9095bd124f1db9f914f253e8e6fbca36dd40e1 Author: Greg Hurrell Date: Fri Mar 31 16:39:45 2017 -0700 Freshen yarn.lock commit 1a624df562c8736305a9c3e1794c0c3e98ca482d Merge: 5ba817e1 74f38fc3 Author: Greg Hurrell Date: Fri Mar 31 16:38:47 2017 -0700 Merge pull request #775 from graphql/greenkeeper/eslint-3.19.0 Update eslint to the latest version 🚀 commit 74f38fc3ac7f20a3db1f9b8afc852089055466f6 Author: greenkeeper[bot] Date: Fri Mar 31 20:48:59 2017 +0000 chore(package): update eslint to version 3.19.0 https://greenkeeper.io/ commit 5ba817e13f7547ce99c4963ee74a805ed3f74dd8 Author: Greg Hurrell Date: Fri Mar 31 10:14:04 2017 -0700 0.9.2 commit 76560159b0951cc51133e6aa47a528fd2bc7becd Author: Greg Hurrell Date: Thu Mar 30 12:59:57 2017 -0700 Freshen yarn.lock commit a61f8e2c80138e37010fed6b8eab277959bc17d4 Merge: 14ec4561 2c6bab24 Author: Greg Hurrell Date: Thu Mar 30 12:59:17 2017 -0700 Merge pull request #774 from graphql/greenkeeper/coveralls-2.13.0 Update coveralls to the latest version 🚀 commit 2c6bab2401513e19d646b6f49ca42bc13bccf36d Author: greenkeeper[bot] Date: Thu Mar 30 16:26:20 2017 +0000 chore(package): update coveralls to version 2.13.0 https://greenkeeper.io/ commit 14ec456122ffd776e0ecaa3726bb7453352b5b48 Merge: dcae89da cdb9af21 Author: Greg Hurrell Date: Thu Mar 23 17:53:08 2017 -0700 Merge pull request #769 from wincent/glh/node Don't run on Node 0.12 in Travis commit cdb9af210ac4f0477b5a8054960ddd62f44b4373 Author: Greg Hurrell Date: Thu Mar 23 17:48:37 2017 -0700 Don't run on Node 0.12 in Travis 0.12 reached end-of-life at the end of 2016 (see: https://github.com/nodejs/LTS). It is now failing CI runs too, presumably because of a Yarn upgrade on the CI boxes, which now complain: > Node.js version v0.12.18 does not meet requirement for yarn. Please > use Node.js 4 or later. (Example: https://travis-ci.org/graphql/graphql-js/jobs/214455818) So, let's drop it from the CI matrix. commit dcae89da089ec7e444db1fbae9773bfe5229f570 Author: Greg Hurrell Date: Thu Mar 23 15:56:34 2017 -0700 Freshen yarn.lock commit 4e49ac652a4f9d35fda49b36692c4907b6cd785a Merge: fa4c8e39 a41b7003 Author: Greg Hurrell Date: Thu Mar 23 15:56:13 2017 -0700 Merge pull request #768 from graphql/greenkeeper/babel-eslint-7.2.1 Update babel-eslint to the latest version 🚀 commit a41b7003038d5342f6bb78037b6c5cd3e0c0553a Author: greenkeeper[bot] Date: Thu Mar 23 18:18:34 2017 +0000 chore(package): update babel-eslint to version 7.2.1 https://greenkeeper.io/ commit fa4c8e39a75b3b9c1d7962de06468a63bd9f8c1e Merge: 2c8d565b ba401e15 Author: Greg Hurrell Date: Wed Mar 22 11:03:09 2017 -0700 Merge pull request #767 from neelance/master Unify wording in error messages. commit ba401e154461bca5323ca9121c6dacaee10ebe88 Author: Richard Musiol Date: Wed Mar 22 16:18:59 2017 +0100 Unify wording in error messages. Before this change there was: - There can be only one argument named ... - There can be only one input field named ... - There can be only one variable named ... - There can only be one fragment named ... - There can only be one operation named ... Now the last two match the others. commit 2c8d565b0c9bcd0ab90f00fa640c7ebec80a04e8 Author: Greg Hurrell Date: Tue Mar 21 10:12:39 2017 -0700 Freshen yarn.lock commit 2f56f17686864350adb4cc65264d31112c87cf50 Merge: 94e24316 275e9677 Author: Greg Hurrell Date: Tue Mar 21 10:10:54 2017 -0700 Merge pull request #766 from graphql/greenkeeper/eslint-plugin-flowtype-2.30.4 Update eslint-plugin-flowtype to the latest version 🚀 commit 275e9677105167e9770af1104f92b8b8af0c6304 Author: greenkeeper[bot] Date: Tue Mar 21 15:45:59 2017 +0000 chore(package): update eslint-plugin-flowtype to version 2.30.4 https://greenkeeper.io/ commit 94e24316761186b1135fcda909dc25baeadaca9c Author: Greg Hurrell Date: Tue Mar 21 07:27:17 2017 -0700 Freshen yarn.lock commit 4e221cc466a70c44c169c635bffb0cc04d261d8d Merge: ea28cda5 cf478777 Author: Greg Hurrell Date: Tue Mar 21 07:26:41 2017 -0700 Merge pull request #765 from graphql/greenkeeper/babel-eslint-7.2.0 Update babel-eslint to the latest version 🚀 commit cf4787773bb8e2829b0100e7c3699b089a142971 Author: greenkeeper[bot] Date: Mon Mar 20 23:18:37 2017 +0000 chore(package): update babel-eslint to version 7.2.0 https://greenkeeper.io/ commit ea28cda530d1c1bddfa332ef207b86ef5db5d621 Author: Greg Hurrell Date: Mon Mar 20 10:52:01 2017 -0700 Freshen yarn.lock commit ff3d7c21433e726651ac24e09a9a58ad8027ff2f Merge: e3199b0e f9a75809 Author: Greg Hurrell Date: Mon Mar 20 18:50:23 2017 +0100 Merge pull request #760 from graphql/greenkeeper/eslint-3.18.0 Update eslint to the latest version 🚀 commit e3199b0e2777ccb6fb5e5c7be7e1a7446865476c Merge: 116ae74b b3f84e37 Author: Greg Hurrell Date: Mon Mar 20 18:50:13 2017 +0100 Merge pull request #759 from graphql/greenkeeper/flow-bin-0.42.0 Update flow-bin to the latest version 🚀 commit 116ae74be129177e98f4a0bb5fe72d3f60b692f7 Author: Greg Hurrell Date: Mon Mar 20 10:38:00 2017 -0700 Freshen yarn.lock commit f9a7580916cee8bcbf0a13e755dc9975bcc5f88f Author: greenkeeper[bot] Date: Fri Mar 17 22:10:34 2017 +0000 chore(package): update eslint to version 3.18.0 https://greenkeeper.io/ commit b3f84e37adf1b0d49e6767a153b6ace625dac7bd Author: greenkeeper[bot] Date: Fri Mar 17 19:18:40 2017 +0000 chore(package): update flow-bin to version 0.42.0 https://greenkeeper.io/ commit 7c044c62b5facc8945aca693bc5dc2b6a1635b20 Author: greenkeeper[bot] Date: Wed Mar 15 16:00:22 2017 -0700 chore(package): update coveralls to version 2.12.0 (#740) https://greenkeeper.io/ commit 45e0765f09637da3a678b1e4b6e6cdfd789a798e Author: Hyo Jeong Date: Wed Mar 15 15:43:26 2017 -0700 allow deprecated fields/values to be extended (#755) commit 2235563141a01f081cf22092fe2dcc401b7cdc83 Author: Greg Hurrell Date: Mon Mar 13 07:43:55 2017 +0100 Freshen yarn.lock commit 7462eb27a9f0593335c5c3f7765314f917c43e2e Merge: 889f50cb ffbc3da1 Author: Greg Hurrell Date: Mon Mar 13 07:43:02 2017 +0100 Merge pull request #752 from graphql/greenkeeper/babel-plugin-transform-es2015-modules-commonjs-6.24.0 Update babel-plugin-transform-es2015-modules-commonjs to the latest version 🚀 commit ffbc3da17889ac80a8249c830b5784ab72035f93 Author: greenkeeper[bot] Date: Mon Mar 13 03:24:16 2017 +0000 chore(package): update babel-plugin-transform-es2015-modules-commonjs to version 6.24.0 https://greenkeeper.io/ commit 889f50cb38f812f3325c48e7e9d51be69e05e72d Author: Greg Hurrell Date: Sun Mar 12 22:09:37 2017 +0100 Freshen yarn.lock commit 751763ae1a4755f3893ef1cf514b4c4524300d53 Merge: d92dd988 4821fc2e Author: Greg Hurrell Date: Sun Mar 12 22:07:52 2017 +0100 Merge pull request #751 from graphql/greenkeeper/eslint-plugin-flowtype-2.30.3 chore(package): update eslint-plugin-flowtype to version 2.30.3 commit 4821fc2ee0c8a272bbd8c2f14a5c66651c6ac892 Author: greenkeeper[bot] Date: Tue Mar 7 16:12:41 2017 +0000 chore(package): update eslint-plugin-flowtype to version 2.30.3 Closes #742 https://greenkeeper.io/ commit d92dd9883b76e54babf2b0ffccdab838f04fc46c Author: Greg Hurrell Date: Tue Mar 7 10:04:44 2017 +0100 Freshen yarn.lock commit c31c3129ae906c87667afcebbb2c7a342892adc2 Merge: 84aef251 392da41e Author: Greg Hurrell Date: Tue Mar 7 10:03:09 2017 +0100 Merge pull request #741 from graphql/greenkeeper/eslint-plugin-babel-4.1.1 Update eslint-plugin-babel to the latest version 🚀 commit e9640950233cef428891014495d8b2d4cf47ef34 Author: Turadg Aleahmad Date: Mon Mar 6 19:49:46 2017 -0800 Forbid duplicate type definitions A GraphQL schema can't have more than one definition of the same type. Facebook runs an integration test to prevent this: https://github.com/graphql/graphql-js/issues/223#issuecomment-265366200 With this PR the `buildASTSchema` step throws, causing any tests that load the schema to fail. commit 392da41e6d0b4ca711776fbe346d807765512d6b Author: greenkeeper[bot] Date: Mon Mar 6 15:52:25 2017 +0000 chore(package): update eslint-plugin-babel to version 4.1.1 https://greenkeeper.io/ commit 84aef251e3e6d287c5125e63e718dba90b1f41e4 Author: Greg Hurrell Date: Sun Mar 5 21:49:02 2017 +0100 Freshen yarn.lock commit 1eb6f0f0a1ee2cf3677c5fbefb310945c5670724 Merge: 93d2b1aa d34d670a Author: Greg Hurrell Date: Sun Mar 5 21:48:35 2017 +0100 Merge pull request #739 from graphql/greenkeeper/flow-bin-0.41.0 Update flow-bin to the latest version 🚀 commit d34d670aff1f21aa379a47f6784b471296de5a3a Author: greenkeeper[bot] Date: Sun Mar 5 01:14:38 2017 +0000 chore(package): update flow-bin to version 0.41.0 https://greenkeeper.io/ commit 93d2b1aa67bcaf6faa47da1cb6cd6b7700f20fd4 Author: Greg Hurrell Date: Sat Mar 4 00:25:51 2017 +0100 Freshen yarn.lock commit ca304fb34fe1e3efb5c089901ba223702a6541c6 Merge: 4e5cfb1e 68d06b0d Author: Greg Hurrell Date: Sat Mar 4 00:25:12 2017 +0100 Merge pull request #737 from graphql/greenkeeper/eslint-3.17.0 Update eslint to the latest version 🚀 commit 68d06b0daf7901c2a372783de05bc73cddf6969d Author: greenkeeper[bot] Date: Fri Mar 3 22:42:22 2017 +0000 chore(package): update eslint to version 3.17.0 https://greenkeeper.io/ commit 4e5cfb1e7908da1a7233ec210074aee275d99895 Author: Greg Hurrell Date: Fri Mar 3 16:26:56 2017 +0100 Freshen yarn.lock commit b0cdac4ed3c5d1215ff341173170bef54813b564 Merge: e3d454d6 e72dec67 Author: Greg Hurrell Date: Fri Mar 3 16:26:11 2017 +0100 Merge pull request #736 from graphql/greenkeeper/chai-subset-1.5.0 Update chai-subset to the latest version 🚀 commit e72dec671f436046e7aa1d2583c880912f78bb03 Author: greenkeeper[bot] Date: Thu Mar 2 15:16:04 2017 +0000 chore(package): update chai-subset to version 1.5.0 https://greenkeeper.io/ commit e3d454d6be6bab319034887e32c193d24eee1f8c Author: Greg Hurrell Date: Mon Feb 27 23:46:36 2017 +0100 Freshen yarn.lock commit 9fb5025c114b2f96fbb8853eed4c61e88ffd7921 Merge: b17d5f56 489a3606 Author: Greg Hurrell Date: Mon Feb 27 23:45:55 2017 +0100 Merge pull request #730 from graphql/greenkeeper/eslint-plugin-babel-4.1.0 Update eslint-plugin-babel to the latest version 🚀 commit 489a360672db48df46793ed626f884ad456c5d3b Author: greenkeeper[bot] Date: Mon Feb 27 20:00:33 2017 +0000 chore(package): update eslint-plugin-babel to version 4.1.0 https://greenkeeper.io/ commit b17d5f566292bb92e1512ba4935b23ff75a6dc22 Author: Greg Hurrell Date: Sat Feb 25 08:21:59 2017 +0100 Freshen yarn.lock commit ff2e4a7d6c5d14957f3d8583156da0a8dd6aa68d Merge: 46205b12 14317d5d Author: Greg Hurrell Date: Sat Feb 25 08:21:31 2017 +0100 Merge pull request #727 from graphql/greenkeeper/flow-bin-0.40.0 Update flow-bin to the latest version 🚀 commit 14317d5dc089dfee9bbfb52b339983a344d879f1 Author: greenkeeper[bot] Date: Thu Feb 23 23:46:43 2017 +0000 chore(package): update flow-bin to version 0.40.0 https://greenkeeper.io/ commit 46205b12f400df04f262027f942a8e0dbea5f9a6 Author: Greg Hurrell Date: Thu Feb 23 08:16:19 2017 +0100 Freshen yarn.lock commit a4d3dedc2bdff8e2b019ba028f18eae17d7e195c Merge: 8751d11a 3af24bed Author: Greg Hurrell Date: Thu Feb 23 08:15:51 2017 +0100 Merge pull request #726 from graphql/greenkeeper/eslint-3.16.1 Update eslint to the latest version 🚀 commit 8751d11aa54370028ed308579c14cbd01090c754 Merge: 31fe1f92 5ca1c450 Author: Greg Hurrell Date: Thu Feb 23 08:15:34 2017 +0100 Merge pull request #725 from graphql/greenkeeper/sane-1.6.0 Update sane to the latest version 🚀 commit 3af24bede8190bdaf679e7b30b233e0edd8b1608 Author: greenkeeper[bot] Date: Wed Feb 22 22:20:38 2017 +0000 chore(package): update eslint to version 3.16.1 https://greenkeeper.io/ commit 5ca1c4507f8147414348f1c6f7d4badabe75edf5 Author: greenkeeper[bot] Date: Tue Feb 21 05:48:57 2017 +0000 chore(package): update sane to version 1.6.0 https://greenkeeper.io/ commit 31fe1f92ae78203e96dfe50dcde711767d816cce Author: Greg Hurrell Date: Tue Feb 21 00:04:33 2017 +0100 Freshen yarn.lock commit a33619e624963f84244eece4eb12b9e8c9b71955 Merge: f7b94d15 1aea0064 Author: Greg Hurrell Date: Tue Feb 21 00:03:57 2017 +0100 Merge pull request #724 from graphql/greenkeeper/eslint-3.16.0 Update eslint to the latest version 🚀 commit 1aea0064662913355382ac47c1df34c98376f5c8 Author: greenkeeper[bot] Date: Mon Feb 20 16:30:01 2017 +0000 chore(package): update eslint to version 3.16.0 https://greenkeeper.io/ commit f7b94d155e62af5c4ae4f3970e5388768f5180bc Merge: 56e82407 44a2cff1 Author: Greg Hurrell Date: Thu Feb 16 12:47:48 2017 -0800 Merge pull request #717 from wincent/glh/degrade-to-warn Soften name validation warnings to avoid CI issues commit 44a2cff1a5abd33c16222848bc1cad470777535a Author: Greg Hurrell Date: Thu Feb 16 11:40:37 2017 -0800 Note that failing dunderscore name validation will become a hard error To adequately serve as a deprecation warning, the message should provide advance notice that it non-compliance will eventually become a hard error. I haven't put a version number in there yet because I don't know which version it will happen in. Once we make that call we should make the message more precise. commit 37d4521795646c82899e85544075c5c1aaada8ee Author: Greg Hurrell Date: Thu Feb 16 11:36:38 2017 -0800 Avoid "Error:" text in advisory warnings This goes a step further than the parent commit, which downgrades `console.error` to `console.warn` for cases that are really just advisory "deprecation" warnings for non-compliant schemas. The motivation in that commit was preventing CI failures stemming from use of `console.error`. That may not be enough though, because on some JS engines (notably Chrome/Node), "Error: " still appears in the output thanks to our use of `Error` objects to get stack traces. Depending on how the CI is set-up, that could also be enough to spuriously fail the run. So in this commit, we add a `formatWarning` helper that takes the `Error` object and grooms it for use as a human-readable warning message. Added tests to capture and verify the different engine behaviors. commit c38a8a1d2a4ca42aa87dbfd3abb5f23fbf3eff0d Author: Greg Hurrell Date: Thu Feb 16 09:31:39 2017 -0800 Use console.warn in name validation In fe346190671c4ad0d666e8eef we degraded the hard error (ie. a `throw`) for non-compliant field names (ie. starting with `__`) to a `console.error`. We've found, however, that certain CI systems will treat the use of `console.error` as a cause for failure, and our intent here is not to block what would otherwise be a valid test run. Switch to `console.warn` instead. Eventually in a later release this will become a hard error, but for now continuing to treat this like a "deprecation" and just warn is appropriate. commit 56e82407095186b6f1dae816621d64fe64323e8a Author: Greg Hurrell Date: Mon Feb 13 21:08:46 2017 -0800 Freshen yarn.lock commit 9d9919b8ed14424f64436562bab04d5288427dc5 Merge: 5aaa7a13 1a0fe4ca Author: Greg Hurrell Date: Mon Feb 13 21:07:58 2017 -0800 Merge pull request #714 from graphql/greenkeeper/babel-plugin-transform-object-rest-spread-6.23.0 Update babel-plugin-transform-object-rest-spread to the latest version 🚀 commit 5aaa7a13474c5b1ae88697f65fd157534fee86b3 Merge: 110423d1 24275a6b Author: Greg Hurrell Date: Mon Feb 13 21:07:45 2017 -0800 Merge pull request #713 from graphql/greenkeeper/babel-plugin-transform-es2015-destructuring-6.23.0 Update babel-plugin-transform-es2015-destructuring to the latest version 🚀 commit 1a0fe4cacfb701cbd37b678c2a165e8fe5204330 Author: greenkeeper[bot] Date: Tue Feb 14 01:15:07 2017 +0000 chore(package): update babel-plugin-transform-object-rest-spread to version 6.23.0 https://greenkeeper.io/ commit 24275a6b7f96e2ae6edfd4c3d19f1e1addb5369f Author: greenkeeper[bot] Date: Tue Feb 14 01:14:47 2017 +0000 chore(package): update babel-plugin-transform-es2015-destructuring to version 6.23.0 https://greenkeeper.io/ commit 110423d12040e129c35d81b7b167ff2680e53b8b Author: Greg Hurrell Date: Fri Feb 10 20:21:41 2017 -0800 Freshen yarn.lock commit 1a36c13f9856f97c7ecfc91bf06464881b0225c8 Merge: 578c76ce 5f777b22 Author: Greg Hurrell Date: Fri Feb 10 20:20:18 2017 -0800 Merge pull request #712 from graphql/greenkeeper/flow-bin-0.39.0 Update flow-bin to the latest version 🚀 commit 5f777b220b5a3be9e1b8bacd5ff7da6245a62a62 Author: greenkeeper[bot] Date: Fri Feb 10 19:00:42 2017 +0000 chore(package): update flow-bin to version 0.39.0 https://greenkeeper.io/ commit 578c76cee55a8677e2c3fb39563ea441d053fb51 Author: Greg Hurrell Date: Thu Feb 9 10:31:10 2017 -0800 Correct a code comment Description got stale over the evolution of the PR: https://github.com/graphql/graphql-js/pull/701 commit 361bd8722719261c86d06a992c20bc6996f4a810 Author: Joel Griffith Date: Thu Feb 9 10:29:49 2017 -0800 `findBreakingChanges` handles args (#701) * Adding in findArgsRemovedFromTypes and tests * Adding in more test cases and breaking argument changes * Removing unused assignment * Fixing flow woes, type issues * PR feedback * Adding in findArgsRemovedFromTypes and tests * Adding in more test cases and breaking argument changes * Removing unused assignment * Fixing flow woes, type issues * PR feedback * New top-level export findDangerousChanges and test/flow updates commit b948b25b80162c7a91789b0d1a4999bfa67e24ad Merge: 21b34a30 f8010893 Author: Lee Byron Date: Tue Feb 7 11:03:07 2017 -0800 Merge pull request #710 from schaitoff/master Improve perf of separateOperations commit f8010893ea49efa400e3332fc591f7e4d6aa5840 Author: Lee Byron Date: Mon Feb 6 20:16:27 2017 -0800 semi commit 36ea2babac8bcee1be68f1481668d52926000b5d Author: Lee Byron Date: Mon Feb 6 20:06:09 2017 -0800 Use a Map for original indices commit ae96377d1ff55e46bc2d5985c258f0e218ffe1b5 Author: Steven Chaitoff Date: Mon Feb 6 14:14:58 2017 -0500 Improve perf of separateOperations commit 21b34a3057f6968da469160558cdd1d8534a84d8 Author: Greg Hurrell Date: Sun Feb 5 12:57:47 2017 -0800 Freshen yarn.lock commit 0d529ae322fcf61f024df02deb6f844e850945e5 Author: greenkeeper[bot] Date: Sun Feb 5 12:57:08 2017 -0800 chore(package): update coveralls to version 2.11.16 (#707) https://greenkeeper.io/ commit c6ffce1d76823063640b0af00dbef67b6aa28116 Author: Greg Hurrell Date: Fri Feb 3 14:29:32 2017 -0800 Freshen yarn.lock commit 91bb198a8cebb8b13cf7e5f20153a144003b7fdd Merge: e133a567 47871ba8 Author: Greg Hurrell Date: Fri Feb 3 14:27:15 2017 -0800 Merge pull request #705 from graphql/greenkeeper/eslint-3.15.0 Update eslint to the latest version 🚀 commit 47871ba80a3ed0738319f0407d859077893ef713 Author: greenkeeper[bot] Date: Fri Feb 3 21:58:17 2017 +0000 chore(package): update eslint to version 3.15.0 https://greenkeeper.io/ commit e133a567d50a356e4732035a068baccf3c5a2dd3 Merge: d052f659 c6440342 Author: Robert Zhu Date: Wed Feb 1 11:19:56 2017 -0500 Merge pull request #702 from cesarandreu/improve-error-message Improved error message for undefined field config commit c64403421e99fd80d7f4d7cf91c537d002d32740 Author: Cesar Andreu Date: Wed Feb 1 04:46:45 2017 -0800 Improved error message for undefined field config commit d052f6597b88eae1c06b3c9a7c74434878dde902 Merge: 88b8098f 77fbd728 Author: Lee Byron Date: Fri Jan 27 15:08:40 2017 -0800 Merge pull request #699 from graphql/thenable RFC: More flow-friendly thenable checking. commit 77fbd728bd7fa0d3aada37c2a8e814f013d58bfa Author: Lee Byron Date: Fri Jan 27 13:44:33 2017 -0800 RFC: More flow-friendly thenable checking. This replaces the isThenable boolean check with a "getIfPromise" function. It's essentially the same, but rather than returning boolean, it's the identify function when it would have returned true, and returns void otherwise. That lets us give it a better type signature that Flow can do more with. Open to feedback on this one, and open to bikeshedding on the name of this new function. commit 88b8098f6a9d8824117a7d0caac004b618e09abb Merge: bd15d530 12b2137f Author: Lee Byron Date: Fri Jan 27 14:33:22 2017 -0800 Merge pull request #697 from graphql/is-leaf Fix: isLeafType matches type definition. commit bd15d530351c536a0006ac746bf0334a16a06cdc Merge: 8122ba7f d163d561 Author: Lee Byron Date: Fri Jan 27 14:33:15 2017 -0800 Merge pull request #698 from graphql/type-info-safe Fix: Type safety for TypeInfo. commit d163d561887d03252bc7b4dd6e1df13ffaaf6f93 Author: Lee Byron Date: Fri Jan 27 13:24:05 2017 -0800 Fix: Type safety for TypeInfo. Previously we just coerce these values to the expected types, record them and carry on. However that is not safe and results in TypeInfo potentially returning invalid types when traversing an invalid query. This instead checks the type before inserting it, upholding type safety. There was one validator which was taking advantage of the unsafe behavior, so I re-wrote it slightly to be type safe. commit 12b2137f8a0b1a72752b5ee54660127a5a042a33 Author: Lee Byron Date: Fri Jan 27 13:14:49 2017 -0800 Fix: isLeafType matches type definition. This was ambiguous before. Other isCompositeType / isAbstractType checks below do not include named type unwrapping, and it did not match the type definition above. Only one callsite actually relied on named type unwrapping, so moved this check there. commit 8122ba7f6fddbb2b0de9653b9d935cb2aec77be2 Author: Lee Byron Date: Thu Jan 26 13:23:46 2017 -0800 0.9.1 commit 80f5ecb23a88693d22d3735fc3bdf45babc03b87 Merge: 024f9f7c fe346190 Author: Lee Byron Date: Thu Jan 26 13:22:49 2017 -0800 Merge pull request #692 from graphql/dunder-warn Convert error to warning for non-compliant use of __ commit fe346190671c4ad0d666e8eef08da55f85dc7565 Author: Lee Byron Date: Thu Jan 26 12:45:53 2017 -0800 Convert error to warning for non-compliant use of __ This unbreaks various uses of graphql-js which were defining fields with __ while retaining some form of reporting warning for non-compliant use. Fixes #690 commit 024f9f7cfefdde00c9f8a3d3ff97bc3f1c481d83 Merge: 47c2ba62 080e281f Author: Lee Byron Date: Thu Jan 26 12:56:39 2017 -0800 Merge pull request #693 from graphql/fix-reserved-properties Quotes reserved literals when used in properties. commit 080e281f97470a309be70e5edbc9bf5107bc4e21 Author: Lee Byron Date: Thu Jan 26 12:53:49 2017 -0800 Quotes reserved literals when used in properties. This is primarily getting hit when using graphql-js in weird or old environments where ES6 exports end up using `default` a bunch. Better safe. commit 47c2ba62661ebbbfae7922728978e03c53b08c86 Merge: 43cd3bb1 04eed8e6 Author: Robert Zhu Date: Wed Jan 25 15:46:40 2017 -0500 Merge pull request #691 from graphql/greenkeeper/eslint-3.14.1 Update eslint to the latest version 🚀 commit 04eed8e6bc77073bc88287934b24246cbbe2b36f Author: greenkeeper[bot] Date: Wed Jan 25 18:51:37 2017 +0000 chore(package): update eslint to version 3.14.1 https://greenkeeper.io/ commit 43cd3bb10778d4f547f551fb73924cf314b7572f Author: Lee Byron Date: Tue Jan 24 12:31:56 2017 -0800 0.9.0 commit e7b4bc760a6747592a353cc01d55e6b74555f243 Author: Lee Byron Date: Tue Jan 24 12:15:35 2017 -0800 Update dependencies commit 5b26da9e0d9d578527a09c645edac8f8487ae64e Author: Lee Byron Date: Tue Jan 24 12:13:42 2017 -0800 Improve type definitions commit 15d2184b0aa81258a0fab34acf9606f809095e16 Merge: 7064b9d2 0417aad2 Author: Lee Byron Date: Tue Jan 24 12:06:18 2017 -0800 Merge pull request #631 from dherault/master Allow `isTypeOf` and `resolveType` to return a Promise commit 0417aad2129c4c31ceb9eafe00a783fdc62fb654 Author: Lee Byron Date: Tue Jan 24 12:02:09 2017 -0800 Simplify default resolver function commit a3c746c511c88ca8a36d8fba313226dea2c3d5e9 Author: Lee Byron Date: Tue Jan 24 11:45:54 2017 -0800 Factor out checking isTypeOf from subfield exe More single-purpose functions commit 9239253b2e4968b729822ddc854be728e7a80048 Author: Lee Byron Date: Fri Jan 20 15:09:11 2017 -0800 Pass lint & flow commit c53efbe83c6e3a922c423e7dc5c43f94e84f38f0 Author: Lee Byron Date: Fri Jan 20 14:28:58 2017 -0800 Missing comma commit b40d427864a848a6d95cf9dc89885501f56c126a Author: Lee Byron Date: Fri Jan 20 14:23:31 2017 -0800 Fix completeObjectValue call bug commit 1fb45d3e2e2be9a9cd41f78293e6adf5213f407d Author: Lee Byron Date: Fri Jan 20 14:21:53 2017 -0800 Factor out runtime type validation Moves runtime type validation to its own function. commit 1305360bb13d7d5dea73f5f8a31ecd6516c8c10c Author: Lee Byron Date: Fri Jan 20 14:08:14 2017 -0800 Reduce scope Just reverts a few unrelated parts of the change commit 7064b9d27cc677b714098d3851ba1daa2fca1043 Merge: d1f586e1 305a1a0a Author: Lee Byron Date: Fri Jan 20 13:47:07 2017 -0800 Merge pull request #675 from robzhu/master Validate Input Types do not define resolvers commit d1f586e177220a3f1d8d2f8a1ffaef034d77cdc0 Merge: 3a53f25c 063148de Author: Lee Byron Date: Fri Jan 20 13:44:59 2017 -0800 Merge pull request #676 from graphql/find-deprecated findDeprecatedUsages() commit 3a53f25cfbb16713892676f350baed76276e213e Author: Greg Hurrell Date: Fri Jan 20 12:19:56 2017 -0800 Freshen yarn.lock commit d7d6110bd826098415c520e365aba81b5cd94d16 Merge: a72408ee c1a8b968 Author: Greg Hurrell Date: Fri Jan 20 12:19:14 2017 -0800 Merge pull request #686 from graphql/greenkeeper/babel-cli-6.22.2 chore(package): update babel-cli to version 6.22.2 commit c1a8b96822f832c75df99ac3902761b97dd61832 Author: greenkeeper[bot] Date: Fri Jan 20 06:05:10 2017 +0000 chore(package): update babel-cli to version 6.22.2 Closes #679 https://greenkeeper.io/ commit a72408ee6f456f679b1182787299da21db534584 Author: Greg Hurrell Date: Thu Jan 19 17:12:14 2017 -0800 Freshen yarn.lock commit 1ad500801b48769ad0d66e6b44215b5e9dc256b7 Merge: e69509a8 1f89956a Author: Greg Hurrell Date: Thu Jan 19 17:02:31 2017 -0800 Merge pull request #683 from graphql/greenkeeper/babel-plugin-transform-es2015-template-literals-6.22.0 Update babel-plugin-transform-es2015-template-literals to the latest version 🚀 commit e69509a8644e57aa39948c0a1fe40310004eda3b Merge: 52dab215 e141ca0f Author: Greg Hurrell Date: Thu Jan 19 17:00:18 2017 -0800 Merge pull request #682 from graphql/greenkeeper/babel-plugin-transform-es2015-function-name-6.22.0 Update babel-plugin-transform-es2015-function-name to the latest version 🚀 commit 52dab215f779cf176827094c78b13d94737f39fa Merge: ae17491d f7cf7231 Author: Greg Hurrell Date: Thu Jan 19 16:56:00 2017 -0800 Merge pull request #681 from graphql/greenkeeper/babel-plugin-transform-class-properties-6.22.0 Update babel-plugin-transform-class-properties to the latest version 🚀 commit ae17491d812472acb22e7638c9e6d3f77ca379ed Merge: 383d83c6 373007fa Author: Greg Hurrell Date: Thu Jan 19 16:50:59 2017 -0800 Merge pull request #680 from graphql/greenkeeper/babel-plugin-check-es2015-constants-6.22.0 Update babel-plugin-check-es2015-constants to the latest version 🚀 commit 1f89956ac41e6062bfc446821b168089e71ab2dc Author: greenkeeper[bot] Date: Fri Jan 20 00:39:10 2017 +0000 chore(package): update babel-plugin-transform-es2015-template-literals to version 6.22.0 https://greenkeeper.io/ commit e141ca0ff30f3247a8e4d65b0ad352f6cfde3969 Author: greenkeeper[bot] Date: Fri Jan 20 00:38:11 2017 +0000 chore(package): update babel-plugin-transform-es2015-function-name to version 6.22.0 https://greenkeeper.io/ commit f7cf7231dd0f1f6aa5db36703e0a2fbe971c9386 Author: greenkeeper[bot] Date: Fri Jan 20 00:37:20 2017 +0000 chore(package): update babel-plugin-transform-class-properties to version 6.22.0 https://greenkeeper.io/ commit 373007fa28a5794516ee59d4c47144231beeeb62 Author: greenkeeper[bot] Date: Fri Jan 20 00:36:38 2017 +0000 chore(package): update babel-plugin-check-es2015-constants to version 6.22.0 https://greenkeeper.io/ commit 383d83c6aa6ccaebcda9229b741e4b268704f78b Merge: 5cf4cef6 9598f1a9 Author: Greg Hurrell Date: Thu Jan 19 16:07:45 2017 -0800 Merge pull request #678 from wincent/glh/fresh Freshen yarn.lock commit 9598f1a976e4cc2c53be9fabf8beb85a5a04e344 Author: Greg Hurrell Date: Thu Jan 19 16:00:58 2017 -0800 Freshen yarn.lock commit 063148de039b02670a760b8d3dfaf2a04a467169 Author: Lee Byron Date: Thu Jan 19 14:14:35 2017 -0800 findDeprecatedUsages() This adds a utility for finding field and enum deprecation usages. The function signature is very similar to validation which should make using it easy where validation is already being used in a reporting flow. Closes #389 commit 305a1a0a9211c071f0df8e189956160b42043543 Author: Robert Zhu Date: Thu Jan 19 16:23:03 2017 -0500 Validate Input Types do not define resolvers commit 5cf4cef688e115e08d9f53efba07bea174ec4446 Merge: 1f93cf43 3ac1bc1a Author: Robert Zhu Date: Thu Jan 19 15:16:59 2017 -0500 Merge pull request #669 from robzhu/master Add resolver validation, check if value is a function commit 3ac1bc1a1d421eb481aa8a0f8def9dc6ef2f65d5 Author: Robert Zhu Date: Thu Jan 19 15:12:43 2017 -0500 Update eslintrc to allow smart '== null' commit 1f93cf437c7c0647848e8489b93c4b4bbddabf70 Merge: 769be7c3 728f4d63 Author: Lee Byron Date: Wed Jan 18 16:36:31 2017 -0800 Merge pull request #674 from graphql/enum-value TypeInfo.getEnumValue() and EnumType.getValue(name) commit 769be7c32b3b508d3b51b110452b91b1eebfc0b7 Merge: 9215a89f 7a21737c Author: Lee Byron Date: Wed Jan 18 16:32:30 2017 -0800 Merge pull request #673 from graphql/greenkeeper/eslint-plugin-babel-4.0.1 Update eslint-plugin-babel to the latest version 🚀 commit 728f4d63acca6b67c6f240a6cea9838c9cb258ea Author: Lee Byron Date: Wed Jan 18 16:15:46 2017 -0800 TypeInfo.getEnumValue() and EnumType.getValue(name) This adds two new APIs to the schema utilities. One is for `TypeInfo` which is typically used alongside an AST visitor - now you can call `getEnumValue()` to get the GraphQLEnumValue instance referred to by the EnumValue ast node under visit. Also, `EnumType.getValue(name)` accepts the name of an enum value and returns the GraphQLEnumValue instance associated with it. Beats running a `getValues().find(...)`. commit 7a21737ce3af220cfb696530deb79d21711890f1 Author: greenkeeper[bot] Date: Wed Jan 18 23:03:53 2017 +0000 chore(package): update eslint-plugin-babel to version 4.0.1 https://greenkeeper.io/ commit 9215a89fe867dadc8a78e1c644aad67144a801c4 Merge: c7f64bca 2646f4af Author: Robert Zhu Date: Wed Jan 18 11:05:24 2017 -0500 Merge pull request #671 from gabelevi/flow Update to flow v0.38.0 commit 2646f4af2cb1523ec44121b26bb3a3040530d7b5 Author: Gabe Levi Date: Wed Jan 18 15:16:57 2017 +0000 Update to flow v0.38.0 commit d77f6a52efffc42f1eb8e486ba3209f5370ed23e Author: Robert Zhu Date: Tue Jan 17 18:26:00 2017 -0500 Validate resolver definition is a function commit c7f64bca91fcfef1decb78db2ceb3f3b74605087 Merge: 29c34535 35d4789a Author: Robert Zhu Date: Tue Jan 17 16:07:22 2017 -0500 Merge pull request #665 from graphql/greenkeeper/eslint-plugin-flowtype-2.30.0 Update eslint-plugin-flowtype to the latest version 🚀 commit 35d4789abd0e29e22eeec45d98a484edda688ce2 Author: greenkeeper[bot] Date: Sun Jan 15 16:23:54 2017 +0000 chore(package): update eslint-plugin-flowtype to version 2.30.0 https://greenkeeper.io/ commit 29c345352efbb2d541a2a17b0f778a3f44bc9d20 Merge: 9fadc2ab 357f7c0c Author: Robert Zhu Date: Thu Jan 12 10:52:42 2017 -0500 Merge pull request #663 from helfer/patch-1 Fix typo in buildASTSchema commit 357f7c0cd028e5787db966345f5d3de9a240ac42 Author: Jonas Helfer Date: Wed Jan 11 19:41:54 2017 +0800 Fix typo in buildASTSchema commit 9fadc2ab1f1874f7863becfc9b075b9e15c1b386 Merge: 012ced6d edb71d15 Author: Robert Zhu Date: Tue Jan 10 10:42:10 2017 -0500 Merge pull request #661 from graphql/greenkeeper/eslint-3.13.1 Update eslint to the latest version 🚀 commit edb71d1597e204873a3fb469553e69756c93ec84 Author: greenkeeper[bot] Date: Mon Jan 9 22:21:57 2017 +0000 chore(package): update eslint to version 3.13.1 https://greenkeeper.io/ commit 012ced6d44ecdb62cacfcd7a0c94899808b3409f Merge: c09f0abb 941bbce4 Author: Robert Zhu Date: Sat Jan 7 16:20:36 2017 -0500 Merge pull request #659 from graphql/greenkeeper/eslint-3.13.0 Update eslint to the latest version 🚀 commit 941bbce459e5bc32f3867f41be88536020676ff4 Author: greenkeeper[bot] Date: Fri Jan 6 20:43:17 2017 +0000 chore(package): update eslint to version 3.13.0 https://greenkeeper.io/ commit ae5295a2d3b3b19aa3e45129ac1a18b163ca9aea Author: David Hérault Date: Thu Jan 5 11:41:02 2017 +0100 apply PR requested changes commit c09f0abb11c38c12159218b4d60e37a752f49dc9 Merge: b639fb0b 0534376c Author: Lee Byron Date: Wed Jan 4 17:37:16 2017 -0800 Merge pull request #655 from graphql/greenkeeper/flow-bin-0.37.4 chore(package): update flow-bin to version 0.37.4 commit 0534376c9f6c2fdc39d44c9cad4c745503e67e25 Merge: ecb1c252 b639fb0b Author: Lee Byron Date: Wed Jan 4 17:26:32 2017 -0800 Merge branch 'master' into greenkeeper/flow-bin-0.37.4 commit b639fb0bb052b172edca62c4d34cb8327d249939 Merge: 871796a1 31fbe174 Author: Lee Byron Date: Wed Jan 4 17:25:47 2017 -0800 Merge pull request #641 from graphql/greenkeeper/flow-bin-0.37.1 Update flow-bin to the latest version 🚀 commit 871796a1713fe9874835ab26f7096dbc662296db Merge: 3cb4ceae eb359d69 Author: Lee Byron Date: Wed Jan 4 17:24:36 2017 -0800 Merge pull request #644 from Urigo/circ-dep-fix chore(circ-dep): fixed circular dependancies commit 31fbe1745eb31db582b55e953c2da652c7d89b5c Merge: 89406509 3cb4ceae Author: Robert Zhu Date: Thu Dec 29 10:29:18 2016 -0500 Merge branch 'master' into greenkeeper/flow-bin-0.37.1 commit 3cb4ceaeaa14b8f96d1c2f0b830222e3ab16cf60 Merge: faa0e1cf 6766eb52 Author: Robert Zhu Date: Thu Dec 29 10:28:22 2016 -0500 Merge pull request #648 from graphql/greenkeeper/chai-subset-1.4.0 Update chai-subset to the latest version 🚀 commit faa0e1cfd845fa345e8ec4eb4ad9e28171667faf Merge: 1ac1094c a88dc144 Author: Robert Zhu Date: Thu Dec 29 10:28:08 2016 -0500 Merge pull request #645 from graphql/greenkeeper/sane-1.5.0 Update sane to the latest version 🚀 commit 1ac1094c850de7def87e5521aa293ad0585139e6 Merge: bb7cd7c3 2650ed51 Author: Robert Zhu Date: Thu Dec 29 10:26:06 2016 -0500 Merge pull request #651 from graphql/greenkeeper/eslint-plugin-flowtype-2.29.2 Update eslint-plugin-flowtype to the latest version 🚀 commit 2650ed51ab2d466146485de499976e268db4a1b1 Author: greenkeeper[bot] Date: Thu Dec 29 12:02:33 2016 +0000 chore(package): update eslint-plugin-flowtype to version 2.29.2 https://greenkeeper.io/ commit 6766eb52ba2fe3b4998ca445c405cd39238a95fe Author: greenkeeper[bot] Date: Mon Dec 26 09:06:07 2016 +0000 chore(package): update chai-subset to version 1.4.0 https://greenkeeper.io/ commit a88dc144eacc492aeee2782586fe2b76c52754ab Author: greenkeeper[bot] Date: Sat Dec 24 07:19:35 2016 +0000 chore(package): update sane to version 1.5.0 https://greenkeeper.io/ commit 7d4cd4b8d2808eaacae24d764e8970ec45d81be0 Author: David Hérault Date: Fri Dec 23 10:37:47 2016 +0100 allow fully sync abstract type resolution commit 164cd3146296ae4bb514502fbb05583b802c0451 Author: David Hérault Date: Fri Dec 23 10:33:16 2016 +0100 edit flow types commit 036e4676f76c306c1d0098a8a3f5a4dbdd330c7e Author: David Hérault Date: Thu Dec 15 15:39:44 2016 +0100 add more tests commit 458383449648e9658b16041f1449c159696185a8 Author: David Hérault Date: Thu Dec 15 15:08:52 2016 +0100 promisify isTypeOf and resolveType commit c75f74ad74623e97091f8ecd09c331b67cc0ba37 Author: David Hérault Date: Thu Dec 15 12:38:10 2016 +0100 add failing tests commit eb359d694155ba22e13916167fbbcde36ad823e0 Author: urigo Date: Wed Dec 21 14:53:59 2016 +0200 chore(circ-dep): fixed circular dependancies commit ecb1c252721737ad9de5c44fed670b087ce0fd7b Author: greenkeeper[bot] Date: Wed Dec 21 04:56:40 2016 +0000 chore(package): update flow-bin to version 0.37.4 Closes #641 https://greenkeeper.io/ commit 89406509ceb3c989c13ddd7d96afee3bc209a268 Author: greenkeeper[bot] Date: Mon Dec 19 17:39:31 2016 +0000 chore(package): update flow-bin to version 0.37.1 https://greenkeeper.io/ commit bb7cd7c3324e2891dd051e0b6436957241f519f2 Author: Greg Hurrell Date: Fri Dec 16 15:40:40 2016 -0800 Update yarn.lock commit 6b32cf0f365d7be9bece9a46eb7c0eb8a229673b Merge: d2efb617 710555d6 Author: Greg Hurrell Date: Fri Dec 16 15:39:31 2016 -0800 Merge pull request #635 from graphql/greenkeeper/babel-plugin-transform-flow-strip-types-6.21.0 Update babel-plugin-transform-flow-strip-types to the latest version 🚀 commit d2efb617e2fd038441612a7919db57fd8169bdcb Merge: fb8b8ed6 ca4e4118 Author: Greg Hurrell Date: Fri Dec 16 15:39:12 2016 -0800 Merge pull request #636 from graphql/greenkeeper/babel-plugin-transform-regenerator-6.21.0 Update babel-plugin-transform-regenerator to the latest version 🚀 commit fb8b8ed60ad8468533aa6f8c9d90e88147c6b568 Merge: 8dc97910 a4ab91ce Author: Greg Hurrell Date: Fri Dec 16 15:39:04 2016 -0800 Merge pull request #634 from graphql/greenkeeper/babel-plugin-transform-es2015-parameters-6.21.0 Update babel-plugin-transform-es2015-parameters to the latest version 🚀 commit 8dc97910868939637e409e62bf00883083226248 Merge: 76db7a1d f75c983d Author: Greg Hurrell Date: Fri Dec 16 15:38:57 2016 -0800 Merge pull request #633 from graphql/greenkeeper/babel-plugin-transform-es2015-block-scoping-6.21.0 Update babel-plugin-transform-es2015-block-scoping to the latest version 🚀 commit ca4e4118249f1d39a9f99e80ed4aae5607cf28b7 Author: greenkeeper[bot] Date: Fri Dec 16 21:57:04 2016 +0000 chore(package): update babel-plugin-transform-regenerator to version 6.21.0 https://greenkeeper.io/ commit 710555d6ac5d4188f624457764c73433a4bf77f9 Author: greenkeeper[bot] Date: Fri Dec 16 21:56:49 2016 +0000 chore(package): update babel-plugin-transform-flow-strip-types to version 6.21.0 https://greenkeeper.io/ commit a4ab91ce58ff9b361fc8c543ef560d8796241a4d Author: greenkeeper[bot] Date: Fri Dec 16 21:56:41 2016 +0000 chore(package): update babel-plugin-transform-es2015-parameters to version 6.21.0 https://greenkeeper.io/ commit f75c983da7bff5962a3ba8b56976d49055ec98d4 Author: greenkeeper[bot] Date: Fri Dec 16 21:56:32 2016 +0000 chore(package): update babel-plugin-transform-es2015-block-scoping to version 6.21.0 https://greenkeeper.io/ commit 76db7a1df3f7995a34464a2063a301194104cb88 Merge: 804aa323 51147014 Author: Lee Byron Date: Wed Dec 14 14:59:20 2016 -0800 Merge pull request #628 from graphql/greenkeeper/eslint-3.12.2 Update eslint to the latest version 🚀 commit 511470142cb708905f7c2d13cf21fc7f0d92b1b4 Author: greenkeeper[bot] Date: Wed Dec 14 19:24:30 2016 +0000 chore(package): update eslint to version 3.12.2 https://greenkeeper.io/ commit 804aa32354b7151afbde63616c73a4d89fd20a48 Merge: 34bf290f 1e90b35c Author: Lee Byron Date: Tue Dec 13 12:59:17 2016 -0800 Merge pull request #626 from graphql/greenkeeper/eslint-3.12.1 Update eslint to the latest version 🚀 commit 34bf290fec55ed5c9e71c46f8553a28712ef9ea6 Merge: 4a832566 8e4713ee Author: Lee Byron Date: Tue Dec 13 12:59:07 2016 -0800 Merge pull request #625 from graphql/greenkeeper/flow-bin-0.37.0 Update flow-bin to the latest version 🚀 commit 1e90b35c6826a33a4d1283689e276191c3d6f325 Author: greenkeeper[bot] Date: Mon Dec 12 22:26:43 2016 +0000 chore(package): update eslint to version 3.12.1 https://greenkeeper.io/ commit 8e4713eec05d4c7a713b5b49350229766c4de2f4 Author: greenkeeper[bot] Date: Mon Dec 12 22:17:13 2016 +0000 chore(package): update flow-bin to version 0.37.0 https://greenkeeper.io/ commit 4a832566c9eb5e1633ef0724b74e86039c148539 Merge: 5cfe7eef 91b4292e Author: Lee Byron Date: Fri Dec 9 16:48:56 2016 -0800 Merge pull request #615 from jonbretman/default-field-resolver-pass-info Pass GraphQLResolveInfo object to resolve functions in defaultFieldResolver commit 5cfe7eef0c2d671c2ba4e624f293a2321964d524 Merge: fd551f9d 36782596 Author: Lee Byron Date: Fri Dec 9 15:51:49 2016 -0800 Merge pull request #621 from graphql/yarnlock Add yarn.lock commit fd551f9d80b8c47d34e3a7585d18c1565d090241 Merge: 3d40f9c1 198841ca Author: Lee Byron Date: Fri Dec 9 15:28:37 2016 -0800 Merge pull request #602 from robzhu/master Catch TypeErrors in isValidJSValue commit 367825962b52ff29ebcef4e2b7d256bb76194e4e Author: Lee Byron Date: Fri Dec 9 15:22:58 2016 -0800 Add yarn.lock commit 198841cac9430ad14465f3520cb27d2780261171 Author: Lee Byron Date: Fri Dec 9 15:21:46 2016 -0800 Include expected type in error msg commit f8322a03f230d93a6174c576818579429c3f9194 Author: Lee Byron Date: Fri Dec 9 15:18:45 2016 -0800 Ensure no errors test finds no errors commit 3d40f9c1f36fdc1c85c6f6c2bb696028a338e2e8 Merge: d787c8fa 7df70eff Author: Lee Byron Date: Fri Dec 9 15:07:57 2016 -0800 Merge pull request #620 from graphql/greenkeeper/babel-plugin-transform-object-rest-spread-6.20.2 chore(package): update babel-plugin-transform-object-rest-spread@6.20.2 commit 7df70eff0d5048f8bf41badf6e1540feb8d535fc Merge: 5c83bf0e d787c8fa Author: Lee Byron Date: Fri Dec 9 15:00:12 2016 -0800 Merge branch 'master' into greenkeeper/babel-plugin-transform-object-rest-spread-6.20.2 commit d787c8faa98c1c0ce70d58f98621ebfe62e01bb6 Merge: 18db1d64 4322f9c7 Author: Lee Byron Date: Fri Dec 9 14:53:28 2016 -0800 Merge pull request #603 from graphql/greenkeeper/flow-bin-0.36.0 Update flow-bin to the latest version 🚀 commit 4322f9c76a468c47c4dae345361a3cc46400445b Merge: 887df34e 18db1d64 Author: Lee Byron Date: Fri Dec 9 14:21:57 2016 -0800 Merge branch 'master' into greenkeeper/flow-bin-0.36.0 commit 18db1d64639bd8a5682aec2c5dbc3dfdc8b04a21 Merge: 00c8c43e 4923286d Author: Lee Byron Date: Fri Dec 9 14:21:23 2016 -0800 Merge pull request #616 from graphql/greenkeeper/babel-plugin-transform-es2015-block-scoping-6.20.0 Update babel-plugin-transform-es2015-block-scoping to the latest version 🚀 commit 00c8c43e09cc012aa06556e0d26441c2f4d35558 Merge: 545c43d1 ac4b33be Author: Lee Byron Date: Fri Dec 9 14:21:05 2016 -0800 Merge pull request #618 from graphql/greenkeeper/babel-plugin-transform-regenerator-6.20.0 Update babel-plugin-transform-regenerator to the latest version 🚀 commit 545c43d12cfded199bfafabb194c256c10c41a57 Merge: 67cd6a5c dd667aa6 Author: Lee Byron Date: Fri Dec 9 14:20:53 2016 -0800 Merge pull request #619 from graphql/greenkeeper/eslint-3.12.0 Update eslint to the latest version 🚀 commit dd667aa621cab586fc60f9a71279f7b15f1b6c6a Author: greenkeeper[bot] Date: Fri Dec 9 16:55:21 2016 +0000 chore(package): update eslint to version 3.12.0 https://greenkeeper.io/ commit 5c83bf0ef1b6819a6de8fd7f4af7d1dd271392d6 Author: greenkeeper[bot] Date: Fri Dec 9 01:15:33 2016 +0000 chore(package): update babel-plugin-transform-object-rest-spread to version 6.20.2 Closes #617 https://greenkeeper.io/ commit ac4b33be51a893581bd264f5d7fdd8496871f879 Author: greenkeeper[bot] Date: Thu Dec 8 23:26:53 2016 +0000 chore(package): update babel-plugin-transform-regenerator to version 6.20.0 https://greenkeeper.io/ commit 4923286d980e3aae2bab0b55a09cb18f9407a42a Author: greenkeeper[bot] Date: Thu Dec 8 23:26:36 2016 +0000 chore(package): update babel-plugin-transform-es2015-block-scoping to version 6.20.0 https://greenkeeper.io/ commit 91b4292e4fd744e0e613324b5649fdf4de7542fc Author: Jon Bretman Date: Tue Dec 6 20:22:29 2016 +0000 Pass GraphQLResolveInfo object to resolve functions in defaultFieldResolver commit 67cd6a5c420fa12d6d54d89168c895256e15a28c Merge: ba422261 bfe9fc90 Author: Robert Zhu Date: Mon Dec 5 13:18:21 2016 -0500 Merge pull request #614 from jmurzy/master Make executor throw if no document is provided commit bfe9fc90a8377dbd2c5c0a3f2a978956d8c9ea39 Author: Jake Murzy Date: Sat Dec 3 22:44:13 2016 -0800 Make executor throw if no document is provided Currently, `buildExecutionContext` throws a null reference error `Cannot read property 'definitions' of null` when `document` is undefined. Instead, we should throw a friendlier error message for null documents. commit ba422261bfec5ad653a6812fab4718f4f22101c2 Merge: 97a1d33c a66a57ba Author: Robert Zhu Date: Thu Dec 1 18:06:09 2016 -0500 Merge pull request #613 from graphql/greenkeeper/eslint-plugin-flowtype-2.29.1 Update eslint-plugin-flowtype to the latest version 🚀 commit a66a57bafa3ae62b2bb3bcc4a542d4939c029914 Author: greenkeeper[bot] Date: Thu Dec 1 17:33:20 2016 +0000 chore(package): update eslint-plugin-flowtype to version 2.29.1 https://greenkeeper.io/ commit 97a1d33c414f65113791ac61548b12afa9f8d45e Merge: 140cd18c a5bc7c57 Author: Robert Zhu Date: Thu Dec 1 10:26:04 2016 -0500 Merge pull request #610 from graphql/greenkeeper/eslint-plugin-flowtype-2.26.0 Update eslint-plugin-flowtype to the latest version 🚀 commit 140cd18c1b1ecaa4ac7b49f4f99c2107f1ebb83b Merge: a7051bb6 3c4e4acc Author: Robert Zhu Date: Wed Nov 30 17:44:32 2016 -0500 Merge pull request #608 from graphql/greenkeeper/eslint-3.11.0 Update eslint to the latest version 🚀 commit a7051bb694ba27716ad3a29b82b6439ac00abf58 Merge: 36cd1622 4a6cb4bd Author: Robert Zhu Date: Wed Nov 30 17:44:12 2016 -0500 Merge pull request #606 from graphql/greenkeeper/mocha-3.2.0 Update mocha to the latest version 🚀 commit a5bc7c576678aa5b7b2a34f39634ce0a70e72c60 Author: greenkeeper[bot] Date: Sun Nov 27 11:27:02 2016 +0000 chore(package): update eslint-plugin-flowtype to version 2.26.0 https://greenkeeper.io/ commit 3c4e4acc0effc26055d79b0083fd85bf2e673fd2 Author: greenkeeper[bot] Date: Fri Nov 25 22:24:34 2016 +0000 chore(package): update eslint to version 3.11.0 https://greenkeeper.io/ commit 4a6cb4bd138bc4c754dc545f2eb2c786499b0438 Author: greenkeeper[bot] Date: Fri Nov 25 00:03:15 2016 +0000 chore(package): update mocha to version 3.2.0 https://greenkeeper.io/ commit 887df34e2752fa0aa82a7212f0b7010f221fec45 Author: greenkeeper[bot] Date: Thu Nov 24 01:05:42 2016 +0000 chore(package): update flow-bin to version 0.36.0 https://greenkeeper.io/ commit 91bca8b2eb4109c569d0ee4d1d07ca02aae7fab7 Author: Robert Zhu Date: Wed Nov 23 18:00:14 2016 -0500 Catch TypeErrors and return the message as part of the error array inside isValidJSValue commit 36cd1622cad12ff63b01752e09e4a274b48a9d7b Merge: 956fd925 2df77efa Author: Lee Byron Date: Tue Nov 22 16:14:45 2016 -0800 Merge pull request #581 from graphql/greenkeeper/babel-plugin-transform-class-properties-6.19.0 Update babel-plugin-transform-class-properties to the latest version 🚀 commit 956fd925743c862c44e3d3e941145c9e8ee9e36c Merge: 637b4c29 385b0262 Author: Lee Byron Date: Tue Nov 22 16:14:14 2016 -0800 Merge pull request #584 from graphql/greenkeeper/iterall-1.0.3 Update iterall to the latest version 🚀 commit 637b4c29cb712024eb391b3fd7bb195778d2a58a Merge: d4cb2b79 379a3084 Author: Lee Byron Date: Tue Nov 22 16:14:00 2016 -0800 Merge pull request #600 from graphql/fix-reserved-names FIX: Uphold spec for non-validation names not beginning with __ commit d4cb2b79bbd01a496abd0fb13e5edaea9f5b595b Merge: e0b095e5 3370592b Author: Lee Byron Date: Tue Nov 22 15:42:41 2016 -0800 Merge pull request #582 from graphql/greenkeeper/babel-plugin-transform-es2015-destructuring-6.19.0 Update babel-plugin-transform-es2015-destructuring to the latest version 🚀 commit e0b095e5607f7bda40009e493e05d6fe1f718ffc Merge: 56e3a53c 0a99a205 Author: Lee Byron Date: Tue Nov 22 15:42:15 2016 -0800 Merge pull request #583 from graphql/greenkeeper/babel-plugin-transform-object-rest-spread-6.19.0 Update babel-plugin-transform-object-rest-spread to the latest version 🚀 commit 56e3a53c08f221e8f7b5ac08deabfa3b02b8c90d Merge: 69c53c5e 00014374 Author: Lee Byron Date: Tue Nov 22 15:41:54 2016 -0800 Merge pull request #590 from graphql/greenkeeper/eslint-plugin-babel-4.0.0 Update eslint-plugin-babel to the latest version 🚀 commit 69c53c5e63c4ac00fd624e455df051f4d62f5278 Merge: 9d359b87 fedcde07 Author: Lee Byron Date: Tue Nov 22 15:41:27 2016 -0800 Merge pull request #592 from graphql/greenkeeper/babel-eslint-7.1.1 Update babel-eslint to the latest version 🚀 commit 379a3084392179d2cae92c211a4559f9836299c6 Author: Lee Byron Date: Tue Nov 22 15:38:19 2016 -0800 FIX: Uphold spec for non-validation names not beginning with __ The spec describing introspection (http://facebook.github.io/graphql/#sec-Naming-conventions) restricts naming non-introspection related artifacts starting with __. This enforces that specification. commit fedcde07a188810cb262a7229a6306d810e68f34 Author: greenkeeper[bot] Date: Thu Nov 17 23:00:13 2016 +0000 chore(package): update babel-eslint to version 7.1.1 https://greenkeeper.io/ commit 0001437434843788628495f1e677775b0cb5886a Author: greenkeeper[bot] Date: Thu Nov 17 21:48:04 2016 +0000 chore(package): update eslint-plugin-babel to version 4.0.0 https://greenkeeper.io/ commit 9d359b8719237f17d166ed3c5eb260b14b9b6e20 Merge: 30811fac f89b237f Author: Joseph Savona Date: Thu Nov 17 12:01:48 2016 -0800 Merge pull request #589 from jamesgorman2/master Add isNamedType and assertNamedType helpers commit f89b237f179df315a1426179a646759f61e4cf0a Author: James Gorman Date: Fri Nov 18 06:24:40 2016 +1100 Add isNamedType and assertNamedType helpers commit 385b0262d2309eabad8b22c1d9a71b1a4a530259 Author: greenkeeper[bot] Date: Thu Nov 17 00:13:56 2016 +0000 fix(package): update iterall to version 1.0.3 https://greenkeeper.io/ commit 0a99a205aae2057d9a13fb9f2454cf3eb92818e2 Author: greenkeeper[bot] Date: Wed Nov 16 16:16:25 2016 +0000 chore(package): update babel-plugin-transform-object-rest-spread to version 6.19.0 https://greenkeeper.io/ commit 3370592b15290f06c3496113b7c284b6179729f7 Author: greenkeeper[bot] Date: Wed Nov 16 16:16:03 2016 +0000 chore(package): update babel-plugin-transform-es2015-destructuring to version 6.19.0 https://greenkeeper.io/ commit 2df77efa0fa360eb6c013d2cb9427b8a294e3c38 Author: greenkeeper[bot] Date: Wed Nov 16 16:15:44 2016 +0000 chore(package): update babel-plugin-transform-class-properties to version 6.19.0 https://greenkeeper.io/ commit 30811fac78f122e75bd7282062ca1845b83de07a Author: Lee Byron Date: Tue Nov 15 18:02:49 2016 -0800 0.8.2 commit b5c2b5e31587b696f2eb10cff51458bc85d8eb87 Merge: 1fc43c3e 59a6172c Author: Lee Byron Date: Tue Nov 15 17:55:19 2016 -0800 Merge pull request #579 from graphql/type-test Flow type tests & reorganize commit 59a6172c316ce4caad35b35284b9f0cd6b7bef31 Author: Lee Byron Date: Tue Nov 15 17:43:21 2016 -0800 Flow type tests & reorganize This cleans up the top level tests and flow-types them. It also moved one unrelated test into a more appropriate location. Inspired by #425 commit 1fc43c3e3626e18853de6de9be222a4ef5d23ec2 Merge: d7eb8899 c812b85c Author: Lee Byron Date: Tue Nov 15 16:55:33 2016 -0800 Merge pull request #578 from graphql/inspect-methods Implement toJSON and inspect on all types. commit c812b85c6dc80d4808f07be56dce35a84dd1faae Author: Lee Byron Date: Tue Nov 15 16:13:25 2016 -0800 Implement toJSON and inspect on all types. This adds toJSON() and inspect() methods on all types which shares the same function as toString(). This means that converting a GraphQL type to JSON or inspecting it with console.log (in Node) will produce something more meaningful than the implementation details of the type. Closes #568 commit d7eb88998ce86795427e409e68276694d7ffe0ff Merge: 7eae7aa5 9f068285 Author: Lee Byron Date: Tue Nov 15 16:00:29 2016 -0800 Merge pull request #577 from graphql/type-args-any Type field arg values as "any" commit 9f0682850d83ea279c310c01d68b5e866cb98347 Author: Lee Byron Date: Tue Nov 15 15:53:33 2016 -0800 Type field arg values as "any" This changes the flow types from an object of mixed values to an object of any values. This is explicitly less type safe, however is way more ergonomic and better matches the previous behavior before flow types were exported. This was suggested in #554 and partially implements #574 commit 7eae7aa5a1063b3e32c9a2fcacc410d25b9d1910 Merge: d07127d8 6dbc12ec Author: Lee Byron Date: Tue Nov 15 15:46:58 2016 -0800 Merge pull request #575 from graphql/more-context-type Add TContext to type resolvers commit d07127d8a14c469ffbab5053dcbf3308e5f02b46 Merge: 914dde29 39bc72ea Author: Lee Byron Date: Tue Nov 15 15:38:47 2016 -0800 Merge pull request #572 from graphql/greenkeeper/eslint-3.10.2 Update eslint to the latest version 🚀 commit 6dbc12ecb8a8ebc5e7e5e3863083816111699b20 Author: Lee Byron Date: Tue Nov 15 15:38:02 2016 -0800 Add TContext to type resolvers Part of #574 commit 914dde29098425df45cee95b6feb81b9fed97edb Merge: 1af8e9ba 3450c464 Author: Lee Byron Date: Tue Nov 15 15:37:14 2016 -0800 Merge pull request #573 from graphql/context-type Add TContext to field resolvers commit 39bc72eaf30095365b24632af01369a9da4073aa Author: greenkeeper[bot] Date: Tue Nov 15 23:22:05 2016 +0000 chore(package): update eslint to version 3.10.2 https://greenkeeper.io/ commit 3450c464b702b9efa03aaf5058184e136fe434c7 Author: Lee Byron Date: Tue Nov 15 15:00:47 2016 -0800 Add TContext to field resolvers This adds additional type information to field resolvers, such that source and context get slightly more appropriate types. This partially improves one of the issues raised in #554 commit 1af8e9ba4258e527ffc0aaccd5c52ea69e8be452 Author: Lee Byron Date: Tue Nov 15 14:29:24 2016 -0800 Minor error message clarity Follow up to #570 commit b7ea84550e5db27f8638353a4e8c654be6347d7c Merge: 63759482 e8b71674 Author: Joseph Savona Date: Tue Nov 15 14:21:52 2016 -0800 Merge pull request #570 from josephsavona/type-assertion-helpers Add assertXXXType helpers commit e8b71674c75a150e7572f7552e1def5f354c2d73 Author: Joe Savona Date: Tue Nov 15 12:27:34 2016 -0800 Add assertXXXType helpers commit 63759482ef20233029fc53045b8cc197e969746d Merge: 882e1670 493d7787 Author: Lee Byron Date: Tue Nov 15 14:00:41 2016 -0800 Merge pull request #567 from graphql/greenkeeper/eslint-3.10.1 Update eslint to the latest version 🚀 commit 882e1670af07e60e495309c247b39bad7c2b91e7 Merge: a17256bb e6643747 Author: Lee Byron Date: Tue Nov 15 13:20:40 2016 -0800 Merge pull request #569 from jjergus/intr differentiate between input values with no default and with default = null commit e66437478227d9506c31a16581bd3f19c3bc0f40 Author: Jan Jergus Date: Tue Nov 15 11:57:05 2016 -0800 differentiate between input values with no default and with default = null commit a17256bb148389727db64d2832339d6dce32827a Author: Lee Byron Date: Mon Nov 14 12:26:32 2016 -0800 Export validation context commit 493d7787d05a60f2b6f5940a02ba72308b6e299a Author: greenkeeper[bot] Date: Mon Nov 14 19:16:14 2016 +0000 chore(package): update eslint to version 3.10.1 https://greenkeeper.io/ commit b3e3e36d062c37aae330297346efcfddefd5ed80 Author: Lee Byron Date: Fri Nov 11 13:54:27 2016 -0800 0.8.1 commit 605f6165a8492a11c50e7c225adac32b4049503a Author: Lee Byron Date: Fri Nov 11 13:53:54 2016 -0800 Update coveralls commit ceb0064823ee4480aa3c98c02f4967ae9157ca4a Merge: 5b8afc0e 7a7c76f0 Author: Lee Byron Date: Fri Nov 11 13:51:23 2016 -0800 Merge pull request #565 from graphql/greenkeeper/flow-bin-0.35.0 Update flow-bin to the latest version 🚀 commit 5b8afc0e0caa3279b49e1325772ccc5c7d71bf08 Merge: 07cc6246 2cac4fa9 Author: Lee Byron Date: Fri Nov 11 13:51:13 2016 -0800 Merge pull request #566 from graphql/greenkeeper/eslint-3.10.0 Update eslint to the latest version 🚀 commit 07cc624677f4c7120e588e530c6fdb2d87e6210a Author: Lee Byron Date: Fri Nov 11 13:07:14 2016 -0800 Clearer lexer errors for common cases. This adds a clearer error specifically for the common case of using single quotes for string literals. It also makes minor clarity improvement to existing errors. Fixes https://github.com/graphql/graphiql/issues/198 commit 2cac4fa91aadfcfa90fc018ee3e4b13e9b5ac662 Author: greenkeeper[bot] Date: Fri Nov 11 20:04:53 2016 +0000 chore(package): update eslint to version 3.10.0 https://greenkeeper.io/ commit 7a7c76f060b035c40bca0bad4f89fddd9ac41d5d Author: greenkeeper[bot] Date: Fri Nov 11 16:52:22 2016 +0000 chore(package): update flow-bin to version 0.35.0 https://greenkeeper.io/ commit 1806976d9e1c96b3810c52221685068e9f5c2314 Author: Lee Byron Date: Thu Nov 10 11:22:13 2016 -0800 0.8.0 commit b4b8cbce5de2ac114de9a4ddf13d532af147294b Merge: 8dcc5b0c 39900ce3 Author: Lee Byron Date: Wed Nov 9 20:10:55 2016 -0800 Merge pull request #562 from graphql/linked-list-path Use linked-list to represent response path. commit 39900ce32261abfe5a7c7a773f74f399b1d806db Author: Lee Byron Date: Wed Nov 9 13:42:28 2016 -0800 Use linked-list to represent response path. This is a performance improvement to the execution path that removes the need for creating a new array to represent the response path for each resolved field in the response. Instead this creates a single-linked-list which is naturally persistently immutable. This exposes a breaking change: if you relied on `resolve(_, _, _, { path }) {` then you'll find `path` in this linked list format instead of an array. commit 8dcc5b0cfb9b99be6195417dfc35fe59b333361a Merge: 95c1bc29 3e069f5c Author: Lee Byron Date: Wed Nov 9 13:43:28 2016 -0800 Merge pull request #561 from graphql/format-path Add path to formatError commit 3e069f5c5ac66295ad881e0b83c391f115a2bd48 Author: Lee Byron Date: Wed Nov 9 13:08:45 2016 -0800 Add path to formatError While path was added to the serializable error, it was not yet added to the default formatError function. Adding this is technically breaking since it begins to expose new information from your API. commit 95c1bc29b664859f0a900502e2ada6f3fd0e7092 Merge: 87a64689 31adf9b4 Author: Robert Zhu Date: Tue Nov 8 14:23:29 2016 -0800 Merge pull request #558 from nodkz/master Expose `printType` for test/debug purposes. commit 31adf9b4ad761d7a70b4d034ba2b4f117c3bde64 Author: nodkz Date: Sun Nov 6 16:59:22 2016 +0600 Expose `printType` for test/debug purposes. commit 87a64689e85397144527e483cb7786b82e360a55 Author: Lee Byron Date: Thu Nov 3 17:18:05 2016 -0700 0.8.0-beta3 commit 35bf62a10ab1a4445135c07c353b835e75fdfab7 Author: Lee Byron Date: Thu Nov 3 17:17:33 2016 -0700 ensure npm ignores built dist folder commit b2e2d34af42d45db1addad95af3ef0dac4adc7f5 Author: Lee Byron Date: Thu Nov 3 17:14:27 2016 -0700 0.8.0-beta2 commit b9b405a071038e8d115c07afcd2ca2e928c6c898 Author: Lee Byron Date: Thu Nov 3 17:00:59 2016 -0700 Ensure Travis builds with flow files commit 9792f75faac6340a9e193c068b962b70e7d453bf Author: Lee Byron Date: Wed Nov 2 22:23:52 2016 -0700 0.8.0-beta1 commit c7af6cbf031062eb91c221315aa7a55c8952eebf Merge: c6a63883 d79b71df Author: Lee Byron Date: Wed Nov 2 22:18:40 2016 -0700 Merge pull request #554 from graphql/export-types Export flow types from index.js commit d79b71dfcde2d356f4881714a2251716fbca4383 Author: Lee Byron Date: Wed Nov 2 22:10:23 2016 -0700 Better name for field resolver types commit e49df4980396ed40d9b43bad738c53e001d8f0e5 Author: Lee Byron Date: Wed Nov 2 21:56:11 2016 -0700 Rename AST nodes to `*Node` to disambiguate types. commit 361b7a6062dc66478daf781d78c988ca4d2b36fb Author: Lee Byron Date: Wed Nov 2 20:33:37 2016 -0700 Export flow types from index.js This adds all flow types exported from individual files to relevant index.js files as well. This enables those using graphql.js with flow to write something like: ```js import type { ... } from 'graphql' ``` commit c6a6388339b8c5af6b75ca14b6861497018bd19f Author: Lee Byron Date: Wed Nov 2 22:02:27 2016 -0700 Export default resolver function as `defaultResolver` Closes #527 commit b93f0490836c75a83e8ae680545756bbcbb6c2bd Author: Lee Byron Date: Wed Nov 2 19:52:09 2016 -0700 Enforces input coercion rules. (#553) * Enforces input coercion rules. Before this diff, bad input to arguments and variables was often ignored and replaced with `null` rather than rejected. Now that `null` has a semantic meaning, and thanks to some recent changes to the spec (https://github.com/facebook/graphql/pull/221) - changes are necessary in order to enforce the stricter coercion rules. This diff does the following: * Implements the CoerceArgumentValues as described in the spec. * Implements the CoerceVariablesValues as described in the spec. * Alters valueFromAST and coerceValue (dual functions) to strictly enforce coercion, returning `undefined` implicitly when they fail to do so. It also fixes issues where undefined returns were being ignored as items in a list or fields in an input object. * Fix most of the failing tests * Fix missing data from errors * fix lint issues * Add full behavior test cases for valueFromAST * additional value coercion tests * Add appropriate list item behavior for missing vars commit 6cdb68c54a6c10e7546e1978290857b1851c6fd1 Author: Lee Byron Date: Tue Nov 1 17:58:26 2016 -0700 Adds Unique Directives Validation Rule. (#552) This implements https://github.com/facebook/graphql/pull/229, in order to adhere with the October2016 edition of the spec. commit 2b717f1405ce04eabd5a44df18b5b9b5cdd80fa3 Author: Lee Byron Date: Mon Oct 31 20:43:07 2016 -0700 minor edit of test path commit 11827c521fa8182f51bd0ca8cab8cacf9ddf420d Author: Pavel Chertorogov Date: Tue Nov 1 09:39:13 2016 +0600 export flow types in build (without test folders) (#412) * export flow types in build (without test folders) Another implementation of @nmn PR Flow types very needed to avoid this trash: https://github.com/nodkz/graphql-compose/blob/master/src/definition.js (and graphql-js as git submodule) Also solved @nmn issue https://github.com/graphql/graphql-js/issues/400 FYI `npm run cp-flow` correctly works if sub-folders exist in `dist/` otherwise it prints `No such file or directory`. * Copy source files with `.flow` extension in build proccess * Move from `master` flag `--optional runtime` for build script commit c23f5782dee81b0a59a6a6bb2bcca9da247570e7 Author: Pavel Lang Date: Tue Nov 1 03:23:29 2016 +0100 language support for NullValue (#544) * language support for NullValue * support null literal in Printer * astFromValue returns NullValue for explicit null * astFromNode does not converts NonNull values to NullValue * astFromValue correctly handles NonNull values * test: astFromValue converts input objects with explicit nulls * handle null values in valueFromAST * Support null in schemaPrinter * isValidLiteralValue: check for NullValue in NonNull type * Add nullish in kitchen sink test * isValidLiteralValue: Accept null in if nullable type + tests * Tests for default null values * ArgumentsOfCorrectType - valid null into list * comment * isNullish is unnecessary there * a note about difference between undefined and null * one test for null is enough * be consistent in return * ArgumentsOfCorrectType tests from null values * Update valueFromAST.js Comment clarity * Update valueFromAST.js Valid return values commit 90121beb32950ec8de2f42f7e32123569d1277e7 Author: Greenkeeper Date: Tue Nov 1 02:13:26 2016 +0100 👻😱 Node.js 0.10 is unmaintained 😱👻 (#551) * chore: drop support for Node.js 0.10 BREAKING CHANGE: This module no longer supports Node.js 0.10 * Update .travis.yml * Update .travis.yml Only include those in current / active lts / maintenance https://github.com/nodejs/LTS commit 19e01dfe42c152f10de8732529f0893924bb8f50 Author: Lee Byron Date: Mon Oct 31 17:43:19 2016 -0700 Update to latest flow commit 1fe8b3e158355ea25eba20448889a7dc16c26e70 Author: Lee Byron Date: Mon Oct 31 16:01:46 2016 -0700 Update to latest version of eslint with new rules commit bc96406ab44453a120da25a0bd6e2b0237119ddf Author: Lee Byron Date: Thu Oct 27 22:19:30 2016 -0700 Update to latest eslint and babel dependencies, update eslintrc (#545) commit 4832d9e7bab73067141dcb0932b1884a17f04186 Author: Greenkeeper Date: Fri Oct 28 05:37:56 2016 +0200 chore(package): update babel-plugin-transform-es2015-modules-commonjs to version 6.18.0 (#532) https://greenkeeper.io/ commit 9ea8223c01f1c64a8dfb72315a415bbc3e78cc39 Author: Caleb Meredith Date: Thu Oct 27 22:58:48 2016 -0400 add ‘GraphQL’ prefix to input object types (#526) * add ‘GraphQL’ prefix to input object types Types with names like `InputObjectConfig` are inconsistent with all other type names. This makes the types awkward to import and use. This may be considered a breaking change (although I’d venture to believe very few people if any are importing this specific file to get at the types). If you’d like to mitigate breakage we could re-export aliases like so: ```js export type InputObjectConfig = GraphQLInputObjectConfig ``` * Update definition.js * Update definition.js commit 5629337751b8505c3ccef51dbf5e095873f26f16 Author: Greenkeeper Date: Fri Oct 28 04:56:51 2016 +0200 chore(package): update babel-plugin-transform-class-properties to version 6.18.0 (#533) https://greenkeeper.io/ commit 4651a972e34edc405edc421ecb0dbcbbdd726557 Author: Greenkeeper Date: Fri Oct 28 04:56:30 2016 +0200 chore(package): update babel-plugin-transform-flow-strip-types to version 6.18.0 (#536) https://greenkeeper.io/ commit fdeb65aaf6b6d68c7a69a18ab0fe217f97fa5a8a Author: Greenkeeper Date: Fri Oct 28 04:56:19 2016 +0200 chore(package): update babel-plugin-transform-es2015-destructuring to version 6.18.0 (#537) https://greenkeeper.io/ commit 171024e5fabf648b5b914df89cc728dd3eb00d92 Author: Greenkeeper Date: Fri Oct 28 04:56:09 2016 +0200 chore(package): update babel-plugin-transform-es2015-shorthand-properties to version 6.18.0 (#539) https://greenkeeper.io/ commit 557d982bcfb5551a1f7edf01a52a2610c3ed7753 Author: Greenkeeper Date: Fri Oct 28 04:55:57 2016 +0200 chore(package): update eslint-plugin-flowtype to version 2.23.1 (#540) https://greenkeeper.io/ commit 267afe850a43a1ee43f2b038dbec22f0e345ef8a Author: Greenkeeper Date: Fri Oct 28 04:55:39 2016 +0200 chore(package): update babel-eslint to version 7.1.0 (#543) https://greenkeeper.io/ commit ea4ff15aaa6ebf1639a6bc608f151bd62d0f5e85 Author: Greenkeeper Date: Fri Oct 28 04:54:49 2016 +0200 chore(package): update babel-plugin-transform-es2015-block-scoping to version 6.18.0 (#538) https://greenkeeper.io/ commit bc4916a886d248c2d4ef64a914edc250bbaa69b3 Merge: 07cba2d8 5daf4a38 Author: Robert Zhu Date: Fri Oct 21 16:22:42 2016 -0400 Merge pull request #520 from graphql/greenkeeper-eslint-3.8.1 Update eslint to version 3.8.1 🚀 commit 07cba2d8e5d0a7955a8b184b06124f807673d85f Merge: 44f315d1 2f489add Author: Robert Zhu Date: Fri Oct 21 16:17:04 2016 -0400 Merge pull request #523 from olivierlesnicki/patch-1 Update starWarsSchema.js commit 2f489addc1e5446a540df35b4081c893f1953fd3 Author: Olivier Lesnicki Date: Wed Oct 19 23:56:04 2016 +0100 Update starWarsSchema.js Updated syntax in interface implementation comment. commit 5daf4a388a7ca0f6ff1969bf73402104f228ec91 Author: greenkeeperio-bot Date: Mon Oct 17 16:59:02 2016 -0400 chore(package): update eslint to version 3.8.1 https://greenkeeper.io/ commit 44f315d1ff72ab32b794937fd11a7f8e792fd873 Merge: 34540098 d9575110 Author: Robert Zhu Date: Mon Oct 17 15:34:59 2016 -0400 Merge pull request #517 from graphql/greenkeeper-eslint-3.8.0 Update eslint to version 3.8.0 🚀 commit d95751104ea6f57f2e13d6eb69a90591127c39c2 Author: greenkeeperio-bot Date: Fri Oct 14 17:58:46 2016 -0400 chore(package): update eslint to version 3.8.0 https://greenkeeper.io/ commit 345400987c67bc67f57d1d07f637bc9acbfd1016 Merge: 7b8ca294 986ff7b0 Author: Robert Zhu Date: Thu Oct 13 13:04:26 2016 -0400 Merge pull request #513 from graphql/greenkeeper-mocha-3.1.2 Update mocha to version 3.1.2 🚀 commit 7b8ca2943d98adfa890518b0625f070f80c3d33e Author: Jérémie Astori Date: Wed Oct 12 14:14:59 2016 -0400 Allow Travis CI's IRC bot to post without joining (#514) See https://docs.travis-ci.com/user/notifications#IRC-notification for more information. Note that this requires removing the `n` flag on the IRC channel. See https://freenode.net/kb/answer/channelmodes > n (prevent external send): Users outside the channel may not send messages to it. Keep in mind that bans and quiets will not apply to external users. commit 986ff7b0ddb30b8efac9613d0957482d68c21c96 Author: greenkeeperio-bot Date: Tue Oct 11 02:22:21 2016 -0400 chore(package): update mocha to version 3.1.2 https://greenkeeper.io/ commit 23592ad16868e06b1c003629759f905a77ab81a0 Author: Lee Byron Date: Mon Oct 10 15:21:12 2016 -0400 strict string coercion for errors commit 1fbd22ff508f5e437df58f0fdbbf01f4a9778818 Author: Lee Byron Date: Mon Oct 10 14:35:01 2016 -0400 Updates devDependencies (#511) Updates all but flow-bin (which will require more changes) and updates newly detected issues). commit 73513d35747cdea255156edbe30d85d9bd0c1b81 Author: Lee Byron Date: Mon Oct 10 14:08:40 2016 -0400 0.7.2 commit 16e016be8403993a5166c6328dbd7d295f322a56 Merge: 146621b2 c82ff68f Author: Lee Byron Date: Mon Oct 10 14:02:36 2016 -0400 Merge branch 'master' of github.com:graphql/graphql-js commit 146621b2989cc639b5f6eaff335c209142d908c2 Author: Lee Byron Date: Mon Oct 10 14:00:17 2016 -0400 Filter Error positions where locations do not exist. Fixes #507 commit c82ff68f52722c20f10da69c9e50a030a1f218ae Author: Tim Griesser Date: Mon Oct 10 13:44:44 2016 -0400 Allow resolveType to return a type name string (#509) commit f379d6980df7f004dd1b3b3d569addcc29e53f7a Author: Lee Byron Date: Mon Oct 10 13:29:12 2016 -0400 Follow ups to #508 Remove usage of Set where simple Object would do. Simplifies type kind description. Sentencify Renames files commit 07ac11a277b61cc87c1987996ce3d6cd5f98705b Author: sam-swarr Date: Mon Oct 10 12:32:40 2016 -0400 Add utility functions to compare schemas (#508) * Add utility functions to compare schemas * Add top level check that invokes other sub checks * Return Arrays instead of Sets, forEach instead of for in, other tweaks * Return a BreakingChange object rather than just a string * Only expose findBreakingChanges; other minor changes * Add static prettyName property to Type classes commit 3e9d4938491d0c38700078360c593a81c779ce76 Author: Lee Byron Date: Wed Sep 28 22:57:40 2016 -0700 Simplify introspection commit b93a516a2a278a78810914a4a68d8a002629ec9b Author: Lee Byron Date: Wed Sep 28 18:38:19 2016 -0700 0.7.1 commit 87e867edc2c70ef6e7fd0740960bfeff31b85075 Merge: a0c25e55 73bf9111 Author: Lee Byron Date: Wed Sep 28 18:23:23 2016 -0700 Merge pull request #506 from graphql/parse-type Adds parseType() commit a0c25e559626483cb9c1f696a6fa5e11185a6ea8 Merge: 948864e1 8a9addc6 Author: Lee Byron Date: Wed Sep 28 18:20:33 2016 -0700 Merge pull request #487 from martijnwalraven/graphqlerror-missing-locations Fix GraphQLError missing positions/locations when node.loc.start === 0 commit 948864e1c26afaeb69445625e847e01a6991db46 Merge: 63b9f15e c6d2b390 Author: Lee Byron Date: Wed Sep 28 18:16:08 2016 -0700 Merge pull request #505 from darthtrevino/488-bluebird-rejections-hang Add 'configurable: true' to GraphQLError stack property commit 73bf91112801cc745d541816d303841d5776ca37 Author: Lee Byron Date: Wed Sep 28 18:08:58 2016 -0700 Adds parseType() The parser already exported a convenience function `parseValue()` which allows you to parse GraphQL value literals independently of parsing entire documents. This adds similar functionality for `parseType()` - which parses type references like `[Int!]`. This also adds a few tests and slightly improved documentation. commit 63b9f15e4a612b7fbddbd3dec1696f64af3f0075 Author: Lee Byron Date: Wed Sep 28 17:27:38 2016 -0700 Correct documentation for type comparators commit c6d2b3909eda8f540e535ff87541b2ebc3a9e69f Author: Chris Trevino Date: Mon Sep 26 11:13:25 2016 -0700 Add 'configurable: true' to GraphQLError stack property commit a725499b155285c2e33647a93393c82689b20b0f Author: Hyo Jeong Date: Tue Sep 20 16:40:52 2016 -0700 Add isDeprecated value to field and enum value definitions (#496) commit 8a9addc60736980ac030e145e25d2f43e33e055b Author: Martijn Walraven Date: Thu Sep 15 15:56:27 2016 +0200 Fix GraphQLError missing positions/locations when node.loc.start === 0 Because the GraphQLError constructor filtered out falsy values for node.loc.start, that would also filter out 0. commit 89f3f1a319bb913616f2910e8a806170155ffaf0 Author: Lee Byron Date: Mon Sep 19 11:24:06 2016 -0700 Improved community help link commit 2406d3ab6569d6214f9ef9c9ecce3f6f4aa629be Author: Lee Byron Date: Wed Sep 14 19:49:32 2016 -0500 Remove preview language, update links commit 988508c9ee8e64e549b1028ffebdbbf4d22b4047 Merge: f31f3250 1fd28592 Author: Lee Byron Date: Thu Sep 8 14:32:14 2016 +0200 Merge pull request #481 from graphql/no-catch Do not use .catch on Promises to supported a wider array of thenables commit f31f32507ca6fd86bb440cc412c22aa894c1eebe Merge: e878745b 87158193 Author: Lee Byron Date: Thu Sep 8 14:30:54 2016 +0200 Merge pull request #477 from robzhu/master Throw when parsing empty string to numeric scalar commit e878745b0996498a8586205ad6ec205de215d491 Author: Lee Byron Date: Thu Sep 8 14:29:37 2016 +0200 Stylistic updates following #479 commit a5e7409b629c8e994a312774a6674ce1c97106eb Merge: 3142d872 4c16c2bd Author: Lee Byron Date: Thu Sep 8 14:22:19 2016 +0200 Merge pull request #479 from iamchenxin/flow-r7 Update to Flow 0.32 commit 1fd28592accff6f9d51abcd2de4b9bd537a7e531 Author: Lee Byron Date: Thu Sep 8 14:18:38 2016 +0200 Do not use .catch on Promises to supported a wider array of Promise libraries. Fixes #478 commit 4c16c2bd52c95bdf5b6e51be0bf4ff5b13e9362a Author: iamchenxin Date: Wed Sep 7 08:10:30 2016 -0600 add @flow for language/index.js commit 7369879af9575b1549c16e234b5b5abebe6f2d31 Author: iamchenxin Date: Wed Sep 7 06:54:20 2016 -0600 Update to Flow 0.32 and update some type definition with 0.32.(Basically most of those error in 0.29 is caused by missing @flow in src/language/kinds.js). commit 871581935aec0bffa3650967032d91fe00c4d5c5 Author: Robert Zhu Date: Mon Sep 5 17:48:09 2016 -0400 Throw when parsing empty string to numeric scalar commit 3142d872af011daec8be83c3a88d014f47ee0c64 Author: Lee Byron Date: Tue Aug 30 20:33:39 2016 -0700 Add tests to ensure resolve info contains correct information. Fixes #473 commit 6a0e00fe46951767287f2cc62e1a10b167b2eaa6 Author: Lee Byron Date: Tue Aug 30 20:15:12 2016 -0700 Remove console from test case commit 765242987558b0577dd1b490f8be1fe2724caf21 Merge: f2f3db56 e28ffb9d Author: Lee Byron Date: Tue Aug 30 19:53:25 2016 -0700 [minor] Fix typo in validation rule comments (#472) commit f2f3db565ba6418c8d2351b468bf653d2300829a Author: Lee Byron Date: Mon Aug 29 12:01:22 2016 -0700 Add early error to help detect unparsed JSON provided as variable values commit e28ffb9da40e54f222013aa0adadd7de1d2b3cf6 Author: Joe McBride Date: Thu Aug 25 22:41:56 2016 -0700 [minor] Fix typo in validation rule comments commit d85fa9f7c8e2fe4f05489ba40f333c326d22166e Author: Lee Byron Date: Thu Aug 25 17:10:19 2016 -0600 0.7.0 commit c614f759df5e436b1092af53811311b254ebb189 Author: Lee Byron Date: Thu Aug 25 16:06:12 2016 -0700 separateOperations - a utility function for splitting an AST (#456) * separateOperations - a utility function for splitting one AST into one per operation. A typical task using GraphQL at Facebook looks something like: 1. Load and parse all .graphql files which may contain operations or fragments. 2. Use `concatAST` to produce one AST that contains all operations and fragments. 3. Separate this all-encompasing AST into individual ASTs that represent each operation which could be sent to the server in isolation. `separateOperations` fulfills this third step. * add flow types, more tests commit 7e8e57b9d13d82a54ecc72cb176baad0452cd564 Author: Kevin Lacker Date: Thu Aug 25 09:22:46 2016 -0700 buildSchema helper function (#471) * buildSchema helper function * import -> import type commit e83409712ef1493a7709a5754b0e72d1bd33c753 Author: Lee Byron Date: Wed Aug 24 19:30:49 2016 -0700 [RFC] Allows use of generated schemas for execution. (#469) Right now our generated schemas (built from introspection, built from AST) explicitly do not allow their use in execution. They throw as soon as any resolver function is called. This conservative behavior was appropriate for early versions where we wanted to limit the surface area under use. Today it's becoming more clear that there are immediately valuable use cases for using generated schema in execution. commit 5e3d377e6e0881191efe02b9d40720ff0f0b5b0f Author: Lee Byron Date: Wed Aug 24 19:20:30 2016 -0700 Advantage common convention for naming root types. (#470) This is a result of a conversation I had with @lacker that we should provide a stronger opinion on what to name the root types, and then advantage that opinion. Here's the result of that: If you use the type names `Query` and `Mutation` for your root types, then printing the schema or parsing a schema IDL can omit the `schema { query: Query, mutation: Mutation }` boilerplate. If your root type names are anything other than these, then you have to include it. There doesn't seem to be a significant downsite to this except for the relative complication of understanding why sometimes a `schema {}` description is included and sometimes it isn't. commit 331dc77924908909e86284315bda12c22f316f54 Author: Lee Byron Date: Wed Aug 24 13:42:15 2016 -0700 Adds descriptions to the schema language via docblocks (#464) This adds descriptions to the `buildASTSchema` (string->schema) and `schemaPrinter` (schema->string) via walking the previous full-line contiguous comment block. This is dependent on #463. commit 9ae43991bf86d58d969ffdb552d7cdd853477f9b Author: Kevin Lacker Date: Mon Aug 22 16:11:43 2016 -0700 improve default fn behavior (#468) commit a819fb3a575f27d077a460f9a4327610b87abe40 Merge: 38b1a46d a1e9374d Author: Lee Byron Date: Mon Aug 15 23:36:43 2016 -0700 Merge branch 'master' of github.com:graphql/graphql-js commit 38b1a46de69bbcb21b88366d14372f57695a2624 Author: Lee Byron Date: Mon Aug 15 23:36:23 2016 -0700 add missing semis commit a1e9374d6ea43269e7e00c2d243fbc529fce8239 Author: Jay Mitchell Date: Tue Aug 16 00:22:15 2016 -0600 [test] [minor] Make test name unique (#466) commit 165b9d3a0b913d792501b0ce2829ad417d83122d Author: Lee Byron Date: Mon Aug 15 23:20:51 2016 -0700 Refactors tokenizer to emit a Token double-linked-list (#463) This refactors the tokenizer, simplifying both tokenizer and parser code slightly (fewer utility functions) and returns tokens as part of the AST's `loc` information. Tokens also have gained a few new properties: `line`/`column` for the 1-indexed position the token begins and `prev`/`next` to navigate the dll of Tokens. Finally, this introduces two new Token types: `` for the empty token at beginning of the file stream, and `Comment` for ignored comment tokens. These tokens are *included* in the Token list allowing for easier navigation of the parsed document in GraphQL tools and as a basis for parsing comment descriptions in the schema language. Providing tokens as part of each AST node's `loc` provides a linkage between the abstract AST and the concrete token list which provides more useful information to GraphQL language tools. Thanks to the addition of the `` token, The AST `Document` node returned from `parse()` now definitionally points to `` as its `startToken` and `` as its `endToken`, effectively the head and tail of the token double linked list. This also removes the `noSource` parser option in favor of defining toJSON/inspect methods so that they do not appear in JSON.stringify/util.inspect. commit 3cf66f33e30d467b068b4054e120562b01d885b7 Author: Robert Zhu Date: Fri Jul 29 15:12:13 2016 -0400 Update extendSchema to support new Directives (#455) * Update extendSchema to support new Directives This changes the extendSchema utility to accept and process new Directive definitions. Existing directives cannot be extended or replaced (should throw an error in such cases). See extendSchema-test for examples. * Update extendSchema to support new Directives This changes the extendSchema utility to accept and process new Directive definitions. Existing directives cannot be extended or replaced (should throw an error in such cases). See extendSchema-test for examples. * Fix trailing whitespace lint error * Improve logic in new directive extendSchema Use an Array instead of an object for collecting new directives detected within the schema extension. commit 8df7894c8974bd19c600ad05df9d42ed3def3e65 Author: Lee Byron Date: Mon Jul 25 21:32:12 2016 -0700 Refactor GraphQLError, add many tests This fixes an issue where `new GraphQLError() instanceof GraphQLError` would unexpectedly return false due to a combination of babel's class transform and the weird behavior of Error on many platforms including Node/v8. In addition, when the stack from an originating error is not available, this uses Node/v8's Error.captureStackTrace when available for cleaner stack traces. Finally this adds lots of documentation! Yay! commit 8e1179f36dfa53df694b325c0df442704811d8b4 Author: Lee Byron Date: Mon Jul 25 17:40:11 2016 -0700 GraphQLError: Only include locations/path when relevant commit 26746aeeae6b132dda704b2d445ce08335e4d6f1 Author: Rylan Hawkins Date: Mon Jul 25 16:40:36 2016 -0700 Use the Error base class stack property (#452) Many libraries (such as https://github.com/PolymerLabs/stacky) expect an error's stack to be of a certain format. Currently this code sets it to the message, which causes exceptions in formatters. It also obscures the actual location of where the error is thrown, since it overwrites the stack property of the inherited Error. commit 75de8b9227af72096a8cb688d92b924bc5a20e55 Author: Lee Byron Date: Mon Jul 25 16:14:01 2016 -0700 Travis dependency speedup commit 2aa060007dda62be2cd5b480ada3b9270cee0454 Author: Lee Byron Date: Thu Jul 21 13:52:50 2016 -0700 0.6.2 commit e2424a1a4aee2e193df1649786f643509b5e2bee Author: Lee Byron Date: Thu Jul 21 13:51:04 2016 -0700 [Build] Update package.json building scripts commit 569d9554b116d8e81bb7862336a63e71ba123ee5 Author: Lee Byron Date: Thu Jul 21 13:41:04 2016 -0700 [Travis] only lint/check/cover on latest node commit 8440d472beb11ed4c81e7c361f5709f7523f4876 Author: Lee Byron Date: Thu Jul 21 13:28:00 2016 -0700 Update eslint to v3 commit 03f06e9a901df62d7a0df19860db3cd5106b0c3f Author: Lee Byron Date: Wed Jul 20 18:44:45 2016 -0700 [RFC] Support iterable values as inputs and outputs (#449) This adds support for returning any Iterable from a resolver function expecting a List type, rather than only Arrays, by using the `iterall` library. This also adds support for accepting any Iterable as input for arguments or variable values which expect a List type. commit fb8ed672ebaaae3068aa85f42aeec047f9d41b1a Author: Lee Byron Date: Wed Jul 20 13:52:41 2016 -0700 [FIX] Include locations for errors related to failed value completion. (#445) Error locations were previously only being added due to async value resolution and not during value completion. This meant if an error was raised due to an incorrect response from a resolver function that it would not have gotten wrapped in a location-aware GraphQLError object. This includes a new intermediate phase which catches and assigns these locations before further propogating the error. This also assigns non-enumable property for `originalError` so it is not included during JSON.stringify. commit 08a00aa4eb2a58c1aece167ee70774fae7c5393c Author: Lee Byron Date: Tue Jul 19 21:01:27 2016 -0700 [FIX] Throw field errors when failing to coerce Int/Float. (#444) As illustrated by #391, when a value is provided for a field of type Int which cannot be represented by Int (e.g. a 64bit value is provided to the 32bit Int type), then the spec claims a field-error should be raised however currently `null` is returned directly instead. Spec: https://facebook.github.io/graphql/#sec-Int This updates to throw meaningful error messages when invalid Int and Float values cannot be coerced without losing information. commit a73c8e283048a7011058a4174be967cd9273da21 Author: Lee Byron Date: Tue Jul 19 20:03:10 2016 -0700 Update ESLint rule to require quoting numeric properties. Flow does not allow unquoted numeric object properties, so ensure ESLint and Flow agree on this. As originally illustrated in #425 commit 4202306e097bac9467702999d8ab317198016f7b Author: Lee Byron Date: Tue Jul 19 19:58:53 2016 -0700 Support Flow v0.29 commit 549a2fd1c3cb8acccb4dd0f82eb8e70b2b23346e Author: Lee Byron Date: Tue Jul 19 19:53:26 2016 -0700 Missing space in description commit 8482ed4718ee89d1c182ea92b76be15a61ca93ab Author: Lee Byron Date: Tue Jul 19 19:53:08 2016 -0700 Improve error message related to sub-selection validation commit db739379cef6d269a6bc51a9ebf999981f6b3adc Author: Lee Byron Date: Tue Jul 19 18:15:08 2016 -0700 Move Unions class-private method into module-private. Improve test message commit e3b9c2175a93b0a39d16f59baccfb50cd72d9f65 Author: Lee Byron Date: Tue Jul 19 18:02:24 2016 -0700 Test cleanup commit 9689bcc4054500d8b7595ead1288124c1d519379 Author: Eric Koslow Date: Tue Jul 19 17:55:04 2016 -0700 Allow UnionTypes to accept a types thunk (#436) This should help with module loading order creating null types. commit 03e62322cbefdd367b8d509ed3817b7b7d43e2a6 Author: Lee Byron Date: Tue Jul 19 16:33:39 2016 -0700 Add `message` and `locations` as enumerable properties on GraphQLError. (#443) As brought up in #426, it can be confusing to return instances of `Error` from the `graphql` function since the expectation is that you will call `JSON.stringify` and submit the result to a client. Calling `JSON.stringify` on an instance of `Error` results in `{}` since it has no enumerable properties. In order to have behavior that matches the GraphQL spec easier to achieve, this makes these two properties enumerable. I think this will be the best of both worlds - anyone who wishes the operate directly on the Error instances will still have the ability to do so (for example, to access the `stack` property), but it can still be converted to JSON directly and get a spec-compliant result. commit 66670e6132ab9457108079f46b542a683ab11843 Author: iamchenxin Date: Tue Jul 19 16:29:55 2016 -0600 ignore vscode's config files (#437) commit b080bf5274e250c158f8111402864ecd6ce788e1 Author: Lee Byron Date: Tue Jul 19 15:27:43 2016 -0700 [FIX] astFromValue uses `serialize()` and requires type. (#441) A bug was reported in #435 and reproduced in #438 which illustrates an issue where defaultValue would serialize incorrectly or even throw an invariant violation when working with input objects or enums backed by values other than their names. The root of the issue is that astFromValue accepts an *internal* value, but then produces an AST directly from that value without serializing it to an *external* value first via calling `type.serialize(value)`. This critical missing step is responsible for the reported issue. In order to fix correctly, this refactored this method to be a closer dual to [`valueFromAST`](https://github.com/graphql/graphql-js/blob/master/src/utilities/valueFromAST.js), relying on the GraphQL type rather than the JavaScript type to guide coercion. As a consequence, `astFromValue` now *requires* a type rather than accepting one optionally. commit bc8ba8b07e894523b402a20cf736438bb0dc147d Author: Lee Byron Date: Tue Jul 19 15:25:15 2016 -0700 Make GraphQLError#stack a writable property. (#442) Some libraries use a brand-checking to determine if something is an Error which specifically looks to see if `stack` is a writable property. Fixes #439 commit b64f87239d164d6b209cca37fb95bedb6d27f38d Author: Lee Byron Date: Mon Jul 18 12:18:56 2016 -0700 [test] Illustrate returning internal enum value from a resolver Illustrates for #435 commit e209cdea9d942551dcbda553644b2c1b40af806c Author: Lee Byron Date: Mon Jul 18 12:05:25 2016 -0700 [test] Illustrate use of defaultValue for Enum-typed arguments Illustrates #435 commit b2c8332001d16b70039cb21bd10ccb0e85b7729c Author: Lee Byron Date: Mon Jul 18 12:01:15 2016 -0700 [test] Include test illustrating enum API commit e496a2adde092ce02fafc5d7158e5baf5e5a22d8 Merge: cf2e8bf0 a73e1809 Author: Lee Byron Date: Mon Jul 18 11:09:21 2016 -0700 Merge branch 'master' of github.com:graphql/graphql-js commit cf2e8bf022efe60eab1a625b68127f67fd29be01 Author: Lee Byron Date: Mon Jul 18 11:08:52 2016 -0700 [test] Assert that Enums can be represented internally by arbitrary values including Object-reference values. This illustrates part of the solution to #435 commit a73e1809923f29a312fcc0d89dd969ad4980163f Merge: 826cba3b 67820304 Author: Dan Schafer Date: Mon Jul 11 13:02:12 2016 -0700 Merge pull request #429 from kassens/ascii Use only ASCII characters commit 67820304ea940beda117fa603f001526783215d4 Author: Jan Kassens Date: Mon Jul 11 12:58:01 2016 -0700 Use only ASCII characters In some environments it's preferable to only use ASCII characters. This changes all non-ASCII characters to ASCII alternatives. commit 826cba3b76e87dbd25a01db5150f89624adaab32 Author: Lee Byron Date: Wed Jul 6 16:06:44 2016 -0700 0.6.1 commit 7cb1acec330041a897e162a7b13e035781941aab Merge: d06c883e e9fa66df Author: Lee Byron Date: Wed Jul 6 15:50:02 2016 -0700 Merge branch 'master' of github.com:graphql/graphql-js commit d06c883ee6165c64969e0c83d32de643f2610e6c Author: Lee Byron Date: Wed Jul 6 15:49:55 2016 -0700 Fix tests for node v0.10, widen test matrix commit e9fa66df99841509236df60c720b011225f00ddf Author: Hafiz Ismail Date: Thu Jul 7 06:37:16 2016 +0800 Fix test assertions for validation test when using custom TypeInfo (#395) - Test should had broke for changes in #355 which improved validation messages with suggestions. - But `expect().to.deep.equal()` checks for the right number of errors but does not check for equality of error messages. commit 188881b457f030ec1dff6c25458a1fbb66bc515b Author: Lee Byron Date: Wed Jul 6 15:34:20 2016 -0700 Removes depencency on babel-runtime. Simplifies babel transform using "loose" options and removing some transforms. This results in a subset of ES2015 environment, but this source has been pretty careful to avoid the more novel features in order to support more environments. The result for those using graphql via npm is fewer dependencies and less reliance on a modern JS environment, both good things when wanting to use graphql as a depencency in a client-side tool, like Apollo or Relay. Fixes #414 commit c7700f206579eef0046649f26e42c8cd336e6e74 Author: Lee Byron Date: Wed Jul 6 12:33:33 2016 -0700 Upgrade to Flow v0.28. flow check now passes for the existing v0.26 as well as v0.27 and v0.28, so upgrading to the latest version. Fixes #412, #418, #420 commit f06051e592362767e6531c1ceb653f1ef3873500 Author: Lee Byron Date: Wed Jul 6 11:52:25 2016 -0700 More specific return types from methods in Schema commit 516dfb9674b4dbde1ee17f715e4c0b6bc24a9f92 Author: Lee Byron Date: Tue Jul 5 21:20:19 2016 -0700 Only type Scalar config rather than Scalar type, improve schema builder types commit f7c78ebf4b08d09e70b31cadffe4f0b941ce1ab0 Author: Lee Byron Date: Tue Jul 5 20:06:59 2016 -0700 Introduce formal definition of "Thunk" to aid in fixing more issues uncovered by Flow v0.28 commit 3083fc5743ef228326588f0d1c6b1ebcdf0c4a52 Author: Lee Byron Date: Tue Jul 5 16:39:56 2016 -0700 Additional flow issues corrected in anticipation of Flow v0.28 commit 887183422f138ca8eeb71a9b3c3390d74542dec9 Author: Lee Byron Date: Tue Jul 5 15:25:50 2016 -0700 Fix some flow issues in anticipation of Flow v0.28 commit 63f9985c535352f0d503807d1881c0b01a0cd868 Author: Pavel Chertorogov Date: Thu Jun 30 23:09:45 2016 +0600 export type InputObjectConfigFieldMapThunk (#411) Needs for external flow type checking. commit 1ed070fed63767e82470ca39d036539b99693c4c Author: Lee Byron Date: Fri Jun 10 15:17:30 2016 -0700 Variable naming follow-up to path generation commit 6223245d14f37b472825bc6136798052ea23077f Author: Slava Kim Date: Fri Jun 10 15:10:57 2016 -0700 Errors thrown from resolvers have the execution path (#396) * Errors thrown from resolvers have the execution path This path is also passed in the `info` object to resolvers. This information is useful for ease of debugging and more detailed logging. * Remove PathedError * rename property executionPath to path * remove an unnecessary block * info.executionPath -> info.path * a minor tweak to make the body of executeFields look closer to executeFieldsSerially * remove the unnecessary clone of info * Add a test for a path with non-nullable fields * stylistic changes * remove stray property commit 572bbdaa3359d28c00fc4f450a4804c1d0cf0105 Author: Lee Byron Date: Fri Jun 10 10:25:15 2016 -0700 Update all dependencies, include flow-specific lint handling commit 061807739999dd8d9b0d27bc66485fb2f65a9da1 Author: Lee Byron Date: Fri Jun 10 09:52:17 2016 -0700 Revert "Update babel-cli and flow-bin package references" (#403) commit 42dcb884d2ccdef5138031c2e1e534f983233525 Author: Kevin Lacker Date: Fri Jun 10 09:18:27 2016 -0700 move babel config to the babelrc (#399) commit 0bbdaecd51b776ba5ca36700910108ad1e607164 Author: Robert Zhu Date: Fri Jun 10 23:04:03 2016 +0800 Update babel-cli and flow-bin package references (#388) commit 485b131ea9ffbd92a9fe5853338ba5e8b0050ca0 Author: Joe Lutz Date: Fri Jun 10 10:03:30 2016 -0500 Fix typo (#387) commit 359ec769ebfcb2c1ef15ea74abb412d0c4c9131e Author: Lee Byron Date: Tue May 10 14:52:48 2016 -0700 0.6.0 commit 4afb263289485897fdfec37aaf6d5f1e5451dcb3 Author: Lee Byron Date: Tue May 10 14:50:26 2016 -0700 Validation: improving overlapping fields quality (#386) This improves the overlapping fields validation performance and improves error reporting quality by separating the concepts of checking fields "within" a single collection of fields from checking fields "between" two different collections of fields. This ensures for deeply overlapping fields that nested fields are not checked against each other repeatedly. Extending this concept further, fragment spreads are no longer expanded inline before looking for conflicts, instead the fields within a fragment are compared to the fields with the selection set which contained the referencing fragment spread. e.g. ```graphql { same: a same: b ...X } fragment X on T { same: c same: d } ``` In the above example, the initial query body is checked "within" so `a` is compared to `b`. Also, the fragment `X` is checked "within" so `c` is compared to `d`. Because of the fragment spread, the query body and fragment `X` are checked "between" so that `a` and `b` are each compared to `c` and `d`. In this trivial example, no fewer checks are performed, but in the case where fragments are referenced multiple times, this reduces the overall number of checks (regardless of memoization). **BREAKING**: This can change the order of fields reported when a conflict arises when fragment spreads are involved. If you are checking the precise output of errors (e.g. for unit tests), you may find existing errors change from `"a" and "c" are different fields` to `"c" and "a" are different fields`. From a perf point of view, this is fairly minor as the memoization "PairSet" was already keeping these repeated checks from consuming time, however this will reduce the number of memoized hits because of the algorithm improvement. From an error reporting point of view, this reports nearest-common-ancestor issues when found in a fragment that comes later in the validation process. I've added a test which fails with the existing impl and now passes, as well as changed a comment. This also fixes an error where validation issues could be missed because of an over-eager memoization. I've also modified the `PairSet` to be aware of both forms of memoization, also represented by a previously failing test. commit 688a1ee20db01ca80fdec2189298078380d81ed6 Author: Lee Byron Date: Mon May 9 18:54:10 2016 -0700 Validation: context.getFragmentSpreads now accepts selectionSet rather than fragment AST node commit cf9be874228f4e16762b481d0abed5575f5587db Author: Lee Byron Date: Mon May 9 15:22:53 2016 -0700 Factor out more closure functions Two more functions from the overlapping-fields validator which now accept arguments rather than closing over them locally. commit 3a01fac4623b37eb7efcdece7a2c33ef74750aeb Author: Lee Byron Date: Mon May 9 15:12:08 2016 -0700 Factor out closure functions to normal functions The functions within this validator did not need to close over any state, which allows them to be pure functions. commit 5375c9b20452801b69dba208cac15d32e02ac608 Author: Lee Byron Date: Sun May 8 14:56:16 2016 -0700 Deprecated directive (#384) This adds a new directive as part of the experimental schema language: ``` directive @deprecated(reason: String = "No longer supported") on FIELD_DEFINITION | ENUM_VALUE ``` It also adds support for this directive in the schemaPrinter and buildASTSchema. Additionally exports a new helper `specifiedDirectives` which is encoured to be used when addressing the collection of all directives defined by the spec. The `@deprecated` directive is optimistically added to this collection. While it's currently experimental, it will become part of the schema definition language RFC. commit 0aa78f61a2dc150b5ea9ee4f50b68a736796f068 Author: Lee Byron Date: Fri May 6 16:05:27 2016 -0700 RFC: Directive location: schema definition (#382) This allows directives to be defined on schema definitions. commit 1b6824bc5df15f8edb259d535aa41a81e2a07234 Author: Lee Byron Date: Fri May 6 14:56:25 2016 -0700 RFC: Schema Language Directives (#376) This implements adding directives to the experimental schema language by extending the *locations* a directive can be used. Notice that this provides no semantic meaning to these directives - they are purely a mechanism for annotating an AST - however future directives which contain semantic meaning may be introduced in the future (the first will be `@deprecated`). commit 71b6a4aaecf064c7095bca81cc4285fa74ba175e Author: Lee Byron Date: Fri May 6 13:26:20 2016 -0700 Export introspection in public API commit 980bdf403f6e9ea3546d2ff5e68d29d618d079da Author: Lee Byron Date: Fri May 6 13:12:17 2016 -0700 Export directive definitions. (#381) This exports the ability to define new directives as well as access the built-in @skip and @include definitions. commit 44768a8e4a403e0ec15281a79a50fb8b6511b844 Author: Lee Byron Date: Fri May 6 12:10:16 2016 -0700 BUG: Ensure building AST schema does not exclude @skip and @include (#380) `buildASTSchema` used to not regard directives in 0.4.x, just always including only `@skip` and `@include`. Since 0.5.0 included the ability to use directives in the experimental schema language, existing use of this tool found no defined directives and therefore excluded these two built-ins. This fixes the issue by implicitly adding these built-in directives if they were not explicitly defined. commit 88cf354cd65e37fa0793600f6f2a3e6d1b29d21f Author: Lee Byron Date: Fri May 6 12:09:16 2016 -0700 documentation of schema constructor commit 2ac41f6f190e25de9c5e0942f12bcac8a9d76972 Author: Lee Byron Date: Thu May 5 09:23:48 2016 -0700 Revert "Remove all 'instanceof GraphQLSchema' checks" (#377) commit 71df46147bcd58d4a63454aacd8675108d82aa06 Author: Jonas Helfer Date: Wed May 4 17:29:41 2016 -0700 remove all 'instanceof GraphQLSchema' checks (#371) commit e6e8d19cd7a8deb48a5a702500f9936e9fbc9c80 Author: Clay Allsopp Date: Wed May 4 17:28:42 2016 -0700 Error logging for new interface type semantics (#350) commit 51362e787da493c6522d110408aa420e6e6b4453 Author: Lee Byron Date: Wed May 4 16:29:04 2016 -0700 Nit: Missing case in grammar for TypeSystemDefinition in comment commit ea5b241487c884edb561b12e0a92e947107bbfc1 Author: Lee Byron Date: Wed May 4 16:26:11 2016 -0700 Bug: printer can print non-parsable value This fixes a bug where an empty "block" list could be skipped by the printer. commit ec05b5404b6426fb7121080dab471241c0331ac7 Author: Lee Byron Date: Tue Apr 26 18:28:33 2016 -0700 Factor out suggestion quoting utility commit 92923be4bcd37958366f77c1dd6863dd03005cca Author: Lee Byron Date: Tue Apr 26 18:06:52 2016 -0700 Minor refactoring commit 30a783a2a4f100cad0f31085284895bf51aa565a Author: Lee Byron Date: Tue Apr 26 17:49:33 2016 -0700 Minor refactoring of error messages for unknown fields commit 5bc1b2541d1b5767de4016e10ae77021f81310fc Author: Yuzhi Date: Tue Apr 26 11:48:45 2016 -0700 Include possible field, argument, type names when validation fails (#355) * Add suggestionList to return strings based on how simular they are to the input * Suggests valid fields in `FieldsOnCorrectType` * Suggest argument names * Suggested valid type names * Fix flow and unit test * addressed comments in PR: move file, update comment, filter out more options, remove redundant warning * fix typos * fix lint commit 4b08c36e865167d0890567f558a195309dbdf624 Author: Lee Byron Date: Mon Apr 25 18:46:48 2016 -0700 Tests commit 6103d2d17d3c0809f4288a8276b48c6b617d91dd Author: Robert Zhu Date: Mon Apr 25 21:28:40 2016 -0400 Improve validation error message when field names conflict (#363) * Improve validation error message when field names conflict * Remove extra hint and add unit test commit 3dc0ddb4a94cfe7ca8d4489b3bc09bb6c1a218b7 Author: Lee Byron Date: Mon Apr 25 11:51:51 2016 -0700 tweak tests commit 0b72e7038761bec9fb5319cc08ea93ff8b071a9c Author: Mike Solomon Date: Mon Apr 25 11:37:25 2016 -0700 Deepen introspection query (#364) commit cbded829525a68b9e0dab61621992cbf01348981 Author: Zhaojun Zhang Date: Mon Apr 25 11:04:47 2016 -0700 Remove unused fragment in queries in unit tests (#367) commit dd0297302800347a20a192624ba6373ee86836a3 Author: Lee Byron Date: Fri Apr 8 16:37:54 2016 -0700 Update README.md commit 6e736bf4733ada6aa15943c0529ed126e8dd8ef1 Author: Lee Byron Date: Thu Apr 7 18:51:04 2016 -0700 Combine invariants into AST-aware error. commit 86db7340be200ce63091b8c7174dc84f1c409e38 Author: Lee Byron Date: Thu Apr 7 18:29:34 2016 -0700 0.5.0 commit 0da0267029c68f6bffb77565454c39299b8e3663 Author: Lee Byron Date: Thu Apr 7 18:21:02 2016 -0700 Update to latest version of flow commit 3b46751f5f8f8c72dea705954b7b46c424de4df7 Author: Lee Byron Date: Thu Apr 7 17:57:58 2016 -0700 import type for this flow type commit c15131588abc9bcef0e0bd58e06f8134e8ad37fa Author: Lee Byron Date: Thu Apr 7 17:47:44 2016 -0700 Update dev dependencies commit c034de91acce10d5c06d03bd332c6ebd45e2213c Author: Lee Byron Date: Wed Apr 6 23:00:31 2016 -0700 RFC: Return type overlap validation Implements https://github.com/facebook/graphql/pull/162 This alters the "Overlapping Fields Can Be Merged" validation rule to better express return type validation issues. The existing rule has presented some false-positives in some schema where interfaces with co-variant types are commonly used. The "same return type" check doesn't remove any ambiguity. Instead what that "same return type" check is attempting to prevent is spreading two fragments (or inline fragments) which have fields with return types where ambiguity would be introduced in the response. In order to curb false-positives, we later changed this rule such that if two fields were known to never apply simultaneously, then we would skip the remainder of the rule. ``` { ... on Person { foo: fullName } ... on Pet { foo: petName } } ``` However this can introduce false-negatives! ``` { ... on Person { foo: birthday { bar: year } } ... on Business { foo: location { bar: street } } } ``` In the above example, `data.foo.bar` could be of type `Int` or type `String`, it's ambiguous! This differing return type breaks some client model implementations (Fragment models) in addition to just being confusing. commit ffe76c51c44922e2a24494ef0def9e3b999caacb Author: Jonas Helfer Date: Wed Apr 6 22:48:23 2016 -0700 Add sanity checks for schema to allow only a single query, mutation, subscription in schema commit a981043af6a536777ab7239e2aa2f76737834ebc Author: Lee Byron Date: Wed Apr 6 17:35:23 2016 -0700 Minor tweak to readme for bleeding edge commit 6e5da5062ffa1f976667a1a95607bf0387464f7a Author: Travis Date: Wed Apr 6 17:26:42 2016 -0700 fix encrypted key commit 6a9ff3f482ffb3ba945adae033961003f1fa2451 Author: Travis Date: Wed Apr 6 17:17:57 2016 -0700 correct repo, doi commit e77f34b9924c9193a1784d9521979b9dad6fc97d Author: Travis Date: Wed Apr 6 17:12:03 2016 -0700 Amend travis npm deploy script commit 5347e263ee9515eb25be48acff61320c4f4256e4 Author: Lee Byron Date: Wed Apr 6 16:58:07 2016 -0700 Add an automatically updating git branch which mirrors npm deployment. commit 3201ebb825f7bab4ca4856238ade4603e15a5abc Author: Lee Byron Date: Tue Apr 5 20:08:06 2016 -0700 Add tests for type comparators commit c7e6a75277f4991290611207573d07affc9f69de Author: Lee Byron Date: Mon Apr 4 22:14:34 2016 -0700 0.5.0-beta.1 commit 07e627adda2b236e720ec352b21eb3043170c60f Author: Lee Byron Date: Mon Apr 4 22:09:42 2016 -0700 remove non spec compliant test commit cf5b2340f934c94b6c960d765d9fc26a02fb6250 Author: Lee Byron Date: Mon Apr 4 22:06:03 2016 -0700 Fix tests on abstract type invariant commit 47f87fa701cb33fc1fb0ca65b4668c7a14a5ad11 Author: Lee Byron Date: Mon Apr 4 22:00:00 2016 -0700 Spec compliant @skip/@include. Follow up to #335 commit 9e5d959353bc1ad6506cfac1a944091b5e6a9e4e Merge: 9cbcb1c9 d6da0bff Author: Lee Byron Date: Mon Apr 4 21:56:55 2016 -0700 Merge branch 'master' of github.com:graphql/graphql-js commit 9cbcb1c9a98c4f3e56bdd11cf11a1c00112e51f2 Author: Lee Byron Date: Mon Apr 4 21:56:50 2016 -0700 Fix lint commit d6da0bff7f877e6a4fb66119796809f9c207f841 Author: Dylan Thacker-Smith Date: Mon Apr 4 23:56:27 2016 -0500 Fix bug where @include directive is ignored if @skip is present. commit 136630f8fd8778c4d2e61d07c0b1ec47f99c9bf6 Author: Lee Byron Date: Mon Apr 4 21:52:43 2016 -0700 Minor touch ups after #342 commit 8514211b674d1f282fdff73e412c289435ab6920 Author: Lee Byron Date: Mon Apr 4 21:52:21 2016 -0700 Clean up tests referenced in #344 commit dea5aacca01f4429026bea3d97ea7cbc88b33bcf Author: Jeff Moore Date: Mon Apr 4 21:48:14 2016 -0700 Improve coercion error messages * Remove redundant falsy check for runtimeType * Replace silent conversion to null with an invariant and a useful error message * Add an error message for unexpected return value from resolveType * Make sure null and undefined mean could not determine type while false or 0 indicates wrong return type commit 39744381d5173795d3b245dcb5d86e78bb3638fe Author: Lee Byron Date: Thu Mar 24 21:47:48 2016 -0700 Rename tests commit 618d36379a18b72b7cf8623f179feae1f0bebfd6 Author: Lee Byron Date: Thu Mar 24 20:58:31 2016 -0700 Bump versions commit 09be751e995dd641f138f67ff9f420525950fad1 Author: Lee Byron Date: Thu Mar 24 19:07:14 2016 -0700 Fix test commit e1da711b9e7782282348f2ef01cbb32ef064d054 Merge: 942f84e8 8379e71f Author: Lee Byron Date: Thu Mar 24 17:42:57 2016 -0700 Merge pull request #325 from graphql/schema-def [RFC] Add Schema Definition to IDL. commit 942f84e8d22ee09622016cf52f9431cbe5cd81e3 Merge: 576b6a15 d7cc6f9a Author: Lee Byron Date: Thu Mar 24 17:40:30 2016 -0700 Merge pull request #326 from graphql/context [RFC] Add explicit context arg to graphql execution commit d7cc6f9aed462588291bc821238650c98ad53580 Author: Lee Byron Date: Tue Mar 22 19:30:13 2016 -0700 [RFC] Add explicit context arg to graphql execution This *BREAKING* change introduces a new argument to the GraphQL execution API which is presented to resolution functions: `context`. This solves a long-standing point of confusion about the correct way to represent authentication or a "viewer context" in which a query is executed. Previously, we suggested that the `rootValue` contain any authentication tokens, however this led to awkward code: ``` resolve: (val, args, { rootValue: { authToken } }) { ... } ``` Which can now be written as: ``` resolve: (val, args, authToken) { ... } ``` The `info` object is still created and provided to resolution functions, and the `rootValue` is still provided within it, however it is now the *fourth* argument rather than the *third*. commit 576b6a15d189b902fa4dc1eb2e881c6bfe367a1f Merge: a781b556 6a1f23e1 Author: Lee Byron Date: Thu Mar 24 16:05:29 2016 -0700 Merge pull request #327 from graphql/tgriesser-schema-types Add GraphQLSchema types field commit 6a1f23e1f9c1e6bf4cea837bc9bb6eae0fb5c382 Author: Lee Byron Date: Tue Mar 22 22:17:43 2016 -0700 Add GraphQLSchema types field This is a rebased and updated version of @tgriesser's #199. I further extended it to completely remove the side-effectful mutation of Interface types rather than just deferring that mutation to schema creation time. This introduces a *breaking* change to the Type System API. Now, any individual Interface type does not have the required information to answer `getPossibleTypes` or `isPossibleType` without knowing the other types in the Schema. These methods were moved to the Schema API, accepting the abstract type as the first parameter. This also introduces a *breaking* change to the type comparator functions: `isTypeSubTypeOf` and `doTypesOverlap` which now require a Schema as a first argument. commit a781b556eea66bbf3cd82e438f560be9d9bec22c Author: Lee Byron Date: Thu Mar 24 15:30:23 2016 -0700 Follow up to #328 commit 8ba02b2fa43b5d60bd6718e076a756f26a0cf4f7 Merge: 81671dca edc405a1 Author: Lee Byron Date: Thu Mar 24 15:22:53 2016 -0700 Merge pull request #328 from JeffRMoore/default-resolve-type-fn Move getTypeOf to execute.js and rename to defaultResolveTypeFn commit 81671dca3fbccbc7d2a452c31c4b872979d9ddc7 Merge: 97611141 d506c23e Author: Lee Byron Date: Thu Mar 24 14:36:46 2016 -0700 Merge pull request #332 from graphql/default-resolve Add tests and refine default resolve function. commit d506c23e413a0b2d5b6b169caca4af928996d1d9 Author: Lee Byron Date: Thu Mar 24 13:56:40 2016 -0700 Add tests and refine default resolve function. This is a follow up to #330 commit 976111412226824043555b33aaf38f85b9042fa5 Merge: d934068b cbccaf9b Author: Lee Byron Date: Thu Mar 24 13:56:40 2016 -0700 Merge pull request #331 from graphql/revert-330-master Revert "unnecessary call throwing errors" commit cbccaf9baf1d4dda949bb317ccc872524ad884db Author: Lee Byron Date: Thu Mar 24 13:56:35 2016 -0700 Revert "unnecessary call throwing errors" commit d934068b3a76a368736f913e98c6cd0ca4a2c541 Merge: 8f495ba1 2cfe4902 Author: Lee Byron Date: Thu Mar 24 13:54:48 2016 -0700 Merge pull request #330 from wenzowski/master unnecessary call throwing errors commit 8f495ba1b1c11b5489c04702e9abce2798b7df78 Merge: 3f6a7f4c a8ee928c Author: Lee Byron Date: Thu Mar 24 13:52:17 2016 -0700 Merge pull request #329 from JeffRMoore/vague-optional-parameter Remove unnecessary optionality in type resolve parameters commit 2cfe490282beb0b83e84c2709732eb59f73e163a Author: Alec Wenzowski Date: Thu Mar 24 16:16:36 2016 -0400 unnecessary call throwing errors Somehow it appears that `call` is becoming unbound resulting in errors being thrown by `defaultResolveFn`. Why not just call the function directly? commit a8ee928cba72ebc1b27b114ae14db2943230c37f Author: jeff@procata.com Date: Thu Mar 24 00:49:22 2016 -0700 Remove unnecessary optionality commit edc405a11508a110759ce53c9efb2eb6dd2d181c Author: jeff@procata.com Date: Thu Mar 24 00:15:33 2016 -0700 Move getTypeOf to execute.js and rename to defaultResolveTypeFn to mirror defaultResolveFn commit 3f6a7f4ca9cd9242819e0e14fc7916635fbeeced Author: Lee Byron Date: Wed Mar 23 00:05:37 2016 -0700 Naming similarity commit 2d833ad166bf926149e9bc8f80358bdebbbfd1c9 Author: Lee Byron Date: Tue Mar 22 23:44:21 2016 -0700 Fix lint commit 1083c7e0f3dbd6be801a12f688fe0959716c54ac Author: Lee Byron Date: Tue Mar 22 23:40:00 2016 -0700 Cache client schema exe function, and include test for unreferenced interface commit 37924d240d7e094382927e4f612d61ff7dda3cb3 Author: Lee Byron Date: Tue Mar 22 23:33:32 2016 -0700 Include test for extending a schema that uses Enums commit 1de281b0713d72172757facdf35e3698956da47f Author: Lee Byron Date: Tue Mar 22 22:49:58 2016 -0700 build status badge for master commit 43992e3a60d7bf8f5e7d2f29dfae302b5ba72eec Author: Lee Byron Date: Tue Mar 22 17:58:05 2016 -0700 Remove unused function parameters commit 533fc43f7d5836fc9b6a3eafde9801db9a3ee011 Author: Lee Byron Date: Tue Mar 22 17:21:04 2016 -0700 Minor follow-up to #311 commit 371a5a0908123302a82de4a8d203df404681269e Merge: 176076c8 7a15a3f1 Author: Lee Byron Date: Tue Mar 22 17:12:06 2016 -0700 Merge pull request #311 from JeffRMoore/split-complete-value Split up the completeValue function commit 8379e71f7011fe044574f4bdef2a761d18d6cf2c Author: Lee Byron Date: Tue Mar 22 16:38:15 2016 -0700 [RFC] Add Schema Definition to IDL. This implements the schema definition in the spec proposal in https://github.com/facebook/graphql/pull/90 Adjusts AST, parser, printer, visitor, but also changes the API of buildASTSchema to require a schema definition instead of passing the type names into the function. commit 176076c8a674e7e718998a6519b327098ff6d457 Merge: 3ab90f84 b0885a03 Author: Lee Byron Date: Tue Mar 22 15:46:53 2016 -0700 Merge pull request #323 from graphql/schema Updating schema parser to more closely match current state of RFC commit 3ab90f846082a0f68cf5b7808f5b70915b55432e Merge: fdafe327 9920d8a1 Author: Lee Byron Date: Tue Mar 22 15:36:50 2016 -0700 Merge pull request #310 from JeffRMoore/resolve-fn-types Add named type for user defined resolveType and isTypeOf functions commit b0885a038ec0e654962d69fb910ac86659279579 Author: Lee Byron Date: Tue Mar 22 15:35:37 2016 -0700 Updating schema parser to more closely match current state of RFC https://github.com/facebook/graphql/pull/90 commit fdafe32724f2d6dac1ba360f1a440c0e633e75d9 Author: Lee Byron Date: Thu Mar 17 19:47:06 2016 -0700 [RFC] Directives in schema language This adds directives to schema language and to the utilities that use it (schema parser, and buildASTSchema). Directives are one of the few missing pieces from representing a full schema in the schema language. Note: the schema language is still experimental, so there is no corresponding change to the spec yet. DirectiveDefinition : - directive @ Name ArgumentsDefinition? on DirectiveLocations DirectiveLocations : - Name - DirectiveLocations | Name Example: ``` directive @skip(if: Boolean!) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT directive @include(if: Boolean!) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT ``` commit bf763b6f538b04cbdb518ceb93679c24815e6864 Merge: 3278e861 a7475032 Author: Lee Byron Date: Tue Mar 22 14:40:42 2016 -0700 Merge pull request #321 from chrisbolin/patch-1 Reference promises for resolve func commit 3278e861837cd3f7d17eaec54f3f04b175300826 Author: Lee Byron Date: Tue Mar 22 14:39:45 2016 -0700 Add tests confirming #319 commit 3ce90faf26d6e44b10fdfd7b514d5ce7877b2fea Merge: e3f53ecf debf3d1f Author: Lee Byron Date: Tue Mar 22 14:39:10 2016 -0700 Merge pull request #319 from denvned/patch-1 Fix error message for missing operation commit e3f53ecf7d64a230f6d6750801ab65a03e039bdf Merge: 57d71e10 e89c19d2 Author: Lee Byron Date: Tue Mar 22 13:48:55 2016 -0700 Merge pull request #317 from graphql/fine-grain-directives [RFC] Proposed change to directive location introspection commit a7475032b38e7614c10fe358f11b25bbfa147e3c Author: Chris Bolin Date: Tue Mar 22 13:11:22 2016 -0400 Reference promises for resolve func In response to https://github.com/graphql/graphql-js/issues/27 and SO questions. I don't believe there is "official" documentation (besides in issues and tests) of Promise support in the resolve function. Totally willing to be wrong :) commit debf3d1fbffc6b31e3b8425a28d3478d8cc0be78 Author: Denis Nedelyaev Date: Sun Mar 20 16:10:34 2016 +0300 Fix error message for missing operation commit e89c19d2ce584f924c2e0e472a61bb805ce260d4 Author: Lee Byron Date: Thu Mar 17 16:33:28 2016 -0700 [RFC] Proposed change to directive location introspection This proposes a change to how we represent the ability to validate the locations of directives via introspection. Specifically, this deprecates `onField`, `onFragment`, and `onOperation` in favor of `locations` which is a list of `__DirectiveLocation`. **Rationale:** This allows for a more fine-grained validation of directive placement, now you can assert that a directive is allowed on queries but not mutations, or allowed on fragment definitions but not on fragment spreads. Also, this makes expanding the locations a directive is allowed to be placed easier to do, as future expansions will not affect the introspection API. This should be considered a prereq to #265. Finally, this is a prereq to a forthcoming RFC to add directives to the type schema language, one of the last missing pieces to represent a full schema using this language. Currently considering something like: ``` directive @skip(if: Boolean) on FIELD, FRAGMENT_SPREAD, INLINE_FRAGMENT ``` **Drawbacks:** Any change to the introspection API is a challenge. Especially so for graphql-js which is used as both client tools via Graph*i*QL and as a node.js server. To account for this, I've left the existing fields as deprecated, and continued to support these deprecated fields in `buildClientSchema`, which is used by Graph*i*QL. While graphql-js will likely continue to expose these deprecated fields for some time to come, the spec itself should not include these fields if this change is reflected. commit 7a15a3f17452fadf2cc7d4f43fd41a7c24b38c8a Author: jeff@procata.com Date: Sat Mar 12 17:09:20 2016 -0800 Add invariant for unreachable condition commit d484f3186a7d9933257a73a7f1240e9abe68895d Author: jeff@procata.com Date: Sat Mar 12 17:06:35 2016 -0800 Extract completeAbstractValue from CompleteValue commit 5a136489f59c934dd9183caac8607c3415a7be07 Author: jeff@procata.com Date: Sat Mar 12 16:52:24 2016 -0800 Extract completeObjectValue from CompleteValue commit 4c5904c69e61fe2bc62cbbbe007016c2d82e24f2 Author: jeff@procata.com Date: Sat Mar 12 16:41:43 2016 -0800 Extract completeLeafValue from CompleteValue commit ab774705cf57fd21faf58ce33c360c21d13fe607 Author: jeff@procata.com Date: Sat Mar 12 16:34:38 2016 -0800 Extract completeListValue funciton from CompleteValue commit 9920d8a1d5e0608926e518b9a1463674c487768c Author: jeff@procata.com Date: Sat Mar 12 15:06:15 2016 -0800 Add GraphQLIsTypeOfFn commit b349a6906ac77a46e552924fddd147f01818e85c Author: jeff@procata.com Date: Sat Mar 12 15:01:43 2016 -0800 Add GraphQLTypeResolveFn commit 57d71e108afc0bdd205f5019fb8d0143b24b55b6 Author: Lee Byron Date: Fri Mar 11 19:07:55 2016 -0800 Adds a new npm script: check-cover, which reports the coverage of type checked code. commit 8e62f938d9bb81efe03587218a17aa70a3356f19 Merge: 2d1a4fb4 121564ce Author: Lee Byron Date: Fri Mar 11 18:36:39 2016 -0800 Merge pull request #309 from graphql/babel6 Upgrade to Babel6 commit 121564ce15ff63d07d0f99ad025fd2837e11dd36 Author: Lee Byron Date: Fri Mar 11 16:33:09 2016 -0800 Upgrade to Babel6 commit 2d1a4fb43b9725188ebbd4b6b55d511b10182b6b Merge: 5ea2ff1e b3a51278 Author: Lee Byron Date: Thu Mar 10 14:59:53 2016 -0800 Merge pull request #305 from tgriesser/test-parseLiteral Add test for parseLiteral on ComplexScalar commit b3a512787618cfbed20c9717daf2d69444bf7f33 Author: Tim Griesser Date: Tue Mar 8 21:02:07 2016 -0500 Add test for parseLiteral on ComplexScalar commit 5ea2ff1e17ff76ad0734c5ebd3041d0bd2b201e5 Author: Lee Byron Date: Mon Mar 7 12:54:37 2016 -0800 Export visitor helpers commit db0924a91f0a6c4cea8ff9a93713cbfe69c5ae8f Author: Lee Byron Date: Sun Mar 6 23:09:14 2016 -0800 Nit: fix missing quote in error message commit ecfdb3bb3e90755a7bff6155af50591d52e75625 Merge: 75e7be00 d2c005af Author: Lee Byron Date: Mon Feb 22 16:08:41 2016 -0800 Merge branch 'dminkovsky-visitor-edit-root-node' commit d2c005afc87353eceadc03592e74bd6e44063e8e Author: Lee Byron Date: Mon Feb 22 16:08:25 2016 -0800 Add to unit tests to ensure test accepts both edits of enter and leave commit f79ba42e30d9f1380f378440e4fe66b1aa428386 Author: Dmitry Minkovsky Date: Sat Feb 20 17:03:39 2016 -0500 Proposed fix commit 42562305570b04a5b7ec1ee7714f020f366023c9 Author: Dmitry Minkovsky Date: Sat Feb 20 16:40:46 2016 -0500 Tests to demonstrate problem commit 75e7be00285a5aa3b1ef3397a4e544148d9b1660 Author: Lee Byron Date: Wed Feb 17 17:44:13 2016 -0800 0.4.18 commit 084d1efa87c078ba62c5f559d2c8b5f1b04d7dfe Merge: fd8598de 58965620 Author: Lee Byron Date: Wed Feb 17 17:42:43 2016 -0800 Merge pull request #294 from dminkovsky/edit-comment Fix comment commit fd8598decf00ddc2de5ff3c0e164295b4e56493b Merge: 9234c6da 089caad3 Author: Lee Byron Date: Wed Feb 17 16:55:08 2016 -0800 Merge pull request #296 from jjergus/master Validate: Unique variable names commit 089caad3628e69003d79675558fe38023af02d31 Author: Jan Jergus Date: Wed Feb 17 15:00:39 2016 -0800 Validate: Unique variable names commit 58965620674a0245a0cc4b7ef190a450c04753cd Author: Dmitry Minkovsky Date: Tue Feb 16 11:38:37 2016 -0500 Fix comment commit 9234c6da0edbc4d2d2f3ff5d544a5980168d69ac Author: Lee Byron Date: Tue Feb 9 00:23:52 2016 -0800 0.4.17 commit 76e3ac14ac713d5bd22e4e56ba5702bbbdc694e7 Merge: 72e90c0d 6741c319 Author: Lee Byron Date: Tue Feb 9 00:22:05 2016 -0800 Merge pull request #289 from graphql/printer Provides a correct OperationType without name in GraphQLPrinter commit 6741c3192d0c0d5a1f6a9185adcf083b01699935 Author: Hyohyeon Jeong Date: Mon Feb 8 11:16:33 2016 -0800 Provides a correct OperationType without name in GraphQLPrinter commit 72e90c0db1a4a1716552cd5c7990f203d1a51300 Merge: 43f19c5c 4e62a143 Author: Igor Canadi Date: Thu Feb 4 21:42:03 2016 -0800 Merge pull request #287 from chapel/patch-1 Test schema instead of function 2 commit 4e62a143228a9944640507a43ab3404ea1f1b4e4 Author: Jacob Chapel Date: Thu Feb 4 21:08:17 2016 -0800 Test schema instead of function 2 Looks like there were plenty of these typos. I was in a rush to catch the train and didn't see them all. commit 43f19c5cddab30e2f347b4cc6d14bb2368cbdd3c Merge: a9839693 4b63d16c Author: Dan Schafer Date: Thu Feb 4 17:37:59 2016 -0800 Merge pull request #286 from chapel/patch-1 Test schema instead of function commit 4b63d16c8a8694b0ba3bbb99170e88e2a39c0256 Author: Jacob Chapel Date: Thu Feb 4 17:00:29 2016 -0800 Test schema instead of function The test was run against the function instead of the schema, a simple typo omission. commit a9839693cd0722f9434b3e305f6ff9f2d56d29f0 Author: Lee Byron Date: Tue Feb 2 21:57:31 2016 -0800 0.4.16 commit aff18e63c8befe9a380d75d82c80411921fe77cb Author: Lee Byron Date: Tue Feb 2 21:53:30 2016 -0800 Extract type comparators into the public API This adds the utilities isEqualType, isTypeSubTypeOf, and doTypesOverlap to the public API. commit 5ee1edc9022e796c4c70da70703bd8093354a444 Author: Lee Byron Date: Tue Feb 2 17:33:33 2016 -0800 Remove remaining references to u2028 and u2029 commit 4977c9eedc4a61e443c56065218fdd96a6affb00 Author: Lee Byron Date: Tue Feb 2 17:15:11 2016 -0800 0.4.15 commit 4547904dda4e430f1eda52dd3e2b7e150049a93b Author: Lee Byron Date: Tue Feb 2 17:11:54 2016 -0800 Export all public API from top module This exposes the full GraphQL.js API from the top level module, which hopefully will make it easier to find and use all of the utilities this library provides. This closes #143 commit 7011034609deeb7edef79f6565f1c9ff62579c64 Merge: f320fd09 7861b226 Author: Dan Schafer Date: Tue Feb 2 14:21:10 2016 -0800 Merge pull request #282 from graphql/errormessage [validator] Add suggested types to incorrect field message commit 7861b226b364979feaba4deef70dc472c54c8d3d Author: dschafer Date: Mon Feb 1 12:33:10 2016 -0800 [validator] Add suggested types to incorrect field message commit f320fd0927c1391c6061725ff2b0d0316d1c0fc6 Author: Lee Byron Date: Mon Feb 1 19:17:37 2016 -0800 Use null-prototype objects as string maps commit 1b639e3a6538d2184e1a2b96c410d164a20c08ed Author: Lee Byron Date: Mon Feb 1 19:07:08 2016 -0800 Improve validation error for unused variable commit 71b7b4aa2d0c82c71efb9c941dbd93e65e93a21c Author: Lee Byron Date: Mon Feb 1 17:43:02 2016 -0800 Fix typo in unit test, closes #269 commit 3eb5b7aa57c4d54fd28344ea467c0efda557a2a0 Merge: 82c16e44 611f4b1d Author: Lee Byron Date: Mon Feb 1 17:25:34 2016 -0800 Merge pull request #256 from benbjohnson/patch-1 Update Int type description to match implementation commit 82c16e444131072acc36964162ad5b52ac43685b Merge: a0eef4b8 ab1f51da Author: Lee Byron Date: Mon Feb 1 17:24:40 2016 -0800 Merge branch 'fson-fix-unknown-field-error' commit ab1f51da6679c98f1de96fd984a401c0b286670d Merge: a0eef4b8 20694e4a Author: Lee Byron Date: Mon Feb 1 17:24:14 2016 -0800 Merge branch 'fix-unknown-field-error' of https://github.com/fson/graphql-js into fson-fix-unknown-field-error commit a0eef4b8b8f5834749d59169c322ee0da9d06b46 Merge: 337925e1 318d41e7 Author: Lee Byron Date: Mon Feb 1 17:03:30 2016 -0800 Merge pull request #276 from nodkz/patch-1 Better error for GraphQLList commit 337925e19c9be8ad51501134ff87213751e3cb6a Merge: 509c85d4 f1997e82 Author: Dan Schafer Date: Mon Feb 1 13:52:34 2016 -0800 Merge pull request #283 from graphql/eslint [easy] Bump babel-eslint version commit f1997e82eacefa0cdab7726be9d9e5c571e41a76 Author: dschafer Date: Mon Feb 1 13:47:15 2016 -0800 [easy] Bump babel-eslint version commit 509c85d4f589b5177daa8c6b6e39762d10072a70 Author: Lee Byron Date: Thu Jan 21 00:22:25 2016 -0800 Flow type the AST schema builder commit dfe676c3011efe9560b9fa0fcbd2b7bd87476d02 Author: Lee Byron Date: Thu Jan 21 00:18:39 2016 -0800 Ensure NamedType is a known Node commit c55e9ac1ca0f2fbc94ddc8cb1fabdb9a454996e0 Author: Lee Byron Date: Wed Jan 20 23:30:46 2016 -0800 Move the extension definition out of type definition commit 9ddb2b579bf94126c5494e64c534571f94bb420d Author: Lee Byron Date: Wed Jan 20 23:10:44 2016 -0800 flow type the parser commit 1651039cf4d28c832dc02ec7995db45ce028a9c4 Author: Lee Byron Date: Wed Jan 20 22:11:13 2016 -0800 no more flow weak commit 7419af27ca11f44dc78b3ee7a65f1b7b94b0d7d8 Author: Lee Byron Date: Wed Jan 20 21:58:44 2016 -0800 Use parametric type for scalars commit d5ecfe08b1f74dedd3e42186426100eddc07da7a Author: Lee Byron Date: Wed Jan 20 21:54:09 2016 -0800 replace most usage of flow all in favor of mixed, fixing some discovered issues Now more resilient enum resolution and field access on a null root value commit 6dba6ce7513af9a792b0a1ee08897f2050b7b236 Author: Lee Byron Date: Wed Jan 20 20:05:48 2016 -0800 ensure returns boolean value from isThenable commit 1ee5907495b971c55873b176a52198ee305496de Author: Lee Byron Date: Wed Jan 20 19:58:22 2016 -0800 Clarify types of types, remove some flow casting commit fc9cb5a5b4976bcc4e5712752f152464ba7a56e2 Author: Lee Byron Date: Wed Jan 20 19:15:40 2016 -0800 turn on prefer-const commit 042e1620bb3a83e07e15586bb5b69b211c91e8de Author: Lee Byron Date: Wed Jan 20 19:10:12 2016 -0800 un-var-ify, prefering const. eslint no-var rule now enabled commit 1b7f878bd92579d8aba929a52b00cfc1d502b294 Author: Lee Byron Date: Wed Jan 20 18:30:11 2016 -0800 No more var in star wars tests commit 660e1d85113b74e808531595ef9584879d0c2add Author: Lee Byron Date: Wed Jan 20 18:27:54 2016 -0800 Update to latest version of flow, finding and fixing some errors! commit 318d41e782b9672f99770ccafde82210043c52c5 Author: Pavel Chertorogov Date: Fri Jan 15 12:24:29 2016 +0600 Fix typo commit 6447badc64c6d4171cebeed5081b8c48e3a2c0d6 Author: Pavel Chertorogov Date: Fri Jan 15 12:13:53 2016 +0600 Better error for GraphQLList Error message now contains field name. commit 89783419eb33716f02c254a6e5dab2623b81cdb9 Author: Lee Byron Date: Fri Jan 8 17:07:53 2016 -0800 discord link commit 89e77d1ed833f0744d2b1854d10b6266af8e8868 Author: Lee Byron Date: Fri Jan 8 17:05:55 2016 -0800 Better links for Q&A commit 20694e4a878dd8afc372c60fd7ce3b8619e99c93 Author: Ville Immonen Date: Mon Dec 7 15:59:33 2015 +0200 Fix the error message for unknown field The error message for unknown field was literal: "In field "${providedField}": Unknown field." Add necessary back ticks to the template literal so the message includes the actual field name. Also change the test that claims to test this case to actually test it. commit 611f4b1d473907fde31c99a6008f5ef387836a14 Author: Ben Johnson Date: Thu Dec 3 12:43:09 2015 -0700 Update Int type description to match implementation This commits updates the `GraphQLInt` type description to match the changes made in 06f97b6. commit a6bcc75d3c19ce31847cd77279a41fbc6ac032d2 Author: Lee Byron Date: Tue Dec 1 00:14:04 2015 -0800 0.4.14 commit 06f97b67491f0215df7536aac50361bd90d5097d Author: Lee Byron Date: Tue Dec 1 00:09:50 2015 -0800 Spec compliant Int sizing As discussed in #182, this was a deviation between spec and reference implementation, where the spec is more reasonable. This tightens the allowed range of Int values to valid 32-bit signed integers, supporting the broadest collection of platforms. For those who stumble upon this rev looking for ways to represent numeric-looking large values, see ID or Custom Scalars. commit 0d033924274c3c701424dd41f04912baa981acc4 Author: Lee Byron Date: Tue Dec 1 00:01:33 2015 -0800 Add links to readme, closes #209 commit 3d27953a4653ca8ea5aa18edab105ca374dc0b39 Author: Lee Byron Date: Mon Nov 30 23:55:11 2015 -0800 Include originalError in GraphQL error to preserve any additional info Fixes #251 commit 786340e450517b4a70c27299e2ad497634b6abb4 Merge: 812e09d6 b07f9ce8 Author: Lee Byron Date: Mon Nov 30 23:38:34 2015 -0800 Merge branch 'master' of github.com:graphql/graphql-js commit 812e09d681c2f10d4e5d09f75314e47953eeb7d4 Author: Lee Byron Date: Mon Nov 30 23:36:46 2015 -0800 Fix false-positive validation error for unknown type Fixes #255 commit b07f9ce88b1a956b8c580f51798951304fc65c31 Merge: 32a54926 46618529 Author: Lee Byron Date: Mon Nov 30 23:19:34 2015 -0800 Merge pull request #252 from rtorr/rtorr-add-main add main to package.json commit 32a54926803ee6b353ffa26c87dfc2c846d4c4f7 Author: Lee Byron Date: Mon Nov 30 20:53:27 2015 -0800 Tests for visitWithTypeInfo, support for editing commit bd87fd312061a2cedcf590d0eca5a56ab26c1b5c Author: Lee Byron Date: Mon Nov 30 20:09:47 2015 -0800 Parallel visitor supports editing commit b2bdae08cfcb1dd7ee78fff156bcdfbf09b2cd47 Author: Lee Byron Date: Mon Nov 30 19:46:35 2015 -0800 Support breaking in parallel visitor commit 699dc10eeea70a8a341c68ea1a34dc0f2f8a6906 Author: Lee Byron Date: Mon Nov 30 19:31:52 2015 -0800 Fix issue with skipping subtrees in parallel visitor Fixes #254 commit 3a6d35b59f9e254ccb1c9b8db0f0ed77cd1a3c90 Author: Lee Byron Date: Mon Nov 30 19:31:24 2015 -0800 add npm script to test single file commit 4661852931bd53c9c034db3e21eb3bfc89531388 Author: Richard Torruellas Date: Sun Nov 29 12:37:48 2015 -0700 add main to package.json commit 30c39ecc13776b7a2ad4488ca38f6b3ea613f181 Author: Lee Byron Date: Wed Nov 25 15:38:06 2015 -0800 Update dependencies and fix newly found lint error commit ca003e48c92840012aa3dff7fd32daeb7cb38459 Author: Lee Byron Date: Wed Nov 25 15:33:03 2015 -0800 Remove cli tool commit b573141752ca9dae309dacc4dc1912f01b8dc4ef Merge: bc81a018 a8d516ea Author: Lee Byron Date: Wed Nov 25 15:16:20 2015 -0800 Merge pull request #250 from plievone/patch-3 Fix tests by updating babel-eslint commit bc81a0184bfc3afcb5e8d4239a657c701e2878db Merge: 86e197a3 9b598994 Author: Lee Byron Date: Wed Nov 25 15:13:38 2015 -0800 Merge pull request #246 from plievone/patch-2 Use the same babel options in npm published package commit 86e197a35a94abcc1108a8f1d1b12b25a8f6115a Merge: b1476620 c3a67be5 Author: Lee Byron Date: Wed Nov 25 15:06:12 2015 -0800 Merge pull request #244 from plievone/patch-1 Docs: remove outdated language/schema from readme. commit a8d516ea500592efb97d1c901069a477a9ff12e5 Author: plievone Date: Mon Nov 23 23:24:41 2015 +0200 Fix tests by updating babel-eslint Tests started failing a few of days ago, when escope (eslint dependency) updated v3.2.0 to v3.2.1, with updated dependencies. There may still be fixes coming in babel-eslint, escope, and their dependencies, but pumping babel-eslint for now seems to fix the tests. commit 9b59899479b64336e7a767190c07ecf0379b576d Author: plievone Date: Sat Nov 21 09:30:04 2015 +0200 Use same babel options in npm published package Followup commit to c61ccac where babel plugin options were inlined to command line. Brings npm published version and built version in sync. commit c3a67be50000bc6aaaf35427fcad09257a085edb Author: plievone Date: Sat Nov 21 01:26:29 2015 +0200 Docs: remove outdated language/schema from readme. `graphql/language/schema` was merged with 'graphql/language' in v0.4.3. commit b14766205951f4fe6f712c9e24d47c0d117cc3bf Author: Lee Byron Date: Tue Nov 17 12:09:37 2015 -0800 0.4.13 commit 3cac2668be813b2779b8c953e18da2b645cb0747 Merge: 2f10ad44 284415e0 Author: Lee Byron Date: Tue Nov 17 11:49:27 2015 -0800 Merge branch 'freiksenet-better-error-messages-for-inputs' commit 284415e00e905e9d3ff24ad931d7aa9ea849a312 Merge: 2f10ad44 ab13f32c Author: Lee Byron Date: Tue Nov 17 11:48:47 2015 -0800 Merge branch 'better-error-messages-for-inputs' of https://github.com/freiksenet/graphql-js into freiksenet-better-error-messages-for-inputs commit 2f10ad44e7e6e8e2865c83ac006105203001eae6 Merge: c61ccace 4cd12d94 Author: Lee Byron Date: Tue Nov 17 11:40:03 2015 -0800 Merge pull request #203 from philix/false Minor change: parseType doesn't need a second parameter commit c61ccace8b2c905b6a40526d6c7d5f98d5f67f01 Author: Lee Byron Date: Tue Nov 17 11:30:24 2015 -0800 Remove babel options from package Babel 6 now reads package.json files of node_modules in some conditions, and the presence of this options causes issues for the npm distributed build. This moves the options to be command flags where necessary. Fixes #228 commit 71ad449959561f4e808c0e1fce9609c35f0d8fa9 Merge: e81cf397 edbe0637 Author: Lee Byron Date: Tue Nov 17 11:14:37 2015 -0800 Merge pull request #239 from graphql/covariance [Schema] Implementing interfaces with covariant return types. commit edbe063718590d84594f2b8e06dc6fd67e1f3ec2 Author: Lee Byron Date: Mon Nov 16 22:38:16 2015 -0800 [Schema] Implementing interfaces with covariant return types. This proposes loosening the definition of implementing an interface by allowing an implementing field to return a subtype of the interface field's return type. This example would previously be an illegal schema, but become legal after this diff: ```graphql interface Friendly { bestFriend: Friendly } type Person implements Friendly { bestFriend: Person } ``` commit e81cf39750e8c2dbde7a7910e13893aa644e02dd Author: Lee Byron Date: Mon Nov 16 21:00:16 2015 -0800 [Validation] Report var def before var usage commit 1d14db78b8e38d6cb5b0698dadc774ed794f7398 Author: Lee Byron Date: Mon Nov 16 20:56:43 2015 -0800 [Validation] Include variable definition node when reporting bad var type commit 81e759620b96b61803ada0486ef5ac63e03b5300 Merge: 439a3e2f 95770418 Author: Lee Byron Date: Mon Nov 16 20:46:02 2015 -0800 Merge pull request #238 from graphql/parallel-validator [Validation] Parallelize validation rules. commit 957704188b0a103c5f2fe0ab99479267d5d1ae43 Author: Lee Byron Date: Mon Nov 16 20:33:54 2015 -0800 [Validation] Parallelize validation rules. This provides a performance improvement and simplification to the validator by providing two new generic visitor utilities. One for tracking a TypeInfo instance alongside a visitor instance, and another for stepping through multiple visitors in parallel. The two can be composed together. Rather than 23 passes of AST visitation with one rule each, this now performs one pass of AST visitation with 23 rules. Since visitation is costly but rules are inexpensive, this nets out to a much faster overall validation, especially noticable for very large queries. commit 439a3e2f4f1238288ef24add882a79e17e5ff31c Merge: 320ca249 c73cc727 Author: Lee Byron Date: Mon Nov 16 19:50:51 2015 -0800 Merge pull request #237 from graphql/no-visitSpreadFragments [Validation] Remove visitFragmentSpreads commit c73cc727e06a29140615d3b8beb452b3e2d09e58 Author: Lee Byron Date: Mon Nov 16 19:45:57 2015 -0800 [Validation] Remove visitFragmentSpreads This removes the mechanism that automatically expanded fragment spreads during a visit. It's no longer used after recent changes to some validator rules, but also makes over-visiting suboptimizations too easy to accidentally create. commit 320ca2497727404021f3807cef130d5bc4eebc04 Merge: 4e610b72 5e545cce Author: Lee Byron Date: Mon Nov 16 19:42:14 2015 -0800 Merge pull request #236 from graphql/reportError [Validation] Report errors rather than return them commit 4e610b72626c27a2fa12784cbfadd1ff4b7e1660 Author: Lee Byron Date: Mon Nov 16 19:41:55 2015 -0800 [Validation] Unwrap recursion for collecting fragment spreads commit 5e545cce0104708a4ac6e994dd5f837d1d30a09b Author: Lee Byron Date: Mon Nov 16 19:32:13 2015 -0800 [Validation] Report errors rather than return them This replaces the mechanism of returning errors or lists of errors from a validator step to instead report those errors via calling a function on the context. This simplifies the implementation of the visitor mechanism, but also opens the doors for future rules being specified as warnings instead of errors. commit ef7c755c58a4da3e28212e85718718195daf1c35 Merge: 88acc01b 2afbff79 Author: Lee Byron Date: Mon Nov 16 19:19:41 2015 -0800 Merge pull request #235 from graphql/memo-variable-use [Validation] Memoize collecting variable usage. commit 2afbff79bfd2b89f03ca7913577556b73980f974 Author: Lee Byron Date: Mon Nov 16 17:54:30 2015 -0800 [Validation] Memoize collecting variable usage. During multiple validation passes we need to know about variable usage within a de-fragmented operation. Memoizing this ensures each pass is O(N) - each fragment is no longer visited per operation, but once total. In doing so, `visitSpreadFragments` is no longer used, which will be cleaned up in a later PR commit 88acc01b994dcb27ad74a82e60c6495c89a0f109 Merge: 568dc52a eef8d97f Author: Lee Byron Date: Mon Nov 16 17:48:03 2015 -0800 Merge pull request #234 from graphql/better-no-unused-fragments [Validation] Factor out and memoize recursively referenced fragments. commit eef8d97f64b5b5fa0df79435c4fe237976867573 Author: Lee Byron Date: Mon Nov 16 17:31:46 2015 -0800 [Validation] Factor out and memoize recursively referenced fragments. This adds a new method to the validation context which when given an Operation definition, returns a list of all Fragment definitions recursively referenced via fragment spreads. This new method is then used to ensure no fragments are unused. The implementation of this method is the same in principle as the one which used to be inline in the validation rule, but has been unfolded from recursion to use a while loop. commit 568dc52a4f9cc9bdec4f9283e6e528970af06cde Author: Lee Byron Date: Mon Nov 16 16:04:20 2015 -0800 Updated to latest flow, fix newly detected issues commit 9a1fb32daa368a6065e569867ecd8761248f994e Merge: 7278b7c9 0bc90881 Author: Lee Byron Date: Fri Nov 13 00:32:23 2015 -0800 Merge pull request #232 from graphql/validation-speedup [Validation] Performance improvements commit 0bc9088187b9902ab19c0ec34e0e9f036dc9d9ea Author: Lee Byron Date: Fri Nov 13 00:26:05 2015 -0800 [Validation] Performance improvements Fairly dramatic improvement of some validation rules by short-circuiting branches which do not need to be checked and memoizing the process of collecting fragment spreads from a given context - which is necessary by multiple rules. commit 7278b7c92c3319bb8b07013913b58fc7cadbb8b4 Merge: a738c6d9 4cf2190b Author: Lee Byron Date: Thu Nov 12 23:55:21 2015 -0800 Merge pull request #231 from graphql/fast-cycle-detection [Validation] perf improvements for fragment cycle detection commit 4cf2190b54fefc34a7b37d22a489933fc15e14ce Author: Lee Byron Date: Thu Nov 12 23:47:01 2015 -0800 [Validation] perf improvements for fragment cycle detection This converts the O(N^2) cycle detector to an O(N) detector and optimizes the visit to short-circuit where parts of the validation visitor were unnecessary. On an internal very large stress test query this was previously ~30s and after this diff runs in 15ms. commit a738c6d90d5d72b776356e992c60023aa26f4b43 Merge: f010e86c 9b11df2e Author: Lee Byron Date: Thu Nov 12 20:16:19 2015 -0800 Merge pull request #230 from graphql/diverging-directives [validation] Allow differing directives. commit 9b11df2efc66ad3c07e0d373a7e04a3ba5ee581a Author: Lee Byron Date: Thu Nov 12 19:48:47 2015 -0800 [validation] Allow differing directives. The currently supported directives: @skip and @include do not create an ambiguous or erroneous query when used on conflicting fields in a divergent fashion. In fact, this may be intended when many different conditions should result in the same outcome. For example: ```graphql { field @include(if: $firstCondition) field @include(if: $secondCondition) } ``` This example could be considered as the intent of fetching `field` given `$firstCondition || $secondCondition`. While this example is contrived, there are more complex examples where such fields are nested within fragments that this condition is reasonable. commit f010e86c3d3057dee36d6096ed2600492c41f4e7 Author: Lee Byron Date: Thu Nov 12 18:11:42 2015 -0800 Perf improvement for comparing two types commit 6a3eac753d49975c9e03a03db80fae7474ca8411 Merge: 228215a7 d71e063f Author: Lee Byron Date: Thu Nov 12 18:07:09 2015 -0800 Merge pull request #229 from graphql/allow-safe-divergence [validation] Allow safe divergence commit d71e063fdd1d4c376b4948147e54438b6f1e13de Author: Lee Byron Date: Thu Nov 12 17:39:54 2015 -0800 [validation] Allow safe divergence As pointed out in #53, our validation is more conservative than it needs to be in some cases. Particularly, two fields which could not overlap are still treated as a potential conflict. This change loosens this rule, allowing fields which can never both apply in a frame of execution to diverge. commit 228215a704e9d7f67078fc2652eafa6b6e22026f Author: Lee Byron Date: Thu Nov 12 16:24:24 2015 -0800 [Validation] Un-interleave overlapping field messages When deep field colisions are detected, the existing validator interleaved the resulting fields in a way that made reading the error more difficult. This solves the issue by internally tracking two parallel lists of blame nodes, one for each side of the comparison, and concatting only at the end to ensure a stable non-interleaved output. commit fee4fe322f982c9f1b8d5c2e2eb9137d1fcba74a Merge: 413c817d 9ea8196c Author: Lee Byron Date: Thu Nov 12 16:00:13 2015 -0800 Merge pull request #227 from graphql/extend-schema extendSchema() commit 9ea8196c2af97551bab5cfd57201c29e3085ee4e Author: Lee Byron Date: Wed Nov 11 18:44:17 2015 -0800 extendSchema() This new utility function produces a new Schema, provided an existing one and a document containing schema type definitions and extensions. commit ab13f32c1c42d72982ee78bb0d51111cca664044 Author: Mikhail Novikov Date: Thu Nov 12 13:58:39 2015 +0200 Fix accidental logic error in argument checking commit 413c817d9177c32a85e1ac23e8baa75ab1f1265d Merge: 8118b4b9 57c47516 Author: Lee Byron Date: Wed Nov 11 20:46:04 2015 -0800 Merge pull request #220 from pyros2097/patch-1 Fix typo commit 8118b4b9c69ca3b1223da08c076729ab00f68e4a Merge: e41ffa59 a4c4a97e Author: Lee Byron Date: Wed Nov 11 20:45:43 2015 -0800 Merge pull request #226 from graphql/kassens-patch-1 Fix typo on introspection.js commit a4c4a97eadc670dca8ddf61d8eecb9585ecc99cf Author: Jan Kassens Date: Wed Nov 11 14:30:53 2015 -0800 Fix typo on introspection.js commit e1c59a488ece3f0221a046e1b7e1cd108dc314c0 Author: Mikhail Novikov Date: Wed Nov 11 11:15:32 2015 +0200 Make unknown field errors uniform with other errors commit 98364f61e716f5ff82ccd9432c264368d1052455 Author: Mikhail Novikov Date: Wed Nov 11 11:10:41 2015 +0200 Improve error messages further commit e41ffa595067e1f808befec358113d8c3dfc12f0 Author: Lee Byron Date: Tue Nov 10 22:10:59 2015 -0800 Test against v4 LTS commit 5b20f2721279899648c6e254dfa47c487d0cba27 Author: Lee Byron Date: Tue Nov 10 20:35:12 2015 -0800 Ensure tests pass on node stable commit 2ada5c69ecf3901e6ce1a5fe73e04a6fbfa2c0f8 Author: Mikhail Novikov Date: Mon Oct 12 18:18:09 2015 +0300 Make input objects and lists return better errors Add index of invalid element or field of invalid field and make it recurse into children until faulty place is found. commit 57c47516894acf4c2265d0812e0dc32b933243c7 Author: pyros2097 Date: Thu Nov 5 14:53:27 2015 +0530 Fix typo commit 60e55da31f761303f60bc8258a71d278939e52c0 Author: Lee Byron Date: Mon Oct 26 20:57:12 2015 -0700 0.4.12 commit 5a6ab116cadafbaf613387dd22a8e4b7b36738e2 Author: Lee Byron Date: Mon Oct 26 20:56:52 2015 -0700 Experimental: customizable validation commit dd41b83981b1ef4c39069349e9c4a7d39628e404 Author: Lee Byron Date: Mon Oct 26 19:54:48 2015 -0700 0.4.11 commit 8c62789fd156761ca83992fb8d2192d41d768d13 Author: Lee Byron Date: Mon Oct 26 19:54:22 2015 -0700 Fix false positive validation error from fragment cycle when unknown fragment is used commit b160c58bf526c4792c50a2a61fbdbda405940cfd Author: Lee Byron Date: Mon Oct 26 19:24:02 2015 -0700 0.4.10 commit b71a738e683a7a40a88220a355c8e6cfea8995ef Merge: 4355c40b e1806ced Author: Lee Byron Date: Mon Oct 26 19:22:38 2015 -0700 Merge pull request #216 from graphql/deprecation-introspection Support deprecation via introspection commit e1806ced58c06a05281a886fcd5dc084e2e2ba36 Author: Lee Byron Date: Mon Oct 26 19:14:28 2015 -0700 Support deprecation via introspection This ensures deprecation information flows throughout introspection back through building client-side schema. commit 4355c40bc0d5873fdfb18e1ef398ba298232b031 Author: Lee Byron Date: Mon Oct 26 18:45:39 2015 -0700 Documentation for main graphql() function Improves #194 commit 39bf4a417efbb7f10f89b9cb1cfbf99462013fac Author: Lee Byron Date: Mon Oct 26 18:11:31 2015 -0700 Allow nested objects with similar keys. Fixes #206 commit 7ecc82e7d8fc4179e98e6faecb7023e03e577622 Merge: 3a6b4d13 2fd6287e Author: Lee Byron Date: Mon Oct 26 16:44:49 2015 -0700 Merge pull request #215 from graphql/directives Allow providing directives to GraphQLSchema commit 2fd6287e3b12f94c5314a0e5a4a74af3ebda82a3 Author: Lee Byron Date: Mon Oct 26 15:29:12 2015 -0700 Allow providing directives to GraphQLSchema This allows GraphQLSchema to represent different sets of directives than those graphql-js is able to use during execution. Critically, this allows GraphQLSchema to be used against servers which support different sets of directives and still use validation utilities. commit 3a6b4d130f225c275cba3027245ffaff0f4b7799 Author: Lee Byron Date: Mon Oct 26 11:40:45 2015 -0700 [Utility] concatAST() This accepts an array of AST documents and returns a single AST document which is the concatenation of all definitions within those documents. This is useful for retaining accurate source:line statements when GraphQL source material is spread across multiple files. commit 07708960b954e869bcbf75be305121df0193cf83 Author: Lee Byron Date: Wed Oct 21 22:51:06 2015 -0700 0.4.9 commit c5d613e295f7b0c229e75dda4c5f32424198c24f Merge: defbb036 08ffd091 Author: Lee Byron Date: Wed Oct 21 22:50:13 2015 -0700 Merge pull request #212 from graphql/moreargs [RFC] Additional optional arguments commit 08ffd091b78c594d92d308970f986cd9258f0596 Author: Lee Byron Date: Wed Oct 21 12:38:45 2015 -0700 [RFC] Additional optional arguments Implements https://github.com/facebook/graphql/pull/110 commit defbb036174063b7d867c614d5c140464c5c44f1 Author: Lee Byron Date: Tue Oct 20 17:00:01 2015 -0700 0.4.8 commit 10ec8f5bcc2d07968c538b8345099feaeb9561a9 Merge: d5b9d411 650bbbc9 Author: Lee Byron Date: Tue Oct 20 16:43:42 2015 -0700 Merge pull request #200 from jhgg/patch-1 Fix copy paste error in test description commit d5b9d411397da4ece1ce4f689c1eb4f77d1748e3 Merge: 39a2ebc0 28b85b80 Author: Lee Byron Date: Tue Oct 20 16:42:33 2015 -0700 Merge pull request #201 from jhgg/missing-directive-tests Implement anonymous inline fragment directive tests commit 39a2ebc0803ef5324912f194e0ad0e45debc6930 Merge: fbe579d1 87c6a274 Author: Lee Byron Date: Tue Oct 20 16:18:22 2015 -0700 Merge pull request #189 from skevy/wip-subscriptions [RFC] Initial pass at adding `subscription` to executor commit 87c6a274fb24e08a2c85a93a9294e5711eed874b Author: Adam Miskiewicz Date: Fri Oct 16 16:55:00 2015 -0400 first pass at tests for subscriptions commit a0c30d347568bafadd4eb8fceb72688241e06bf5 Author: Adam Miskiewicz Date: Fri Oct 16 14:14:35 2015 -0400 code style improvements commit d5f27681fe8956c6c75c3e52b885300e8b5fcdc8 Merge: 8a589f6e fbe579d1 Author: Adam Miskiewicz Date: Fri Oct 16 14:09:32 2015 -0400 Merge remote-tracking branch 'upstream/master' into wip-subscriptions commit fbe579d12f837d99dd7bed0331d1128d9f2e428d Merge: a941554f 85bcbffc Author: Greg Hurrell Date: Wed Oct 14 00:24:59 2015 -0700 Merge pull request #195 from wincent/war-on-it-s Declare total war on misuse of "it's" commit 4cd12d94e28e488b42ef49d3eebbf008b89e7163 Author: Felipe Oliveira Carvalho Date: Sun Oct 11 09:47:49 2015 -0300 parseType doesn't need a second parameter commit 28b85b80ff73af7faa34e170c55148e90ea7e2f5 Author: Jake Date: Thu Oct 8 18:18:21 2015 -0400 Implement anonymous inline fragment directive tests commit 650bbbc94dbbbcd1e57ae48d42bed056ff836d8f Author: Jake Date: Thu Oct 8 12:58:39 2015 -0400 Fix copy paste error in test description commit 85bcbffcaf950b6a6dacae97ee351041f6f406c1 Author: Greg Hurrell Date: Fri Oct 2 17:59:25 2015 -0700 Declare total war on misuse of "it's" Also fixed one use of "descendents" that happened to be on one of the touched lines. commit a941554fc56d607fecebe2188a7ca8848835c2a8 Author: Lee Byron Date: Thu Oct 1 20:15:02 2015 -0700 0.4.7 commit a0bf6f9bb1155a502649c8de743b4e35841b08b0 Author: Lee Byron Date: Thu Oct 1 20:14:39 2015 -0700 Fix validators to be aware of type-condition-less inline frags commit b6a326bfd3bef649b8cd82edea29c9677bef3838 Author: Lee Byron Date: Thu Oct 1 19:57:38 2015 -0700 0.4.6 commit 58e2b2ebb9af9e5f0f3ac68fb47aaaca661a96be Merge: 529257b8 3f1f9f57 Author: Lee Byron Date: Thu Oct 1 18:22:25 2015 -0700 Merge pull request #191 from graphql/inline-fragment-op-type [RFC] Type condition optional on inline fragments. commit 3f1f9f5759704ca9ed153c98558236a66af75153 Author: Lee Byron Date: Thu Oct 1 18:10:21 2015 -0700 [RFC] Type condition optional on inline fragments. Implements https://github.com/facebook/graphql/pull/100 commit 529257b8d3319100ba66ad432a6dc8b167d9874e Merge: 2cfbfcec 56f0b399 Author: Lee Byron Date: Thu Oct 1 16:00:49 2015 -0700 Merge pull request #190 from graphql/optional-op-name [RFC] Make operation name optional. commit 56f0b39911101400e462def6880f90d1117f242c Author: Lee Byron Date: Thu Oct 1 15:37:42 2015 -0700 [RFC] Make operation name optional. Implements https://github.com/facebook/graphql/pull/99 commit 2cfbfcec58f9a58d327de59ed3d378db5666bdee Author: Lee Byron Date: Wed Sep 30 18:58:23 2015 -0700 properly export getOperationAST utility commit 59ea82470804393d3d8697a4b78f380beb5c6dd7 Author: Lee Byron Date: Wed Sep 30 18:47:40 2015 -0700 0.4.5 commit 75ce8b1f1e90484ced2291a9cbd8bce978990553 Author: Lee Byron Date: Wed Sep 30 18:45:31 2015 -0700 Early errors for misuse of deprecation It was too easy to accidentally misuse the field and enum deprecation API. This adds an early error explaining the correct form. Closes #185 commit 6f2b66df332625a8f2269836f774e91d750e00ac Author: Lee Byron Date: Wed Sep 30 18:21:18 2015 -0700 Clearer lex errors for unprintable unicode Fixes #183 commit 4bd4b33a5a48cff0c4382e6873555bed9adadb00 Author: Lee Byron Date: Wed Sep 30 17:38:02 2015 -0700 terminology nit commit f66ddf55f93010f7e2ca4ca717d522d4d0d4b12b Author: Lee Byron Date: Wed Sep 30 17:35:46 2015 -0700 getOperationAST utility function commit 1bf253734e32be518dd2bf693de0612969e1e847 Author: Lee Byron Date: Mon Sep 28 14:15:59 2015 -0700 fix lint commit da5c4b0814887382067dcaeaddd6fed8a76a3614 Author: Lee Byron Date: Mon Sep 28 14:13:20 2015 -0700 Add parser test containing tricky multi-byte commit 160c67a74e833f17dde75203b385a33f09e68775 Merge: 5d4d531f 969095e9 Author: Lee Byron Date: Fri Sep 25 12:52:46 2015 -0700 Merge pull request #186 from graphql/control-badness [RFC] Clarify and restrict unicode support commit 969095e9f6be0bb13a69c715c6ee4910814a065b Author: Lee Byron Date: Thu Sep 24 15:51:32 2015 -0700 [RFC] Clarify and restrict unicode support This proposal alters the parser grammar to be more specific about what unicode characters are allowed as source, restricts those characters interpretted as white space or line breaks, and clarifies line break behavior relative to error reporting with a non-normative note. Implements https://github.com/facebook/graphql/pull/96 commit 5d4d531f231136179ecd8df0e6ac36ea20531dc1 Merge: 657fbbba 9046c14d Author: Lee Byron Date: Thu Sep 24 10:17:22 2015 -0700 Merge pull request #184 from graphql/unique-input-fields [RFC] Move input field uniqueness validator commit 9046c14d135e7e0785b6a43cd0e0ceef7e8773b4 Author: Lee Byron Date: Wed Sep 23 16:49:45 2015 -0700 [RFC] Move input field uniqueness validator This proposes moving input field uniqueness assertion from the parser to the validator. This simplifies the parser and allows these errors to be reported as part of the collection of validation errors which is actually more valuable. A follow-up RFC against the spec will be added commit 657fbbba26ed1fa18915b2a9f050a5fae08a7469 Author: Lee Byron Date: Wed Sep 23 16:39:39 2015 -0700 Fix test for unique arg names commit 9cedbc3ffe14c001d091d79f0e3e29df546ee899 Merge: ace66361 850bc950 Author: Lee Byron Date: Mon Sep 21 20:52:11 2015 -0700 Merge branch 'master' of github.com:graphql/graphql-js commit ace663618b543c2eddbe0218a805bf31551755cc Author: Lee Byron Date: Mon Sep 21 20:21:53 2015 -0700 Only import types from ast commit 850bc950139c3716e2d43cd74843c8e860e4a015 Merge: e606cecd f62c0a25 Author: Lee Byron Date: Mon Sep 21 14:19:09 2015 -0700 Merge pull request #178 from graphql/error-return Resolvers can return `Error` to signify failure commit e606cecd12d1069a01c43e23db0b0fa0564c9db8 Merge: e6051bc5 242fdcb2 Author: Lee Byron Date: Fri Sep 18 22:41:49 2015 -0700 Merge branch 'master' of github.com:graphql/graphql-js commit e6051bc50df88c14911bfffec6510fa95c180619 Author: Lee Byron Date: Fri Sep 18 21:09:40 2015 -0700 Update to latest flow commit f62c0a25ffa8d4285b5d66c7886872ea4fee8c28 Author: Lee Byron Date: Fri Sep 18 13:55:46 2015 -0700 Resolvers can return `Error` to signify failure This adds another way resolver functions can signify a failure: returning an Error object. The primary reason this is useful is returning a list of values where index contains an error but another does not. A test casehas been added to illustrate this behavior. Previously sync resolvers could only throw an error, killing the whole list, or return nulls and fail to present error messaging. I then used this as a simplifying factor to the executor core where it removed a third instance of locating and logging an error. commit 242fdcb202b3d599391cc324db4180fa6b983bf3 Merge: 8c52207a 17998532 Author: Lee Byron Date: Thu Sep 17 18:47:57 2015 -0700 Merge pull request #177 from woodb/validation-use-constants Replaced validator kind strings with constants commit 8c52207af26bf9818479681811e881d747ef17c4 Author: Lee Byron Date: Thu Sep 17 18:37:18 2015 -0700 Fix tests commit 0530394f9ac81e235070b67d9dd0a95b54b3c754 Author: Lee Byron Date: Thu Sep 17 14:09:26 2015 -0700 introspection descriptions for scalars and introspection commit 17998532216b520a899a196f54bcb59c1faa512a Author: Brandon Wood Date: Wed Sep 16 21:52:56 2015 -0400 Replaced validator kind strings with constants There were a few places in the validation rules that were not using the constants found in `src/language/kinds.js`. This commit replaces those strings with their respective constants. This can be considered a cleanup. commit 662e316f04939a58922de948efe6e8273db0f029 Author: Lee Byron Date: Tue Sep 15 13:21:46 2015 -0700 Rename "runtimeType" variable Calling this variable "runtimeType" makes it a little more clear that this value cannot be known statically, which is an easy misinterpretation. Also added a bit of documentation above the function. commit 0ca1946e5ff5421ced715fc057f36c62461b90b4 Author: Lee Byron Date: Mon Sep 14 12:20:07 2015 -0700 0.4.4 commit 8241f221bc4517feed17a5e6644e086fd7b8973b Merge: cde2774d e892cac4 Author: Lee Byron Date: Mon Sep 14 12:13:10 2015 -0700 Merge pull request #175 from chentsulin/patch-2 Add npm version badge commit cde2774d977f57428030503c07b5b7df2658ae7e Merge: e5565263 9ffe3c7e Author: Lee Byron Date: Mon Sep 14 12:13:00 2015 -0700 Merge pull request #174 from graphql/test-parsing-extension Add test for parsing extend type definitions commit e892cac4954ed0216a11828545bdf64ec736adac Author: C. T. Lin Date: Mon Sep 14 01:01:39 2015 +0800 Add npm version badge commit 9ffe3c7ef2b2970055066024c2895bc54c783d50 Author: Scott Wolchok Date: Sat Sep 12 12:18:24 2015 -0700 Add test for parsing extend type definitions commit e556526313909b409821098283f52838a99d3f48 Merge: 3bc93a74 b96a0d41 Author: Lee Byron Date: Tue Sep 8 20:01:43 2015 -0700 Merge pull request #167 from nemanja-stanarevic/master Fixed the issue #166 related to parsing of 'extend type' declaration commit 8a589f6e88ecf675ce34d39d813a7b271dae46aa Author: Adam Miskiewicz Date: Sun Sep 6 17:32:29 2015 -0400 initial subscription commit. Makes "subscription" behave like "query" commit b96a0d4108986fd9d0615fba3d07c38f8247bee2 Author: nemanja-stanarevic Date: Wed Sep 2 15:30:41 2015 -0400 Fixed the issue #166 related to parsing of extend type declaration commit 3bc93a74400bbfac727ee97b4a4a38c253c640b5 Author: Lee Byron Date: Tue Sep 1 19:34:36 2015 -0700 0.4.3 commit 63167b58189b65392813a5ff864746a6fd9372d9 Author: Lee Byron Date: Tue Sep 1 19:06:30 2015 -0700 Cleanup parser changes based on spec discussion commit 62fac26385d75ed239a688c36644a24fce965a92 Author: Lee Byron Date: Tue Sep 1 16:34:30 2015 -0700 [Experimental] Subscription queries This simply adds `subscription` as an operation kind to the parser and AST. No semantics or implementations are added here. This should unlock those who are beginning experimentation with GraphQL subscriptions. commit f9a287754898faf850101045f7d63000ea1b2159 Author: Lee Byron Date: Tue Sep 1 15:56:32 2015 -0700 Move name assertion to definition time commit 4ff563ec8bb16f0e3f79a7f0ed84d3b3511a535b Merge: d05d751c c8592d8f Author: Lee Byron Date: Tue Sep 1 15:48:27 2015 -0700 Merge pull request #145 from jmandel/check-arg-names Check for valid field arg names commit d05d751cb45c6ccc623579cebf6edfb497c73e06 Merge: 20ad1a8a a68212ee Author: Lee Byron Date: Tue Sep 1 15:47:09 2015 -0700 Merge pull request #165 from graphql/rfc-type-extension [RFC] Type extension syntax commit 20ad1a8aed304b835faf8f743d7b265977cd8ef0 Merge: 0800c349 a475d334 Author: Lee Byron Date: Tue Sep 1 11:54:19 2015 -0700 Merge pull request #160 from chentsulin/patch-1 clarify String => GraphQLString in comment commit a68212eeffb1fae8e5783f461508d82c01e7a686 Author: Lee Byron Date: Mon Aug 31 15:11:23 2015 -0700 [RFC] Type extension syntax This proposal introduces a syntactic addition for client-side tools that perform code generation. It allows those tools to describe "extensions" to the server-supplied GraphQL schema. Tools may then use this information to generate client side Plain-Ol'-Data types which include these client-side-only extensions. The syntax I'm proposing is: ``` TypeExtensionDefinition : `extend` ObjectDefinition ``` An example of this might look like: ``` type User { name: String birthday: Int } extend type User { age: Int } ``` While I could have proposed simply `extend User { ... }`, I chose to fully reuse the ObjectDefinition rule to preserve the future ability to expand this syntax to include extending interfaces, enums, and other types. commit 0800c34965b7c144731a38abc2099f0f1eb50f76 Author: Lee Byron Date: Mon Aug 31 15:45:04 2015 -0700 Follow up: clarify AST kind names commit 7a07c81be3e3024db19322d8200e1c63e324aa5b Merge: 9afdada4 73b4d4d3 Author: Lee Byron Date: Mon Aug 31 15:31:04 2015 -0700 Merge pull request #163 from graphql/rfc-lang [RFC] Expand GraphQL language commit 73b4d4d301a232ebdd790bb3cf1042e3a67a8fca Author: Lee Byron Date: Fri Aug 28 17:38:23 2015 -0700 [RFC] Expand GraphQL language This proposes merging the schema language into the GraphQL language. After some time of thinking about this, I believe this is the best path. There is only one "GraphQL language" and thus only one spec for a parser. I believe this will have substantial simplification forces on GraphQL server libs and client tools and the APIs they expose. This also means the validation phase can be designed to accept both "client GraphQL" and "server GraphQL" rather than two separate utilities with two separate AST and rule structures. Instead we're just likely to want to introduce standard rule sets for each environment. The drawback is explaining the semantics. This diff primarily adds type definition syntax to GraphQL, and it should be made clear that *at present* GraphQL servers do not have semantics for these and in fact will not execute queries which contain them. commit a475d334d83b9a9490a3cf0abff56c3cce7b4053 Author: C. T. Lin Date: Thu Aug 27 17:20:21 2015 +0800 clarify String => GraphQLString commit 9afdada4f8f27a41d22c671ac701b842449d2296 Merge: 4d6eb4d6 3e9ea7b7 Author: Lee Byron Date: Wed Aug 26 14:04:40 2015 -0600 Merge pull request #157 from Gregoor/patch-1 Add --save to graphql install commit 3e9ea7b70a511ce1222aae711a3964745ee94f73 Author: Gregoor Date: Wed Aug 26 15:24:58 2015 +0200 Add --save to graphql install commit 4d6eb4d62625c4bc2d9f5493bab79b5080af6e43 Merge: 028b3b68 88b52e9c Author: Dan Schafer Date: Tue Aug 25 10:34:43 2015 -0700 Merge pull request #153 from ning-github/patch-1 Correct capitalization commit 88b52e9c01733e43c17a0c5d2e112c0283a11096 Author: Ning Xia Date: Mon Aug 24 22:22:43 2015 -0700 Correct capitalization capitalized 'ast' into 'AST' for consistency throughout commit 028b3b68cffb19d2469d4cce9a964b2b444790d7 Merge: 5e9c79a7 6cf0f3f8 Author: Dan Schafer Date: Mon Aug 24 14:42:37 2015 -0700 Merge pull request #147 from philix/extra-store Minor change: remove unnecessary update of local variable commit c8592d8f55d2f5fdf32ef0c6d8ea1515f6a3e4ef Author: Josh Mandel Date: Mon Aug 24 11:32:27 2015 -0400 Check field name validity too commit 6cf0f3f8f60f6dd60f656f92bd65d2a56b8325e1 Author: Felipe Oliveira Carvalho Date: Sat Aug 22 20:56:32 2015 -0300 Remove unnecessary update of local variable commit 2edab8b043501a67d1c66f8b05e0e16321a616bf Author: Josh Mandel Date: Fri Aug 21 17:35:14 2015 -0400 Check for valid field arg names commit 5e9c79a7be9ef58a80bda0d5779d0c3d9bb98818 Merge: f9cd233e 5261658a Author: Lee Byron Date: Wed Aug 19 19:58:45 2015 -0700 Merge branch 'master' of github.com:graphql/graphql-js commit f9cd233e9fa70f4d932859fc394e33fe104ec890 Author: Lee Byron Date: Wed Aug 19 19:58:38 2015 -0700 Minor note in contributing commit 5261658a10499f75bf59e9c3c04fb4ab9f1f1ee8 Merge: 1c5cdbd3 8cb2c251 Author: Lee Byron Date: Wed Aug 19 18:43:51 2015 -0700 Merge pull request #141 from enaqx/patch-4 Fix comments typo in type definition commit 1c5cdbd314200a5bc78ef52b6be9194587a55437 Merge: 2a84e0d7 a1921288 Author: Lee Byron Date: Wed Aug 19 18:43:37 2015 -0700 Merge pull request #140 from hzoo/arrow-parens update babel-eslint@4.0.10, use eslint-plugin-babel/arrow-parens, fixes commit 8cb2c2516e5d43b332b6b72364ab1bb151850c10 Author: Nick Raienko Date: Thu Aug 20 04:41:55 2015 +0300 Fix comments typo in type definition commit 2a84e0d70f3f2ae0eae8bec5c057224a46b8c10d Author: dschafer Date: Wed Aug 19 16:13:32 2015 -0700 Fix misnamed export commit a1921288128da2c2b3bbadf915ec224267988020 Author: Henry Zhu Date: Wed Aug 19 18:31:32 2015 -0400 update babel-eslint@4.0.10, use eslint-plugin-babel/arrow-parens, fixes commit ffe7be456a00457833e4fdffcbbd459a546e9218 Merge: 2125bb43 431271e8 Author: Lee Byron Date: Wed Aug 19 12:26:15 2015 -0700 Merge pull request #137 from enaqx/patch-2 Fix typo in prepublish commit 2125bb43d38881390c972d000e851a51c2422611 Merge: d10827f2 562f9d7b Author: Lee Byron Date: Wed Aug 19 12:23:55 2015 -0700 Merge pull request #136 from enaqx/watch-es6 Match ES6 style in watcher commit d10827f22c944056f75126262c6ea61b85b73de8 Merge: bf75d436 8cd2d40a Author: Lee Byron Date: Wed Aug 19 12:22:29 2015 -0700 Merge pull request #139 from graphql/listbadchar Add explanation of bad number character commit 8cd2d40a70fcc6c5b72e71d4e8390479e8814150 Author: Lee Byron Date: Wed Aug 19 12:14:14 2015 -0700 Improve error messages for number lexing, catching common errors commit a6ae8a666b6d764146480a1fc4c744d25439d7ae Author: dschafer Date: Wed Aug 19 10:44:30 2015 -0700 Add explanation of bad number character commit 431271e8ef06c6f871c07b70812b2bbb50490766 Author: Nick Raienko Date: Wed Aug 19 14:29:06 2015 +0300 Fix typo in prepublish commit 562f9d7bc94dad19beaaa0366adbd02a2a06a274 Author: Nick Raienko Date: Wed Aug 19 12:02:19 2015 +0300 Match ES6 style in watcher commit bf75d43679f35190764901ce4ce647ac743cb354 Merge: cf50cc3a fa7e5c12 Author: Lee Byron Date: Tue Aug 18 16:45:32 2015 -0700 Merge pull request #132 from freiksenet/do-not-mutate-passed-fields Do not mutate passed field map in ObjectType and ObjectInput commit fa7e5c1249aa66c675082169fa9c1ee2ffc2cfee Author: Mikhail Novikov Date: Mon Aug 17 14:48:11 2015 +0300 Do not mutate passed field map in ObjectType and ObjectInput commit cf50cc3a304faff9a4215cd121a548e65794a089 Author: Lee Byron Date: Fri Aug 14 14:45:41 2015 -0700 Formatting to match code guidelines commit e0ab1d21db1f5053a00b58dc0cffdec357194fcc Merge: 8d5c1239 a7d02554 Author: Lee Byron Date: Fri Aug 14 14:43:14 2015 -0700 Merge pull request #129 from johanatan/master Add enum coercion test for mutation. commit a7d025547115353bb3c664e1bf8ee44e043b1115 Author: Jonathan Leonard Date: Fri Aug 14 12:12:52 2015 -0700 Add enum coercion test for mutation. commit 8d5c1239b75476ff951c3e285518146d16275361 Author: Lee Byron Date: Fri Aug 14 02:27:06 2015 -0700 0.4.2 commit 60d0cbb7d157125e27abfa3df51da750e875d264 Author: Lee Byron Date: Fri Aug 14 02:26:33 2015 -0700 Use error ctor for syntax errors rather than mutation Fixes issue where syntax errors were reported with poor messages. commit a4c5605badb28e5182e8822073689167725aede8 Author: Lee Byron Date: Fri Aug 14 01:34:37 2015 -0700 0.4.1 commit a149b89a3047f38750eaade1f220eb1317eb9217 Author: Lee Byron Date: Fri Aug 14 01:19:04 2015 -0700 Assert the result of `getObjectType` When an interface or union resolves to an object type at runtime, we now assert that the resolved type is a possible type for that abstract type. commit e53ccef20a8494cce28a372f453cf2e8eb3f627e Author: Lee Byron Date: Fri Aug 14 00:05:30 2015 -0700 Add resource to check the current git state before versioning commit e06420e73f834218d9aba850168a84b22e0e69ff Author: Lee Byron Date: Thu Aug 13 23:42:14 2015 -0700 Update README.md commit 2e29b7885976d83bc1a289fdcce9541e7048e6ac Author: Lee Byron Date: Thu Aug 13 23:10:04 2015 -0700 Assert proper Enum configuration. This asserts that Enums have properly configured values. This also asserts that isTypeOf and resolveType are functions, if provided. Finally, this changes the signature of EnumType.getValues() to return an array instead of an Object map, since every single use case was calling Object.keys. This fixes #122 commit fec9862e381995af90656a312f552695dd008118 Merge: a45a02d0 8889cf97 Author: Lee Byron Date: Thu Aug 13 22:30:49 2015 -0700 Merge pull request #128 from chris-ramon/patch-1 typo commit 8889cf97d08a744c4f25bb3383626a152dae0f30 Author: Chris Ramón Date: Fri Aug 14 00:28:00 2015 -0500 typo commit a45a02d04f1754a81d5b97fc48738d742b3b01b2 Merge: 44aa5851 a617fa77 Author: Lee Byron Date: Thu Aug 13 21:51:08 2015 -0700 Merge branch 'rexxars-improve-non-null-error' commit a617fa778de6e396ed92036272d5bbdc79730e98 Author: Lee Byron Date: Thu Aug 13 21:50:58 2015 -0700 Minor error message clean up to use Type.field pattern commit 6ece8e3d7d6041b3ca69de187c08dd3451e10e54 Merge: 44aa5851 a92f1ca8 Author: Lee Byron Date: Thu Aug 13 21:44:51 2015 -0700 Merge branch 'improve-non-null-error' of https://github.com/rexxars/graphql-js into rexxars-improve-non-null-error commit 44aa585146486d53be388a4c00aa547f3b877df8 Merge: d3188d39 73401ed2 Author: Lee Byron Date: Thu Aug 13 19:16:35 2015 -0700 Merge pull request #127 from graphql/interfaceinvariant [RFC] schema enforced interface adherance. commit 73401ed28c6755f8f4c234f8389aa1ede9edef92 Author: Lee Byron Date: Thu Aug 13 15:52:27 2015 -0700 [RFC] schema enforced interface adherance. This adds an invariant step in the Schema ctor for enforcing that all Object types in the Schema properly adhere to the Interface types they claim to implement. This effectively implements http://facebook.github.io/graphql/#sec-Object-type-validation commit d3188d39b5ae1ae36987e035d6d166ff540f7e6a Author: Lee Byron Date: Thu Aug 13 15:07:16 2015 -0700 Prevent registering more than one type with the same name A freshening up of the PR #35 (thanks @dittos) This enforces that a schema consists of a list of uniquely named types, as per the spec. commit 29a1990ec989233f2682c425df2668647dba109f Author: Lee Byron Date: Thu Aug 13 14:19:27 2015 -0700 Type modifiers invariant correct inputs in ctor This adds a new predicate `isType` exposed from `graphql/type` and uses it to invariant that the composed type of List and NonNull types are correct. Fixes #126 commit ef2073245f4366a116be7cf20b821cdf2127a745 Author: Lee Byron Date: Thu Aug 13 14:03:55 2015 -0700 Enforce Scalar coercion functions in ctor This asserts `serialize`, `parseValue` and `parseLiteral` are all properly defined. commit 1aa71c67f2b896c04b61a9ba8a46c10f3e65a99b Author: Lee Byron Date: Thu Aug 13 13:27:33 2015 -0700 [Maintenance] improve test titles commit cb05af014a79f6a8b72423cf0949da546cc890bb Author: Lee Byron Date: Thu Aug 13 13:17:32 2015 -0700 Enforce Union types and Object interfaces in ctor This adds more invariants for Type ctors. In this case ensuring that the `types` field of a Union or the `interfaces` field of an Object type are correct. Note: this does not yet enforce that an Object type correctly implements the Interface type it claims to. commit a92f1ca80172c472e7e93feb8db0ce7991555fd0 Author: Espen Hovlandsdal Date: Thu Aug 13 22:08:08 2015 +0200 Improve error message when encountering null-values for non-nullable fields commit 3b17c31c72e194808fe129742df97be39d83444f Merge: 7214a652 7154b1c8 Author: Lee Byron Date: Thu Aug 13 11:37:17 2015 -0700 Merge pull request #124 from graphql/type-invariants [RFC] move type validation to ctor invariants commit 7154b1c84d1531d402ed4d29d20379e49557c83a Author: Lee Byron Date: Wed Aug 12 23:17:56 2015 -0700 [RFC] move type validation to ctor invariants This removes the type validation system, and in its place puts invariants into the type ctors. This ensures that errors are produced as types are created, rather than when (or if) they run through the validator. This should lead to faster error recovery and less errors. There were a number of issues detected in our test files that these invariants picked up. Fixes #121 commit 7214a652b83f9ff08498831bba0306bdecc82277 Merge: 2cf2f4c3 e4a411a8 Author: Lee Byron Date: Wed Aug 12 19:29:28 2015 -0700 Merge branch 'master' of github.com:graphql/graphql-js commit 2cf2f4c33aa524796414c787f9bf75ba0380a28b Author: Lee Byron Date: Wed Aug 12 19:28:30 2015 -0700 Correctly parse enum values from variables This adds a test suite to ensure the proper handling of enum types. In doing so, it fixed an issue where enum values were not being properly parsed when provided as variables. Fixes #123 commit ae4e0d9dea4725eaa19ec243fdc892c4f655cdd6 Author: Lee Byron Date: Wed Aug 12 19:25:41 2015 -0700 Clearer error messages This adds clearer errors for incorrect variables. Does not wrap printed values in quotes, to avoid ambiguity with strings. commit c3e94a31deb14f16cd08f4635531caccd2974c53 Author: Lee Byron Date: Wed Aug 12 19:22:31 2015 -0700 Make GraphQL properties non-editable and non-enumerable This will make writing tests using deep.equal easier and not require using containsSubset which can lead to false positives. commit 0e0f44582f6644856f86e4a2c708b09fa9bb5b3a Author: Lee Byron Date: Wed Aug 12 17:36:47 2015 -0700 fix npm run watch commit e4a411a8699566e096815ea1027ff7794249c403 Merge: a84abd69 f26872b3 Author: Dan Schafer Date: Wed Aug 12 17:25:07 2015 -0700 Merge pull request #120 from cletusw/master Update starWarsQueryTests to mimic real database API commit a84abd692141fb78ab0b8eb500b6643a359463a8 Author: Lee Byron Date: Wed Aug 12 17:16:20 2015 -0700 Clearer message when multiple copies of GraphQL are in use commit 29eff45d1c4b4cf8570311544abed1cee774803a Author: Lee Byron Date: Wed Aug 12 15:40:03 2015 -0700 [Maintenance] moving scripts to resources commit f26872b32927c1300b986e0748a97dc410493872 Author: Clayton Watts Date: Wed Aug 12 11:08:08 2015 -0600 Update starWarsQueryTests to support real database API A back-end implementation with a real database wouldn't have direct access to the full dataset. commit e988b9ac8efbe73017c51007715ff84472dc8f47 Author: Lee Byron Date: Tue Aug 11 18:33:46 2015 -0700 0.3.0 commit 6ca64c6c89c78e5ada7f2409cbfa6839a25b82ae Author: Lee Byron Date: Tue Aug 11 18:33:21 2015 -0700 Rename variables to variableValues for clarity commit 31ffe4a2ada422a098238110d1cd6d6c2cc66077 Author: Lee Byron Date: Tue Aug 11 17:37:08 2015 -0700 Call isTypeOf during execution for assertion of type. Also ensures resolution info is provided to isTypeOf function. Fixes #38 commit d6f428a180a0543b51c5d7cb8a7a58497841d15a Author: Lee Byron Date: Tue Aug 11 16:51:26 2015 -0700 Provide GraphQLResolveInfo to resolveType This solves the issue raised in #103 by providing a second argument with this information. There is also some minor renaming happening in this diff to match previous diffs. commit 06ecf38878bb3904977b68b6ff948c3df818a1a7 Merge: 2314da34 d919089f Author: Lee Byron Date: Tue Aug 11 16:25:39 2015 -0700 Merge pull request #119 from graphql/arity [RFC] Expose more information to field resolver functions. commit d919089f784a97c85dabb253280ae0682208e2b1 Author: Lee Byron Date: Tue Aug 11 16:16:20 2015 -0700 [RFC] Expose more information to field resolver functions. This exposes more info to field resolvers, but reduces the arity of these functions to a fixed 3 arguments: source, arguments, execution info. This along with ES6 argument destructuring makes accessing this information more natural. commit 2314da34d2386a79e0750f8774d4db70632a6f91 Merge: 2734d013 35600776 Author: Lee Byron Date: Tue Aug 11 16:15:50 2015 -0700 Merge pull request #118 from graphql/no-format [RFC] Do not format errors from graphql() commit 3560077644ec52086cad8d7ad4760987020b7ce9 Author: Lee Byron Date: Tue Aug 11 14:48:34 2015 -0700 [RFC] Do not format errors from graphql() This changes the implementation of `graphql()` to not format any returned errors. Most importantly, this allows access to the `stack` property of each error, along with richer information contained in GraphQLError like the affected AST nodes and source document. This means that the responsibility for formatting errors must be handled elsewhere, likely by an HTTP service like `express-graphql`. commit 2734d013e0048da60110b4f1ad3a5c65b027d562 Author: Lee Byron Date: Tue Aug 11 14:22:54 2015 -0700 Do not set arguments that were not provided commit 44c9daf3cbe6ea8d85a595767dcdf7492e873c25 Author: Lee Byron Date: Tue Aug 11 13:50:58 2015 -0700 Ensure null values are not provided in input objects commit 7bb34be0a083a910393add5ddec58b891a03a9ae Author: Lee Byron Date: Tue Aug 11 13:31:29 2015 -0700 Fix accidental renames, build breakage commit a623fc6a75c03c336bb0447161c52d0018388343 Merge: 5cc84040 90d0b0d7 Author: Lee Byron Date: Tue Aug 11 13:10:28 2015 -0700 Merge branch 'freiksenet-parse-variable' commit 90d0b0d71744cc59ec25d865547ccc74a7a85e79 Author: Mikhail Novikov Date: Tue Aug 11 11:30:48 2015 +0300 Add parseValue and move from coerce terminology * Add parseValue to scalar, to separate parsing of values from their serialization * Rename coerce to serialize and coerceLiteral to parseLiteral commit 5cc840402afa6d813cf16e8a58b40254da69e844 Merge: 9d1df7a5 d90f1786 Author: Lee Byron Date: Tue Aug 11 12:46:59 2015 -0700 Merge branch 'fson-nested-input-objects' commit d90f17863ab7a0ea7cb53fff802ddec1a9971366 Merge: 9d1df7a5 7b2d290f Author: Lee Byron Date: Tue Aug 11 12:45:37 2015 -0700 Merge branch 'nested-input-objects' of https://github.com/fson/graphql-js into fson-nested-input-objects commit 9d1df7a59ddacee17b7b00b6b68129aaf4f4aa0e Author: Lee Byron Date: Tue Aug 11 12:37:17 2015 -0700 unbreak build commit 7b2d290f897af03b51b7e89bf3ff28358d0ec61a Author: Ville Immonen Date: Tue Aug 11 15:47:25 2015 +0300 Fix some input objects missing from the type map Input object types were not included in the type map when they were used as a field type in other input objects, because `typeMapReducer` did not recurse into those fields. Modify `typeMapReducer` to also handle GraphQLInputObjectType and add a test case that checks also nested input object types are handled. commit 81a7d7add03adbb14dc852bbe45ab030c0601489 Author: Lee Byron Date: Mon Aug 10 18:15:35 2015 -0700 Upgrade to latest eslint, improving rules, fixing newly caught issues commit e2c1451bb30a4b05a74197c6ada9c07f6d55dbda Author: Lee Byron Date: Fri Aug 7 16:11:31 2015 -0700 Fix issue where misspelled fragment definition can break validator commit 4fe29bc9ce1f594ddaff4addf30e1e231adefbc4 Author: Lee Byron Date: Fri Aug 7 14:22:36 2015 -0700 update contributing to explain release process commit f5f6946ea74aaf9c9b2c098b63110f88714a716f Author: Lee Byron Date: Fri Aug 7 14:21:11 2015 -0700 0.2.6 commit dbb37528ca4ea9ab68ce861cd38f1371b8f7ed25 Author: Lee Byron Date: Fri Aug 7 14:18:52 2015 -0700 move validation rule messages into rule file to make it easier to find commit 472af2848e121f9595366b43fbbadfeee53150bb Author: Lee Byron Date: Fri Aug 7 13:38:08 2015 -0700 rename allRules to specifiedRules commit e7825199de6c265e49daa50f0589046bb046ece2 Author: Lee Byron Date: Fri Aug 7 13:35:30 2015 -0700 Formatting consistency in validator commit 7d6e981889e727087f1d47144c364404154bc468 Author: Lee Byron Date: Fri Aug 7 13:21:49 2015 -0700 Simplify validator This replaces the validator's visitor which loops through each validation rule at each step of the visitor with a single visitor for each validator. This removes the complexity and duplication in the validator and removes spurious errors that could result from an unrelated validation error. commit e7f7fee5778cbee3293ec4f3e3b36fc0f5d0bb0d Author: Lee Byron Date: Fri Aug 7 12:41:46 2015 -0700 Add validation rule for argument uniqueness commit cab585f644a81c5050891cbd1b06d5c8a137c146 Author: Lee Byron Date: Thu Aug 6 18:54:39 2015 -0700 Ensure all validators have error name definitions commit 7c1375b0a5d6cad3eb5ef6554326414861a5fd21 Author: Lee Byron Date: Thu Aug 6 18:50:26 2015 -0700 Add validation rules for operation uniqueness commit fce1fec257b75aa03342125e587f2d6cd77b4adf Author: Lee Byron Date: Thu Aug 6 17:49:03 2015 -0700 Add validation rule for Fragment Name Uniqueness commit ebace3168c376dccd2f7e1b876f977eb51455fc4 Author: Lee Byron Date: Thu Aug 6 17:23:38 2015 -0700 validation error clarity commit 742bfa405e61983512e283ac0bdd9dcae930583a Author: Lee Byron Date: Thu Aug 6 17:09:26 2015 -0700 Validate directive arguments Fix #110 Argument validation was assuming field arguments which led to spurious error. commit bd944466b334c6bcffd55aa74c72c7aca9b9961a Author: Lee Byron Date: Thu Aug 6 16:59:19 2015 -0700 fix bad package reference commit a74082134a56d51ab0edc7dabd4590e263123481 Author: dschafer Date: Thu Aug 6 10:38:02 2015 -0700 0.2.5 commit 8385b7b026b9de8b2fe38f0a7517361af84657a9 Merge: e99fc53d 5262885b Author: Dan Schafer Date: Thu Aug 6 10:37:18 2015 -0700 Merge pull request #108 from graphql/mutationname Add check for unknown mutation type commit 5262885b4a3a8c290b324657be3b108f6c2b0ecb Author: dschafer Date: Thu Aug 6 10:30:32 2015 -0700 Add check for unknown mutation type commit e99fc53d6ae5954641c8b852c41ff969644a03c7 Merge: 8317a112 b3109219 Author: Dan Schafer Date: Thu Aug 6 10:33:07 2015 -0700 Merge pull request #107 from graphql/fixinterface Ensure unreferenced types that implement reference interfaces are detected commit b3109219399c3912776d06413f21f131b60f88b1 Author: dschafer Date: Thu Aug 6 10:25:14 2015 -0700 Iterate through all types, not just from query commit b8c3d0de7debccf8d77ded335e4b569bfb2cec8a Author: dschafer Date: Wed Aug 5 22:58:12 2015 -0700 Ensure unreferenced types that implement reference interfaces are detected commit 8317a1126bcd04bb380029fddaea837ff6e4d5ba Merge: 5fe05af6 3466fc90 Author: Dan Schafer Date: Wed Aug 5 16:50:53 2015 -0700 Merge pull request #105 from nemanja-stanarevic/master Fixes issue #104 with buildASTSchema and Float fields commit 3466fc906fa1bb68aedc463ee9d9a034c1e6b824 Author: nemanja-stanarevic Date: Wed Aug 5 19:30:28 2015 -0400 Fixes issue #104, allows buildASTSchema to materialize a type with a Float field. Adds tests for Float and ID to 'Simple type' test and for Float, ID, Int and Boolean to 'Single argument field' test. commit 5fe05af64fa310194e0921ef3834765cd76a248d Author: dschafer Date: Mon Aug 3 13:28:52 2015 -0700 Update CONTRIBUTING commit 84138db91bfb23b0c095406cc768ec8df021121d Author: dschafer Date: Mon Aug 3 13:21:44 2015 -0700 0.2.4 commit 974584628697b0cd94a2e459af5c95675e196993 Merge: b0922151 500f85ec Author: Lee Byron Date: Mon Aug 3 13:18:11 2015 -0700 Merge branch 'master' of github.com:graphql/graphql-js commit 500f85ec2fd705c0de6578e7620a2ad4a8a0447b Author: dschafer Date: Mon Aug 3 13:15:26 2015 -0700 Release 0.2.3 commit f2794c356253f2f64e8bba6211db209e2039be4f Author: dschafer Date: Mon Aug 3 13:00:39 2015 -0700 Fix the print-schema script commit 85d93b76d875e464caa7eb038e7e112e7f23585b Merge: f9eda2e7 ac7a99f7 Author: Dan Schafer Date: Mon Aug 3 11:40:10 2015 -0700 Merge pull request #101 from nemanja-stanarevic/master Fix issue with buildASTSchema when both query and mutation are passed commit ac7a99f753f27dd86a8f15ff8b4ba6e8cd69f0a4 Author: nemanja-stanarevic Date: Sun Aug 2 15:15:50 2015 -0400 minor naming tweak commit 6504907452383e9efe6e5bbc54a21c1c39ff69f9 Author: nemanja-stanarevic Date: Sun Aug 2 14:56:45 2015 -0400 Fix issue with buildASTSchema when both query and mutation are passed commit b092215120b516b072591db8c81036bb8d2da730 Author: Lee Byron Date: Sun Aug 2 02:19:51 2015 -0700 0.2.3 commit f9eda2e75a446e0aeda70d3bcea3734829f39146 Author: Lee Byron Date: Sun Aug 2 02:19:41 2015 -0700 Do not rely on ES6 methods, fixes #99 commit 9f3effc6589f0cba3ce35a597536b274249bc7c8 Author: Lee Byron Date: Thu Jul 30 21:23:39 2015 -0700 0.2.2 commit d47a25532eb41e3d109dda0f8b78e9f0206c9d69 Author: Lee Byron Date: Thu Jul 30 21:21:59 2015 -0700 Fix issues with OverlappingFields validator Add tests for issues reported by @steveluscher, ensure those tests pass. Also fix remaining flow issues with this rule impl. commit 7812eda5e9c6f8c537a67f8dcd1c860b6da1041e Author: Lee Byron Date: Thu Jul 30 19:11:09 2015 -0700 0.2.1 commit e5e9e69a543f5754c6e4c68565b1ea912f102def Author: Lee Byron Date: Thu Jul 30 19:10:45 2015 -0700 remove flow comments, it is too buggy commit 105ec5381ee06c5e4a1a75f32499074cd14f90fa Author: Lee Byron Date: Thu Jul 30 18:24:06 2015 -0700 fix build script commit 5753fdbf035626c91328be1ee83b63afbb0b9bae Author: Lee Byron Date: Thu Jul 30 18:18:43 2015 -0700 add schema submodule README commit 532bdd03ac8bbadf41c23ae7b158edada23f5d65 Author: Lee Byron Date: Thu Jul 30 18:00:29 2015 -0700 0.2.0 commit aefa03380269e82734a652e422ce55a6dfc8706d Author: Lee Byron Date: Thu Jul 30 18:00:19 2015 -0700 export a bunch of definition types and predicates commit aa5902cf9d7c24837b949f55a0088173d83a1471 Author: Lee Byron Date: Thu Jul 30 17:48:05 2015 -0700 export flow types from introspection query result commit e6b8e58ac31d6de2c98454c33cc7c3565458f8cc Author: Lee Byron Date: Thu Jul 30 17:12:34 2015 -0700 move Introspection Query into utilities commit 447c1c03fd99bb24ec29bf6f0214a984940f2aa7 Author: Lee Byron Date: Thu Jul 30 17:11:59 2015 -0700 ensure flow ignores generated files commit 476943fb16af1389e6680ec4fcd6b7be51842533 Author: Lee Byron Date: Thu Jul 30 17:06:24 2015 -0700 Transform with flow comments for npm build commit b6cd4c77ad691a565e7d90b762fb9d9689597cde Author: Lee Byron Date: Thu Jul 30 16:47:34 2015 -0700 upgrade v of flow commit 09e35ff6d96a08b8407eaf9a98a19c7a62d99349 Author: Lee Byron Date: Thu Jul 30 16:12:08 2015 -0700 do not expose errors directly from graphql main module commit 3153825d8910e40860255ba21ab30e9773fbe4d0 Author: Lee Byron Date: Thu Jul 30 16:09:38 2015 -0700 Move isValidJSValue to utilities commit c42fa3d587514268aedb63a8cecacfdf35a2fd4a Author: Lee Byron Date: Thu Jul 30 15:58:40 2015 -0700 jsutil readme commit b721ada810a41fd193058a539e76c6c884643892 Author: Lee Byron Date: Thu Jul 30 15:55:31 2015 -0700 minor directory renaming: validation commit 98efcbd7b37df5f5ae548eb05830a5856209bd90 Author: Lee Byron Date: Thu Jul 30 15:47:44 2015 -0700 minor directory renaming commit 8371c9c2b1b7922559a179a9ea448b83cf1e2b69 Author: Lee Byron Date: Thu Jul 30 15:41:11 2015 -0700 add source module readmes commit e29c189ce5cb1142561d482b45ef61043e239400 Author: Lee Byron Date: Thu Jul 30 15:28:21 2015 -0700 only lint js files commit 2bf0850dd142b4866b1cbec73ba3cbb4009a7860 Author: Lee Byron Date: Thu Jul 30 15:09:38 2015 -0700 rename submodules to "utilities" and "jsutils" commit 7f604eddbe1b737d0aff54a4c3ced5d9cf89695d Author: Lee Byron Date: Thu Jul 30 14:54:04 2015 -0700 jingle commit 0003d47e66d4425b648cecd333a2cc628788d1d6 Merge: 9424ef23 19b3367e Author: Lee Byron Date: Thu Jul 30 14:52:16 2015 -0700 Merge pull request #98 from graphql/tools Move GraphQL-specific utils to tools commit 19b3367e2d552de13d310954f611f45537da5c12 Author: Lee Byron Date: Thu Jul 30 14:45:41 2015 -0700 Move GraphQL-specific utils to tools commit 9424ef23b4dbabb1ea379003434eaadac50961e9 Merge: 22d5d2d3 a94a4399 Author: Lee Byron Date: Thu Jul 30 14:21:48 2015 -0700 Merge pull request #97 from graphql/graphql-tools Leverage 'graphql/tools' for common utilities commit a94a43995df0eb0d46598efc58aa89b004ba0b87 Author: Lee Byron Date: Thu Jul 30 14:14:31 2015 -0700 Leverage 'graphql/tools' for common utilities that will be useful for client tooling. This moves the client-side schema builders (from introspection and from DSL) along with the schema printer into the `graphql/tools` sub-module, and sets up an index export for these tools. commit 22d5d2d3c2f1ad712b06b96611037ccf81e0f63f Author: Lee Byron Date: Thu Jul 30 13:34:43 2015 -0700 use input type to print default values commit 790b5c21a4e4d7283e6db02bc80b21286d3739c2 Author: Lee Byron Date: Thu Jul 30 13:21:54 2015 -0700 require path nit commit e0495d2a1b010da02c07a7538dab4f3cd52b85ad Author: Lee Byron Date: Thu Jul 30 13:19:30 2015 -0700 move valueToAST to utils commit 137caa9b9d7a674107a37710325795c137bfd0c0 Author: Lee Byron Date: Wed Jul 29 19:57:54 2015 -0700 Properly format defaultValue in introspection commit a84f2f1c9b99c4b3a817f14ffb473ada6e32359b Merge: e7e51fd4 a4c09938 Author: Lee Byron Date: Wed Jul 29 17:10:39 2015 -0700 Merge pull request #94 from graphql/print-schema Print the schema directly, rather than the introspection result. commit a4c0993864444162bd84b261a8314740f12c2d2d Author: Lee Byron Date: Tue Jul 28 23:59:35 2015 -0700 Print the schema directly, rather than the introspection result. This allows schemaPrinter to be a sync rather than async function. Also introduces the (meaty) "astFromValue" utility which accepts arbitrary JS values and outputs GraphQL AST. commit e7e51fd4e208f7e5728b8e7323f0a03e8390d0a2 Merge: fd6f133c 6a6f1c37 Author: Lee Byron Date: Wed Jul 29 12:05:36 2015 -0700 Merge pull request #89 from graphql/build-client-schema Client Schema Builder commit 6a6f1c3785df282cce857b72de09df5ddfae530f Author: Lee Byron Date: Tue Jul 28 23:11:13 2015 -0700 Client Schema Builder Given a full introspection result, this builds a GraphQLSchema instance that can be used for everything except execution, allowing clients to use it throughout tools, establishing GraphQLSchema as the common in-mem representation of the type system for use across both server and client. This differs from the DSL materializer in a few important ways: 1. Input. This accepts introspection result, which is trivial for a client to produce given any server. This avoids requiring client tools to leverage the whole GraphQL executor locally to derive this information, which lets it be a sync operation. 2. Scope. This preserves everything that introspection represents including descriptions (and in a follow-up, deprecations). commit fd6f133ce261f1ee425fd6013136b1c1d4c62c56 Merge: a9411cf3 890ceb1b Author: Lee Byron Date: Wed Jul 29 10:40:18 2015 -0700 Merge pull request #90 from graphql/schema-type-default-args Schema DSL Input fields can have default values commit 890ceb1b86d987ed688ded95f8480d8add8f2e29 Author: Lee Byron Date: Tue Jul 28 23:37:27 2015 -0700 Schema DSL Input fields can have default values Small over-sight, DSL needs a way to define default values for input fields. This approach mirrors the introspection API terminology of "input value" to unify the argument and input field ASTs into one. commit a9411cf3dbeac71e918b909160b59d34939b1ad7 Merge: 264be165 4fb13fa7 Author: Lee Byron Date: Tue Jul 28 23:10:52 2015 -0700 Merge pull request #88 from graphql/flow-schema-printer Ensure flow checks introspection result commit 4fb13fa7871d51926dffec40c7863ec05230867b Author: Lee Byron Date: Tue Jul 28 17:32:19 2015 -0700 Ensure flow checks introspection result Flow was not checking introspectionQuery.js, so I added @flow header. In order to fix flow errors I flushed out a more specific Flow query that takes advantage of tagged unions. commit 264be1653c0b04669a64d7e7b6a17488ef340269 Merge: ee815d77 fa70ff81 Author: Lee Byron Date: Tue Jul 28 14:05:25 2015 -0700 Merge pull request #59 from graphql/test-non-keywords Add parser tests for accepting non-keywords commit ee815d77065136843fa5e415b2a9d427d0a17e59 Merge: 0842a3fe 23046af3 Author: Lee Byron Date: Tue Jul 28 14:02:32 2015 -0700 Merge pull request #87 from graphql/schema-ast-printer Add visitor and printer utils to schema language commit 23046af3b7e21c608e26f632c6de08fec4291198 Author: Lee Byron Date: Tue Jul 28 00:26:48 2015 -0700 Add visitor and printer utils to schema language This adds a "visitor" and "printer" utilities for the schema language in the same form as those used for the document language. commit 0842a3fe08354c759eff31f0dc9872b6d1f0fb39 Merge: 0203d149 027a23e8 Author: Lee Byron Date: Tue Jul 28 12:45:01 2015 -0700 Merge pull request #86 from graphql/minor-move Minor follow-on re-org. commit 027a23e8cebda0bf6ecf25519456f5d16b9c997d Author: Lee Byron Date: Tue Jul 28 12:39:05 2015 -0700 Minor follow-on re-org. I'm making some room here for a "printer" in language/schema/printer which mirrors the behavior of language/printer: it takes the AST in, and prints out the DSL. The printer as written makes sense to live in type/schemaPrinter IMO, since it's within the family of tools that operate upon GraphQLSchema instances. commit 0203d1497c4e1b344b7393652465cd15c61289c9 Author: Lee Byron Date: Tue Jul 28 10:36:13 2015 -0700 allow visitor to accept keys as a separate argument commit 4f5e9daa157f0b50ae8525371dfd32336ec66403 Author: Lee Byron Date: Tue Jul 28 10:33:32 2015 -0700 move file specific ast type into file commit f9cd5900de5bcd0e26d68338e675e32d73bf7b7a Author: Lee Byron Date: Tue Jul 28 10:30:35 2015 -0700 fix ast kind commit fa70ff815615bcae14399354110f43cc17729df5 Author: Scott Wolchok Date: Tue Jul 28 09:50:09 2015 -0700 Add parser tests for accepting non keywords, take 2 commit e614782abdbfaaf20c97a660ba1dd96f86c1a283 Author: Scott Wolchok Date: Tue Jul 28 09:47:23 2015 -0700 Revert "Add parser tests for accepting non-keywords" This reverts commit 3483827a430906822cec47f28ab5380ef45ad76b. I meant to update my PR, let's not just push to master without going through PR flow for this. commit 3483827a430906822cec47f28ab5380ef45ad76b Author: Scott Wolchok Date: Wed Jul 15 18:52:04 2015 -0700 Add parser tests for accepting non-keywords commit 5011d4fd0b8be02d0f4ec0325c5241930cabec33 Merge: db5e973c 7d6aaa50 Author: Nicholas Schrock Date: Tue Jul 28 00:08:19 2015 -0700 Merge pull request #85 from graphql/schema-language-reorg Schema language reorg commit 7d6aaa5029b77f751eb02b4a34153714685c6d9d Author: schrockn Date: Mon Jul 27 21:36:48 2015 -0700 Schema DSL Language Reorgnization This PR does a few things. 1) Moves the Schema DSL printer from type/printer to language/schema/printer 2) Renames functions in order to make it more clear where they are in the pipeline in the various representations of schema: -- parseSchema --> parseSchemaIntoAST -- materializeSchema --> materializeSchemaAST -- new fn createSchemaFromDSL that goes from DSL --> in-mem GraphQLSchema 3) Creates flow types for the introspection query 4) Uses those flow types in the printer commit db5e973cceb80ea06d129a7fff89172b039e157b Author: Lee Byron Date: Mon Jul 27 21:47:04 2015 -0700 improve prepublish script commit 2bf7786f6dcf75400dfbabfbe51aefea7e00a88b Author: Lee Byron Date: Mon Jul 27 21:12:12 2015 -0700 update README commit 07d23b601d8baa7cbcf69946755aec45c3d59627 Author: Lee Byron Date: Mon Jul 27 21:01:51 2015 -0700 no double testing in travis commit ef8a66ff2d605a1e6785525d95c7c55596390712 Author: Lee Byron Date: Mon Jul 27 20:43:52 2015 -0700 update CONTRIBUTING commit 7a3b9312a80aaf1b46fb33378ebd989e793be7b0 Author: Lee Byron Date: Mon Jul 27 20:05:36 2015 -0700 0.1.12 commit 1c9a2fffcc5550f5a13f0f61f4cdc42656dc01ae Author: Lee Byron Date: Mon Jul 27 20:02:23 2015 -0700 fix prepublish commit d16f75d8a3f5a5a240e9affb3664567e157aa67f Author: Lee Byron Date: Mon Jul 27 19:34:22 2015 -0700 another update to CONTRIBUTING.md commit 0ce151bc0d8749f1a12e050cfb6681ba7fca468a Author: Lee Byron Date: Mon Jul 27 19:13:28 2015 -0700 0.1.11 commit 84c96dae4e6d36bcdcf7eedda027854dfdb9eca4 Author: Lee Byron Date: Mon Jul 27 19:01:02 2015 -0700 rewrite CONTRIBUTING.md, tighten how npm deploy works commit 37e0de9ee28b06fc90f7837b56abdaae76c9c2f3 Author: Lee Byron Date: Mon Jul 27 18:28:03 2015 -0700 build shallow npm module commit 445629aaa2f617bd1d5b5189659831b8beebaca6 Author: Lee Byron Date: Mon Jul 27 17:23:15 2015 -0700 more travis tweaking commit c5f2e27ef8bc1280c7cb630979db8869137a46ee Author: Lee Byron Date: Mon Jul 27 17:18:09 2015 -0700 travis after all commit abfde2bb279ad149372fa5c2f374acc5ad721da0 Author: Lee Byron Date: Mon Jul 27 16:44:41 2015 -0700 only deploy on iojs build commit 9820c05f22b8818621d1f72521c57f8d92643ca0 Author: Lee Byron Date: Mon Jul 27 16:34:16 2015 -0700 Release 0.1.10 commit 00ad7bcd0ea99daf9db9e90956d2de840fac8d9c Author: Lee Byron Date: Mon Jul 27 16:32:51 2015 -0700 npm deploy update key commit c46ec69abfcc4bef442db386a1f3a0b661dca6a9 Author: Lee Byron Date: Mon Jul 27 15:52:25 2015 -0700 Release 0.1.9 commit 53c79c2bd1e03d2155d0a6b96ea2a31960541ecc Author: Lee Byron Date: Mon Jul 27 15:47:48 2015 -0700 add slack notifications commit 95aaefe7b7f715df37ffdf99b77705ded8e62586 Author: Lee Byron Date: Mon Jul 27 15:44:22 2015 -0700 add npm deploy to travis commit 6d38d5c08420ad4230f8dbb423c2631a3379d8b7 Merge: c81e442b b8d1d2fc Author: Lee Byron Date: Mon Jul 27 13:29:26 2015 -0700 Merge pull request #84 from andimarek/master fix type info: astAndDefs and the return value have the same type commit c81e442bf754fbb8dfd8d3e02aab9abd0b3877bf Author: Lee Byron Date: Mon Jul 27 12:25:41 2015 -0700 update babel-eslint, fix b0rk commit 0f784fd83e98f908b54b1d51f6e79ba38549aed1 Author: Lee Byron Date: Mon Jul 27 12:19:01 2015 -0700 s/Array/List/ commit b8d1d2fc0e3117afb7a78444938309f7eedf7b56 Author: andimarek Date: Sun Jul 26 02:50:20 2015 +0200 fix type info: astAndDefs and the return value have the same type commit 92fe8d23a1eee3858c18fe63ff159207f0b70e79 Merge: d3e91897 137e8473 Author: Joseph Savona Date: Fri Jul 24 16:41:32 2015 -0700 Merge pull request #83 from josephsavona/printschemaencoding Set encoding when reading schema file commit 137e8473c26b64bf10e03b6745b9e55e0c71d8e7 Author: Joseph Savona Date: Fri Jul 24 16:37:42 2015 -0700 Set encoding when reading schema file commit d3e91897e292282e8b5ff399b3341ea895797e44 Merge: aafa4d32 476005b8 Author: Joseph Savona Date: Thu Jul 23 16:47:04 2015 -0700 Merge pull request #80 from josephsavona/printschema Fix paths and dependencies in print-schema tool commit 476005b89d1a500b3ef9b5e50c6a8f33721dc16b Author: Joseph Savona Date: Thu Jul 23 16:40:41 2015 -0700 Fix paths and dependencies in print-schema tool commit aafa4d32b8cef208ad3748f13af1b7bc802a758d Author: schrockn Date: Thu Jul 23 15:22:34 2015 -0700 Release 0.1.8 commit e6e39187073676e40568c347318a0ba0b43c0bad Author: schrockn Date: Thu Jul 23 15:22:18 2015 -0700 Reverting package.json to 0.1.7 to fix release-it lolz commit 09303f2e91d2de5ee5c3642ac357c8583dc412a8 Author: schrockn Date: Thu Jul 23 15:17:52 2015 -0700 Release 0.1.8 commit 643476377f48b13c1ce2a1454e8da3966b5b6278 Author: schrockn Date: Thu Jul 23 15:15:47 2015 -0700 Release 0.1.9 commit 97ae3a13e9be69f33b6c12a20aa6550104fcfb20 Author: schrockn Date: Thu Jul 23 15:14:03 2015 -0700 Release 0.1.8 commit fb5334fdbb8b7b0ef6eee5b3249bcceb2cf31772 Author: schrockn Date: Thu Jul 23 15:12:47 2015 -0700 Revert "Release 0.1.8" This reverts commit d2b03e5d8c45b43e205aaeb7e13d810bbf340f8e. Removing because of aborted release-it run commit d2b03e5d8c45b43e205aaeb7e13d810bbf340f8e Author: schrockn Date: Thu Jul 23 15:11:58 2015 -0700 Release 0.1.8 commit 1618f7d537718af8405543ea8c3ffce68e0d404e Merge: 697a6ca7 6d2fa489 Author: Nicholas Schrock Date: Thu Jul 23 15:05:00 2015 -0700 Merge pull request #79 from graphql/print-schema-tool Print Schema Tool commit 6d2fa4890e7107c80c7861a7edf48a807e6324f0 Author: schrockn Date: Tue Jul 21 14:45:22 2015 -0700 Print Schema Tool This tool accepts an input graphql schema definition file and outputs the corresponding introspection query result for that file commit 697a6ca76d340505c79adac544c557be8004a869 Merge: c518e9a1 9dcbf57e Author: Nicholas Schrock Date: Thu Jul 23 13:49:22 2015 -0700 Merge pull request #77 from graphql/parse-objects Schema Materializer commit 9dcbf57ed434de9a9f0ff8946ac6f6e0e5f333bd Author: schrockn Date: Mon Jul 20 12:24:24 2015 -0700 Schema Materializer Adds the schema materializer. This components takes a schema definition AST and produces a set of type definition objects corresponding to the schema definitions. This allows a user to specify schema in a far more literate fashion The next tool that I'm going to write is one that takes the schema definition DSL and outputs the result of the introspection query against that schema. This will be really useful for tests, etc. commit c518e9a1e4a7d93ca104a8ef457c3c0cbb1ffe8b Author: dschafer Date: Thu Jul 23 12:53:16 2015 -0700 Release 0.1.7 commit 2dacafc87d83e90846b269af6c90a775909b4658 Author: dschafer Date: Thu Jul 23 10:52:05 2015 -0700 Update babel versions commit eb5cda585d40f0e82deeb9cccbcb8507c079173e Merge: 50177591 3496c596 Author: Dan Schafer Date: Wed Jul 22 15:25:08 2015 -0700 Merge pull request #76 from martinandert/fix-directive-introspection-according-to-spec fix directive inspection according to spec commit 50177591834af26b579ebb904b43b4598b281e57 Author: schrockn Date: Tue Jul 21 09:51:59 2015 -0700 Revert "Improve error handling for the graphql function. This only returns the" This reverts commit 04723dedd27b7b3694d3ac1b5502b0772a34b5c4. commit 04723dedd27b7b3694d3ac1b5502b0772a34b5c4 Author: schrockn Date: Tue Jul 21 09:30:31 2015 -0700 Improve error handling for the graphql function. This only returns the formatted errors for GraphQLError, which are effectively pseudo-control-flow and part of expected execution. If it is another error, we assume it is *programmer error* and rethrow so we get a reasonable error message commit 40e780689789b57024a842c82ade952eb25d0ca9 Author: schrockn Date: Tue Jul 21 09:07:21 2015 -0700 Allow interfaces in GraphQLObjectType to be a thunk commit 3496c59603fc2be339eccb87e8904c64f064e6de Author: martinandert Date: Tue Jul 21 11:30:45 2015 +0200 fix directive inspection according to spec commit 822dca81f85e017d2edbbca26e24e2bebd4edfe6 Merge: 2a4d18b0 80ac7285 Author: Lee Byron Date: Mon Jul 20 23:23:59 2015 -0700 Merge pull request #75 from graphql/grammar-pass Docs and Alterations to Schema Grammar commit 80ac72858b62bdb267cb6d70ea43d02bbd1680fd Author: Lee Byron Date: Mon Jul 20 23:12:30 2015 -0700 Docs and Alterations to Schema Grammar This PR tackles a few things: 1. Adds doc block illustrating grammar for every parse rule. 2. Changes Union syntax to match what we use in GraphQL spec. 3. Add default value to field arguments, along with test. 4. Edit tests to be of form "expect test-value to be expected-value" 5. Consistency through rules w.r.t `loc` vs `location` and short-hand object definitions. commit 2a4d18b04f8f1ea9c53f7bb8858e41466fe1e123 Author: Lee Byron Date: Mon Jul 20 19:11:37 2015 -0700 Schema parser add Union AST definition Adds Union definition to AST, uses in parser. Order definitions in all files to be in same order. commit 08559470ab5b7bd4621128add4b1f7a5afde876c Merge: 8727a083 52eb17f8 Author: Lee Byron Date: Mon Jul 20 18:54:32 2015 -0700 Merge branch 'andimarek-master' commit 52eb17f861f8b0def23aa2c0ec92fb57728789c7 Author: andimarek Date: Fri Jul 17 08:27:45 2015 +0200 Bugfix getArgumentValues: DefaultValue not used When no argument was provided, the defaultValue should be used as argument value commit 8727a08323dd7df2e0929ea8ec57a7b8981421fb Merge: 1af7d4ef 4a7a7a65 Author: Nicholas Schrock Date: Mon Jul 20 18:51:13 2015 -0700 Merge pull request #74 from graphql/schema-dsl Schema Definition Language Parser This is a parser for the ad-hoc type definition language included in the spec. This should also serve as a de-facto spec for the language. Clearly once this is stable we should include it in the actual spec as well. This should end up being useful in a few contexts, including client-side types and also a DSL for producing the JS type definitions which can be tedious to write, and a way to specify acceptance tests. (This would be a clear next step for this project) commit 4a7a7a653099da6a25029a07c4c4fa7911ae6c9a Author: schrockn Date: Fri Jul 17 13:22:37 2015 -0700 Schema Definition Language Parser This is a parser for the ad-hoc type definition language included in the spec. This should also serve as a de-facto spec for the language. Clearly once this is stable we should include it in the actual spec as well. This should end up being useful in a few contexts, including client-side types and also a DSL for producing the JS type definitions which can be tedious to write, and a way to specify acceptance tests. (This would be a clear next step for this project) commit 1af7d4ef4ffec8ca9b292cb64832716d22db941b Author: Lee Byron Date: Mon Jul 20 18:08:13 2015 -0700 ast should be linted commit 33ed9aaaadace873d50828769b76c124603d2660 Author: schrockn Date: Sun Jul 19 10:15:31 2015 -0700 Turn on eslint's comma spacing rule. The default one is reasonable commit 50768f1478a3ac870b16658f8f90aa02a9e430b1 Author: Lee Byron Date: Fri Jul 17 19:43:51 2015 -0700 Sane executor arguments. This matches the order of arguments of the main graphql function to the execute function. It also renames some variables to better match how we describe them elsewhere. commit 0afeed95218acac06c1dbccde520732923b7bd7f Author: Lee Byron Date: Fri Jul 17 16:37:03 2015 -0700 Ensure isValidValue and isValidLiteralValue share same logic and cover same cases. add tests commit a973b4d841a68d5bbd4f8754b5386686011bb008 Author: Lee Byron Date: Fri Jul 17 16:08:52 2015 -0700 improve locatedError to handle more error throwing cases commit e87eda0804d0b374b0b0bb25395214c31f483027 Author: Lee Byron Date: Fri Jul 17 15:58:17 2015 -0700 Removed unnecessary check in locatedError utility commit 47df125a813fb02351598f15f734f83f9d2b7fe2 Author: Lee Byron Date: Fri Jul 17 15:56:06 2015 -0700 test that validators are not noisy commit 1a50d51be8c378969cef8705a6223d7b847b5837 Author: Lee Byron Date: Fri Jul 17 15:46:58 2015 -0700 rm dead code commit f71b28ad255c0603fe19226ffcb56bf659bbf8bc Author: Lee Byron Date: Fri Jul 17 15:44:25 2015 -0700 Expand on variable tests, fixing some minor issues with values functions commit f3565fe1494a34e428b8c7c1978838151507b694 Author: Lee Byron Date: Fri Jul 17 15:43:43 2015 -0700 add back npm run cover commit 7e1eabfb463f72f5bc8172b07c75323405aec505 Merge: 978ec61f 01e36920 Author: Lee Byron Date: Fri Jul 17 14:47:40 2015 -0700 Merge pull request #72 from graphql/namedtype NamedType AST commit 978ec61f92725c0b78ddb815c830aebea0684aa2 Author: Lee Byron Date: Fri Jul 17 14:45:43 2015 -0700 use located error utility commit 5408bdc3482bdd9d1ca0373673cf6c50f5bdf0b7 Author: Lee Byron Date: Fri Jul 17 14:42:03 2015 -0700 cleanup tests commit 01e3692093d748dd69429cd1b89d8ce89b8c1459 Author: Lee Byron Date: Fri Jul 17 14:20:45 2015 -0700 NamedType AST This replaces the raw usage of `Name` as a kind of `Type` with the AST node `NamedType`. It also carries the vernacular "named type" throughout the codebase in the places where this same concept was being provided many different names (unmodified, naked, raw, etc). Finally, this simplifies some of the validation rules once this clarification was in place. commit b242fce65ebfb5b380e87f8e663ee8ac1a0f35e9 Author: Lee Byron Date: Thu Jul 16 23:02:24 2015 -0700 Release 0.1.6 commit 6574ec8c86fc790e39775d049c7b6c6290147495 Author: Lee Byron Date: Thu Jul 16 23:02:15 2015 -0700 Fix issue where leaving visitor could return false, it should behave as similarly to visitor enter as possible commit 2c6fa9545c8784d566d3b7a385c5f924bb2da9ac Author: Lee Byron Date: Thu Jul 16 18:45:05 2015 -0700 Release 0.1.5 commit 2c83c7f9c40ce80fa64ffde2ae4f62be32ecc96d Author: Lee Byron Date: Thu Jul 16 17:44:05 2015 -0700 Fix Int coercion Int is now properly coerced for values between 2^32 and MAX_INT. Fixes #69 commit 18a9ac74070c25a1754980d78a2c5af82267838f Merge: ca574962 c3de35b5 Author: Dan Schafer Date: Thu Jul 16 16:49:14 2015 -0700 Merge pull request #70 from graphql/hero Allow an episode to be passed to hero commit c3de35b5a93f5209982da302928e62b001671649 Author: dschafer Date: Thu Jul 16 16:31:53 2015 -0700 Allow an episode to be passed to hero commit ca5749621b122b1cf92101f43a01a446b922b57f Author: Lee Byron Date: Thu Jul 16 16:31:36 2015 -0700 Update number lexer Ensures graphql-js matches spec after https://github.com/facebook/graphql/pull/56 Adds tests for changed error and success cases, fixing #68 commit 1a2b9f30fd53ab3d2fe0ba2e65948525483e1e0b Merge: 7dad578f f7f8235c Author: Nicholas Schrock Date: Thu Jul 16 14:29:17 2015 -0700 Merge pull request #67 from graphql/land-pretty-printer Add Schema Printer commit f7f8235c4a898df58412e5dabf30d8c8bf1b7ce9 Author: schrockn Date: Thu Jul 16 13:40:49 2015 -0700 Add Schema Printer This adds a printer to translate the result of an introspection query to the grammar that is currently used as shorthand in the specification. This should be treated as the de facto specification until a formalized grammar is produced. The next step is to do the transformation in the other direction. A tool that should be built on top of this is one that executes the introspection query against an arbitrary GraphQL HTTP endpoint (specified per the upcoming graphql-http spec) and then performs acceptable tests with that tool. In the interim we hope that this will be useful for implementors building and debugging their own type systems. commit 7dad578f79e9c52be30032b9dcce083edd46105a Merge: 704f975f f779ddc7 Author: Lee Byron Date: Thu Jul 16 14:21:50 2015 -0700 Merge branch 'master' of github.com:graphql/graphql-js commit 704f975f3dd08ef09c30e861b22c10ab2a8bb687 Author: Lee Byron Date: Thu Jul 16 14:21:44 2015 -0700 Add null restriction to Enum value parser commit f779ddc7aefe6008720f3ac51d41be8969a1468c Merge: 947325b5 1d513079 Author: Nicholas Schrock Date: Thu Jul 16 13:51:48 2015 -0700 Merge pull request #66 from graphql/introspection-changes Introspection query changes commit 1d5130794bbd5c84bd469d46f23e45d914455dca Author: schrockn Date: Thu Jul 16 13:40:40 2015 -0700 Introspection query changes This PR makes the introspection query more complete. We simply did not query everything we needed to for a complete type system. I also removed the __typename field everywhere. We should have a different query for an introspection acceptance test. This query is for tool-building. commit 947325b55ded3853ad3e73194cb9a644913ddd88 Author: Lee Byron Date: Thu Jul 16 12:35:28 2015 -0700 simplify variable input type validator for clarity commit 80df2e1fae1a91625b300ecad33bb395280f7446 Merge: 7d29d4e2 2c70321a Author: Lee Byron Date: Thu Jul 16 09:20:24 2015 -0700 Merge pull request #64 from gabrielf/patch-2 Mention that Flow is used. commit 2c70321a99c85ad1234d7c2bab52dc5cf06a4d97 Author: Gabriel Falkenberg Date: Thu Jul 16 15:05:01 2015 +0200 Mention that Flow is used. To avoid confusion for developers new to the project that haven't heard of Flow. commit 7d29d4e244d94464de5820d1898cb667608040ee Author: Lee Byron Date: Thu Jul 16 01:33:58 2015 -0700 remove unused methods from validator test harness commit 80a7af046028c0975d1ad0b8e6d9fe84630f67e8 Author: Lee Byron Date: Thu Jul 16 01:32:25 2015 -0700 Ensure star wars example is following best practice For example, resolveType must not return null. commit 0b8bbda48644f84844e67c88dd7a062ab877d676 Author: Lee Byron Date: Thu Jul 16 01:22:21 2015 -0700 use AbstractType predicate commit 01808183b5e593fbadc4035be25e3187a5cb9fa7 Author: Lee Byron Date: Thu Jul 16 01:14:36 2015 -0700 improve parser test coverage, rm no longer needed check in getVisitFn commit e01930728099fd2cc61cdeefdcc56fc080729faf Author: Lee Byron Date: Thu Jul 16 01:02:59 2015 -0700 amend overzealous lint fix commit f685fba541d9e382fea6d5579b5f528c8de3c40a Author: Lee Byron Date: Thu Jul 16 01:00:24 2015 -0700 async space lint commit 76fd2180a425961d702f43dbae19595fd2fef1ae Merge: 8d30fc48 0b4d7c61 Author: Lee Byron Date: Thu Jul 16 00:57:27 2015 -0700 Merge pull request #63 from graphql/coveralls2 coveralls sanity commit 0b4d7c611fa9c99019b7af2ec8c8689f982e17de Author: Lee Byron Date: Thu Jul 16 00:52:06 2015 -0700 coveralls sanity commit 8d30fc48f8029a4b8bc8206bc38c07fe2df10a55 Author: Lee Byron Date: Thu Jul 16 00:48:27 2015 -0700 fix flow for formatted error simplification commit 2d94628a5ebbd45a9c9c43386abcfbe03ec40c70 Author: Lee Byron Date: Thu Jul 16 00:42:22 2015 -0700 simplify formatError to always include locations commit bd2cd6bb6b801aa9cf5b7000e7c5d23b5dfc23ba Author: Lee Byron Date: Thu Jul 16 00:40:20 2015 -0700 add parser test commit a89425ba00b20a57174f17c7ba89374db3a79267 Merge: a0976e8e 74c4c925 Author: Lee Byron Date: Thu Jul 16 00:39:48 2015 -0700 Merge pull request #62 from graphql/coveralls Simplify coveralls script commit 74c4c925e53a56bc76b3b4248488a5ee2ba9273f Author: Lee Byron Date: Thu Jul 16 00:12:45 2015 -0700 Simplify coveralls script Removes `npm run cover` in favor of the one `npm run coveralls` integration. Also simplifies that script, removing the need for babel-node. Finally, ensures the root is at "src" which removes the transient error parsing _mocha, speeds up the script, and does not count "scripts" as part of coverage score. commit a0976e8e1e52b88172858f79120636eaa282b22f Merge: f4c8b7d8 e525353c Author: Lee Byron Date: Thu Jul 16 00:28:48 2015 -0700 Merge pull request #61 from andimarek/master Bugfix TypeInfo: Missing/Wrong cleanup in leave commit f4c8b7d8a42290738596ba26d6cc637df100a693 Merge: 8ae5bd7e 1e9d3520 Author: Lee Byron Date: Thu Jul 16 00:25:23 2015 -0700 Merge branch 'master' of github.com:graphql/graphql-js commit 8ae5bd7e4d733c99dbbbece347eb15c4bcded951 Author: Lee Byron Date: Thu Jul 16 00:24:38 2015 -0700 Include fragment name lookahead in parser as specced commit 1e9d3520b2c52c715ba28ee6ef6dfb425aa5821f Author: schrockn Date: Wed Jul 15 23:43:44 2015 -0700 This eliminates all usages of chai-as-promised and replaces it with async await. It also removes the module as a dependency. commit 91e6109523a808906e8a64998d0bdd545d03ceab Merge: a075add8 1f4d7626 Author: Nicholas Schrock Date: Wed Jul 15 23:25:20 2015 -0700 Merge pull request #60 from graphql/babel-async-await Babel async await commit 1f4d7626378a12ea89d55b2b2c1baf38fb607c5b Author: Lee Byron Date: Wed Jul 15 23:15:57 2015 -0700 Bump to latest version of babel-core, move babel args into package definition commit e525353c1ce875f3b621f5e72e2a66a404e7f4ad Author: andimarek Date: Thu Jul 16 07:38:23 2015 +0200 Bugfix TypeInfo: Missing/Wrong cleanup in leave VariableDefinition needs to cleanup the inputTypeStack and not argument Argument needs to cleanup inputTypeStack too commit f940fcda7d7265055bc54611b49d19fa442cec93 Author: schrockn Date: Wed Jul 15 21:12:23 2015 -0700 remove unnecessary changes to .eslintrc commit a7bf614970071edbbaceb24063db9b09da80d431 Author: schrockn Date: Wed Jul 15 20:55:41 2015 -0700 works commit a075add88aeb6d11ff9833aba3532356ec69fc8b Merge: 80eed2e2 6d7d5c8f Author: Lee Byron Date: Wed Jul 15 18:43:54 2015 -0700 Merge branch 'master' of github.com:graphql/graphql-js commit 80eed2e2dce51b199485bfd97f3edb2d5b5e33bd Author: Lee Byron Date: Wed Jul 15 18:43:47 2015 -0700 Add test listener for uncaught promise rejection commit 6d7d5c8f703c18431571ea60690861b7c243f522 Merge: c0e9189e 6e7ba273 Author: Lee Byron Date: Wed Jul 15 17:28:42 2015 -0700 Merge pull request #57 from andimarek/master use isCompositeType function instead of manual checking commit 6e7ba2735fdef96b25bcdc77b9c97aa7b2eb7e20 Author: andimarek Date: Thu Jul 16 02:23:20 2015 +0200 use isCompositeType function instead of manual checking commit c0e9189e206d99b0601dfb46b53953d4e0120765 Author: Lee Byron Date: Wed Jul 15 16:54:30 2015 -0700 minor file rename commit 09020612ccded1bdaf001b8703d1196a62141b3c Author: Lee Byron Date: Wed Jul 15 16:32:16 2015 -0700 Executor does not format Errors This change has two major components: 1) Executor no longer formats it's Errors, which means direct callers will have access to the complete GraphQLError objects for richer information about those errors. The burden for formatting is then moved to the top level graphql() function at this time. 2) Executor now throws immediately when given invalid input, illustrating a semantic difference between errors encountered immediately via incorrect function arguments from the errors encountered during the execution process itself (which may only invalidate subtrees of a query). commit 3b0ceb6027bf0596307718ce0024c70633de4051 Author: Lee Byron Date: Wed Jul 15 15:21:45 2015 -0700 Apply validator simplification to schema validator commit f6cbe3349f41483dd657b57498615697a148059d Author: Lee Byron Date: Wed Jul 15 15:11:20 2015 -0700 Validation returns list of errors. This is a small simplification to Validation: rather than returning a struct including both the result of validation as well as a list of errors, it simply returns the list of errors. Also, importantly, this no longer formats the error within the validation submodule, but instead returns raw GraphQLError objects so that more value can be extracted from these by the caller. Formatting should be done much later in the pipeline. commit aea3319204caabf6cb33d3566a45b6260aff19c4 Author: Lee Byron Date: Wed Jul 15 14:53:18 2015 -0700 Improvements to Error submodule. Breaks out the various functions in the error submodule into their own files. Moves syntax error out of language and into error. Uses new syntax error definition throughout language. Find and fix some flow-type issues in the process. commit 15dfb77c52522240be84da93cf75dfc09b999082 Author: Lee Byron Date: Wed Jul 15 14:17:53 2015 -0700 export errors from primary module commit 7a3d7abcd8ebeb86fbeb7a714853a912e820c6d4 Merge: 11f02906 ddf5cc28 Author: Lee Byron Date: Tue Jul 14 18:31:15 2015 -0700 Merge pull request #54 from graphql/printer [RFC] standard printer uses no comma between fields commit ddf5cc28098a7ce8331beeabbd2b74b36ff2aff0 Author: Lee Byron Date: Tue Jul 14 18:10:50 2015 -0700 [RFC] standard printer uses no comma between fields A couple issues have opened up about inconsistency in rendering graphql queries in the spec and in the ref impl - especially with respect to whitespace and commas. Here I'm proposing that it's easier to read queries where every field is always on it's own line (eg, no `image { width, height }` one-liners) and that lines are split only by line-terminators and not also commas. If there's agreement around this proposal, the second step will be to apply the printer to all graphql examples in the spec. commit 11f0290638b660f4928cfd542f38b2319fd9483c Author: dschafer Date: Tue Jul 14 15:07:19 2015 -0700 Release 0.1.4 commit 815c282000422ec6a68c0709c01d40942ea63c59 Author: dschafer Date: Tue Jul 14 14:22:42 2015 -0700 Update to the latest version of babel Fixes #25 commit 44bede0660ee81f596b8cd6cd09c7894bb9cc129 Merge: 40b48cc4 667fbecd Author: Lee Byron Date: Tue Jul 14 08:45:12 2015 -0700 Merge pull request #49 from gabrielf/patch-1 Fix links to repo, issues, bugs. commit 667fbecdc71f8ca0dec758dbc304f07d9e4f2874 Author: Gabriel Falkenberg Date: Tue Jul 14 11:12:03 2015 +0200 Fix links to repo, issues, bugs. commit 40b48cc47260ef19727906b0def2ecde0a51ceaf Merge: 38f638c3 d40a66cd Author: Lee Byron Date: Mon Jul 13 21:05:11 2015 -0700 Merge pull request #47 from andimarek/master fix wrong section reference commit d40a66cd71e654288525d1ff54891a25814ff810 Author: andimarek Date: Tue Jul 14 05:25:47 2015 +0200 fix wrong section reference commit 38f638c309ac0038919453ba741e52bc5cb5fc89 Merge: fe2ee65e 1753f989 Author: Lee Byron Date: Mon Jul 13 20:09:16 2015 -0700 Merge pull request #37 from albertstill/args-description-fix Add missing `description` to field args commit fe2ee65e0c7959e0ce53860a82faa5c276d50bc4 Merge: 422bb22c 58352525 Author: Lee Byron Date: Mon Jul 13 19:11:06 2015 -0700 Merge pull request #46 from andimarek/master Rename GraphQLFieldArgument to GraphQLArgument commit 583525253dcf4918bb7a3b61e1048130514d54b5 Author: andimarek Date: Tue Jul 14 03:55:49 2015 +0200 rename GraphQLFieldArgument to GraphQLArgument, because it's also used as argument for directives commit 3a420af80e023adde6825034a41306d3dcf79702 Author: andimarek Date: Tue Jul 14 03:53:40 2015 +0200 add *.iml to gitignore commit 422bb22caaf01d81c0619be83ec9f349b74430e4 Merge: b0e53b5a 3122cff3 Author: Dan Schafer Date: Mon Jul 13 13:41:44 2015 -0700 Merge pull request #43 from andimarek/patch-1 Fix typo in comment commit b0e53b5ae6297a1270608f4ec70a330faba0b840 Merge: 9737830c 9a3e888d Author: Dan Schafer Date: Mon Jul 13 13:41:21 2015 -0700 Merge pull request #42 from OlegIlyenko/master Directive name is not-null commit 3122cff3800617fb5ce63c92be7f1d7b0c95e37b Author: Andreas Marek Date: Mon Jul 13 08:08:44 2015 +0200 Fix typo in comment The class is named TypeInfo and not FieldInfo. commit 9a3e888d5d42e3cf35949a013a450be30c94c17c Author: Oleg Ilyenko Date: Sun Jul 12 15:48:45 2015 +0200 Directive name is not-null (fixed test) commit 2a41cd45ee7ee0657f01c71900ff885490522b85 Author: Oleg Ilyenko Date: Sun Jul 12 15:29:51 2015 +0200 Directive name is not-null commit 9737830c5b6d892d5dab7dfce8e055bbb0d66b55 Merge: 07f78f70 acbb7f03 Author: Lee Byron Date: Sat Jul 11 16:26:49 2015 -0700 Merge pull request #40 from aackerman/master Remove expletives commit acbb7f03e490ad17e2c55773f91f89a86a549df7 Author: Aaron Ackerman Date: Sat Jul 11 17:54:45 2015 -0500 Remove expletives commit 07f78f70734a0fcbd89d0022f94726eebb4d0581 Author: Lee Byron Date: Thu Jul 9 18:12:12 2015 -0700 add slack to readme commit 6ddc93806a13e4b87a0c9cf1479e8f4f0d5f4072 Author: Lee Byron Date: Thu Jul 9 11:26:42 2015 -0700 Split Argument Value validator ArgumentsOfCorrectType was doing double-duty. The spec also separates these out, so mirring spec in the codebase and introducing a separate ProvidedNonNullArguments validator. commit 93b5b6ad92d7f1443fa9d5a603e81b9f3b8f63af Author: Lee Byron Date: Thu Jul 9 11:00:34 2015 -0700 clarify tests commit 1753f9894b1370e9afc1a046812938dee3629971 Author: Albert Still Date: Thu Jul 9 11:06:17 2015 +0100 Add missing `description` to field args commit 91e4587d1752af46d5d82b6cc9a6caa77d46c88c Merge: 3df77881 7b256339 Author: Lee Byron Date: Wed Jul 8 21:14:46 2015 -0700 Merge pull request #36 from enaqx/patch-1 Fix typo in in starWarsSchema commit 7b25633981cd37fbc8f835aa6b158b4a6987913e Author: Nick Raienko Date: Thu Jul 9 07:00:57 2015 +0300 Fix typo in in starWarsSchema commit 3df77881fd53e69b267130b71fa4063f81dc7c12 Author: schrockn Date: Wed Jul 8 11:37:37 2015 -0700 Make introspection query in type/__tests__ a fully featured introspection query and factor it out into its own module. This will allow it to be reused in other contexts. commit 3f2a25244e51dc6a43f2301bc23149f022e5de3d Merge: 89265ec4 f1cc2281 Author: Dan Schafer Date: Wed Jul 8 11:22:48 2015 -0700 Merge pull request #34 from enaqx/master Consistency in trail comma placement commit f1cc22819d43989a08cf34f01bf6183f307c46cf Author: Nick Raienko Date: Wed Jul 8 13:05:57 2015 +0300 Extra commas commit a07493b3e4b39537bf2902d9f846418487bea7c3 Author: Nick Raienko Date: Wed Jul 8 13:01:25 2015 +0300 Make trail comma placement more consistent commit 89265ec40bec6f895bff8685919b53be64fae564 Author: Lee Byron Date: Mon Jul 6 20:25:23 2015 -0700 Release 0.1.3 commit d32cb7377058dcb02218449f91ff5acff3e2376a Merge: 0d70847d 79250c8e Author: Lee Byron Date: Mon Jul 6 20:25:11 2015 -0700 Merge branch 'master' of github.com:graphql/graphql-js commit 0d70847ddbb00b8a371fb27f801344adcc4e4f3a Author: Lee Byron Date: Mon Jul 6 20:22:07 2015 -0700 prepublish script commit 79250c8e451d7dee3ce721ead195d846347eca7b Merge: 858e6933 d070872d Author: Lee Byron Date: Mon Jul 6 19:47:56 2015 -0700 Merge pull request #30 from amarant/redundant-test Remove redundant tests. commit 858e6933507e9154787a8e4b66d6942af987b5bc Merge: fd934cda 0b4fb811 Author: Lee Byron Date: Mon Jul 6 19:45:39 2015 -0700 Merge pull request #29 from dittos/fix-recursion-test Test recursion avoidance correctly commit fd934cda4f423170daa7e8eaa838fa2a0f5225e0 Author: Lee Byron Date: Mon Jul 6 19:45:17 2015 -0700 comments on test commit a852d85d05b98f3f3179a85c13bf210e37777f2d Author: Lee Byron Date: Mon Jul 6 19:32:16 2015 -0700 Separate test and testonly, add prepublish rule to ensure built files are published commit cc1e5501fa277e29d12c6b4518259cd0183ea8d9 Author: Lee Byron Date: Mon Jul 6 18:55:47 2015 -0700 badge coverage commit 39e51dfa55f546b2fd8b402bbfb1e9f6e7454c70 Author: Lee Byron Date: Mon Jul 6 18:52:13 2015 -0700 move coveralls to package, try again commit 3f4f1ebeb70a65cd6dd87f3ba04d154a528e89ae Author: Lee Byron Date: Mon Jul 6 18:40:06 2015 -0700 coveralls commit c6be908ebc88bf480171a656ef3e9b950f7e0515 Author: Lee Byron Date: Mon Jul 6 18:26:14 2015 -0700 only test on non-ancient node commit 585019f54296ee64b5ef1796a5f00b3372d40765 Author: Lee Byron Date: Mon Jul 6 18:21:43 2015 -0700 Hook up travis-ci commit 172b515fa5fa7595833efb5c4e8a9d9c824ffbdf Author: Lee Byron Date: Mon Jul 6 17:55:37 2015 -0700 fix lint issues found by newer eslint commit 8d200800e00cfe1e9b090c28b0a779bf7f1f1556 Author: Lee Byron Date: Mon Jul 6 17:50:27 2015 -0700 Update npm dependencies commit c3e2a4b796ee7b405dd1d5468eb4d10d02c3f42c Author: Lee Byron Date: Mon Jul 6 16:10:49 2015 -0700 Fix overlapping fields validator As a follow up to 6f2af8dd544158fa4b9fbeedf5bd052812caeff1, this ensures that fields can only be merged if their directive arguments align as well commit 6ec76f4ebd614f3189b0353236d876ce00f330c8 Merge: 3c358c37 6f2af8dd Author: Lee Byron Date: Mon Jul 6 15:41:09 2015 -0700 Merge pull request #31 from graphql/directives Reworking of Directives commit 6f2af8dd544158fa4b9fbeedf5bd052812caeff1 Author: Lee Byron Date: Mon Jul 6 14:47:22 2015 -0700 Reworking of Directives I think we have gotten directives slightly wrong. Since we're still in working draft, I think we should fix this: Old: ``` { foo @if: true bar @unless: true } ``` New: ``` { foo @include(if: true) bar @skip(if: true) } ``` Now directives are just as powerful as fields in their ability to accept multiple argument values. More importantly, this is a *simplification* as directive arguments and field arguments are syntactically *identical*, and semantically extremely similar, allowing us to reuse spec, grammar, and impl for both. This simplification is really valuable to fix some issues with directives today. Directive value nullability is poorly (and probably incorrectly) defined in the current form. What does a non-null type on a directive today mean? Directives cannot be required. Now the rules are the same as field arguments. This also helps us support future directives that have no arguments, or directives that have multiple arguments. `@defer` alone is perfectly fine, and `@defer(priority: 3)` is much easier to read than `@defer: 3`. So if we do this, then `@if` and `@unless` are replaced by `@include` and `@skip` respectively. I think this is helpful as it describes more accurately what the directives' jobs are. So grammar becomes: ``` Directive : Name Arguments? ``` And the directive value validation rule is merged into the argument validation rule. commit d070872d73d95f0e77532cec8a4e3b008a533a9a Author: Arnaud Marant Date: Mon Jul 6 23:33:06 2015 +0200 Remove redundant tests. commit 0b4fb81106e3fc5c4f743c16e4c7d86552b9221e Author: Taeho Kim Date: Mon Jul 6 23:28:33 2015 +0900 Test recursion avoidance correctly commit 3c358c37dc66b090f0d143dd3c379e86485383c4 Merge: 3c2bfcdc 9f478527 Author: Lee Byron Date: Sun Jul 5 14:34:53 2015 +0100 Merge pull request #24 from vkurchatkin/fix-build-typo build: use && instead of & commit 9f47852773c3044f30bf0005c82f3531479b36d2 Author: Vladimir Kurchatkin Date: Sun Jul 5 16:31:02 2015 +0300 build: use && instead of & commit 3c2bfcdcba13a01b6fcb3a0286784174684e8c47 Author: Lee Byron Date: Sat Jul 4 16:36:00 2015 -0700 Release 0.1.2 commit 0fd8be16abd3fb14bcc97b933f68b99582af9403 Author: Lee Byron Date: Sat Jul 4 08:20:51 2015 -0700 Support more forms of async returned values. GraphQL.js already had support for `Promise` and `Promise>`, but not `Array>`. We had assumed that resolve functions would call Promise.all when necessary based on how GraphQL had been used in the context of PHP/Hack at Facebook where `Array>` is actually pretty hard to construct. In JavaScript, however, it's easy to forget a call to Promise.all and provide this kind of value. This change makes GraphQL.js aware of `Array>` and importantly enables a new expression of error handling for nullable list item types (`[T]` vs `[T!]`): If the second of an array of three values fails, we can log an error accordingly and place a null value for that index. The primary structural change here is moving the error detection logic to after calling a field's `resolve` rather than before it. This means direct field `resolve` errors have to be dealt with directly, which is a little less elegant, but it means this error detection logic can be easily reused when completing the values of items in a list. Finally, this adds a more comprehensive test suite for list types in permuation with nullability and Array and Promise return types. Fixes #17 commit 099eeb7b5a49a16fa3d55353b9774291881e959c Merge: e22fea81 1fdba31d Author: Lee Byron Date: Fri Jul 3 12:07:57 2015 +0200 Merge pull request #15 from sevki/patch-1 omit => emit commit 1fdba31d8537bbc4c66bcb0876e8ec3ed9e20615 Author: Sevki Date: Fri Jul 3 12:40:04 2015 +0300 omit => emit commit e22fea813cc60047e7524f8a23ca0b57d1e7151e Merge: 558b9e3b 6d8002e7 Author: Lee Byron Date: Fri Jul 3 10:25:16 2015 +0200 Merge pull request #12 from enaqx/headers Add headers where missed and update .gitignore commit 6d8002e79f29f25abbc410dc1afb14e8ace3987c Author: Nick Raienko Date: Fri Jul 3 07:17:19 2015 +0300 .gitinore update commit 558b9e3b701f2c94933b59351c04e0fa27962ed3 Merge: 03df01cf 0e4e7b04 Author: Lee Byron Date: Fri Jul 3 00:49:27 2015 +0200 Merge pull request #11 from enaqx/comment-typos Misc comment typos commit 30d65749085a4c4433e7f773190d836481deba33 Author: Nick Raienko Date: Fri Jul 3 01:19:20 2015 +0300 Add headers where missed and update .gitignore with IntelliJ Webstorm directory commit 0e4e7b047ceee5abfa3f8bcb33792c08a7ad97e6 Author: Nick Raienko Date: Fri Jul 3 01:05:11 2015 +0300 Misc comment typos commit 03df01cfd79e5f1ae280f6dae31cf7cce957a685 Author: Lee Byron Date: Thu Jul 2 13:56:59 2015 -0700 Release 0.1.1 commit ef84970fff815e49f2f22e9aca03115372c1f7f6 Merge: 432b3568 239b634d Author: Lee Byron Date: Thu Jul 2 22:54:41 2015 +0200 Merge pull request #10 from RStankov/fix-double-resolve Don't resolve when invalid commit 239b634d3624ed473a899d4d3d023cbf545830d9 Author: Radoslav Stankov Date: Thu Jul 2 23:32:55 2015 +0300 Don't resolve when invalid commit 432b35685adc89d6c3cba2eb1c9ce176cb9af794 Merge: 862209d9 c2fe3a13 Author: Lee Byron Date: Thu Jul 2 13:28:53 2015 -0700 Merge branch 'master' of github.com:graphql/graphql-js commit 862209d9e57a3a3a9c9aabaff24a3c3b631f0b47 Merge: b28614fa 5c467d8f Author: Lee Byron Date: Thu Jul 2 13:28:36 2015 -0700 Merge branch 'enaqx-es6-docs' commit 5c467d8f6052dfff335fbd573675fd9a7bfc0261 Merge: b28614fa 07382b8f Author: Lee Byron Date: Thu Jul 2 13:26:37 2015 -0700 Merge branch 'es6-docs' of https://github.com/enaqx/graphql-js into enaqx-es6-docs commit c2fe3a1303aeb2fb2fe8c3718f2eafd7b4b8b34b Merge: c211cc81 b59e2880 Author: Lee Byron Date: Thu Jul 2 22:25:56 2015 +0200 Merge pull request #2 from hzoo/patch-1 fill in Todo Spec Sections commit c211cc815788deb2014faecbf2f25742cc89d80a Merge: b28614fa 5fb1133a Author: Lee Byron Date: Thu Jul 2 22:25:12 2015 +0200 Merge pull request #3 from ckimes89/patch-1 Change variable names to reduce confusion commit b28614fa9dc0d6fa06156299f3dcf0cd790aed5d Merge: b68c4060 97cd10b7 Author: Lee Byron Date: Thu Jul 2 13:24:41 2015 -0700 Merge branch 'readme-minor-edit' commit 97cd10b7bc17bac3974a38a2518388709ccb251c Merge: 60c9448e b68c4060 Author: Lee Byron Date: Thu Jul 2 13:24:26 2015 -0700 Merge branch 'master' into readme-minor-edit Conflicts: README.md commit b68c40601d6d7c6e56ac0911dee74975435f378b Merge: 917a6d40 2da77ae7 Author: Lee Byron Date: Thu Jul 2 22:20:31 2015 +0200 Merge pull request #5 from enaqx/license Update license identifier and Fix Typos commit 917a6d40a639ae6ea2bab3bbd86014c9aee2478c Merge: 87b338f5 6c3500d2 Author: Lee Byron Date: Thu Jul 2 22:19:49 2015 +0200 Merge pull request #6 from coryhouse/patch-1 Clarified wording commit 87b338f51047aac3ee30bc72e9b4e6345dd64c4f Merge: d8f3a312 6fadf836 Author: Lee Byron Date: Thu Jul 2 13:18:55 2015 -0700 Merge branch 'enaqx-eslint-rules-extract' commit 6fadf836876204345bae3416ed0a985bd942bffa Merge: d8f3a312 a978de0c Author: Lee Byron Date: Thu Jul 2 13:18:16 2015 -0700 Merge branch 'eslint-rules-extract' of https://github.com/enaqx/graphql-js into enaqx-eslint-rules-extract commit d8f3a312c4bc16e19fdec1d0642ba96a4e21bb51 Merge: a0332193 5a40391b Author: Lee Byron Date: Thu Jul 2 22:17:06 2015 +0200 Merge pull request #9 from enaqx/remove-dependencies Remove bluebird dependency commit 5a40391b26832bec9ca8b4fe5abbe68acaaa35e8 Author: Nick Raienko Date: Thu Jul 2 23:13:09 2015 +0300 Remove bluebird dependency commit a978de0ce2dc82606aec93262a425427c3d46dc2 Author: Nick Raienko Date: Thu Jul 2 22:38:29 2015 +0300 Extract ESLint rules in config file commit 07382b8f25e3ab5a010a55b5479721ceba971cbb Author: Nick Raienko Date: Thu Jul 2 21:56:16 2015 +0300 Proposition to change README examples to ES2015 style due to GraphQL is also written in ES2015. commit 6c3500d2b0c54e5cb40599e2fcd17153c1d4edb3 Author: Cory House Date: Thu Jul 2 13:49:18 2015 -0500 Clarified wording commit 2da77ae719b1759028923e1229118fa43b2dbdf8 Merge: a05b631a 80b8f209 Author: Nick Raienko Date: Thu Jul 2 21:33:31 2015 +0300 Merge pull request #1 from enaqx/typos Fix Misc Typos in README.md commit 80b8f2099b8898c3eb156787f3b2e791b1059dc1 Author: Nick Raienko Date: Thu Jul 2 21:23:35 2015 +0300 Fix Misc Typos in README.md commit a05b631ad64d5f87a65ec0f8d5412039a6e0bb20 Author: Nick Raienko Date: Thu Jul 2 21:15:49 2015 +0300 Update license identifier to conform with SPDX in order to eliminate NPM warning. commit 60c9448ea67642580f8366fe5eac234c576a20eb Author: Scott Wolchok Date: Thu Jul 2 08:35:12 2015 -0700 Update README.md couple of missing commas, caps, words, etc. commit 5fb1133a77ccc8de95156ee5e79d64570cf3d223 Author: ckimes89 Date: Thu Jul 2 10:20:49 2015 -0400 Change variable names to reduce confusion commit b59e28809abdc29e33091ed8a0c4de734c0f785f Author: Henry Zhu Date: Thu Jul 2 09:23:04 2015 -0400 fill in Todo Spec Sections commit a0332193731a388702dd80596550b1fb9d8bd85d Merge: b5ed31e6 a4f9e382 Author: Dan Schafer Date: Thu Jul 2 13:53:34 2015 +0200 Merge pull request #1 from mgechev/master Fix broken link commit a4f9e3822e783fb7c5d5b6a2b49ea622439a4c46 Author: mgechev Date: Thu Jul 2 14:47:53 2015 +0300 Fix broken link --- .babelrc-deno.json | 7 + .babelrc-npm.json | 27 + .babelrc.json | 9 + .c8rc.json | 23 + .eslintignore | 9 + .eslintrc.yml | 693 + .github/CONTRIBUTING.md | 101 + .github/ISSUE_TEMPLATE.md | 21 + .../actions/deploy-dir-as-branch/action.yml | 52 + .github/workflows/ci.yml | 300 + .gitignore | 14 + .mocharc.yml | 7 + .prettierignore | 7 + .prettierrc | 4 + LICENSE | 21 + README.md | 158 + benchmark/benchmark.js | 393 + benchmark/buildASTSchema-benchmark.js | 16 + benchmark/buildClientSchema-benchmark.js | 13 + benchmark/fixtures.js | 13 + benchmark/github-schema.graphql | 20367 ++++++ benchmark/github-schema.json | 56836 ++++++++++++++++ .../introspectionFromSchema-benchmark.js | 21 + benchmark/parser-benchmark.js | 16 + benchmark/validateGQL-benchmark.js | 21 + benchmark/validateInvalidGQL-benchmark.js | 30 + benchmark/validateSDL-benchmark.js | 16 + benchmark/visit-benchmark.js | 25 + benchmark/visitInParallel-benchmark.js | 25 + codecov.yml | 14 + cspell.yml | 50 + docs/APIReference-Errors.md | 109 + docs/APIReference-Execution.md | 60 + docs/APIReference-ExpressGraphQL.md | 35 + docs/APIReference-GraphQL.md | 179 + docs/APIReference-Language.md | 311 + docs/APIReference-TypeSystem.md | 667 + docs/APIReference-Utilities.md | 266 + docs/APIReference-Validation.md | 68 + docs/Guides-ConstructingTypes.md | 125 + docs/Tutorial-Authentication.md | 57 + docs/Tutorial-BasicTypes.md | 62 + docs/Tutorial-ExpressGraphQL.md | 63 + docs/Tutorial-GettingStarted.md | 66 + docs/Tutorial-GraphQLClients.md | 87 + docs/Tutorial-Mutations.md | 193 + docs/Tutorial-ObjectTypes.md | 148 + docs/Tutorial-PassingArguments.md | 134 + integrationTests/README.md | 1 + integrationTests/integration-test.js | 49 + integrationTests/node/index.js | 27 + integrationTests/node/package.json | 14 + integrationTests/node/test.js | 17 + .../ts/TypedQueryDocumentNode-test.ts | 72 + integrationTests/ts/basic-test.ts | 34 + integrationTests/ts/extensions-test.ts | 62 + integrationTests/ts/internalImports-test.ts | 8 + integrationTests/ts/package.json | 15 + integrationTests/ts/test.js | 19 + integrationTests/ts/tsconfig.json | 9 + integrationTests/webpack/entry.js | 13 + integrationTests/webpack/package.json | 12 + integrationTests/webpack/test.js | 14 + integrationTests/webpack/webpack.config.json | 7 + package-lock.json | 11393 ++++ package.json | 79 + resources/add-extension-to-import-paths.js | 39 + resources/build-deno.js | 35 + resources/build-npm.js | 139 + resources/checkgit.sh | 38 + resources/diff-npm-package.js | 104 + resources/eslint-internal-rules/README.md | 6 + resources/eslint-internal-rules/index.js | 13 + .../eslint-internal-rules/no-dir-import.js | 36 + resources/eslint-internal-rules/only-ascii.js | 39 + resources/eslint-internal-rules/package.json | 8 + .../require-to-string-tag.js | 37 + resources/gen-changelog.js | 323 + resources/gen-version.js | 38 + resources/inline-invariant.js | 48 + resources/ts-register.js | 3 + resources/utils.js | 99 + src/README.md | 23 + src/__testUtils__/__tests__/dedent-test.ts | 131 + .../__tests__/genFuzzStrings-test.ts | 83 + .../__tests__/inspectStr-test.ts | 19 + .../__tests__/resolveOnNextTick-test.ts | 21 + src/__testUtils__/dedent.ts | 41 + src/__testUtils__/expectJSON.ts | 51 + src/__testUtils__/genFuzzStrings.ts | 29 + src/__testUtils__/inspectStr.ts | 14 + src/__testUtils__/kitchenSinkQuery.ts | 68 + src/__testUtils__/kitchenSinkSDL.ts | 158 + src/__testUtils__/resolveOnNextTick.ts | 3 + src/__tests__/starWarsData.ts | 154 + src/__tests__/starWarsIntrospection-test.ts | 366 + src/__tests__/starWarsQuery-test.ts | 497 + src/__tests__/starWarsSchema.ts | 303 + src/__tests__/starWarsValidation-test.ts | 119 + src/__tests__/version-test.ts | 54 + src/error/GraphQLError.ts | 255 + src/error/README.md | 9 + src/error/__tests__/GraphQLError-test.ts | 356 + src/error/__tests__/locatedError-test.ts | 54 + src/error/index.ts | 9 + src/error/locatedError.ts | 37 + src/error/syntaxError.ts | 17 + src/execution/README.md | 9 + src/execution/__tests__/abstract-test.ts | 643 + src/execution/__tests__/directives-test.ts | 307 + src/execution/__tests__/executor-test.ts | 1272 + src/execution/__tests__/lists-test.ts | 225 + .../__tests__/mapAsyncIterator-test.ts | 336 + src/execution/__tests__/mutations-test.ts | 194 + src/execution/__tests__/nonnull-test.ts | 714 + src/execution/__tests__/resolve-test.ts | 129 + src/execution/__tests__/schema-test.ts | 188 + src/execution/__tests__/simplePubSub-test.ts | 55 + src/execution/__tests__/simplePubSub.ts | 74 + src/execution/__tests__/subscribe-test.ts | 1022 + src/execution/__tests__/sync-test.ts | 177 + .../__tests__/union-interface-test.ts | 548 + src/execution/__tests__/variables-test.ts | 1080 + src/execution/collectFields.ts | 212 + src/execution/execute.ts | 1055 + src/execution/index.ts | 18 + src/execution/mapAsyncIterator.ts | 57 + src/execution/subscribe.ts | 253 + src/execution/values.ts | 263 + src/graphql.ts | 142 + src/index.ts | 485 + src/jsutils/Maybe.ts | 2 + src/jsutils/ObjMap.ts | 13 + src/jsutils/Path.ts | 33 + src/jsutils/PromiseOrValue.ts | 1 + src/jsutils/README.md | 8 + src/jsutils/__tests__/Path-test.ts | 36 + src/jsutils/__tests__/didYouMean-test.ts | 36 + src/jsutils/__tests__/identityFunc-test.ts | 16 + src/jsutils/__tests__/inspect-test.ts | 187 + src/jsutils/__tests__/instanceOf-test.ts | 79 + src/jsutils/__tests__/invariant-test.ts | 14 + src/jsutils/__tests__/isAsyncIterable-test.ts | 52 + .../__tests__/isIterableObject-test.ts | 70 + src/jsutils/__tests__/isObjectLike-test.ts | 22 + src/jsutils/__tests__/naturalCompare-test.ts | 72 + src/jsutils/__tests__/suggestionList-test.ts | 69 + src/jsutils/__tests__/toObjMap-test.ts | 61 + src/jsutils/devAssert.ts | 6 + src/jsutils/didYouMean.ts | 37 + src/jsutils/groupBy.ts | 19 + src/jsutils/identityFunc.ts | 6 + src/jsutils/inspect.ts | 123 + src/jsutils/instanceOf.ts | 54 + src/jsutils/invariant.ts | 11 + src/jsutils/isAsyncIterable.ts | 9 + src/jsutils/isIterableObject.ts | 25 + src/jsutils/isObjectLike.ts | 9 + src/jsutils/isPromise.ts | 7 + src/jsutils/keyMap.ts | 39 + src/jsutils/keyValMap.ts | 30 + src/jsutils/mapValue.ts | 17 + src/jsutils/memoize3.ts | 37 + src/jsutils/naturalCompare.ts | 58 + src/jsutils/printPathArray.ts | 10 + src/jsutils/promiseForObject.ts | 20 + src/jsutils/promiseReduce.ts | 23 + src/jsutils/suggestionList.ts | 137 + src/jsutils/toError.ts | 20 + src/jsutils/toObjMap.ts | 20 + src/language/README.md | 9 + src/language/__tests__/blockString-fuzz.ts | 67 + src/language/__tests__/blockString-test.ts | 294 + src/language/__tests__/lexer-test.ts | 1207 + src/language/__tests__/parser-test.ts | 642 + src/language/__tests__/predicates-test.ts | 144 + src/language/__tests__/printLocation-test.ts | 77 + src/language/__tests__/printString-test.ts | 82 + src/language/__tests__/printer-test.ts | 216 + src/language/__tests__/schema-parser-test.ts | 1106 + src/language/__tests__/schema-printer-test.ts | 177 + src/language/__tests__/source-test.ts | 46 + src/language/__tests__/visitor-test.ts | 1364 + src/language/ast.ts | 737 + src/language/blockString.ts | 169 + src/language/characterClasses.ts | 64 + src/language/directiveLocation.ts | 33 + src/language/index.ts | 109 + src/language/kinds.ts | 76 + src/language/lexer.ts | 854 + src/language/location.ts | 33 + src/language/parser.ts | 1566 + src/language/predicates.ts | 112 + src/language/printLocation.ts | 80 + src/language/printString.ts | 38 + src/language/printer.ts | 347 + src/language/source.ts | 57 + src/language/tokenKind.ts | 35 + src/language/visitor.ts | 414 + src/subscription/README.md | 10 + src/subscription/index.ts | 23 + src/type/README.md | 8 + src/type/__tests__/assertName-test.ts | 69 + src/type/__tests__/definition-test.ts | 1009 + src/type/__tests__/directive-test.ts | 137 + src/type/__tests__/enumType-test.ts | 406 + src/type/__tests__/extensions-test.ts | 393 + src/type/__tests__/introspection-test.ts | 1651 + src/type/__tests__/predicate-test.ts | 704 + src/type/__tests__/scalars-test.ts | 654 + src/type/__tests__/schema-test.ts | 409 + src/type/__tests__/validation-test.ts | 2629 + src/type/assertName.ts | 45 + src/type/definition.ts | 1741 + src/type/directives.ts | 225 + src/type/index.ts | 186 + src/type/introspection.ts | 556 + src/type/scalars.ts | 284 + src/type/schema.ts | 437 + src/type/validate.ts | 627 + src/utilities/README.md | 9 + src/utilities/TypeInfo.ts | 363 + src/utilities/__tests__/TypeInfo-test.ts | 460 + src/utilities/__tests__/astFromValue-test.ts | 379 + .../__tests__/buildASTSchema-test.ts | 1108 + .../__tests__/buildClientSchema-test.ts | 971 + .../__tests__/coerceInputValue-test.ts | 429 + src/utilities/__tests__/concatAST-test.ts | 40 + src/utilities/__tests__/extendSchema-test.ts | 1322 + .../__tests__/findBreakingChanges-test.ts | 1230 + .../__tests__/getIntrospectionQuery-test.ts | 133 + .../__tests__/getOperationAST-test.ts | 68 + .../__tests__/getOperationRootType-test.ts | 159 + .../__tests__/introspectionFromSchema-test.ts | 66 + .../__tests__/lexicographicSortSchema-test.ts | 359 + src/utilities/__tests__/printSchema-test.ts | 850 + .../__tests__/separateOperations-test.ts | 258 + .../__tests__/stripIgnoredCharacters-fuzz.ts | 51 + .../__tests__/stripIgnoredCharacters-test.ts | 446 + .../__tests__/typeComparators-test.ts | 160 + src/utilities/__tests__/valueFromAST-test.ts | 265 + .../__tests__/valueFromASTUntyped-test.ts | 67 + src/utilities/assertValidName.ts | 39 + src/utilities/astFromValue.ts | 150 + src/utilities/buildASTSchema.ts | 111 + src/utilities/buildClientSchema.ts | 406 + src/utilities/coerceInputValue.ts | 187 + src/utilities/concatAST.ts | 17 + src/utilities/extendSchema.ts | 684 + src/utilities/findBreakingChanges.ts | 586 + src/utilities/getIntrospectionQuery.ts | 331 + src/utilities/getOperationAST.ts | 32 + src/utilities/getOperationRootType.ts | 57 + src/utilities/index.ts | 105 + src/utilities/introspectionFromSchema.ts | 40 + src/utilities/lexicographicSortSchema.ts | 190 + src/utilities/printSchema.ts | 326 + src/utilities/separateOperations.ts | 98 + src/utilities/stripIgnoredCharacters.ts | 101 + src/utilities/typeComparators.ts | 119 + src/utilities/typeFromAST.ts | 52 + src/utilities/typedQueryDocumentNode.ts | 19 + src/utilities/valueFromAST.ts | 161 + src/utilities/valueFromASTUntyped.ts | 52 + src/validation/README.md | 9 + src/validation/ValidationContext.ts | 269 + .../ExecutableDefinitionsRule-test.ts | 94 + .../__tests__/FieldsOnCorrectTypeRule-test.ts | 447 + .../FragmentsOnCompositeTypesRule-test.ts | 126 + .../__tests__/KnownArgumentNamesRule-test.ts | 329 + .../__tests__/KnownDirectivesRule-test.ts | 452 + .../__tests__/KnownFragmentNamesRule-test.ts | 71 + .../__tests__/KnownTypeNamesRule-test.ts | 362 + .../LoneAnonymousOperationRule-test.ts | 106 + .../LoneSchemaDefinitionRule-test.ts | 158 + .../__tests__/NoDeprecatedCustomRule-test.ts | 272 + .../__tests__/NoFragmentCyclesRule-test.ts | 260 + .../NoSchemaIntrospectionCustomRule-test.ts | 140 + .../NoUndefinedVariablesRule-test.ts | 407 + .../__tests__/NoUnusedFragmentsRule-test.ts | 163 + .../__tests__/NoUnusedVariablesRule-test.ts | 233 + .../OverlappingFieldsCanBeMergedRule-test.ts | 1096 + .../PossibleFragmentSpreadsRule-test.ts | 303 + .../PossibleTypeExtensionsRule-test.ts | 271 + .../ProvidedRequiredArgumentsRule-test.ts | 356 + .../__tests__/ScalarLeafsRule-test.ts | 129 + .../SingleFieldSubscriptionsRule-test.ts | 306 + .../UniqueArgumentDefinitionNamesRule-test.ts | 174 + .../__tests__/UniqueArgumentNamesRule-test.ts | 154 + .../UniqueDirectiveNamesRule-test.ts | 101 + .../UniqueDirectivesPerLocationRule-test.ts | 394 + .../UniqueEnumValueNamesRule-test.ts | 194 + .../UniqueFieldDefinitionNamesRule-test.ts | 435 + .../__tests__/UniqueFragmentNamesRule-test.ts | 119 + .../UniqueInputFieldNamesRule-test.ts | 110 + .../UniqueOperationNamesRule-test.ts | 135 + .../UniqueOperationTypesRule-test.ts | 384 + .../__tests__/UniqueTypeNamesRule-test.ts | 162 + .../__tests__/UniqueVariableNamesRule-test.ts | 53 + .../__tests__/ValidationContext-test.ts | 40 + .../__tests__/ValuesOfCorrectTypeRule-test.ts | 1201 + .../VariablesAreInputTypesRule-test.ts | 52 + .../VariablesInAllowedPositionRule-test.ts | 360 + src/validation/__tests__/harness.ts | 143 + src/validation/__tests__/validation-test.ts | 181 + src/validation/index.ts | 99 + .../rules/ExecutableDefinitionsRule.ts | 40 + .../rules/FieldsOnCorrectTypeRule.ts | 144 + .../rules/FragmentsOnCompositeTypesRule.ts | 53 + .../rules/KnownArgumentNamesRule.ts | 101 + src/validation/rules/KnownDirectivesRule.ts | 141 + .../rules/KnownFragmentNamesRule.ts | 27 + src/validation/rules/KnownTypeNamesRule.ts | 82 + .../rules/LoneAnonymousOperationRule.ts | 37 + .../rules/LoneSchemaDefinitionRule.ts | 43 + src/validation/rules/NoFragmentCyclesRule.ts | 90 + .../rules/NoUndefinedVariablesRule.ts | 47 + src/validation/rules/NoUnusedFragmentsRule.ts | 59 + src/validation/rules/NoUnusedVariablesRule.ts | 51 + .../rules/OverlappingFieldsCanBeMergedRule.ts | 837 + .../rules/PossibleFragmentSpreadsRule.ts | 78 + .../rules/PossibleTypeExtensionsRule.ts | 144 + .../rules/ProvidedRequiredArgumentsRule.ts | 127 + src/validation/rules/ScalarLeafsRule.ts | 48 + .../rules/SingleFieldSubscriptionsRule.ts | 82 + .../UniqueArgumentDefinitionNamesRule.ts | 79 + .../rules/UniqueArgumentNamesRule.ts | 46 + .../rules/UniqueDirectiveNamesRule.ts | 46 + .../rules/UniqueDirectivesPerLocationRule.ts | 91 + .../rules/UniqueEnumValueNamesRule.ts | 69 + .../rules/UniqueFieldDefinitionNamesRule.ts | 88 + .../rules/UniqueFragmentNamesRule.ts | 35 + .../rules/UniqueInputFieldNamesRule.ts | 51 + .../rules/UniqueOperationNamesRule.ts | 37 + .../rules/UniqueOperationTypesRule.ts | 66 + src/validation/rules/UniqueTypeNamesRule.ts | 52 + .../rules/UniqueVariableNamesRule.ts | 40 + .../rules/ValuesOfCorrectTypeRule.ts | 157 + .../rules/VariablesAreInputTypesRule.ts | 41 + .../rules/VariablesInAllowedPositionRule.ts | 102 + .../rules/custom/NoDeprecatedCustomRule.ts | 92 + .../custom/NoSchemaIntrospectionCustomRule.ts | 37 + src/validation/specifiedRules.ts | 125 + src/validation/validate.ts | 137 + src/version.ts | 17 + tsconfig.json | 14 + 346 files changed, 158523 insertions(+) create mode 100644 .babelrc-deno.json create mode 100644 .babelrc-npm.json create mode 100644 .babelrc.json create mode 100644 .c8rc.json create mode 100644 .eslintignore create mode 100644 .eslintrc.yml create mode 100644 .github/CONTRIBUTING.md create mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/actions/deploy-dir-as-branch/action.yml create mode 100644 .github/workflows/ci.yml create mode 100644 .gitignore create mode 100644 .mocharc.yml create mode 100644 .prettierignore create mode 100644 .prettierrc create mode 100644 LICENSE create mode 100644 README.md create mode 100644 benchmark/benchmark.js create mode 100644 benchmark/buildASTSchema-benchmark.js create mode 100644 benchmark/buildClientSchema-benchmark.js create mode 100644 benchmark/fixtures.js create mode 100644 benchmark/github-schema.graphql create mode 100644 benchmark/github-schema.json create mode 100644 benchmark/introspectionFromSchema-benchmark.js create mode 100644 benchmark/parser-benchmark.js create mode 100644 benchmark/validateGQL-benchmark.js create mode 100644 benchmark/validateInvalidGQL-benchmark.js create mode 100644 benchmark/validateSDL-benchmark.js create mode 100644 benchmark/visit-benchmark.js create mode 100644 benchmark/visitInParallel-benchmark.js create mode 100644 codecov.yml create mode 100644 cspell.yml create mode 100644 docs/APIReference-Errors.md create mode 100644 docs/APIReference-Execution.md create mode 100644 docs/APIReference-ExpressGraphQL.md create mode 100644 docs/APIReference-GraphQL.md create mode 100644 docs/APIReference-Language.md create mode 100644 docs/APIReference-TypeSystem.md create mode 100644 docs/APIReference-Utilities.md create mode 100644 docs/APIReference-Validation.md create mode 100644 docs/Guides-ConstructingTypes.md create mode 100644 docs/Tutorial-Authentication.md create mode 100644 docs/Tutorial-BasicTypes.md create mode 100644 docs/Tutorial-ExpressGraphQL.md create mode 100644 docs/Tutorial-GettingStarted.md create mode 100644 docs/Tutorial-GraphQLClients.md create mode 100644 docs/Tutorial-Mutations.md create mode 100644 docs/Tutorial-ObjectTypes.md create mode 100644 docs/Tutorial-PassingArguments.md create mode 100644 integrationTests/README.md create mode 100644 integrationTests/integration-test.js create mode 100644 integrationTests/node/index.js create mode 100644 integrationTests/node/package.json create mode 100644 integrationTests/node/test.js create mode 100644 integrationTests/ts/TypedQueryDocumentNode-test.ts create mode 100644 integrationTests/ts/basic-test.ts create mode 100644 integrationTests/ts/extensions-test.ts create mode 100644 integrationTests/ts/internalImports-test.ts create mode 100644 integrationTests/ts/package.json create mode 100644 integrationTests/ts/test.js create mode 100644 integrationTests/ts/tsconfig.json create mode 100644 integrationTests/webpack/entry.js create mode 100644 integrationTests/webpack/package.json create mode 100644 integrationTests/webpack/test.js create mode 100644 integrationTests/webpack/webpack.config.json create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 resources/add-extension-to-import-paths.js create mode 100644 resources/build-deno.js create mode 100644 resources/build-npm.js create mode 100644 resources/checkgit.sh create mode 100644 resources/diff-npm-package.js create mode 100644 resources/eslint-internal-rules/README.md create mode 100644 resources/eslint-internal-rules/index.js create mode 100644 resources/eslint-internal-rules/no-dir-import.js create mode 100644 resources/eslint-internal-rules/only-ascii.js create mode 100644 resources/eslint-internal-rules/package.json create mode 100644 resources/eslint-internal-rules/require-to-string-tag.js create mode 100644 resources/gen-changelog.js create mode 100644 resources/gen-version.js create mode 100644 resources/inline-invariant.js create mode 100644 resources/ts-register.js create mode 100644 resources/utils.js create mode 100644 src/README.md create mode 100644 src/__testUtils__/__tests__/dedent-test.ts create mode 100644 src/__testUtils__/__tests__/genFuzzStrings-test.ts create mode 100644 src/__testUtils__/__tests__/inspectStr-test.ts create mode 100644 src/__testUtils__/__tests__/resolveOnNextTick-test.ts create mode 100644 src/__testUtils__/dedent.ts create mode 100644 src/__testUtils__/expectJSON.ts create mode 100644 src/__testUtils__/genFuzzStrings.ts create mode 100644 src/__testUtils__/inspectStr.ts create mode 100644 src/__testUtils__/kitchenSinkQuery.ts create mode 100644 src/__testUtils__/kitchenSinkSDL.ts create mode 100644 src/__testUtils__/resolveOnNextTick.ts create mode 100644 src/__tests__/starWarsData.ts create mode 100644 src/__tests__/starWarsIntrospection-test.ts create mode 100644 src/__tests__/starWarsQuery-test.ts create mode 100644 src/__tests__/starWarsSchema.ts create mode 100644 src/__tests__/starWarsValidation-test.ts create mode 100644 src/__tests__/version-test.ts create mode 100644 src/error/GraphQLError.ts create mode 100644 src/error/README.md create mode 100644 src/error/__tests__/GraphQLError-test.ts create mode 100644 src/error/__tests__/locatedError-test.ts create mode 100644 src/error/index.ts create mode 100644 src/error/locatedError.ts create mode 100644 src/error/syntaxError.ts create mode 100644 src/execution/README.md create mode 100644 src/execution/__tests__/abstract-test.ts create mode 100644 src/execution/__tests__/directives-test.ts create mode 100644 src/execution/__tests__/executor-test.ts create mode 100644 src/execution/__tests__/lists-test.ts create mode 100644 src/execution/__tests__/mapAsyncIterator-test.ts create mode 100644 src/execution/__tests__/mutations-test.ts create mode 100644 src/execution/__tests__/nonnull-test.ts create mode 100644 src/execution/__tests__/resolve-test.ts create mode 100644 src/execution/__tests__/schema-test.ts create mode 100644 src/execution/__tests__/simplePubSub-test.ts create mode 100644 src/execution/__tests__/simplePubSub.ts create mode 100644 src/execution/__tests__/subscribe-test.ts create mode 100644 src/execution/__tests__/sync-test.ts create mode 100644 src/execution/__tests__/union-interface-test.ts create mode 100644 src/execution/__tests__/variables-test.ts create mode 100644 src/execution/collectFields.ts create mode 100644 src/execution/execute.ts create mode 100644 src/execution/index.ts create mode 100644 src/execution/mapAsyncIterator.ts create mode 100644 src/execution/subscribe.ts create mode 100644 src/execution/values.ts create mode 100644 src/graphql.ts create mode 100644 src/index.ts create mode 100644 src/jsutils/Maybe.ts create mode 100644 src/jsutils/ObjMap.ts create mode 100644 src/jsutils/Path.ts create mode 100644 src/jsutils/PromiseOrValue.ts create mode 100644 src/jsutils/README.md create mode 100644 src/jsutils/__tests__/Path-test.ts create mode 100644 src/jsutils/__tests__/didYouMean-test.ts create mode 100644 src/jsutils/__tests__/identityFunc-test.ts create mode 100644 src/jsutils/__tests__/inspect-test.ts create mode 100644 src/jsutils/__tests__/instanceOf-test.ts create mode 100644 src/jsutils/__tests__/invariant-test.ts create mode 100644 src/jsutils/__tests__/isAsyncIterable-test.ts create mode 100644 src/jsutils/__tests__/isIterableObject-test.ts create mode 100644 src/jsutils/__tests__/isObjectLike-test.ts create mode 100644 src/jsutils/__tests__/naturalCompare-test.ts create mode 100644 src/jsutils/__tests__/suggestionList-test.ts create mode 100644 src/jsutils/__tests__/toObjMap-test.ts create mode 100644 src/jsutils/devAssert.ts create mode 100644 src/jsutils/didYouMean.ts create mode 100644 src/jsutils/groupBy.ts create mode 100644 src/jsutils/identityFunc.ts create mode 100644 src/jsutils/inspect.ts create mode 100644 src/jsutils/instanceOf.ts create mode 100644 src/jsutils/invariant.ts create mode 100644 src/jsutils/isAsyncIterable.ts create mode 100644 src/jsutils/isIterableObject.ts create mode 100644 src/jsutils/isObjectLike.ts create mode 100644 src/jsutils/isPromise.ts create mode 100644 src/jsutils/keyMap.ts create mode 100644 src/jsutils/keyValMap.ts create mode 100644 src/jsutils/mapValue.ts create mode 100644 src/jsutils/memoize3.ts create mode 100644 src/jsutils/naturalCompare.ts create mode 100644 src/jsutils/printPathArray.ts create mode 100644 src/jsutils/promiseForObject.ts create mode 100644 src/jsutils/promiseReduce.ts create mode 100644 src/jsutils/suggestionList.ts create mode 100644 src/jsutils/toError.ts create mode 100644 src/jsutils/toObjMap.ts create mode 100644 src/language/README.md create mode 100644 src/language/__tests__/blockString-fuzz.ts create mode 100644 src/language/__tests__/blockString-test.ts create mode 100644 src/language/__tests__/lexer-test.ts create mode 100644 src/language/__tests__/parser-test.ts create mode 100644 src/language/__tests__/predicates-test.ts create mode 100644 src/language/__tests__/printLocation-test.ts create mode 100644 src/language/__tests__/printString-test.ts create mode 100644 src/language/__tests__/printer-test.ts create mode 100644 src/language/__tests__/schema-parser-test.ts create mode 100644 src/language/__tests__/schema-printer-test.ts create mode 100644 src/language/__tests__/source-test.ts create mode 100644 src/language/__tests__/visitor-test.ts create mode 100644 src/language/ast.ts create mode 100644 src/language/blockString.ts create mode 100644 src/language/characterClasses.ts create mode 100644 src/language/directiveLocation.ts create mode 100644 src/language/index.ts create mode 100644 src/language/kinds.ts create mode 100644 src/language/lexer.ts create mode 100644 src/language/location.ts create mode 100644 src/language/parser.ts create mode 100644 src/language/predicates.ts create mode 100644 src/language/printLocation.ts create mode 100644 src/language/printString.ts create mode 100644 src/language/printer.ts create mode 100644 src/language/source.ts create mode 100644 src/language/tokenKind.ts create mode 100644 src/language/visitor.ts create mode 100644 src/subscription/README.md create mode 100644 src/subscription/index.ts create mode 100644 src/type/README.md create mode 100644 src/type/__tests__/assertName-test.ts create mode 100644 src/type/__tests__/definition-test.ts create mode 100644 src/type/__tests__/directive-test.ts create mode 100644 src/type/__tests__/enumType-test.ts create mode 100644 src/type/__tests__/extensions-test.ts create mode 100644 src/type/__tests__/introspection-test.ts create mode 100644 src/type/__tests__/predicate-test.ts create mode 100644 src/type/__tests__/scalars-test.ts create mode 100644 src/type/__tests__/schema-test.ts create mode 100644 src/type/__tests__/validation-test.ts create mode 100644 src/type/assertName.ts create mode 100644 src/type/definition.ts create mode 100644 src/type/directives.ts create mode 100644 src/type/index.ts create mode 100644 src/type/introspection.ts create mode 100644 src/type/scalars.ts create mode 100644 src/type/schema.ts create mode 100644 src/type/validate.ts create mode 100644 src/utilities/README.md create mode 100644 src/utilities/TypeInfo.ts create mode 100644 src/utilities/__tests__/TypeInfo-test.ts create mode 100644 src/utilities/__tests__/astFromValue-test.ts create mode 100644 src/utilities/__tests__/buildASTSchema-test.ts create mode 100644 src/utilities/__tests__/buildClientSchema-test.ts create mode 100644 src/utilities/__tests__/coerceInputValue-test.ts create mode 100644 src/utilities/__tests__/concatAST-test.ts create mode 100644 src/utilities/__tests__/extendSchema-test.ts create mode 100644 src/utilities/__tests__/findBreakingChanges-test.ts create mode 100644 src/utilities/__tests__/getIntrospectionQuery-test.ts create mode 100644 src/utilities/__tests__/getOperationAST-test.ts create mode 100644 src/utilities/__tests__/getOperationRootType-test.ts create mode 100644 src/utilities/__tests__/introspectionFromSchema-test.ts create mode 100644 src/utilities/__tests__/lexicographicSortSchema-test.ts create mode 100644 src/utilities/__tests__/printSchema-test.ts create mode 100644 src/utilities/__tests__/separateOperations-test.ts create mode 100644 src/utilities/__tests__/stripIgnoredCharacters-fuzz.ts create mode 100644 src/utilities/__tests__/stripIgnoredCharacters-test.ts create mode 100644 src/utilities/__tests__/typeComparators-test.ts create mode 100644 src/utilities/__tests__/valueFromAST-test.ts create mode 100644 src/utilities/__tests__/valueFromASTUntyped-test.ts create mode 100644 src/utilities/assertValidName.ts create mode 100644 src/utilities/astFromValue.ts create mode 100644 src/utilities/buildASTSchema.ts create mode 100644 src/utilities/buildClientSchema.ts create mode 100644 src/utilities/coerceInputValue.ts create mode 100644 src/utilities/concatAST.ts create mode 100644 src/utilities/extendSchema.ts create mode 100644 src/utilities/findBreakingChanges.ts create mode 100644 src/utilities/getIntrospectionQuery.ts create mode 100644 src/utilities/getOperationAST.ts create mode 100644 src/utilities/getOperationRootType.ts create mode 100644 src/utilities/index.ts create mode 100644 src/utilities/introspectionFromSchema.ts create mode 100644 src/utilities/lexicographicSortSchema.ts create mode 100644 src/utilities/printSchema.ts create mode 100644 src/utilities/separateOperations.ts create mode 100644 src/utilities/stripIgnoredCharacters.ts create mode 100644 src/utilities/typeComparators.ts create mode 100644 src/utilities/typeFromAST.ts create mode 100644 src/utilities/typedQueryDocumentNode.ts create mode 100644 src/utilities/valueFromAST.ts create mode 100644 src/utilities/valueFromASTUntyped.ts create mode 100644 src/validation/README.md create mode 100644 src/validation/ValidationContext.ts create mode 100644 src/validation/__tests__/ExecutableDefinitionsRule-test.ts create mode 100644 src/validation/__tests__/FieldsOnCorrectTypeRule-test.ts create mode 100644 src/validation/__tests__/FragmentsOnCompositeTypesRule-test.ts create mode 100644 src/validation/__tests__/KnownArgumentNamesRule-test.ts create mode 100644 src/validation/__tests__/KnownDirectivesRule-test.ts create mode 100644 src/validation/__tests__/KnownFragmentNamesRule-test.ts create mode 100644 src/validation/__tests__/KnownTypeNamesRule-test.ts create mode 100644 src/validation/__tests__/LoneAnonymousOperationRule-test.ts create mode 100644 src/validation/__tests__/LoneSchemaDefinitionRule-test.ts create mode 100644 src/validation/__tests__/NoDeprecatedCustomRule-test.ts create mode 100644 src/validation/__tests__/NoFragmentCyclesRule-test.ts create mode 100644 src/validation/__tests__/NoSchemaIntrospectionCustomRule-test.ts create mode 100644 src/validation/__tests__/NoUndefinedVariablesRule-test.ts create mode 100644 src/validation/__tests__/NoUnusedFragmentsRule-test.ts create mode 100644 src/validation/__tests__/NoUnusedVariablesRule-test.ts create mode 100644 src/validation/__tests__/OverlappingFieldsCanBeMergedRule-test.ts create mode 100644 src/validation/__tests__/PossibleFragmentSpreadsRule-test.ts create mode 100644 src/validation/__tests__/PossibleTypeExtensionsRule-test.ts create mode 100644 src/validation/__tests__/ProvidedRequiredArgumentsRule-test.ts create mode 100644 src/validation/__tests__/ScalarLeafsRule-test.ts create mode 100644 src/validation/__tests__/SingleFieldSubscriptionsRule-test.ts create mode 100644 src/validation/__tests__/UniqueArgumentDefinitionNamesRule-test.ts create mode 100644 src/validation/__tests__/UniqueArgumentNamesRule-test.ts create mode 100644 src/validation/__tests__/UniqueDirectiveNamesRule-test.ts create mode 100644 src/validation/__tests__/UniqueDirectivesPerLocationRule-test.ts create mode 100644 src/validation/__tests__/UniqueEnumValueNamesRule-test.ts create mode 100644 src/validation/__tests__/UniqueFieldDefinitionNamesRule-test.ts create mode 100644 src/validation/__tests__/UniqueFragmentNamesRule-test.ts create mode 100644 src/validation/__tests__/UniqueInputFieldNamesRule-test.ts create mode 100644 src/validation/__tests__/UniqueOperationNamesRule-test.ts create mode 100644 src/validation/__tests__/UniqueOperationTypesRule-test.ts create mode 100644 src/validation/__tests__/UniqueTypeNamesRule-test.ts create mode 100644 src/validation/__tests__/UniqueVariableNamesRule-test.ts create mode 100644 src/validation/__tests__/ValidationContext-test.ts create mode 100644 src/validation/__tests__/ValuesOfCorrectTypeRule-test.ts create mode 100644 src/validation/__tests__/VariablesAreInputTypesRule-test.ts create mode 100644 src/validation/__tests__/VariablesInAllowedPositionRule-test.ts create mode 100644 src/validation/__tests__/harness.ts create mode 100644 src/validation/__tests__/validation-test.ts create mode 100644 src/validation/index.ts create mode 100644 src/validation/rules/ExecutableDefinitionsRule.ts create mode 100644 src/validation/rules/FieldsOnCorrectTypeRule.ts create mode 100644 src/validation/rules/FragmentsOnCompositeTypesRule.ts create mode 100644 src/validation/rules/KnownArgumentNamesRule.ts create mode 100644 src/validation/rules/KnownDirectivesRule.ts create mode 100644 src/validation/rules/KnownFragmentNamesRule.ts create mode 100644 src/validation/rules/KnownTypeNamesRule.ts create mode 100644 src/validation/rules/LoneAnonymousOperationRule.ts create mode 100644 src/validation/rules/LoneSchemaDefinitionRule.ts create mode 100644 src/validation/rules/NoFragmentCyclesRule.ts create mode 100644 src/validation/rules/NoUndefinedVariablesRule.ts create mode 100644 src/validation/rules/NoUnusedFragmentsRule.ts create mode 100644 src/validation/rules/NoUnusedVariablesRule.ts create mode 100644 src/validation/rules/OverlappingFieldsCanBeMergedRule.ts create mode 100644 src/validation/rules/PossibleFragmentSpreadsRule.ts create mode 100644 src/validation/rules/PossibleTypeExtensionsRule.ts create mode 100644 src/validation/rules/ProvidedRequiredArgumentsRule.ts create mode 100644 src/validation/rules/ScalarLeafsRule.ts create mode 100644 src/validation/rules/SingleFieldSubscriptionsRule.ts create mode 100644 src/validation/rules/UniqueArgumentDefinitionNamesRule.ts create mode 100644 src/validation/rules/UniqueArgumentNamesRule.ts create mode 100644 src/validation/rules/UniqueDirectiveNamesRule.ts create mode 100644 src/validation/rules/UniqueDirectivesPerLocationRule.ts create mode 100644 src/validation/rules/UniqueEnumValueNamesRule.ts create mode 100644 src/validation/rules/UniqueFieldDefinitionNamesRule.ts create mode 100644 src/validation/rules/UniqueFragmentNamesRule.ts create mode 100644 src/validation/rules/UniqueInputFieldNamesRule.ts create mode 100644 src/validation/rules/UniqueOperationNamesRule.ts create mode 100644 src/validation/rules/UniqueOperationTypesRule.ts create mode 100644 src/validation/rules/UniqueTypeNamesRule.ts create mode 100644 src/validation/rules/UniqueVariableNamesRule.ts create mode 100644 src/validation/rules/ValuesOfCorrectTypeRule.ts create mode 100644 src/validation/rules/VariablesAreInputTypesRule.ts create mode 100644 src/validation/rules/VariablesInAllowedPositionRule.ts create mode 100644 src/validation/rules/custom/NoDeprecatedCustomRule.ts create mode 100644 src/validation/rules/custom/NoSchemaIntrospectionCustomRule.ts create mode 100644 src/validation/specifiedRules.ts create mode 100644 src/validation/validate.ts create mode 100644 src/version.ts create mode 100644 tsconfig.json diff --git a/.babelrc-deno.json b/.babelrc-deno.json new file mode 100644 index 00000000..0e173bfb --- /dev/null +++ b/.babelrc-deno.json @@ -0,0 +1,7 @@ +{ + "plugins": [ + "@babel/plugin-syntax-typescript", + ["./resources/add-extension-to-import-paths", { "extension": "ts" }], + "./resources/inline-invariant" + ] +} diff --git a/.babelrc-npm.json b/.babelrc-npm.json new file mode 100644 index 00000000..357c91db --- /dev/null +++ b/.babelrc-npm.json @@ -0,0 +1,27 @@ +{ + "plugins": [ + "@babel/plugin-transform-typescript", + "./resources/inline-invariant" + ], + "env": { + "cjs": { + "presets": [ + [ + "@babel/preset-env", + { "modules": "commonjs", "targets": { "node": "12" } } + ] + ], + "plugins": [ + ["./resources/add-extension-to-import-paths", { "extension": "js" }] + ] + }, + "mjs": { + "presets": [ + ["@babel/preset-env", { "modules": false, "targets": { "node": "12" } }] + ], + "plugins": [ + ["./resources/add-extension-to-import-paths", { "extension": "mjs" }] + ] + } + } +} diff --git a/.babelrc.json b/.babelrc.json new file mode 100644 index 00000000..caa5300a --- /dev/null +++ b/.babelrc.json @@ -0,0 +1,9 @@ +{ + "plugins": ["@babel/plugin-transform-typescript"], + "presets": [ + [ + "@babel/preset-env", + { "bugfixes": true, "targets": { "node": "current" } } + ] + ] +} diff --git a/.c8rc.json b/.c8rc.json new file mode 100644 index 00000000..22bb450e --- /dev/null +++ b/.c8rc.json @@ -0,0 +1,23 @@ +{ + "all": true, + "include": ["src/"], + "exclude": [ + "src/**/index.ts", + "src/**/*-fuzz.ts", + "src/jsutils/Maybe.ts", + "src/jsutils/ObjMap.ts", + "src/jsutils/PromiseOrValue.ts", + "src/utilities/assertValidName.ts", + "src/utilities/typedQueryDocumentNode.ts" + ], + "clean": true, + "temp-directory": "coverage", + "report-dir": "coverage", + "skip-full": true, + "reporter": ["json", "html", "text"], + "check-coverage": true, + "branches": 100, + "lines": 100, + "functions": 100, + "statements": 100 +} diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000..a872ca6e --- /dev/null +++ b/.eslintignore @@ -0,0 +1,9 @@ +# Copied from '.gitignore', please keep it in sync. +/.eslintcache +/node_modules +/coverage +/npmDist +/denoDist + +# Ignore TS files inside integration test +/integrationTests/ts/*.ts diff --git a/.eslintrc.yml b/.eslintrc.yml new file mode 100644 index 00000000..6e21f0e9 --- /dev/null +++ b/.eslintrc.yml @@ -0,0 +1,693 @@ +parserOptions: + sourceType: script + ecmaVersion: 2020 +env: + es6: true + node: true +reportUnusedDisableDirectives: true +plugins: + - internal-rules + - node + - import + - simple-import-sort +settings: + node: + tryExtensions: ['.js', '.json', '.node', '.ts', '.d.ts'] + +rules: + ############################################################################## + # Internal rules located in 'resources/eslint-internal-rules'. + # See './resources/eslint-internal-rules/README.md' + ############################################################################## + + internal-rules/only-ascii: error + internal-rules/no-dir-import: error + internal-rules/require-to-string-tag: off + + ############################################################################## + # `eslint-plugin-node` rule list based on `v11.1.x` + ############################################################################## + + # Possible Errors + # https://github.com/mysticatea/eslint-plugin-node#possible-errors + + node/handle-callback-err: [error, error] + node/no-callback-literal: error + node/no-exports-assign: error + node/no-extraneous-import: error + node/no-extraneous-require: error + node/no-missing-import: error + node/no-missing-require: error + node/no-new-require: error + node/no-path-concat: error + node/no-process-exit: off + node/no-unpublished-bin: error + node/no-unpublished-import: error + node/no-unpublished-require: error + node/no-unsupported-features/es-builtins: error + node/no-unsupported-features/es-syntax: [error, { ignores: [modules] }] + node/no-unsupported-features/node-builtins: error + node/process-exit-as-throw: error + node/shebang: error + + # Best Practices + # https://github.com/mysticatea/eslint-plugin-node#best-practices + node/no-deprecated-api: error + + # Stylistic Issues + # https://github.com/mysticatea/eslint-plugin-node#stylistic-issues + + node/callback-return: error + node/exports-style: off # TODO consider + node/file-extension-in-import: off # TODO consider + node/global-require: error + node/no-mixed-requires: error + node/no-process-env: off + node/no-restricted-import: off + node/no-restricted-require: off + node/no-sync: error + node/prefer-global/buffer: error + node/prefer-global/console: error + node/prefer-global/process: error + node/prefer-global/text-decoder: error + node/prefer-global/text-encoder: error + node/prefer-global/url-search-params: error + node/prefer-global/url: error + node/prefer-promises/dns: off + node/prefer-promises/fs: off + + ############################################################################## + # `eslint-plugin-import` rule list based on `v2.25.x` + ############################################################################## + + # Static analysis + # https://github.com/benmosher/eslint-plugin-import#static-analysis + import/no-unresolved: error + import/named: error + import/default: error + import/namespace: error + import/no-restricted-paths: + - error + - basePath: './' + zones: + - { target: './src', from: 'src/__testUtils__' } + import/no-absolute-path: error + import/no-dynamic-require: error + import/no-internal-modules: off + import/no-webpack-loader-syntax: error + import/no-self-import: error + import/no-cycle: error + import/no-useless-path-segments: error + import/no-relative-parent-imports: off + import/no-relative-packages: off + + # Helpful warnings + # https://github.com/benmosher/eslint-plugin-import#helpful-warnings + import/export: error + import/no-named-as-default: error + import/no-named-as-default-member: error + import/no-deprecated: error + import/no-extraneous-dependencies: [error, { devDependencies: false }] + import/no-mutable-exports: error + import/no-unused-modules: error + + # Module systems + # https://github.com/benmosher/eslint-plugin-import#module-systems + import/unambiguous: error + import/no-commonjs: error + import/no-amd: error + import/no-nodejs-modules: error + import/no-import-module-exports: off + + # Style guide + # https://github.com/benmosher/eslint-plugin-import#style-guide + import/first: error + import/exports-last: off + import/no-duplicates: error + import/no-namespace: error + import/extensions: + - error + - ignorePackages + - ts: never # TODO: remove once TS supports extensions + import/order: [error, { newlines-between: always-and-inside-groups }] + import/newline-after-import: error + import/prefer-default-export: off + import/max-dependencies: off + import/no-unassigned-import: error + import/no-named-default: error + import/no-default-export: error + import/no-named-export: off + import/no-anonymous-default-export: error + import/group-exports: off + import/dynamic-import-chunkname: off + + ############################################################################## + # `eslint-plugin-simple-import-sort` rule list based on `v2.25.x` + # https://github.com/lydell/eslint-plugin-simple-import-sort + ############################################################################## + simple-import-sort/imports: + - error + - groups: + # Packages. + # Things that start with a letter (or digit or underscore), or `@` followed by a letter. + - ["^@?\\w"] + + # General utilities + - ["^(\\./|(\\.\\./)+)__testUtils__/"] + - ["^(\\./|(\\.\\./)+)jsutils/"] + + # Top-level directories + - ["^(\\./|(\\.\\./)+)error/"] + - ["^(\\./|(\\.\\./)+)language/"] + - ["^(\\./|(\\.\\./)+)type/"] + - ["^(\\./|(\\.\\./)+)validation/"] + - ["^(\\./|(\\.\\./)+)execution/"] + - ["^(\\./|(\\.\\./)+)utilities/"] + + # Relative imports. + # Anything that starts with a dot. + - ["^(\\.\\./){4,}"] + - ["^(\\.\\./){3}"] + - ["^(\\.\\./){2}"] + - ["^(\\.\\./){1}"] + - ["^\\./"] + simple-import-sort/exports: off # TODO + + ############################################################################## + # ESLint builtin rules list based on `v8.5.x` + ############################################################################## + + # Possible Errors + # https://eslint.org/docs/rules/#possible-errors + + for-direction: error + getter-return: error + no-async-promise-executor: error + no-await-in-loop: error + no-compare-neg-zero: error + no-cond-assign: error + no-console: warn + no-constant-condition: error + no-control-regex: error + no-debugger: warn + no-dupe-args: error + no-dupe-else-if: error + no-dupe-keys: error + no-duplicate-case: error + no-empty: error + no-empty-character-class: error + no-ex-assign: error + no-extra-boolean-cast: error + no-func-assign: error + no-import-assign: error + no-inner-declarations: [error, both] + no-invalid-regexp: error + no-irregular-whitespace: error + no-loss-of-precision: error + no-misleading-character-class: error + no-obj-calls: error + no-promise-executor-return: off # TODO + no-prototype-builtins: error + no-regex-spaces: error + no-setter-return: error + no-sparse-arrays: error + no-template-curly-in-string: error + no-unreachable: error + no-unreachable-loop: error + no-unsafe-finally: error + no-unsafe-negation: error + no-unsafe-optional-chaining: [error, { disallowArithmeticOperators: true }] + no-unused-private-class-members: error + no-useless-backreference: error + require-atomic-updates: error + use-isnan: error + valid-typeof: error + + # Best Practices + # https://eslint.org/docs/rules/#best-practices + + accessor-pairs: error + array-callback-return: error + block-scoped-var: error + class-methods-use-this: off + complexity: off + consistent-return: off + curly: error + default-case: off + default-case-last: error + default-param-last: error + dot-notation: error + eqeqeq: [error, smart] + grouped-accessor-pairs: error + guard-for-in: error + max-classes-per-file: off + no-alert: error + no-caller: error + no-case-declarations: error + no-constructor-return: error + no-div-regex: error + no-else-return: error + no-empty-function: error + no-empty-pattern: error + no-eq-null: off + no-eval: error + no-extend-native: error + no-extra-bind: error + no-extra-label: error + no-fallthrough: error + no-global-assign: error + no-implicit-coercion: error + no-implicit-globals: off + no-implied-eval: error + no-invalid-this: error + no-iterator: error + no-labels: error + no-lone-blocks: error + no-loop-func: error + no-magic-numbers: off + no-multi-str: error + no-new: error + no-new-func: error + no-new-wrappers: error + no-nonoctal-decimal-escape: error + no-octal: error + no-octal-escape: error + no-param-reassign: error + no-proto: error + no-redeclare: error + no-restricted-properties: off + no-return-assign: error + no-return-await: error + no-script-url: error + no-self-assign: error + no-self-compare: off # TODO + no-sequences: error + no-throw-literal: error + no-unmodified-loop-condition: error + no-unused-expressions: error + no-unused-labels: error + no-useless-call: error + no-useless-catch: error + no-useless-concat: error + no-useless-escape: error + no-useless-return: error + no-void: error + no-warning-comments: off + no-with: error + prefer-named-capture-group: off # ES2018 + prefer-promise-reject-errors: error + prefer-regex-literals: error + radix: error + require-await: error + require-unicode-regexp: off + vars-on-top: error + yoda: [error, never, { exceptRange: true }] + + # Strict Mode + # https://eslint.org/docs/rules/#strict-mode + + strict: error + + # Variables + # https://eslint.org/docs/rules/#variables + + init-declarations: off + no-delete-var: error + no-label-var: error + no-restricted-globals: off + no-shadow: error + no-shadow-restricted-names: error + no-undef: error + no-undef-init: error + no-undefined: off + no-unused-vars: [error, { vars: all, args: all, argsIgnorePattern: '^_' }] + no-use-before-define: off + + # Stylistic Issues + # https://eslint.org/docs/rules/#stylistic-issues + + camelcase: error + capitalized-comments: off # maybe + consistent-this: off + func-name-matching: off + func-names: [error, as-needed] # improve debug experience + func-style: off + id-denylist: off + id-length: off + id-match: [error, '^(?:_?[a-zA-Z0-9]*)|[_A-Z0-9]+$'] + line-comment-position: off + lines-around-comment: off + lines-between-class-members: [error, always, { exceptAfterSingleLine: true }] + max-depth: off + max-lines: off + max-lines-per-function: off + max-nested-callbacks: off + max-params: off + max-statements: off + max-statements-per-line: off + multiline-comment-style: off + new-cap: error + no-array-constructor: error + no-bitwise: off + no-continue: off + no-inline-comments: off + no-lonely-if: error + no-multi-assign: off + no-negated-condition: off + no-nested-ternary: off + no-new-object: error + no-plusplus: off + no-restricted-syntax: off + no-tabs: error + no-ternary: off + no-underscore-dangle: off # TODO + no-unneeded-ternary: error + one-var: [error, never] + operator-assignment: error + padding-line-between-statements: off + prefer-exponentiation-operator: error + prefer-object-spread: error + quotes: [error, single, { avoidEscape: true }] + sort-keys: off + sort-vars: off + spaced-comment: error + + # ECMAScript 6 + # https://eslint.org/docs/rules/#ecmascript-6 + + arrow-body-style: error + constructor-super: error + no-class-assign: error + no-const-assign: error + no-dupe-class-members: error + no-duplicate-imports: off # Superseded by `import/no-duplicates` + no-new-symbol: error + no-restricted-exports: off + no-restricted-imports: off + no-this-before-super: error + no-useless-computed-key: error + no-useless-constructor: error + no-useless-rename: error + no-var: error + object-shorthand: error + prefer-arrow-callback: error + prefer-const: error + prefer-destructuring: off + prefer-numeric-literals: error + prefer-object-has-own: off # TODO requires Node.js v16.9.0 + prefer-rest-params: off # TODO + prefer-spread: error + prefer-template: off + require-yield: error + sort-imports: off + symbol-description: off + + # Bellow rules are disabled because coflicts with Prettier, see: + # https://github.com/prettier/eslint-config-prettier/blob/master/index.js + array-bracket-newline: off + array-bracket-spacing: off + array-element-newline: off + arrow-parens: off + arrow-spacing: off + block-spacing: off + brace-style: off + comma-dangle: off + comma-spacing: off + comma-style: off + computed-property-spacing: off + dot-location: off + eol-last: off + func-call-spacing: off + function-call-argument-newline: off + function-paren-newline: off + generator-star-spacing: off + implicit-arrow-linebreak: off + indent: off + jsx-quotes: off + key-spacing: off + keyword-spacing: off + linebreak-style: off + max-len: off + multiline-ternary: off + newline-per-chained-call: off + new-parens: off + no-confusing-arrow: off + no-extra-parens: off + no-extra-semi: off + no-floating-decimal: off + no-mixed-operators: off + no-mixed-spaces-and-tabs: off + no-multi-spaces: off + no-multiple-empty-lines: off + no-trailing-spaces: off + no-unexpected-multiline: off + no-whitespace-before-property: off + nonblock-statement-body-position: off + object-curly-newline: off + object-curly-spacing: off + object-property-newline: off + one-var-declaration-per-line: off + operator-linebreak: off + padded-blocks: off + quote-props: off + rest-spread-spacing: off + semi: off + semi-spacing: off + semi-style: off + space-before-blocks: off + space-before-function-paren: off + space-in-parens: off + space-infix-ops: off + space-unary-ops: off + switch-colon-spacing: off + template-curly-spacing: off + template-tag-spacing: off + unicode-bom: off + wrap-iife: off + wrap-regex: off + yield-star-spacing: off + +overrides: + - files: '**/*.ts' + parser: '@typescript-eslint/parser' + parserOptions: + sourceType: module + project: ['tsconfig.json'] + plugins: + - '@typescript-eslint' + - 'eslint-plugin-tsdoc' + extends: + - plugin:import/typescript + rules: + ########################################################################## + # `eslint-plugin-tsdoc` rule list based on `v0.2.x` + # https://github.com/microsoft/tsdoc/tree/master/eslint-plugin + ########################################################################## + + tsdoc/syntax: error + + ########################################################################## + # `@typescript-eslint/eslint-plugin` rule list based on `v5.8.x` + ########################################################################## + + # Supported Rules + # https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#supported-rules + '@typescript-eslint/adjacent-overload-signatures': error + '@typescript-eslint/array-type': [error, { default: generic }] + '@typescript-eslint/await-thenable': error + '@typescript-eslint/ban-ts-comment': [error, { 'ts-expect-error': false }] + '@typescript-eslint/ban-tslint-comment': error + '@typescript-eslint/ban-types': off # TODO temporarily disabled + '@typescript-eslint/class-literal-property-style': off # TODO enable after TS conversion + '@typescript-eslint/consistent-indexed-object-style': + [error, index-signature] + '@typescript-eslint/consistent-type-assertions': off # TODO temporarily disable + '@typescript-eslint/consistent-type-definitions': error + '@typescript-eslint/consistent-type-exports': error + '@typescript-eslint/consistent-type-imports': error + '@typescript-eslint/explicit-function-return-type': off # TODO consider + '@typescript-eslint/explicit-member-accessibility': off # TODO consider + '@typescript-eslint/explicit-module-boundary-types': off # TODO consider + '@typescript-eslint/member-ordering': error + '@typescript-eslint/method-signature-style': error + '@typescript-eslint/naming-convention': off # TODO consider + '@typescript-eslint/no-base-to-string': error + '@typescript-eslint/no-confusing-non-null-assertion': error + '@typescript-eslint/no-confusing-void-expression': off # TODO enable with ignoreArrowShorthand + '@typescript-eslint/no-dynamic-delete': off + '@typescript-eslint/no-empty-interface': error + '@typescript-eslint/no-explicit-any': off # TODO error + '@typescript-eslint/no-extra-non-null-assertion': error + '@typescript-eslint/no-extraneous-class': off # TODO consider + '@typescript-eslint/no-floating-promises': error + '@typescript-eslint/no-for-in-array': error + '@typescript-eslint/no-implicit-any-catch': off # TODO: Enable after TS conversion + '@typescript-eslint/no-implied-eval': error + '@typescript-eslint/no-inferrable-types': + [error, { ignoreParameters: true, ignoreProperties: true }] + '@typescript-eslint/no-misused-new': error + '@typescript-eslint/no-misused-promises': error + '@typescript-eslint/no-namespace': error + '@typescript-eslint/no-non-null-asserted-nullish-coalescing': error + '@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-invalid-void-type': error + '@typescript-eslint/no-require-imports': error + '@typescript-eslint/no-this-alias': error + '@typescript-eslint/no-type-alias': off # TODO consider + '@typescript-eslint/no-unnecessary-boolean-literal-compare': error + '@typescript-eslint/no-unnecessary-condition': off # TODO temporary disable + '@typescript-eslint/no-unnecessary-qualifier': error + '@typescript-eslint/no-unnecessary-type-arguments': error + '@typescript-eslint/no-unnecessary-type-assertion': error + '@typescript-eslint/no-unnecessary-type-constraint': error + '@typescript-eslint/no-unsafe-argument': off # TODO consider + '@typescript-eslint/no-unsafe-assignment': off # TODO consider + '@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-var-requires': error + '@typescript-eslint/non-nullable-type-assertion-style': off #TODO temporarily disabled + '@typescript-eslint/prefer-as-const': error + '@typescript-eslint/prefer-enum-initializers': error + '@typescript-eslint/prefer-for-of': error + '@typescript-eslint/prefer-function-type': error + '@typescript-eslint/prefer-includes': error + '@typescript-eslint/prefer-literal-enum-member': error + '@typescript-eslint/prefer-namespace-keyword': error + '@typescript-eslint/prefer-nullish-coalescing': error + '@typescript-eslint/prefer-optional-chain': error + '@typescript-eslint/prefer-readonly': off + '@typescript-eslint/prefer-readonly-parameter-types': off # TODO consider + '@typescript-eslint/prefer-reduce-type-parameter': error + '@typescript-eslint/prefer-regexp-exec': off + '@typescript-eslint/prefer-return-this-type': error + '@typescript-eslint/prefer-string-starts-ends-with': error + '@typescript-eslint/prefer-ts-expect-error': error + '@typescript-eslint/promise-function-async': off + '@typescript-eslint/require-array-sort-compare': error + '@typescript-eslint/restrict-plus-operands': off #TODO temporarily disabled + '@typescript-eslint/restrict-template-expressions': off #TODO temporarily disabled + '@typescript-eslint/sort-type-union-intersection-members': off # TODO consider + '@typescript-eslint/strict-boolean-expressions': off # TODO consider + '@typescript-eslint/switch-exhaustiveness-check': error + '@typescript-eslint/triple-slash-reference': error + '@typescript-eslint/typedef': off + '@typescript-eslint/unbound-method': off # TODO consider + '@typescript-eslint/unified-signatures': error + + # Extension Rules + # https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#extension-rules + + # Disable conflicting ESLint rules and enable TS-compatible ones + default-param-last: off + dot-notation: off + lines-between-class-members: off + no-array-constructor: off + no-dupe-class-members: off + no-empty-function: off + no-invalid-this: off + no-loop-func: off + no-loss-of-precision: off + no-redeclare: off + no-throw-literal: off + no-shadow: off + no-unused-expressions: off + no-unused-vars: off + no-useless-constructor: off + require-await: off + no-return-await: off + '@typescript-eslint/default-param-last': error + '@typescript-eslint/dot-notation': error + '@typescript-eslint/lines-between-class-members': + [error, always, { exceptAfterSingleLine: true }] + '@typescript-eslint/no-array-constructor': error + '@typescript-eslint/no-dupe-class-members': error + '@typescript-eslint/no-empty-function': error + '@typescript-eslint/no-invalid-this': error + '@typescript-eslint/no-loop-func': error + '@typescript-eslint/no-loss-of-precision': error + '@typescript-eslint/no-redeclare': error + '@typescript-eslint/no-throw-literal': error # TODO [error, { allowThrowingAny: false, allowThrowingUnknown: false }] + '@typescript-eslint/no-shadow': error + '@typescript-eslint/no-unused-expressions': error + '@typescript-eslint/no-unused-vars': + [ + error, + { + vars: all, + args: all, + argsIgnorePattern: '^_', + varsIgnorePattern: '^_T', + }, + ] + '@typescript-eslint/no-useless-constructor': error + '@typescript-eslint/require-await': error + '@typescript-eslint/return-await': error + + # Disable for JS and TS + '@typescript-eslint/init-declarations': off + '@typescript-eslint/no-magic-numbers': off + '@typescript-eslint/no-restricted-imports': off + '@typescript-eslint/no-use-before-define': off + '@typescript-eslint/no-duplicate-imports': off # Superseded by `import/no-duplicates` + + # Below rules are disabled because they conflict with Prettier, see: + # https://github.com/prettier/eslint-config-prettier/blob/main/index.js + '@typescript-eslint/object-curly-spacing': off + '@typescript-eslint/quotes': off + '@typescript-eslint/brace-style': off + '@typescript-eslint/comma-dangle': off + '@typescript-eslint/comma-spacing': off + '@typescript-eslint/func-call-spacing': off + '@typescript-eslint/indent': off + '@typescript-eslint/keyword-spacing': off + '@typescript-eslint/member-delimiter-style': off + '@typescript-eslint/no-extra-parens': off + '@typescript-eslint/no-extra-semi': off + '@typescript-eslint/semi': off + '@typescript-eslint/space-before-function-paren': off + '@typescript-eslint/space-infix-ops': off + '@typescript-eslint/type-annotation-spacing': off + - files: 'src/**' + rules: + internal-rules/require-to-string-tag: error + - files: 'src/**/__*__/**' + rules: + internal-rules/require-to-string-tag: off + node/no-unpublished-import: [error, { allowModules: ['chai', 'mocha'] }] + import/no-deprecated: off + import/no-restricted-paths: off + import/no-extraneous-dependencies: [error, { devDependencies: true }] + - files: 'integrationTests/*' + 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/*/**' + 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/**' + rules: + internal-rules/only-ascii: [error, { allowEmoji: true }] + node/no-sync: off + node/no-missing-require: off + import/no-nodejs-modules: off + import/no-commonjs: off + no-console: off + no-await-in-loop: off + - files: 'resources/**' + rules: + internal-rules/only-ascii: [error, { allowEmoji: true }] + node/no-unpublished-require: off + node/no-sync: off + import/no-extraneous-dependencies: [error, { devDependencies: true }] + import/no-nodejs-modules: off + import/no-commonjs: off + no-console: off diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 00000000..d935f6d4 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,101 @@ +# 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/graphql/graphql-spec/issues/). + +## Issues + +We use GitHub issues to track public bugs and requests. Please ensure your bug +description is clear and has sufficient instructions to be able to reproduce the +issue. The best way is to provide a reduced test case on jsFiddle or jsBin. + +## Pull Requests + +All active development of graphql-js happens on GitHub. We actively welcome +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://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/graphql/graphql-spec/issues/) against the spec. + +### GraphQL Specification Membership Agreement + +This repository is managed by EasyCLA. Project participants must sign the free ([GraphQL Specification Membership agreement](https://preview-spec-membership.graphql.org) before making a contribution. You only need to do this one time, and it can be signed by [individual contributors](http://individual-spec-membership.graphql.org/) or their [employers](http://corporate-spec-membership.graphql.org/). + +To initiate the signature process please open a PR against this repo. The EasyCLA bot will block the merge if we still need a membership agreement from you. + +You can find [detailed information here](https://github.com/graphql/graphql-wg/tree/main/membership). If you have issues, please email [operations@graphql.org](mailto:operations@graphql.org). + +If your company benefits from GraphQL and you would like to provide essential financial support for the systems and people that power our community, please also consider membership in the [GraphQL Foundation](https://foundation.graphql.org/join). + +### Getting Started + +1. Fork this repo by using the "Fork" button in the upper-right + +2. Check out your fork + + ```sh + git clone git@github.com:your_name_here/graphql-js.git + ``` + +3. Install or Update all dependencies + + ```sh + npm install + ``` + +4. Get coding! If you've added code, add tests. If you've changed APIs, update + any relevant documentation or tests. Ensure your work is committed within a + feature branch. + +5. Ensure all tests pass + + ```sh + npm test + ``` + +## Coding Style + +This project uses [Prettier](https://prettier.io/) for standard formatting. To +ensure your pull request matches the style guides, run `npm run prettier`. + +- 2 spaces for indentation (no tabs) +- 80 character line length strongly preferred. +- Prefer `'` over `"` +- ES6 syntax when possible. However do not rely on ES6-specific functions to be available. +- Use [TypeScript](https://www.typescriptlang.org). +- Use semicolons; +- Trailing commas, +- Avd abbr wrds. + +## Release on NPM + +_Only core contributors may release to NPM._ + +To release a new version on NPM, first ensure all tests pass with `npm test`, +then use `npm version patch|minor|major` in order to increment the version in +package.json and tag and commit a release. Then `git push && git push --tags` +to sync this change with source control. Then `npm publish npmDist` to actually +publish the release to NPM. +Once published, add [release notes](https://github.com/graphql/graphql-js/tags). +Use [semver](https://semver.org/) to determine which version part to increment. + +Example for a patch release: + +```sh +npm test +npm version patch +git push --follow-tags +npm publish npmDist +``` + +## License + +By contributing to graphql-js, you agree that your contributions will be +licensed under its [MIT license](../LICENSE). diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 00000000..d8236318 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,21 @@ +# Questions regarding how to use GraphQL + +We want to keep signal strong in the GitHub issue tracker – to make sure that it remains the best place to track bugs and features that affect development. + +If you have a question on how to use GraphQL, please [post it to Stack Overflow](https://stackoverflow.com/questions/ask?tags=graphql) with the tag [#graphql](https://stackoverflow.com/questions/tagged/graphql). + +Please do not post general questions directly as GitHub issues. They may sit for weeks unanswered, or may be spontaneously closed without answer. + +# Reporting issues with GraphQL.js + +Before filing a new issue, make sure an issue for your problem doesn't already exist. + +The best way to get a bug fixed is to provide a _pull request_ with a simplified failing test case (or better yet, include a fix). + +# Feature requests + +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 + +Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe disclosure of security bugs. With that in mind, please do not file public issues; go through the process outlined on that page. diff --git a/.github/actions/deploy-dir-as-branch/action.yml b/.github/actions/deploy-dir-as-branch/action.yml new file mode 100644 index 00000000..0910ca75 --- /dev/null +++ b/.github/actions/deploy-dir-as-branch/action.yml @@ -0,0 +1,52 @@ +name: 'Deploy specified directory as a branch' +description: 'This action deploys directory as branch.' +inputs: + src_dir: + required: true + target_branch: + required: true +runs: + using: 'composite' + steps: + - name: Creating temporary directory to clone the branch + shell: bash + run: | + BRANCH_DIR=$(mktemp -d "`pwd`/cloned_${{ inputs.target_branch }}_XXXXXX") + echo "BRANCH_DIR=$BRANCH_DIR" >> $GITHUB_ENV + + - name: Checkout `${{ inputs.target_branch }}` branch + uses: actions/checkout@v2 + with: + ref: ${{ inputs.target_branch }} + path: ${{ env.BRANCH_DIR }} + + - name: Publish `${{ inputs.target_branch }}` branch + working-directory: ${{ env.BRANCH_DIR }} + shell: bash + run: | + echo '::echo::on' + + echo '::group::Remove existing files first' + git rm -r . + echo '::endgroup::' + + echo '::group::Move necessary files' + cp -vnR '${{ github.workspace }}/${{ inputs.src_dir }}/.' . + echo '::endgroup::' + + git add -A + if git diff --staged --quiet; then + echo 'Nothing to publish' + else + git config user.name 'GitHub Action Script' + git config user.email 'please@open.issue' + + git commit -a -m 'Deploy ${{ github.sha }} to '${{ inputs.target_branch }}' branch' + git push + echo 'Pushed' + fi + + - name: Remove cloned branch + if: ${{ always() }} + shell: bash + run: 'rm -rf $BRANCH_DIR' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..f8f6b196 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,300 @@ +name: CI +on: [push, pull_request] +env: + NODE_VERSION_USED_FOR_DEVELOPMENT: 17 +jobs: + lint: + name: Lint source files + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v2 + with: + persist-credentials: false + + - 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: Lint ESLint + run: npm run lint + + - name: Check Types + run: npm run check + + - name: Lint Prettier + run: npm run prettier:check + + - name: Spellcheck + run: npm run check:spelling + + checkForCommonlyIgnoredFiles: + name: Check for commonly ignored files + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v2 + with: + persist-credentials: false + + - name: Check if commit contains files that should be ignored + run: | + git clone --depth 1 https://github.com/github/gitignore.git && + cat gitignore/Node.gitignore $(find gitignore/Global -name "*.gitignore" | grep -v ModelSim) > all.gitignore && + if [[ "$(git ls-files -iX all.gitignore)" != "" ]]; then + echo "::error::Please remove these files:" + git ls-files -iX all.gitignore + exit 1 + fi + + checkPackageLock: + name: Check health of package-lock.json file + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v2 + with: + persist-credentials: false + + - 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: Check that package-lock.json doesn't have conflicts + run: npm ls --depth 999 + + - name: Run npm install + run: npm install --force --package-lock-only --ignore-scripts --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 + + integrationTests: + name: Run integration tests + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v2 + with: + persist-credentials: false + + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: ${{ env.NODE_VERSION_USED_FOR_DEVELOPMENT }} + # We install bunch of packages during integration tests without locking them + # so we skip cache action to not pollute cache for other jobs. + + - name: Install Dependencies + run: npm ci --ignore-scripts + + - name: Run Integration Tests + run: npm run check:integrations + + fuzz: + name: Run fuzzing tests + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v2 + with: + persist-credentials: false + + - 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 Tests + run: npm run fuzzonly + + coverage: + name: Measure test coverage + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v2 + with: + persist-credentials: false + + - 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 tests and measure code coverage + run: npm run testonly:cover + + - name: Upload coverage to Codecov + if: ${{ always() }} + uses: codecov/codecov-action@v1 + with: + file: ./coverage/coverage-final.json + fail_ci_if_error: true + + test: + name: Run tests on Node v${{ matrix.node_version_to_setup }} + runs-on: ubuntu-latest + strategy: + matrix: + node_version_to_setup: [12, 14, 16, 17] + steps: + - name: Checkout repo + uses: actions/checkout@v2 + with: + persist-credentials: false + + - name: Setup Node.js v${{ matrix.node_version_to_setup }} + uses: actions/setup-node@v2 + with: + cache: npm + node-version: ${{ matrix.node_version_to_setup }} + + - name: Install Dependencies + run: npm ci --ignore-scripts + + - name: Run Tests + run: npm run testonly + + benchmark: + name: Run benchmark + 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] + steps: + - name: Checkout repo + uses: actions/checkout@v2 + with: + persist-credentials: false + + - 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: Build NPM package + run: npm run build:npm + + - name: Deploy to `npm` branch + uses: ./.github/actions/deploy-dir-as-branch + with: + src_dir: npmDist + target_branch: npm + + deploy-to-deno-branch: + name: Deploy to `deno` 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] + steps: + - name: Checkout repo + uses: actions/checkout@v2 + with: + persist-credentials: false + + - 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: Build Deno package + run: npm run build:deno + + - name: Deploy to `deno` branch + uses: ./.github/actions/deploy-dir-as-branch + with: + src_dir: denoDist + target_branch: deno diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..69b0985a --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +# This .gitignore only ignores files specific to this repository. +# If you see other files generated by your OS or tools you use, consider +# creating a global .gitignore file. +# +# https://help.github.com/articles/ignoring-files/#create-a-global-gitignore +# https://www.gitignore.io/ + +/diff-npm-package.html +/.eslintcache +/.cspellcache +/node_modules +/coverage +/npmDist +/denoDist diff --git a/.mocharc.yml b/.mocharc.yml new file mode 100644 index 00000000..5050fbe4 --- /dev/null +++ b/.mocharc.yml @@ -0,0 +1,7 @@ +fail-zero: true +throw-deprecation: true +check-leaks: true +require: + - 'resources/ts-register.js' +extension: + - 'ts' diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..07b1fbef --- /dev/null +++ b/.prettierignore @@ -0,0 +1,7 @@ +# Copied from '.gitignore', please keep it in sync. +/diff-npm-package.html +/.eslintcache +/node_modules +/coverage +/npmDist +/denoDist diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..a20502b7 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,4 @@ +{ + "singleQuote": true, + "trailingComma": "all" +} diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..7bbf892a --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 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 +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 00000000..34753472 --- /dev/null +++ b/README.md @@ -0,0 +1,158 @@ +# GraphQL.js + +The JavaScript reference implementation for GraphQL, a query language for APIs created by Facebook. + +[![npm version](https://badge.fury.io/js/graphql.svg)](https://badge.fury.io/js/graphql) +[![Build Status](https://github.com/graphql/graphql-js/workflows/CI/badge.svg?branch=main)](https://github.com/graphql/graphql-js/actions?query=branch%3Amain) +[![Coverage Status](https://codecov.io/gh/graphql/graphql-js/branch/main/graph/badge.svg)](https://codecov.io/gh/graphql/graphql-js) + +See more complete documentation at https://graphql.org/ and +https://graphql.org/graphql-js/. + +Looking for help? Find resources [from the community](https://graphql.org/community/). + +## Getting Started + +A general overview of GraphQL is available in the +[README](https://github.com/graphql/graphql-spec/blob/main/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. + +### Using GraphQL.js + +Install GraphQL.js from npm + +With npm: + +```sh +npm install --save graphql +``` + +or using yarn: + +```sh +yarn add graphql +``` + +GraphQL.js provides two important capabilities: building a type schema and +serving queries against that type schema. + +First, build a GraphQL type schema which maps to your codebase. + +```js +import { + graphql, + GraphQLSchema, + GraphQLObjectType, + GraphQLString, +} from 'graphql'; + +var schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'RootQueryType', + fields: { + hello: { + type: GraphQLString, + resolve() { + return 'world'; + }, + }, + }, + }), +}); +``` + +This defines a simple schema, with one type and one field, that resolves +to a fixed value. The `resolve` function can return a value, a promise, +or an array of promises. A more complex example is included in the top-level [tests](src/__tests__) directory. + +Then, serve the result of a query against that type schema. + +```js +var source = '{ hello }'; + +graphql({ schema, source }).then((result) => { + // Prints + // { + // data: { hello: "world" } + // } + console.log(result); +}); +``` + +This runs a query fetching the one field defined. The `graphql` function will +first ensure the query is syntactically and semantically valid before executing +it, reporting errors otherwise. + +```js +var source = '{ BoyHowdy }'; + +graphql({ schema, source }).then((result) => { + // Prints + // { + // errors: [ + // { message: 'Cannot query field BoyHowdy on RootQueryType', + // locations: [ { line: 1, column: 3 } ] } + // ] + // } + console.log(result); +}); +``` + +**Note**: Please don't forget to set `NODE_ENV=production` if you are running a production server. It will disable some checks that can be useful during development but will significantly improve performance. + +### Want to ride the bleeding edge? + +The `npm` branch in this repository is automatically maintained to be the last +commit to `main` to pass all tests, in the same form found on npm. It is +recommended to use builds deployed to npm for many reasons, but if you want to use +the latest not-yet-released version of graphql-js, you can do so by depending +directly on this branch: + +``` +npm install graphql@git://github.com/graphql/graphql-js.git#npm +``` + +### Experimental features + +Each release of GraphQL.js will be accompanied by an experimental release containing support for the `@defer` and `@stream` directive proposal. We are hoping to get community feedback on these releases before the proposal is accepted into the GraphQL specification. You can use this experimental release of GraphQL.js by adding the following to your project's `package.json` file. + +``` +"graphql": "experimental-stream-defer" +``` + +Community feedback on this experimental release is much appreciated and can be provided on the [issue created for this purpose](https://github.com/graphql/graphql-js/issues/2848). + +### Using in a Browser + +GraphQL.js is a general-purpose library and can be used both in a Node server +and in the browser. As an example, the [GraphiQL](https://github.com/graphql/graphiql/) +tool is built with GraphQL.js! + +Building a project using GraphQL.js with [webpack](https://webpack.js.org) or +[rollup](https://github.com/rollup/rollup) should just work and only include +the portions of the library you use. This works because GraphQL.js is distributed +with both CommonJS (`require()`) and ESModule (`import`) files. Ensure that any +custom build configurations look for `.mjs` files! + +### Contributing + +We actively welcome pull requests. Learn how to [contribute](./.github/CONTRIBUTING.md). + +This repository is managed by EasyCLA. Project participants must sign the free ([GraphQL Specification Membership agreement](https://preview-spec-membership.graphql.org) before making a contribution. You only need to do this one time, and it can be signed by [individual contributors](http://individual-spec-membership.graphql.org/) or their [employers](http://corporate-spec-membership.graphql.org/). + +To initiate the signature process please open a PR against this repo. The EasyCLA bot will block the merge if we still need a membership agreement from you. + +You can find [detailed information here](https://github.com/graphql/graphql-wg/tree/main/membership). If you have issues, please email [operations@graphql.org](mailto:operations@graphql.org). + +If your company benefits from GraphQL and you would like to provide essential financial support for the systems and people that power our community, please also consider membership in the [GraphQL Foundation](https://foundation.graphql.org/join). + +### Changelog + +Changes are tracked as [GitHub releases](https://github.com/graphql/graphql-js/releases). + +### License + +GraphQL.js is [MIT-licensed](./LICENSE). diff --git a/benchmark/benchmark.js b/benchmark/benchmark.js new file mode 100644 index 00000000..9288d1f2 --- /dev/null +++ b/benchmark/benchmark.js @@ -0,0 +1,393 @@ +'use strict'; + +const os = require('os'); +const fs = require('fs'); +const path = require('path'); +const assert = require('assert'); +const cp = require('child_process'); + +const NS_PER_SEC = 1e9; +const LOCAL = 'local'; + +// The maximum time in seconds a benchmark is allowed to run before finishing. +const maxTime = 5; +// The minimum sample size required to perform statistical analysis. +const minSamples = 5; + +// Get the revisions and make things happen! +if (require.main === module) { + const { benchmarks, revisions } = getArguments(process.argv.slice(2)); + const benchmarkProjects = prepareBenchmarkProjects(revisions); + + runBenchmarks(benchmarks, benchmarkProjects).catch((error) => { + console.error(error); + process.exit(1); + }); +} + +function localDir(...paths) { + return path.join(__dirname, '..', ...paths); +} + +function exec(command, options = {}) { + const result = cp.execSync(command, { + encoding: 'utf-8', + stdio: ['inherit', 'pipe', 'inherit'], + ...options, + }); + return result?.trimEnd(); +} + +// Build a benchmark-friendly environment for the given revision +// and returns path to its 'dist' directory. +function prepareBenchmarkProjects(revisionList) { + const tmpDir = path.join(os.tmpdir(), 'graphql-js-benchmark'); + fs.rmSync(tmpDir, { recursive: true, force: true }); + fs.mkdirSync(tmpDir); + + const setupDir = path.join(tmpDir, 'setup'); + fs.mkdirSync(setupDir); + + return revisionList.map((revision) => { + console.log(`🍳 Preparing ${revision}...`); + const projectPath = path.join(setupDir, revision); + fs.rmSync(projectPath, { recursive: true, force: true }); + fs.mkdirSync(projectPath); + + fs.writeFileSync( + path.join(projectPath, 'package.json'), + '{ "private": true }', + ); + exec( + 'npm --quiet install --ignore-scripts ' + prepareNPMPackage(revision), + { cwd: projectPath }, + ); + exec(`cp -R ${localDir('benchmark')} ${projectPath}`); + + return { revision, projectPath }; + }); + + function prepareNPMPackage(revision) { + if (revision === LOCAL) { + const repoDir = localDir(); + const archivePath = path.join(tmpDir, 'graphql-local.tgz'); + fs.renameSync(buildNPMArchive(repoDir), archivePath); + return archivePath; + } + + // Returns the complete git hash for a given git revision reference. + const hash = exec(`git rev-parse "${revision}"`); + + const archivePath = path.join(tmpDir, `graphql-${hash}.tgz`); + if (fs.existsSync(archivePath)) { + return archivePath; + } + + const repoDir = path.join(tmpDir, hash); + fs.rmSync(repoDir, { recursive: true, force: true }); + fs.mkdirSync(repoDir); + exec(`git archive "${hash}" | tar -xC "${repoDir}"`); + exec('npm --quiet ci --ignore-scripts', { cwd: repoDir }); + fs.renameSync(buildNPMArchive(repoDir), archivePath); + fs.rmSync(repoDir, { recursive: true }); + return archivePath; + } + + function buildNPMArchive(repoDir) { + exec('npm --quiet run build:npm', { cwd: repoDir }); + + const distDir = path.join(repoDir, 'npmDist'); + const archiveName = exec(`npm --quiet pack ${distDir}`, { cwd: repoDir }); + return path.join(repoDir, archiveName); + } +} + +async function collectSamples(modulePath) { + const samples = []; + + // If time permits, increase sample size to reduce the margin of error. + const start = Date.now(); + while (samples.length < minSamples || (Date.now() - start) / 1e3 < maxTime) { + const { clocked, memUsed } = await sampleModule(modulePath); + assert(clocked > 0); + assert(memUsed > 0); + samples.push({ clocked, memUsed }); + } + return samples; +} + +// T-Distribution two-tailed critical values for 95% confidence. +// See http://www.itl.nist.gov/div898/handbook/eda/section3/eda3672.htm. +// prettier-ignore +const tTable = { + '1': 12.706, '2': 4.303, '3': 3.182, '4': 2.776, '5': 2.571, '6': 2.447, + '7': 2.365, '8': 2.306, '9': 2.262, '10': 2.228, '11': 2.201, '12': 2.179, + '13': 2.16, '14': 2.145, '15': 2.131, '16': 2.12, '17': 2.11, '18': 2.101, + '19': 2.093, '20': 2.086, '21': 2.08, '22': 2.074, '23': 2.069, '24': 2.064, + '25': 2.06, '26': 2.056, '27': 2.052, '28': 2.048, '29': 2.045, '30': 2.042, + infinity: 1.96, +}; + +// Computes stats on benchmark results. +function computeStats(samples) { + assert(samples.length > 1); + + // Compute the sample mean (estimate of the population mean). + let mean = 0; + let meanMemUsed = 0; + for (const { clocked, memUsed } of samples) { + mean += clocked; + meanMemUsed += memUsed; + } + mean /= samples.length; + meanMemUsed /= samples.length; + + // Compute the sample variance (estimate of the population variance). + let variance = 0; + for (const { clocked } of samples) { + variance += (clocked - mean) ** 2; + } + variance /= samples.length - 1; + + // Compute the sample standard deviation (estimate of the population standard deviation). + const sd = Math.sqrt(variance); + + // Compute the standard error of the mean (a.k.a. the standard deviation of the sampling distribution of the sample mean). + const sem = sd / Math.sqrt(samples.length); + + // Compute the degrees of freedom. + const df = samples.length - 1; + + // Compute the critical value. + const critical = tTable[df] || tTable.infinity; + + // Compute the margin of error. + const moe = sem * critical; + + // The relative margin of error (expressed as a percentage of the mean). + const rme = (moe / mean) * 100 || 0; + + return { + memPerOp: Math.floor(meanMemUsed), + ops: NS_PER_SEC / mean, + deviation: rme, + numSamples: samples.length, + }; +} + +function beautifyBenchmark(results) { + const nameMaxLen = maxBy(results, ({ name }) => name.length); + const opsTop = maxBy(results, ({ ops }) => ops); + const opsMaxLen = maxBy(results, ({ ops }) => beautifyNumber(ops).length); + const memPerOpMaxLen = maxBy( + results, + ({ memPerOp }) => beautifyBytes(memPerOp).length, + ); + + for (const result of results) { + printBench(result); + } + + function printBench(bench) { + const { name, memPerOp, ops, deviation, numSamples } = bench; + console.log( + ' ' + + nameStr() + + grey(' x ') + + opsStr() + + ' ops/sec ' + + grey('\xb1') + + deviationStr() + + cyan('%') + + grey(' x ') + + memPerOpStr() + + '/op' + + grey(' (' + numSamples + ' runs sampled)'), + ); + + function nameStr() { + const nameFmt = name.padEnd(nameMaxLen); + return ops === opsTop ? green(nameFmt) : nameFmt; + } + + function opsStr() { + const percent = ops / opsTop; + const colorFn = percent > 0.95 ? green : percent > 0.8 ? yellow : red; + return colorFn(beautifyNumber(ops).padStart(opsMaxLen)); + } + + function deviationStr() { + const colorFn = deviation > 5 ? red : deviation > 2 ? yellow : green; + return colorFn(deviation.toFixed(2)); + } + + function memPerOpStr() { + return beautifyBytes(memPerOp).padStart(memPerOpMaxLen); + } + } +} + +function beautifyBytes(bytes) { + const sizes = ['Bytes', 'KB', 'MB', 'GB']; + const i = Math.floor(Math.log2(bytes) / 10); + return beautifyNumber(bytes / 2 ** (i * 10)) + ' ' + sizes[i]; +} + +function beautifyNumber(num) { + return Number(num.toFixed(num > 100 ? 0 : 2)).toLocaleString(); +} + +function maxBy(array, fn) { + return Math.max(...array.map(fn)); +} + +// Prepare all revisions and run benchmarks matching a pattern against them. +async function runBenchmarks(benchmarks, benchmarkProjects) { + for (const benchmark of benchmarks) { + const results = []; + for (let i = 0; i < benchmarkProjects.length; ++i) { + const { revision, projectPath } = benchmarkProjects[i]; + const modulePath = path.join(projectPath, benchmark); + + if (i === 0) { + const { name } = await sampleModule(modulePath); + console.log('⏱ ' + name); + } + + try { + const samples = await collectSamples(modulePath); + + results.push({ + name: revision, + samples, + ...computeStats(samples), + }); + process.stdout.write(' ' + cyan(i + 1) + ' tests completed.\u000D'); + } catch (error) { + console.log(' ' + revision + ': ' + red(String(error))); + } + } + console.log('\n'); + + beautifyBenchmark(results); + console.log(''); + } +} + +function getArguments(argv) { + const revsIndex = argv.indexOf('--revs'); + const revisions = revsIndex === -1 ? [] : argv.slice(revsIndex + 1); + const benchmarks = revsIndex === -1 ? argv : argv.slice(0, revsIndex); + + switch (revisions.length) { + case 0: + revisions.unshift('HEAD'); + // fall through + case 1: { + revisions.unshift('local'); + + const assumeArgv = ['benchmark', ...benchmarks, '--revs', ...revisions]; + console.warn('Assuming you meant: ' + bold(assumeArgv.join(' '))); + break; + } + } + + if (benchmarks.length === 0) { + benchmarks.push(...findAllBenchmarks()); + } + + return { benchmarks, revisions }; +} + +function findAllBenchmarks() { + return fs + .readdirSync(localDir('benchmark'), { withFileTypes: true }) + .filter((dirent) => dirent.isFile()) + .map((dirent) => dirent.name) + .filter((name) => name.endsWith('-benchmark.js')) + .map((name) => path.join('benchmark', name)); +} + +function bold(str) { + return '\u001b[1m' + str + '\u001b[0m'; +} + +function red(str) { + return '\u001b[31m' + str + '\u001b[0m'; +} + +function green(str) { + return '\u001b[32m' + str + '\u001b[0m'; +} + +function yellow(str) { + return '\u001b[33m' + str + '\u001b[0m'; +} + +function cyan(str) { + return '\u001b[36m' + str + '\u001b[0m'; +} + +function grey(str) { + return '\u001b[90m' + str + '\u001b[0m'; +} + +function sampleModule(modulePath) { + const sampleCode = ` + const assert = require('assert'); + + assert(global.gc); + assert(process.send); + const module = require('${modulePath}'); + + clock(7, module.measure); // warm up + global.gc(); + process.nextTick(() => { + const memBaseline = process.memoryUsage().heapUsed; + const clocked = clock(module.count, module.measure); + process.send({ + name: module.name, + clocked: clocked / module.count, + memUsed: (process.memoryUsage().heapUsed - memBaseline) / module.count, + }); + }); + + // Clocks the time taken to execute a test per cycle (secs). + function clock(count, fn) { + const start = process.hrtime.bigint(); + for (let i = 0; i < count; ++i) { + fn(); + } + return Number(process.hrtime.bigint() - start); + } + `; + + return new Promise((resolve, reject) => { + const child = cp.spawn( + process.argv[0], + [ + '--no-concurrent-sweeping', + '--predictable', + '--expose-gc', + '--eval', + sampleCode, + ], + { + stdio: ['inherit', 'inherit', 'inherit', 'ipc'], + env: { NODE_ENV: 'production' }, + }, + ); + + let message; + let error; + + child.on('message', (msg) => (message = msg)); + child.on('error', (e) => (error = e)); + child.on('close', () => { + if (message) { + return resolve(message); + } + reject(error || new Error('Spawn process closed without error')); + }); + }); +} diff --git a/benchmark/buildASTSchema-benchmark.js b/benchmark/buildASTSchema-benchmark.js new file mode 100644 index 00000000..b578d71a --- /dev/null +++ b/benchmark/buildASTSchema-benchmark.js @@ -0,0 +1,16 @@ +'use strict'; + +const { parse } = require('graphql/language/parser.js'); +const { buildASTSchema } = require('graphql/utilities/buildASTSchema.js'); + +const { bigSchemaSDL } = require('./fixtures.js'); + +const schemaAST = parse(bigSchemaSDL); + +module.exports = { + name: 'Build Schema from AST', + count: 10, + measure() { + buildASTSchema(schemaAST, { assumeValid: true }); + }, +}; diff --git a/benchmark/buildClientSchema-benchmark.js b/benchmark/buildClientSchema-benchmark.js new file mode 100644 index 00000000..240c9ca1 --- /dev/null +++ b/benchmark/buildClientSchema-benchmark.js @@ -0,0 +1,13 @@ +'use strict'; + +const { buildClientSchema } = require('graphql/utilities/buildClientSchema.js'); + +const { bigSchemaIntrospectionResult } = require('./fixtures.js'); + +module.exports = { + name: 'Build Schema from Introspection', + count: 10, + measure() { + buildClientSchema(bigSchemaIntrospectionResult.data, { assumeValid: true }); + }, +}; diff --git a/benchmark/fixtures.js b/benchmark/fixtures.js new file mode 100644 index 00000000..d057a805 --- /dev/null +++ b/benchmark/fixtures.js @@ -0,0 +1,13 @@ +'use strict'; + +const fs = require('fs'); +const path = require('path'); + +exports.bigSchemaSDL = fs.readFileSync( + path.join(__dirname, 'github-schema.graphql'), + 'utf8', +); + +exports.bigSchemaIntrospectionResult = JSON.parse( + fs.readFileSync(path.join(__dirname, 'github-schema.json'), 'utf8'), +); diff --git a/benchmark/github-schema.graphql b/benchmark/github-schema.graphql new file mode 100644 index 00000000..7baa4239 --- /dev/null +++ b/benchmark/github-schema.graphql @@ -0,0 +1,20367 @@ +""" +Autogenerated input type of AcceptTopicSuggestion +""" +input AcceptTopicSuggestionInput { + """ + The Node ID of the repository. + """ + repositoryId: ID! + + """ + The name of the suggested topic. + """ + name: String! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of AcceptTopicSuggestion +""" +type AcceptTopicSuggestionPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The accepted topic. + """ + topic: Topic +} + +""" +Represents an object which can take actions on GitHub. Typically a User or Bot. +""" +interface Actor { + """ + A URL pointing to the actor's public avatar. + """ + avatarUrl( + """ + The size of the resulting square image. + """ + size: Int + ): URI! + + """ + The username of the actor. + """ + login: String! + + """ + The HTTP path for this actor. + """ + resourcePath: URI! + + """ + The HTTP URL for this actor. + """ + url: URI! +} + +""" +Autogenerated input type of AddAssigneesToAssignable +""" +input AddAssigneesToAssignableInput { + """ + The id of the assignable object to add assignees to. + """ + assignableId: ID! + + """ + The id of users to add as assignees. + """ + assigneeIds: [ID!]! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of AddAssigneesToAssignable +""" +type AddAssigneesToAssignablePayload { + """ + The item that was assigned. + """ + assignable: Assignable + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated input type of AddComment +""" +input AddCommentInput { + """ + The Node ID of the subject to modify. + """ + subjectId: ID! + + """ + The contents of the comment. + """ + body: String! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of AddComment +""" +type AddCommentPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The edge from the subject's comment connection. + """ + commentEdge: IssueCommentEdge + + """ + The subject + """ + subject: Node + + """ + The edge from the subject's timeline connection. + """ + timelineEdge: IssueTimelineItemEdge +} + +""" +Represents a 'added_to_project' event on a given issue or pull request. +""" +type AddedToProjectEvent implements Node { + """ + Identifies the actor who performed the event. + """ + actor: Actor + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + Identifies the primary key from the database. + """ + databaseId: Int + id: ID! +} + +""" +Autogenerated input type of AddLabelsToLabelable +""" +input AddLabelsToLabelableInput { + """ + The id of the labelable object to add labels to. + """ + labelableId: ID! + + """ + The ids of the labels to add. + """ + labelIds: [ID!]! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of AddLabelsToLabelable +""" +type AddLabelsToLabelablePayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The item that was labeled. + """ + labelable: Labelable +} + +""" +Autogenerated input type of AddProjectCard +""" +input AddProjectCardInput { + """ + The Node ID of the ProjectColumn. + """ + projectColumnId: ID! + + """ + The content of the card. Must be a member of the ProjectCardItem union + """ + contentId: ID + + """ + The note on the card. + """ + note: String + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of AddProjectCard +""" +type AddProjectCardPayload { + """ + The edge from the ProjectColumn's card connection. + """ + cardEdge: ProjectCardEdge + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The ProjectColumn + """ + projectColumn: ProjectColumn +} + +""" +Autogenerated input type of AddProjectColumn +""" +input AddProjectColumnInput { + """ + The Node ID of the project. + """ + projectId: ID! + + """ + The name of the column. + """ + name: String! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of AddProjectColumn +""" +type AddProjectColumnPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The edge from the project's column connection. + """ + columnEdge: ProjectColumnEdge + + """ + The project + """ + project: Project +} + +""" +Autogenerated input type of AddPullRequestReviewComment +""" +input AddPullRequestReviewCommentInput { + """ + The Node ID of the review to modify. + """ + pullRequestReviewId: ID! + + """ + The SHA of the commit to comment on. + """ + commitOID: GitObjectID + + """ + The text of the comment. + """ + body: String! + + """ + The relative path of the file to comment on. + """ + path: String + + """ + The line index in the diff to comment on. + """ + position: Int + + """ + The comment id to reply to. + """ + inReplyTo: ID + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of AddPullRequestReviewComment +""" +type AddPullRequestReviewCommentPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The newly created comment. + """ + comment: PullRequestReviewComment + + """ + The edge from the review's comment connection. + """ + commentEdge: PullRequestReviewCommentEdge +} + +""" +Autogenerated input type of AddPullRequestReview +""" +input AddPullRequestReviewInput { + """ + The Node ID of the pull request to modify. + """ + pullRequestId: ID! + + """ + The commit OID the review pertains to. + """ + commitOID: GitObjectID + + """ + The contents of the review body comment. + """ + body: String + + """ + The event to perform on the pull request review. + """ + event: PullRequestReviewEvent + + """ + The review line comments. + """ + comments: [DraftPullRequestReviewComment] + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of AddPullRequestReview +""" +type AddPullRequestReviewPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The newly created pull request review. + """ + pullRequestReview: PullRequestReview + + """ + The edge from the pull request's review connection. + """ + reviewEdge: PullRequestReviewEdge +} + +""" +Autogenerated input type of AddReaction +""" +input AddReactionInput { + """ + The Node ID of the subject to modify. + """ + subjectId: ID! + + """ + The name of the emoji to react with. + """ + content: ReactionContent! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of AddReaction +""" +type AddReactionPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The reaction object. + """ + reaction: Reaction + + """ + The reactable subject. + """ + subject: Reactable +} + +""" +Autogenerated input type of AddStar +""" +input AddStarInput { + """ + The Starrable ID to star. + """ + starrableId: ID! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of AddStar +""" +type AddStarPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The starrable. + """ + starrable: Starrable +} + +""" +A GitHub App. +""" +type App implements Node { + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + Identifies the primary key from the database. + """ + databaseId: Int + + """ + The description of the app. + """ + description: String + id: ID! + + """ + The hex color code, without the leading '#', for the logo background. + """ + logoBackgroundColor: String! + + """ + A URL pointing to the app's logo. + """ + logoUrl( + """ + The size of the resulting image. + """ + size: Int + ): URI! + + """ + The name of the app. + """ + name: String! + + """ + A slug based on the name of the app for use in URLs. + """ + slug: String! + + """ + Identifies the date and time when the object was last updated. + """ + updatedAt: DateTime! + + """ + The URL to the app's homepage. + """ + url: URI! +} + +""" +An edge in a connection. +""" +type AppEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: App +} + +""" +An object that can have users assigned to it. +""" +interface Assignable { + """ + A list of Users assigned to this object. + """ + assignees( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): UserConnection! +} + +""" +Represents an 'assigned' event on any assignable object. +""" +type AssignedEvent implements Node { + """ + Identifies the actor who performed the event. + """ + actor: Actor + + """ + Identifies the assignable associated with the event. + """ + assignable: Assignable! + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + id: ID! + + """ + Identifies the user who was assigned. + """ + user: User +} + +""" +Represents a 'base_ref_changed' event on a given issue or pull request. +""" +type BaseRefChangedEvent implements Node { + """ + Identifies the actor who performed the event. + """ + actor: Actor + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + Identifies the primary key from the database. + """ + databaseId: Int + id: ID! +} + +""" +Represents a 'base_ref_force_pushed' event on a given pull request. +""" +type BaseRefForcePushedEvent implements Node { + """ + Identifies the actor who performed the event. + """ + actor: Actor + + """ + Identifies the after commit SHA for the 'base_ref_force_pushed' event. + """ + afterCommit: Commit + + """ + Identifies the before commit SHA for the 'base_ref_force_pushed' event. + """ + beforeCommit: Commit + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + id: ID! + + """ + PullRequest referenced by event. + """ + pullRequest: PullRequest! + + """ + Identifies the fully qualified ref name for the 'base_ref_force_pushed' event. + """ + ref: Ref +} + +""" +Represents a Git blame. +""" +type Blame { + """ + The list of ranges from a Git blame. + """ + ranges: [BlameRange!]! +} + +""" +Represents a range of information from a Git blame. +""" +type BlameRange { + """ + Identifies the recency of the change, from 1 (new) to 10 (old). This is + calculated as a 2-quantile and determines the length of distance between the + median age of all the changes in the file and the recency of the current + range's change. + """ + age: Int! + + """ + Identifies the line author + """ + commit: Commit! + + """ + The ending line for the range + """ + endingLine: Int! + + """ + The starting line for the range + """ + startingLine: Int! +} + +""" +Represents a Git blob. +""" +type Blob implements Node & GitObject { + """ + An abbreviated version of the Git object ID + """ + abbreviatedOid: String! + + """ + Byte size of Blob object + """ + byteSize: Int! + + """ + The HTTP path for this Git object + """ + commitResourcePath: URI! + + """ + The HTTP URL for this Git object + """ + commitUrl: URI! + id: ID! + + """ + Indicates whether the Blob is binary or text + """ + isBinary: Boolean! + + """ + Indicates whether the contents is truncated + """ + isTruncated: Boolean! + + """ + The Git object ID + """ + oid: GitObjectID! + + """ + The Repository the Git object belongs to + """ + repository: Repository! + + """ + UTF8 text data or null if the Blob is binary + """ + text: String +} + +""" +A special type of user which takes actions on behalf of GitHub Apps. +""" +type Bot implements Node & Actor & UniformResourceLocatable { + """ + A URL pointing to the GitHub App's public avatar. + """ + avatarUrl( + """ + The size of the resulting square image. + """ + size: Int + ): URI! + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + Identifies the primary key from the database. + """ + databaseId: Int + id: ID! + + """ + The username of the actor. + """ + login: String! + + """ + The HTTP path for this bot + """ + resourcePath: URI! + + """ + Identifies the date and time when the object was last updated. + """ + updatedAt: DateTime! + + """ + The HTTP URL for this bot + """ + url: URI! +} + +""" +A branch protection rule. +""" +type BranchProtectionRule implements Node { + """ + A list of conflicts matching branches protection rule and other branch protection rules + """ + branchProtectionRuleConflicts( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): BranchProtectionRuleConflictConnection! + + """ + The actor who created this branch protection rule. + """ + creator: Actor + + """ + Identifies the primary key from the database. + """ + databaseId: Int + + """ + Will new commits pushed to matching branches dismiss pull request review approvals. + """ + dismissesStaleReviews: Boolean! + id: ID! + + """ + Can admins overwrite branch protection. + """ + isAdminEnforced: Boolean! + + """ + Repository refs that are protected by this rule + """ + matchingRefs( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): RefConnection! + + """ + Identifies the protection rule pattern. + """ + pattern: String! + + """ + A list push allowances for this branch protection rule. + """ + pushAllowances( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): PushAllowanceConnection! + + """ + The repository associated with this branch protection rule. + """ + repository: Repository + + """ + Number of approving reviews required to update matching branches. + """ + requiredApprovingReviewCount: Int + + """ + List of required status check contexts that must pass for commits to be accepted to matching branches. + """ + requiredStatusCheckContexts: [String] + + """ + Are approving reviews required to update matching branches. + """ + requiresApprovingReviews: Boolean! + + """ + Are commits required to be signed. + """ + requiresCommitSignatures: Boolean! + + """ + Are status checks required to update matching branches. + """ + requiresStatusChecks: Boolean! + + """ + Are branches required to be up to date before merging. + """ + requiresStrictStatusChecks: Boolean! + + """ + Is pushing to matching branches restricted. + """ + restrictsPushes: Boolean! + + """ + Is dismissal of pull request reviews restricted. + """ + restrictsReviewDismissals: Boolean! + + """ + A list review dismissal allowances for this branch protection rule. + """ + reviewDismissalAllowances( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): ReviewDismissalAllowanceConnection! +} + +""" +A conflict between two branch protection rules. +""" +type BranchProtectionRuleConflict { + """ + Identifies the branch protection rule. + """ + branchProtectionRule: BranchProtectionRule + + """ + Identifies the conflicting branch protection rule. + """ + conflictingBranchProtectionRule: BranchProtectionRule + + """ + Identifies the branch ref that has conflicting rules + """ + ref: Ref +} + +""" +The connection type for BranchProtectionRuleConflict. +""" +type BranchProtectionRuleConflictConnection { + """ + A list of edges. + """ + edges: [BranchProtectionRuleConflictEdge] + + """ + A list of nodes. + """ + nodes: [BranchProtectionRuleConflict] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type BranchProtectionRuleConflictEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: BranchProtectionRuleConflict +} + +""" +The connection type for BranchProtectionRule. +""" +type BranchProtectionRuleConnection { + """ + A list of edges. + """ + edges: [BranchProtectionRuleEdge] + + """ + A list of nodes. + """ + nodes: [BranchProtectionRule] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type BranchProtectionRuleEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: BranchProtectionRule +} + +""" +Autogenerated input type of ChangeUserStatus +""" +input ChangeUserStatusInput { + """ + The emoji to represent your status. Can either be a native Unicode emoji or an emoji name with colons, e.g., :grinning:. + """ + emoji: String + + """ + A short description of your current status. + """ + message: String + + """ + The ID of the organization whose members will be allowed to see the status. If + omitted, the status will be publicly visible. + """ + organizationId: ID + + """ + Whether this status should indicate you are not fully available on GitHub, e.g., you are away. + """ + limitedAvailability: Boolean = false + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of ChangeUserStatus +""" +type ChangeUserStatusPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + Your updated status. + """ + status: UserStatus +} + +""" +Autogenerated input type of ClearLabelsFromLabelable +""" +input ClearLabelsFromLabelableInput { + """ + The id of the labelable object to clear the labels from. + """ + labelableId: ID! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of ClearLabelsFromLabelable +""" +type ClearLabelsFromLabelablePayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The item that was unlabeled. + """ + labelable: Labelable +} + +""" +Autogenerated input type of CloneProject +""" +input CloneProjectInput { + """ + The owner ID to create the project under. + """ + targetOwnerId: ID! + + """ + The source project to clone. + """ + sourceId: ID! + + """ + Whether or not to clone the source project's workflows. + """ + includeWorkflows: Boolean! + + """ + The name of the project. + """ + name: String! + + """ + The description of the project. + """ + body: String + + """ + The visibility of the project, defaults to false (private). + """ + public: Boolean + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of CloneProject +""" +type CloneProjectPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The id of the JobStatus for populating cloned fields. + """ + jobStatusId: String + + """ + The new cloned project. + """ + project: Project +} + +""" +An object that can be closed +""" +interface Closable { + """ + `true` if the object is closed (definition of closed may depend on type) + """ + closed: Boolean! + + """ + Identifies the date and time when the object was closed. + """ + closedAt: DateTime +} + +""" +Represents a 'closed' event on any `Closable`. +""" +type ClosedEvent implements Node & UniformResourceLocatable { + """ + Identifies the actor who performed the event. + """ + actor: Actor + + """ + Object that was closed. + """ + closable: Closable! + + """ + Object which triggered the creation of this event. + """ + closer: Closer + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + id: ID! + + """ + The HTTP path for this closed event. + """ + resourcePath: URI! + + """ + The HTTP URL for this closed event. + """ + url: URI! +} + +""" +Autogenerated input type of CloseIssue +""" +input CloseIssueInput { + """ + ID of the issue to be closed. + """ + issueId: ID! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of CloseIssue +""" +type CloseIssuePayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The issue that was closed. + """ + issue: Issue +} + +""" +Autogenerated input type of ClosePullRequest +""" +input ClosePullRequestInput { + """ + ID of the pull request to be closed. + """ + pullRequestId: ID! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of ClosePullRequest +""" +type ClosePullRequestPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The pull request that was closed. + """ + pullRequest: PullRequest +} + +""" +The object which triggered a `ClosedEvent`. +""" +union Closer = Commit | PullRequest + +""" +The Code of Conduct for a repository +""" +type CodeOfConduct implements Node { + """ + The body of the Code of Conduct + """ + body: String + id: ID! + + """ + The key for the Code of Conduct + """ + key: String! + + """ + The formal name of the Code of Conduct + """ + name: String! + + """ + The HTTP path for this Code of Conduct + """ + resourcePath: URI + + """ + The HTTP URL for this Code of Conduct + """ + url: URI +} + +""" +Collaborators affiliation level with a subject. +""" +enum CollaboratorAffiliation { + """ + All outside collaborators of an organization-owned subject. + """ + OUTSIDE + + """ + All collaborators with permissions to an organization-owned subject, regardless of organization membership status. + """ + DIRECT + + """ + All collaborators the authenticated user can see. + """ + ALL +} + +""" +Types that can be inside Collection Items. +""" +union CollectionItemContent = Repository | Organization | User + +""" +Represents a comment. +""" +interface Comment { + """ + The actor who authored the comment. + """ + author: Actor + + """ + Author's association with the subject of the comment. + """ + authorAssociation: CommentAuthorAssociation! + + """ + The body as Markdown. + """ + body: String! + + """ + The body rendered to HTML. + """ + bodyHTML: HTML! + + """ + The body rendered to text. + """ + bodyText: String! + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + Check if this comment was created via an email reply. + """ + createdViaEmail: Boolean! + + """ + The actor who edited the comment. + """ + editor: Actor + id: ID! + + """ + Check if this comment was edited and includes an edit with the creation data + """ + includesCreatedEdit: Boolean! + + """ + The moment the editor made the last edit + """ + lastEditedAt: DateTime + + """ + Identifies when the comment was published at. + """ + publishedAt: DateTime + + """ + Identifies the date and time when the object was last updated. + """ + updatedAt: DateTime! + + """ + A list of edits to this content. + """ + userContentEdits( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): UserContentEditConnection + + """ + Did the viewer author this comment. + """ + viewerDidAuthor: Boolean! +} + +""" +A comment author association with repository. +""" +enum CommentAuthorAssociation { + """ + Author is a member of the organization that owns the repository. + """ + MEMBER + + """ + Author is the owner of the repository. + """ + OWNER + + """ + Author has been invited to collaborate on the repository. + """ + COLLABORATOR + + """ + Author has previously committed to the repository. + """ + CONTRIBUTOR + + """ + Author has not previously committed to the repository. + """ + FIRST_TIME_CONTRIBUTOR + + """ + Author has not previously committed to GitHub. + """ + FIRST_TIMER + + """ + Author has no association with the repository. + """ + NONE +} + +""" +The possible errors that will prevent a user from updating a comment. +""" +enum CommentCannotUpdateReason { + """ + You must be the author or have write access to this repository to update this comment. + """ + INSUFFICIENT_ACCESS + + """ + Unable to create comment because issue is locked. + """ + LOCKED + + """ + You must be logged in to update this comment. + """ + LOGIN_REQUIRED + + """ + Repository is under maintenance. + """ + MAINTENANCE + + """ + At least one email address must be verified to update this comment. + """ + VERIFIED_EMAIL_REQUIRED + + """ + You cannot update this comment + """ + DENIED +} + +""" +Represents a 'comment_deleted' event on a given issue or pull request. +""" +type CommentDeletedEvent implements Node { + """ + Identifies the actor who performed the event. + """ + actor: Actor + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + Identifies the primary key from the database. + """ + databaseId: Int + id: ID! +} + +""" +Represents a Git commit. +""" +type Commit implements Node & GitObject & Subscribable & UniformResourceLocatable { + """ + An abbreviated version of the Git object ID + """ + abbreviatedOid: String! + + """ + The number of additions in this commit. + """ + additions: Int! + + """ + The pull requests associated with a commit + """ + associatedPullRequests( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for pull requests. + """ + orderBy: PullRequestOrder + ): PullRequestConnection + + """ + Authorship details of the commit. + """ + author: GitActor + + """ + Check if the committer and the author match. + """ + authoredByCommitter: Boolean! + + """ + The datetime when this commit was authored. + """ + authoredDate: DateTime! + + """ + Fetches `git blame` information. + """ + blame( + """ + The file whose Git blame information you want. + """ + path: String! + ): Blame! + + """ + The number of changed files in this commit. + """ + changedFiles: Int! + + """ + Comments made on the commit. + """ + comments( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): CommitCommentConnection! + + """ + The HTTP path for this Git object + """ + commitResourcePath: URI! + + """ + The HTTP URL for this Git object + """ + commitUrl: URI! + + """ + The datetime when this commit was committed. + """ + committedDate: DateTime! + + """ + Check if commited via GitHub web UI. + """ + committedViaWeb: Boolean! + + """ + Committership details of the commit. + """ + committer: GitActor + + """ + The number of deletions in this commit. + """ + deletions: Int! + + """ + The deployments associated with a commit. + """ + deployments( + """ + Environments to list deployments for + """ + environments: [String!] + + """ + Ordering options for deployments returned from the connection. + """ + orderBy: DeploymentOrder + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): DeploymentConnection + + """ + The linear commit history starting from (and including) this commit, in the same order as `git log`. + """ + history( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + If non-null, filters history to only show commits touching files under this path. + """ + path: String + + """ + If non-null, filters history to only show commits with matching authorship. + """ + author: CommitAuthor + + """ + Allows specifying a beginning time or date for fetching commits. + """ + since: GitTimestamp + + """ + Allows specifying an ending time or date for fetching commits. + """ + until: GitTimestamp + ): CommitHistoryConnection! + id: ID! + + """ + The Git commit message + """ + message: String! + + """ + The Git commit message body + """ + messageBody: String! + + """ + The commit message body rendered to HTML. + """ + messageBodyHTML: HTML! + + """ + The Git commit message headline + """ + messageHeadline: String! + + """ + The commit message headline rendered to HTML. + """ + messageHeadlineHTML: HTML! + + """ + The Git object ID + """ + oid: GitObjectID! + + """ + The parents of a commit. + """ + parents( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): CommitConnection! + + """ + The datetime when this commit was pushed. + """ + pushedDate: DateTime + + """ + The Repository this commit belongs to + """ + repository: Repository! + + """ + The HTTP path for this commit + """ + resourcePath: URI! + + """ + Commit signing information, if present. + """ + signature: GitSignature + + """ + Status information for this commit + """ + status: Status + + """ + Returns a URL to download a tarball archive for a repository. + Note: For private repositories, these links are temporary and expire after five minutes. + """ + tarballUrl: URI! + + """ + Commit's root Tree + """ + tree: Tree! + + """ + The HTTP path for the tree of this commit + """ + treeResourcePath: URI! + + """ + The HTTP URL for the tree of this commit + """ + treeUrl: URI! + + """ + The HTTP URL for this commit + """ + url: URI! + + """ + Check if the viewer is able to change their subscription status for the repository. + """ + viewerCanSubscribe: Boolean! + + """ + Identifies if the viewer is watching, not watching, or ignoring the subscribable entity. + """ + viewerSubscription: SubscriptionState + + """ + Returns a URL to download a zipball archive for a repository. + Note: For private repositories, these links are temporary and expire after five minutes. + """ + zipballUrl: URI! +} + +""" +Specifies an author for filtering Git commits. +""" +input CommitAuthor { + """ + ID of a User to filter by. If non-null, only commits authored by this user + will be returned. This field takes precedence over emails. + """ + id: ID + + """ + Email addresses to filter by. Commits authored by any of the specified email addresses will be returned. + """ + emails: [String!] +} + +""" +Represents a comment on a given Commit. +""" +type CommitComment implements Node & Comment & Deletable & Updatable & UpdatableComment & Reactable & RepositoryNode { + """ + The actor who authored the comment. + """ + author: Actor + + """ + Author's association with the subject of the comment. + """ + authorAssociation: CommentAuthorAssociation! + + """ + Identifies the comment body. + """ + body: String! + + """ + Identifies the comment body rendered to HTML. + """ + bodyHTML: HTML! + + """ + The body rendered to text. + """ + bodyText: String! + + """ + Identifies the commit associated with the comment, if the commit exists. + """ + commit: Commit + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + Check if this comment was created via an email reply. + """ + createdViaEmail: Boolean! + + """ + Identifies the primary key from the database. + """ + databaseId: Int + + """ + The actor who edited the comment. + """ + editor: Actor + id: ID! + + """ + Check if this comment was edited and includes an edit with the creation data + """ + includesCreatedEdit: Boolean! + + """ + Returns whether or not a comment has been minimized. + """ + isMinimized: Boolean! + + """ + The moment the editor made the last edit + """ + lastEditedAt: DateTime + + """ + Returns why the comment was minimized. + """ + minimizedReason: String + + """ + Identifies the file path associated with the comment. + """ + path: String + + """ + Identifies the line position associated with the comment. + """ + position: Int + + """ + Identifies when the comment was published at. + """ + publishedAt: DateTime + + """ + A list of reactions grouped by content left on the subject. + """ + reactionGroups: [ReactionGroup!] + + """ + A list of Reactions left on the Issue. + """ + reactions( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Allows filtering Reactions by emoji. + """ + content: ReactionContent + + """ + Allows specifying the order in which reactions are returned. + """ + orderBy: ReactionOrder + ): ReactionConnection! + + """ + The repository associated with this node. + """ + repository: Repository! + + """ + The HTTP path permalink for this commit comment. + """ + resourcePath: URI! + + """ + Identifies the date and time when the object was last updated. + """ + updatedAt: DateTime! + + """ + The HTTP URL permalink for this commit comment. + """ + url: URI! + + """ + A list of edits to this content. + """ + userContentEdits( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): UserContentEditConnection + + """ + Check if the current viewer can delete this object. + """ + viewerCanDelete: Boolean! + + """ + Check if the current viewer can minimize this object. + """ + viewerCanMinimize: Boolean! + + """ + Can user react to this subject + """ + viewerCanReact: Boolean! + + """ + Check if the current viewer can update this object. + """ + viewerCanUpdate: Boolean! + + """ + Reasons why the current viewer can not update this comment. + """ + viewerCannotUpdateReasons: [CommentCannotUpdateReason!]! + + """ + Did the viewer author this comment. + """ + viewerDidAuthor: Boolean! +} + +""" +The connection type for CommitComment. +""" +type CommitCommentConnection { + """ + A list of edges. + """ + edges: [CommitCommentEdge] + + """ + A list of nodes. + """ + nodes: [CommitComment] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type CommitCommentEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: CommitComment +} + +""" +A thread of comments on a commit. +""" +type CommitCommentThread implements Node & RepositoryNode { + """ + The comments that exist in this thread. + """ + comments( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): CommitCommentConnection! + + """ + The commit the comments were made on. + """ + commit: Commit! + id: ID! + + """ + The file the comments were made on. + """ + path: String + + """ + The position in the diff for the commit that the comment was made on. + """ + position: Int + + """ + The repository associated with this node. + """ + repository: Repository! +} + +""" +The connection type for Commit. +""" +type CommitConnection { + """ + A list of edges. + """ + edges: [CommitEdge] + + """ + A list of nodes. + """ + nodes: [Commit] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +Ordering options for commit contribution connections. +""" +input CommitContributionOrder { + """ + The field by which to order commit contributions. + """ + field: CommitContributionOrderField! + + """ + The ordering direction. + """ + direction: OrderDirection! +} + +""" +Properties by which commit contribution connections can be ordered. +""" +enum CommitContributionOrderField { + """ + Order commit contributions by when they were made. + """ + OCCURRED_AT + + """ + Order commit contributions by how many commits they represent. + """ + COMMIT_COUNT +} + +""" +This aggregates commits made by a user within one repository. +""" +type CommitContributionsByRepository { + """ + The commit contributions, each representing a day. + """ + contributions( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for commit contributions returned from the connection. + """ + orderBy: CommitContributionOrder + ): CreatedCommitContributionConnection! + + """ + The repository in which the commits were made. + """ + repository: Repository! + + """ + The HTTP path for the user's commits to the repository in this time range. + """ + resourcePath: URI! + + """ + The HTTP URL for the user's commits to the repository in this time range. + """ + url: URI! +} + +""" +An edge in a connection. +""" +type CommitEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: Commit +} + +""" +The connection type for Commit. +""" +type CommitHistoryConnection { + """ + A list of edges. + """ + edges: [CommitEdge] + + """ + A list of nodes. + """ + nodes: [Commit] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +A content attachment +""" +type ContentAttachment { + """ + The body text of the content attachment. This parameter supports markdown. + """ + body: String! + + """ + The content reference that the content attachment is attached to. + """ + contentReference: ContentReference! + + """ + Identifies the primary key from the database. + """ + databaseId: Int! + id: ID! + + """ + The title of the content attachment. + """ + title: String! +} + +""" +A content reference +""" +type ContentReference { + """ + Identifies the primary key from the database. + """ + databaseId: Int! + id: ID! + + """ + The reference of the content reference. + """ + reference: String! +} + +""" +Represents a contribution a user made on GitHub, such as opening an issue. +""" +interface Contribution { + """ + Whether this contribution is associated with a record you do not have access to. For + example, your own 'first issue' contribution may have been made on a repository you can no + longer access. + """ + isRestricted: Boolean! + + """ + When this contribution was made. + """ + occurredAt: DateTime! + + """ + The HTTP path for this contribution. + """ + resourcePath: URI! + + """ + The HTTP URL for this contribution. + """ + url: URI! + + """ + The user who made this contribution. + """ + user: User! +} + +""" +A calendar of contributions made on GitHub by a user. +""" +type ContributionCalendar { + """ + A list of hex color codes used in this calendar. The darker the color, the more contributions it represents. + """ + colors: [String!]! + + """ + Determine if the color set was chosen because it's currently Halloween. + """ + isHalloween: Boolean! + + """ + A list of the months of contributions in this calendar. + """ + months: [ContributionCalendarMonth!]! + + """ + The count of total contributions in the calendar. + """ + totalContributions: Int! + + """ + A list of the weeks of contributions in this calendar. + """ + weeks: [ContributionCalendarWeek!]! +} + +""" +Represents a single day of contributions on GitHub by a user. +""" +type ContributionCalendarDay { + """ + The hex color code that represents how many contributions were made on this day compared to others in the calendar. + """ + color: String! + + """ + How many contributions were made by the user on this day. + """ + contributionCount: Int! + + """ + The day this square represents. + """ + date: Date! + + """ + A number representing which day of the week this square represents, e.g., 1 is Monday. + """ + weekday: Int! +} + +""" +A month of contributions in a user's contribution graph. +""" +type ContributionCalendarMonth { + """ + The date of the first day of this month. + """ + firstDay: Date! + + """ + The name of the month. + """ + name: String! + + """ + How many weeks started in this month. + """ + totalWeeks: Int! + + """ + The year the month occurred in. + """ + year: Int! +} + +""" +A week of contributions in a user's contribution graph. +""" +type ContributionCalendarWeek { + """ + The days of contributions in this week. + """ + contributionDays: [ContributionCalendarDay!]! + + """ + The date of the earliest square in this week. + """ + firstDay: Date! +} + +""" +Ordering options for contribution connections. +""" +input ContributionOrder { + """ + The field by which to order contributions. + """ + field: ContributionOrderField! + + """ + The ordering direction. + """ + direction: OrderDirection! +} + +""" +Properties by which contribution connections can be ordered. +""" +enum ContributionOrderField { + """ + Order contributions by when they were made. + """ + OCCURRED_AT +} + +""" +A contributions collection aggregates contributions such as opened issues and commits created by a user. +""" +type ContributionsCollection { + """ + Commit contributions made by the user, grouped by repository. + """ + commitContributionsByRepository( + """ + How many repositories should be included. + """ + maxRepositories: Int = 25 + ): [CommitContributionsByRepository!]! + + """ + A calendar of this user's contributions on GitHub. + """ + contributionCalendar: ContributionCalendar! + + """ + The years the user has been making contributions with the most recent year first. + """ + contributionYears: [Int!]! + + """ + Determine if this collection's time span ends in the current month. + """ + doesEndInCurrentMonth: Boolean! + + """ + The date of the first restricted contribution the user made in this time + period. Can only be non-null when the user has enabled private contribution counts. + """ + earliestRestrictedContributionDate: Date + + """ + The ending date and time of this collection. + """ + endedAt: DateTime! + + """ + The first issue the user opened on GitHub. This will be null if that issue was + opened outside the collection's time range and ignoreTimeRange is false. If + the issue is not visible but the user has opted to show private contributions, + a RestrictedContribution will be returned. + """ + firstIssueContribution( + """ + If true, the first issue will be returned even if it was opened outside of the collection's time range. + + **Upcoming Change on 2019-07-01 UTC** + **Description:** `ignoreTimeRange` will be removed. Use a `ContributionsCollection` starting sufficiently far back + **Reason:** ignore_time_range will be removed + """ + ignoreTimeRange: Boolean = false + ): CreatedIssueOrRestrictedContribution + + """ + The first pull request the user opened on GitHub. This will be null if that + pull request was opened outside the collection's time range and + ignoreTimeRange is not true. If the pull request is not visible but the user + has opted to show private contributions, a RestrictedContribution will be returned. + """ + firstPullRequestContribution( + """ + If true, the first pull request will be returned even if it was opened outside of the collection's time range. + + **Upcoming Change on 2019-07-01 UTC** + **Description:** `ignoreTimeRange` will be removed. Use a `ContributionsCollection` starting sufficiently far back + **Reason:** ignore_time_range will be removed + """ + ignoreTimeRange: Boolean = false + ): CreatedPullRequestOrRestrictedContribution + + """ + The first repository the user created on GitHub. This will be null if that + first repository was created outside the collection's time range and + ignoreTimeRange is false. If the repository is not visible, then a + RestrictedContribution is returned. + """ + firstRepositoryContribution( + """ + If true, the first repository will be returned even if it was opened outside of the collection's time range. + + **Upcoming Change on 2019-07-01 UTC** + **Description:** `ignoreTimeRange` will be removed. Use a `ContributionsCollection` starting sufficiently far back + **Reason:** ignore_time_range will be removed + """ + ignoreTimeRange: Boolean = false + ): CreatedRepositoryOrRestrictedContribution + + """ + Does the user have any more activity in the timeline that occurred prior to the collection's time range? + """ + hasActivityInThePast: Boolean! + + """ + Determine if there are any contributions in this collection. + """ + hasAnyContributions: Boolean! + + """ + Determine if the user made any contributions in this time frame whose details + are not visible because they were made in a private repository. Can only be + true if the user enabled private contribution counts. + """ + hasAnyRestrictedContributions: Boolean! + + """ + Whether or not the collector's time span is all within the same day. + """ + isSingleDay: Boolean! + + """ + A list of issues the user opened. + """ + issueContributions( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Should the user's first issue ever be excluded from the result. + """ + excludeFirst: Boolean = false + + """ + Should the user's most commented issue be excluded from the result. + """ + excludePopular: Boolean = false + + """ + Ordering options for contributions returned from the connection. + """ + orderBy: ContributionOrder + ): CreatedIssueContributionConnection! + + """ + Issue contributions made by the user, grouped by repository. + """ + issueContributionsByRepository( + """ + How many repositories should be included. + """ + maxRepositories: Int = 25 + + """ + Should the user's first issue ever be excluded from the result. + """ + excludeFirst: Boolean = false + + """ + Should the user's most commented issue be excluded from the result. + """ + excludePopular: Boolean = false + ): [IssueContributionsByRepository!]! + + """ + When the user signed up for GitHub. This will be null if that sign up date + falls outside the collection's time range and ignoreTimeRange is false. + """ + joinedGitHubContribution( + """ + If true, the contribution will be returned even if the user signed up outside of the collection's time range. + + **Upcoming Change on 2019-07-01 UTC** + **Description:** `ignoreTimeRange` will be removed. Use a `ContributionsCollection` starting sufficiently far back + **Reason:** ignore_time_range will be removed + """ + ignoreTimeRange: Boolean = false + ): JoinedGitHubContribution + + """ + The date of the most recent restricted contribution the user made in this time + period. Can only be non-null when the user has enabled private contribution counts. + """ + latestRestrictedContributionDate: Date + + """ + When this collection's time range does not include any activity from the user, use this + to get a different collection from an earlier time range that does have activity. + """ + mostRecentCollectionWithActivity: ContributionsCollection + + """ + Returns a different contributions collection from an earlier time range than this one + that does not have any contributions. + """ + mostRecentCollectionWithoutActivity: ContributionsCollection + + """ + The issue the user opened on GitHub that received the most comments in the specified + time frame. + """ + popularIssueContribution: CreatedIssueContribution + + """ + The pull request the user opened on GitHub that received the most comments in the + specified time frame. + """ + popularPullRequestContribution: CreatedPullRequestContribution + + """ + Pull request contributions made by the user. + """ + pullRequestContributions( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Should the user's first pull request ever be excluded from the result. + """ + excludeFirst: Boolean = false + + """ + Should the user's most commented pull request be excluded from the result. + """ + excludePopular: Boolean = false + + """ + Ordering options for contributions returned from the connection. + """ + orderBy: ContributionOrder + ): CreatedPullRequestContributionConnection! + + """ + Pull request contributions made by the user, grouped by repository. + """ + pullRequestContributionsByRepository( + """ + How many repositories should be included. + """ + maxRepositories: Int = 25 + + """ + Should the user's first pull request ever be excluded from the result. + """ + excludeFirst: Boolean = false + + """ + Should the user's most commented pull request be excluded from the result. + """ + excludePopular: Boolean = false + ): [PullRequestContributionsByRepository!]! + + """ + Pull request review contributions made by the user. + """ + pullRequestReviewContributions( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for contributions returned from the connection. + """ + orderBy: ContributionOrder + ): CreatedPullRequestReviewContributionConnection! + + """ + Pull request review contributions made by the user, grouped by repository. + """ + pullRequestReviewContributionsByRepository( + """ + How many repositories should be included. + """ + maxRepositories: Int = 25 + ): [PullRequestReviewContributionsByRepository!]! + + """ + A list of repositories owned by the user that the user created in this time range. + """ + repositoryContributions( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Should the user's first repository ever be excluded from the result. + """ + excludeFirst: Boolean = false + + """ + Ordering options for contributions returned from the connection. + """ + orderBy: ContributionOrder + ): CreatedRepositoryContributionConnection! + + """ + A count of contributions made by the user that the viewer cannot access. Only + non-zero when the user has chosen to share their private contribution counts. + """ + restrictedContributionsCount: Int! + + """ + The beginning date and time of this collection. + """ + startedAt: DateTime! + + """ + How many commits were made by the user in this time span. + """ + totalCommitContributions: Int! + + """ + How many issues the user opened. + """ + totalIssueContributions( + """ + Should the user's first issue ever be excluded from this count. + """ + excludeFirst: Boolean = false + + """ + Should the user's most commented issue be excluded from this count. + """ + excludePopular: Boolean = false + ): Int! + + """ + How many pull requests the user opened. + """ + totalPullRequestContributions( + """ + Should the user's first pull request ever be excluded from this count. + """ + excludeFirst: Boolean = false + + """ + Should the user's most commented pull request be excluded from this count. + """ + excludePopular: Boolean = false + ): Int! + + """ + How many pull request reviews the user left. + """ + totalPullRequestReviewContributions: Int! + + """ + How many different repositories the user committed to. + """ + totalRepositoriesWithContributedCommits: Int! + + """ + How many different repositories the user opened issues in. + """ + totalRepositoriesWithContributedIssues( + """ + Should the user's first issue ever be excluded from this count. + """ + excludeFirst: Boolean = false + + """ + Should the user's most commented issue be excluded from this count. + """ + excludePopular: Boolean = false + ): Int! + + """ + How many different repositories the user left pull request reviews in. + """ + totalRepositoriesWithContributedPullRequestReviews: Int! + + """ + How many different repositories the user opened pull requests in. + """ + totalRepositoriesWithContributedPullRequests( + """ + Should the user's first pull request ever be excluded from this count. + """ + excludeFirst: Boolean = false + + """ + Should the user's most commented pull request be excluded from this count. + """ + excludePopular: Boolean = false + ): Int! + + """ + How many repositories the user created. + """ + totalRepositoryContributions( + """ + Should the user's first repository ever be excluded from this count. + """ + excludeFirst: Boolean = false + ): Int! + + """ + The user who made the contributions in this collection. + """ + user: User! +} + +""" +Represents a 'converted_note_to_issue' event on a given issue or pull request. +""" +type ConvertedNoteToIssueEvent implements Node { + """ + Identifies the actor who performed the event. + """ + actor: Actor + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + Identifies the primary key from the database. + """ + databaseId: Int + id: ID! +} + +""" +Autogenerated input type of ConvertProjectCardNoteToIssue +""" +input ConvertProjectCardNoteToIssueInput { + """ + The ProjectCard ID to convert. + """ + projectCardId: ID! + + """ + The ID of the repository to create the issue in. + """ + repositoryId: ID! + + """ + The title of the newly created issue. Defaults to the card's note text. + """ + title: String + + """ + The body of the newly created issue. + """ + body: String + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of ConvertProjectCardNoteToIssue +""" +type ConvertProjectCardNoteToIssuePayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The updated ProjectCard. + """ + projectCard: ProjectCard +} + +""" +Autogenerated input type of CreateBranchProtectionRule +""" +input CreateBranchProtectionRuleInput { + """ + The global relay id of the repository in which a new branch protection rule should be created in. + """ + repositoryId: ID! + + """ + The glob-like pattern used to determine matching branches. + """ + pattern: String! + + """ + Are approving reviews required to update matching branches. + """ + requiresApprovingReviews: Boolean + + """ + Number of approving reviews required to update matching branches. + """ + requiredApprovingReviewCount: Int + + """ + Are commits required to be signed. + """ + requiresCommitSignatures: Boolean + + """ + Can admins overwrite branch protection. + """ + isAdminEnforced: Boolean + + """ + Are status checks required to update matching branches. + """ + requiresStatusChecks: Boolean + + """ + Are branches required to be up to date before merging. + """ + requiresStrictStatusChecks: Boolean + + """ + Are reviews from code owners required to update matching branches. + """ + requiresCodeOwnerReviews: Boolean + + """ + Will new commits pushed to matching branches dismiss pull request review approvals. + """ + dismissesStaleReviews: Boolean + + """ + Is dismissal of pull request reviews restricted. + """ + restrictsReviewDismissals: Boolean + + """ + A list of User or Team IDs allowed to dismiss reviews on pull requests targeting matching branches. + """ + reviewDismissalActorIds: [ID!] + + """ + Is pushing to matching branches restricted. + """ + restrictsPushes: Boolean + + """ + A list of User or Team IDs allowed to push to matching branches. + """ + pushActorIds: [ID!] + + """ + List of required status check contexts that must pass for commits to be accepted to matching branches. + """ + requiredStatusCheckContexts: [String!] + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of CreateBranchProtectionRule +""" +type CreateBranchProtectionRulePayload { + """ + The newly created BranchProtectionRule. + """ + branchProtectionRule: BranchProtectionRule + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated input type of CreateContentAttachment +""" +input CreateContentAttachmentInput { + """ + The node ID of the content_reference. + """ + contentReferenceId: ID! + + """ + The title of the content attachment. + """ + title: String! + + """ + The body of the content attachment, which may contain markdown. + """ + body: String! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Represents the contribution a user made by committing to a repository. +""" +type CreatedCommitContribution implements Contribution { + """ + How many commits were made on this day to this repository by the user. + """ + commitCount: Int! + + """ + Whether this contribution is associated with a record you do not have access to. For + example, your own 'first issue' contribution may have been made on a repository you can no + longer access. + """ + isRestricted: Boolean! + + """ + When this contribution was made. + """ + occurredAt: DateTime! + + """ + The repository the user made a commit in. + """ + repository: Repository! + + """ + The HTTP path for this contribution. + """ + resourcePath: URI! + + """ + The HTTP URL for this contribution. + """ + url: URI! + + """ + The user who made this contribution. + """ + user: User! +} + +""" +The connection type for CreatedCommitContribution. +""" +type CreatedCommitContributionConnection { + """ + A list of edges. + """ + edges: [CreatedCommitContributionEdge] + + """ + A list of nodes. + """ + nodes: [CreatedCommitContribution] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of commits across days and repositories in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type CreatedCommitContributionEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: CreatedCommitContribution +} + +""" +Represents the contribution a user made on GitHub by opening an issue. +""" +type CreatedIssueContribution implements Contribution { + """ + Whether this contribution is associated with a record you do not have access to. For + example, your own 'first issue' contribution may have been made on a repository you can no + longer access. + """ + isRestricted: Boolean! + + """ + The issue that was opened. + """ + issue: Issue! + + """ + When this contribution was made. + """ + occurredAt: DateTime! + + """ + The HTTP path for this contribution. + """ + resourcePath: URI! + + """ + The HTTP URL for this contribution. + """ + url: URI! + + """ + The user who made this contribution. + """ + user: User! +} + +""" +The connection type for CreatedIssueContribution. +""" +type CreatedIssueContributionConnection { + """ + A list of edges. + """ + edges: [CreatedIssueContributionEdge] + + """ + A list of nodes. + """ + nodes: [CreatedIssueContribution] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type CreatedIssueContributionEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: CreatedIssueContribution +} + +""" +Represents either a issue the viewer can access or a restricted contribution. +""" +union CreatedIssueOrRestrictedContribution = + CreatedIssueContribution + | RestrictedContribution + +""" +Represents the contribution a user made on GitHub by opening a pull request. +""" +type CreatedPullRequestContribution implements Contribution { + """ + Whether this contribution is associated with a record you do not have access to. For + example, your own 'first issue' contribution may have been made on a repository you can no + longer access. + """ + isRestricted: Boolean! + + """ + When this contribution was made. + """ + occurredAt: DateTime! + + """ + The pull request that was opened. + """ + pullRequest: PullRequest! + + """ + The HTTP path for this contribution. + """ + resourcePath: URI! + + """ + The HTTP URL for this contribution. + """ + url: URI! + + """ + The user who made this contribution. + """ + user: User! +} + +""" +The connection type for CreatedPullRequestContribution. +""" +type CreatedPullRequestContributionConnection { + """ + A list of edges. + """ + edges: [CreatedPullRequestContributionEdge] + + """ + A list of nodes. + """ + nodes: [CreatedPullRequestContribution] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type CreatedPullRequestContributionEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: CreatedPullRequestContribution +} + +""" +Represents either a pull request the viewer can access or a restricted contribution. +""" +union CreatedPullRequestOrRestrictedContribution = + CreatedPullRequestContribution + | RestrictedContribution + +""" +Represents the contribution a user made by leaving a review on a pull request. +""" +type CreatedPullRequestReviewContribution implements Contribution { + """ + Whether this contribution is associated with a record you do not have access to. For + example, your own 'first issue' contribution may have been made on a repository you can no + longer access. + """ + isRestricted: Boolean! + + """ + When this contribution was made. + """ + occurredAt: DateTime! + + """ + The pull request the user reviewed. + """ + pullRequest: PullRequest! + + """ + The review the user left on the pull request. + """ + pullRequestReview: PullRequestReview! + + """ + The repository containing the pull request that the user reviewed. + """ + repository: Repository! + + """ + The HTTP path for this contribution. + """ + resourcePath: URI! + + """ + The HTTP URL for this contribution. + """ + url: URI! + + """ + The user who made this contribution. + """ + user: User! +} + +""" +The connection type for CreatedPullRequestReviewContribution. +""" +type CreatedPullRequestReviewContributionConnection { + """ + A list of edges. + """ + edges: [CreatedPullRequestReviewContributionEdge] + + """ + A list of nodes. + """ + nodes: [CreatedPullRequestReviewContribution] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type CreatedPullRequestReviewContributionEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: CreatedPullRequestReviewContribution +} + +""" +Represents the contribution a user made on GitHub by creating a repository. +""" +type CreatedRepositoryContribution implements Contribution { + """ + Whether this contribution is associated with a record you do not have access to. For + example, your own 'first issue' contribution may have been made on a repository you can no + longer access. + """ + isRestricted: Boolean! + + """ + When this contribution was made. + """ + occurredAt: DateTime! + + """ + The repository that was created. + """ + repository: Repository! + + """ + The HTTP path for this contribution. + """ + resourcePath: URI! + + """ + The HTTP URL for this contribution. + """ + url: URI! + + """ + The user who made this contribution. + """ + user: User! +} + +""" +The connection type for CreatedRepositoryContribution. +""" +type CreatedRepositoryContributionConnection { + """ + A list of edges. + """ + edges: [CreatedRepositoryContributionEdge] + + """ + A list of nodes. + """ + nodes: [CreatedRepositoryContribution] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type CreatedRepositoryContributionEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: CreatedRepositoryContribution +} + +""" +Represents either a repository the viewer can access or a restricted contribution. +""" +union CreatedRepositoryOrRestrictedContribution = + CreatedRepositoryContribution + | RestrictedContribution + +""" +Autogenerated input type of CreateIssue +""" +input CreateIssueInput { + """ + The Node ID of the repository. + """ + repositoryId: ID! + + """ + The title for the issue. + """ + title: String! + + """ + The body for the issue description. + """ + body: String + + """ + The Node ID for the user assignee for this issue. + """ + assigneeIds: [ID!] + + """ + The Node ID of the milestone for this issue. + """ + milestoneId: ID + + """ + An array of Node IDs of labels for this issue. + """ + labelIds: [ID!] + + """ + An array of Node IDs for projects associated with this issue. + """ + projectIds: [ID!] + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of CreateIssue +""" +type CreateIssuePayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The new issue. + """ + issue: Issue +} + +""" +Autogenerated input type of CreateProject +""" +input CreateProjectInput { + """ + The owner ID to create the project under. + """ + ownerId: ID! + + """ + The name of project. + """ + name: String! + + """ + The description of project. + """ + body: String + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of CreateProject +""" +type CreateProjectPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The new project. + """ + project: Project +} + +""" +Autogenerated input type of CreatePullRequest +""" +input CreatePullRequestInput { + """ + The Node ID of the repository. + """ + repositoryId: ID! + + """ + The name of the branch you want your changes pulled into. This should be an existing branch + on the current repository. You cannot update the base branch on a pull request to point + to another repository. + """ + baseRefName: String! + + """ + The name of the branch where your changes are implemented. For cross-repository pull requests + in the same network, namespace `head_ref_name` with a user like this: `username:branch`. + """ + headRefName: String! + + """ + The title of the pull request. + """ + title: String! + + """ + The contents of the pull request. + """ + body: String + + """ + Indicates whether maintainers can modify the pull request. + """ + maintainerCanModify: Boolean = true + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of CreatePullRequest +""" +type CreatePullRequestPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The new pull request. + """ + pullRequest: PullRequest +} + +""" +Represents a mention made by one issue or pull request to another. +""" +type CrossReferencedEvent implements Node & UniformResourceLocatable { + """ + Identifies the actor who performed the event. + """ + actor: Actor + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + id: ID! + + """ + Reference originated in a different repository. + """ + isCrossRepository: Boolean! + + """ + Identifies when the reference was made. + """ + referencedAt: DateTime! + + """ + The HTTP path for this pull request. + """ + resourcePath: URI! + + """ + Issue or pull request that made the reference. + """ + source: ReferencedSubject! + + """ + Issue or pull request to which the reference was made. + """ + target: ReferencedSubject! + + """ + The HTTP URL for this pull request. + """ + url: URI! + + """ + Checks if the target will be closed when the source is merged. + """ + willCloseTarget: Boolean! +} + +""" +An ISO-8601 encoded date string. +""" +scalar Date + +""" +An ISO-8601 encoded UTC date string. +""" +scalar DateTime + +""" +Autogenerated input type of DeclineTopicSuggestion +""" +input DeclineTopicSuggestionInput { + """ + The Node ID of the repository. + """ + repositoryId: ID! + + """ + The name of the suggested topic. + """ + name: String! + + """ + The reason why the suggested topic is declined. + """ + reason: TopicSuggestionDeclineReason! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of DeclineTopicSuggestion +""" +type DeclineTopicSuggestionPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The declined topic. + """ + topic: Topic +} + +""" +The possible default permissions for repositories. +""" +enum DefaultRepositoryPermissionField { + """ + No access + """ + NONE + + """ + Can read repos by default + """ + READ + + """ + Can read and write repos by default + """ + WRITE + + """ + Can read, write, and administrate repos by default + """ + ADMIN +} + +""" +Entities that can be deleted. +""" +interface Deletable { + """ + Check if the current viewer can delete this object. + """ + viewerCanDelete: Boolean! +} + +""" +Autogenerated input type of DeleteBranchProtectionRule +""" +input DeleteBranchProtectionRuleInput { + """ + The global relay id of the branch protection rule to be deleted. + """ + branchProtectionRuleId: ID! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of DeleteBranchProtectionRule +""" +type DeleteBranchProtectionRulePayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated input type of DeleteIssueComment +""" +input DeleteIssueCommentInput { + """ + The ID of the comment to delete. + """ + id: ID! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of DeleteIssueComment +""" +type DeleteIssueCommentPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated input type of DeleteIssue +""" +input DeleteIssueInput { + """ + The ID of the issue to delete. + """ + issueId: ID! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of DeleteIssue +""" +type DeleteIssuePayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The repository the issue belonged to + """ + repository: Repository +} + +""" +Autogenerated input type of DeleteProjectCard +""" +input DeleteProjectCardInput { + """ + The id of the card to delete. + """ + cardId: ID! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of DeleteProjectCard +""" +type DeleteProjectCardPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The column the deleted card was in. + """ + column: ProjectColumn + + """ + The deleted card ID. + """ + deletedCardId: ID +} + +""" +Autogenerated input type of DeleteProjectColumn +""" +input DeleteProjectColumnInput { + """ + The id of the column to delete. + """ + columnId: ID! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of DeleteProjectColumn +""" +type DeleteProjectColumnPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The deleted column ID. + """ + deletedColumnId: ID + + """ + The project the deleted column was in. + """ + project: Project +} + +""" +Autogenerated input type of DeleteProject +""" +input DeleteProjectInput { + """ + The Project ID to update. + """ + projectId: ID! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of DeleteProject +""" +type DeleteProjectPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The repository or organization the project was removed from. + """ + owner: ProjectOwner +} + +""" +Autogenerated input type of DeletePullRequestReviewComment +""" +input DeletePullRequestReviewCommentInput { + """ + The ID of the comment to delete. + """ + id: ID! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of DeletePullRequestReviewComment +""" +type DeletePullRequestReviewCommentPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The pull request review the deleted comment belonged to. + """ + pullRequestReview: PullRequestReview +} + +""" +Autogenerated input type of DeletePullRequestReview +""" +input DeletePullRequestReviewInput { + """ + The Node ID of the pull request review to delete. + """ + pullRequestReviewId: ID! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of DeletePullRequestReview +""" +type DeletePullRequestReviewPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The deleted pull request review. + """ + pullRequestReview: PullRequestReview +} + +""" +Represents a 'demilestoned' event on a given issue or pull request. +""" +type DemilestonedEvent implements Node { + """ + Identifies the actor who performed the event. + """ + actor: Actor + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + id: ID! + + """ + Identifies the milestone title associated with the 'demilestoned' event. + """ + milestoneTitle: String! + + """ + Object referenced by event. + """ + subject: MilestoneItem! +} + +""" +Represents a 'deployed' event on a given pull request. +""" +type DeployedEvent implements Node { + """ + Identifies the actor who performed the event. + """ + actor: Actor + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + Identifies the primary key from the database. + """ + databaseId: Int + + """ + The deployment associated with the 'deployed' event. + """ + deployment: Deployment! + id: ID! + + """ + PullRequest referenced by event. + """ + pullRequest: PullRequest! + + """ + The ref associated with the 'deployed' event. + """ + ref: Ref +} + +""" +A repository deploy key. +""" +type DeployKey implements Node { + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + id: ID! + + """ + The deploy key. + """ + key: String! + + """ + Whether or not the deploy key is read only. + """ + readOnly: Boolean! + + """ + The deploy key title. + """ + title: String! + + """ + Whether or not the deploy key has been verified. + """ + verified: Boolean! +} + +""" +The connection type for DeployKey. +""" +type DeployKeyConnection { + """ + A list of edges. + """ + edges: [DeployKeyEdge] + + """ + A list of nodes. + """ + nodes: [DeployKey] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type DeployKeyEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: DeployKey +} + +""" +Represents triggered deployment instance. +""" +type Deployment implements Node { + """ + Identifies the commit sha of the deployment. + """ + commit: Commit + + """ + Identifies the oid of the deployment commit, even if the commit has been deleted. + """ + commitOid: String! + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + Identifies the actor who triggered the deployment. + """ + creator: Actor + + """ + Identifies the primary key from the database. + """ + databaseId: Int + + """ + The deployment description. + """ + description: String + + """ + The environment to which this deployment was made. + """ + environment: String + id: ID! + + """ + The latest status of this deployment. + """ + latestStatus: DeploymentStatus + + """ + Extra information that a deployment system might need. + """ + payload: String + + """ + Identifies the Ref of the deployment, if the deployment was created by ref. + """ + ref: Ref + + """ + Identifies the repository associated with the deployment. + """ + repository: Repository! + + """ + The current state of the deployment. + """ + state: DeploymentState + + """ + A list of statuses associated with the deployment. + """ + statuses( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): DeploymentStatusConnection + + """ + The deployment task. + """ + task: String + + """ + Identifies the date and time when the object was last updated. + """ + updatedAt: DateTime! +} + +""" +The connection type for Deployment. +""" +type DeploymentConnection { + """ + A list of edges. + """ + edges: [DeploymentEdge] + + """ + A list of nodes. + """ + nodes: [Deployment] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type DeploymentEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: Deployment +} + +""" +Represents a 'deployment_environment_changed' event on a given pull request. +""" +type DeploymentEnvironmentChangedEvent implements Node { + """ + Identifies the actor who performed the event. + """ + actor: Actor + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + The deployment status that updated the deployment environment. + """ + deploymentStatus: DeploymentStatus! + id: ID! + + """ + PullRequest referenced by event. + """ + pullRequest: PullRequest! +} + +""" +Ordering options for deployment connections +""" +input DeploymentOrder { + """ + The field to order deployments by. + """ + field: DeploymentOrderField! + + """ + The ordering direction. + """ + direction: OrderDirection! +} + +""" +Properties by which deployment connections can be ordered. +""" +enum DeploymentOrderField { + """ + Order collection by creation time + """ + CREATED_AT +} + +""" +The possible states in which a deployment can be. +""" +enum DeploymentState { + """ + The pending deployment was not updated after 30 minutes. + """ + ABANDONED + + """ + The deployment is currently active. + """ + ACTIVE + + """ + An inactive transient deployment. + """ + DESTROYED + + """ + The deployment experienced an error. + """ + ERROR + + """ + The deployment has failed. + """ + FAILURE + + """ + The deployment is inactive. + """ + INACTIVE + + """ + The deployment is pending. + """ + PENDING + + """ + The deployment has queued + """ + QUEUED + + """ + The deployment is in progress. + """ + IN_PROGRESS +} + +""" +Describes the status of a given deployment attempt. +""" +type DeploymentStatus implements Node { + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + Identifies the actor who triggered the deployment. + """ + creator: Actor + + """ + Identifies the deployment associated with status. + """ + deployment: Deployment! + + """ + Identifies the description of the deployment. + """ + description: String + + """ + Identifies the environment URL of the deployment. + """ + environmentUrl: URI + id: ID! + + """ + Identifies the log URL of the deployment. + """ + logUrl: URI + + """ + Identifies the current state of the deployment. + """ + state: DeploymentStatusState! + + """ + Identifies the date and time when the object was last updated. + """ + updatedAt: DateTime! +} + +""" +The connection type for DeploymentStatus. +""" +type DeploymentStatusConnection { + """ + A list of edges. + """ + edges: [DeploymentStatusEdge] + + """ + A list of nodes. + """ + nodes: [DeploymentStatus] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type DeploymentStatusEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: DeploymentStatus +} + +""" +The possible states for a deployment status. +""" +enum DeploymentStatusState { + """ + The deployment is pending. + """ + PENDING + + """ + The deployment was successful. + """ + SUCCESS + + """ + The deployment has failed. + """ + FAILURE + + """ + The deployment is inactive. + """ + INACTIVE + + """ + The deployment experienced an error. + """ + ERROR + + """ + The deployment is queued + """ + QUEUED + + """ + The deployment is in progress. + """ + IN_PROGRESS +} + +""" +Autogenerated input type of DismissPullRequestReview +""" +input DismissPullRequestReviewInput { + """ + The Node ID of the pull request review to modify. + """ + pullRequestReviewId: ID! + + """ + The contents of the pull request review dismissal message. + """ + message: String! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of DismissPullRequestReview +""" +type DismissPullRequestReviewPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The dismissed pull request review. + """ + pullRequestReview: PullRequestReview +} + +""" +Specifies a review comment to be left with a Pull Request Review. +""" +input DraftPullRequestReviewComment { + """ + Path to the file being commented on. + """ + path: String! + + """ + Position in the file to leave a comment on. + """ + position: Int! + + """ + Body of the comment to leave. + """ + body: String! +} + +""" +An external identity provisioned by SAML SSO or SCIM. +""" +type ExternalIdentity implements Node { + """ + The GUID for this identity + """ + guid: String! + id: ID! + + """ + Organization invitation for this SCIM-provisioned external identity + """ + organizationInvitation: OrganizationInvitation + + """ + SAML Identity attributes + """ + samlIdentity: ExternalIdentitySamlAttributes + + """ + SCIM Identity attributes + """ + scimIdentity: ExternalIdentityScimAttributes + + """ + User linked to this external identity. Will be NULL if this identity has not been claimed by an organization member. + """ + user: User +} + +""" +The connection type for ExternalIdentity. +""" +type ExternalIdentityConnection { + """ + A list of edges. + """ + edges: [ExternalIdentityEdge] + + """ + A list of nodes. + """ + nodes: [ExternalIdentity] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type ExternalIdentityEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: ExternalIdentity +} + +""" +SAML attributes for the External Identity +""" +type ExternalIdentitySamlAttributes { + """ + The NameID of the SAML identity + """ + nameId: String +} + +""" +SCIM attributes for the External Identity +""" +type ExternalIdentityScimAttributes { + """ + The userName of the SCIM identity + """ + username: String +} + +""" +The connection type for User. +""" +type FollowerConnection { + """ + A list of edges. + """ + edges: [UserEdge] + + """ + A list of nodes. + """ + nodes: [User] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +The connection type for User. +""" +type FollowingConnection { + """ + A list of edges. + """ + edges: [UserEdge] + + """ + A list of nodes. + """ + nodes: [User] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +A Gist. +""" +type Gist implements Node & Starrable { + """ + A list of comments associated with the gist + """ + comments( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): GistCommentConnection! + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + The gist description. + """ + description: String + + """ + The files in this gist. + """ + files( + """ + The maximum number of files to return. + """ + limit: Int = 10 + ): [GistFile] + id: ID! + + """ + Identifies if the gist is a fork. + """ + isFork: Boolean! + + """ + Whether the gist is public or not. + """ + isPublic: Boolean! + + """ + The gist name. + """ + name: String! + + """ + The gist owner. + """ + owner: RepositoryOwner + + """ + Identifies when the gist was last pushed to. + """ + pushedAt: DateTime + + """ + A list of users who have starred this starrable. + """ + stargazers( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Order for connection + """ + orderBy: StarOrder + ): StargazerConnection! + + """ + Identifies the date and time when the object was last updated. + """ + updatedAt: DateTime! + + """ + Returns a boolean indicating whether the viewing user has starred this starrable. + """ + viewerHasStarred: Boolean! +} + +""" +Represents a comment on an Gist. +""" +type GistComment implements Node & Comment & Deletable & Updatable & UpdatableComment { + """ + The actor who authored the comment. + """ + author: Actor + + """ + Author's association with the gist. + """ + authorAssociation: CommentAuthorAssociation! + + """ + Identifies the comment body. + """ + body: String! + + """ + The comment body rendered to HTML. + """ + bodyHTML: HTML! + + """ + The body rendered to text. + """ + bodyText: String! + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + Check if this comment was created via an email reply. + """ + createdViaEmail: Boolean! + + """ + Identifies the primary key from the database. + """ + databaseId: Int + + """ + The actor who edited the comment. + """ + editor: Actor + + """ + The associated gist. + """ + gist: Gist! + id: ID! + + """ + Check if this comment was edited and includes an edit with the creation data + """ + includesCreatedEdit: Boolean! + + """ + Returns whether or not a comment has been minimized. + """ + isMinimized: Boolean! + + """ + The moment the editor made the last edit + """ + lastEditedAt: DateTime + + """ + Returns why the comment was minimized. + """ + minimizedReason: String + + """ + Identifies when the comment was published at. + """ + publishedAt: DateTime + + """ + Identifies the date and time when the object was last updated. + """ + updatedAt: DateTime! + + """ + A list of edits to this content. + """ + userContentEdits( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): UserContentEditConnection + + """ + Check if the current viewer can delete this object. + """ + viewerCanDelete: Boolean! + + """ + Check if the current viewer can minimize this object. + """ + viewerCanMinimize: Boolean! + + """ + Check if the current viewer can update this object. + """ + viewerCanUpdate: Boolean! + + """ + Reasons why the current viewer can not update this comment. + """ + viewerCannotUpdateReasons: [CommentCannotUpdateReason!]! + + """ + Did the viewer author this comment. + """ + viewerDidAuthor: Boolean! +} + +""" +The connection type for GistComment. +""" +type GistCommentConnection { + """ + A list of edges. + """ + edges: [GistCommentEdge] + + """ + A list of nodes. + """ + nodes: [GistComment] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type GistCommentEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: GistComment +} + +""" +The connection type for Gist. +""" +type GistConnection { + """ + A list of edges. + """ + edges: [GistEdge] + + """ + A list of nodes. + """ + nodes: [Gist] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type GistEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: Gist +} + +""" +A file in a gist. +""" +type GistFile { + """ + The file name encoded to remove characters that are invalid in URL paths. + """ + encodedName: String + + """ + The gist file encoding. + """ + encoding: String + + """ + The file extension from the file name. + """ + extension: String + + """ + Indicates if this file is an image. + """ + isImage: Boolean! + + """ + Whether the file's contents were truncated. + """ + isTruncated: Boolean! + + """ + The programming language this file is written in. + """ + language: Language + + """ + The gist file name. + """ + name: String + + """ + The gist file size in bytes. + """ + size: Int + + """ + UTF8 text data or null if the file is binary + """ + text( + """ + Optionally truncate the returned file to this length. + """ + truncate: Int + ): String +} + +""" +Ordering options for gist connections +""" +input GistOrder { + """ + The field to order repositories by. + """ + field: GistOrderField! + + """ + The ordering direction. + """ + direction: OrderDirection! +} + +""" +Properties by which gist connections can be ordered. +""" +enum GistOrderField { + """ + Order gists by creation time + """ + CREATED_AT + + """ + Order gists by update time + """ + UPDATED_AT + + """ + Order gists by push time + """ + PUSHED_AT +} + +""" +The privacy of a Gist +""" +enum GistPrivacy { + """ + Public + """ + PUBLIC + + """ + Secret + """ + SECRET + + """ + Gists that are public and secret + """ + ALL +} + +""" +Represents an actor in a Git commit (ie. an author or committer). +""" +type GitActor { + """ + A URL pointing to the author's public avatar. + """ + avatarUrl( + """ + The size of the resulting square image. + """ + size: Int + ): URI! + + """ + The timestamp of the Git action (authoring or committing). + """ + date: GitTimestamp + + """ + The email in the Git commit. + """ + email: String + + """ + The name in the Git commit. + """ + name: String + + """ + The GitHub user corresponding to the email field. Null if no such user exists. + """ + user: User +} + +""" +Represents information about the GitHub instance. +""" +type GitHubMetadata { + """ + Returns a String that's a SHA of `github-services` + """ + gitHubServicesSha: GitObjectID! + + """ + IP addresses that users connect to for git operations + """ + gitIpAddresses: [String!] + + """ + IP addresses that service hooks are sent from + """ + hookIpAddresses: [String!] + + """ + IP addresses that the importer connects from + """ + importerIpAddresses: [String!] + + """ + Whether or not users are verified + """ + isPasswordAuthenticationVerifiable: Boolean! + + """ + IP addresses for GitHub Pages' A records + """ + pagesIpAddresses: [String!] +} + +""" +Represents a Git object. +""" +interface GitObject { + """ + An abbreviated version of the Git object ID + """ + abbreviatedOid: String! + + """ + The HTTP path for this Git object + """ + commitResourcePath: URI! + + """ + The HTTP URL for this Git object + """ + commitUrl: URI! + id: ID! + + """ + The Git object ID + """ + oid: GitObjectID! + + """ + The Repository the Git object belongs to + """ + repository: Repository! +} + +""" +A Git object ID. +""" +scalar GitObjectID + +""" +Information about a signature (GPG or S/MIME) on a Commit or Tag. +""" +interface GitSignature { + """ + Email used to sign this object. + """ + email: String! + + """ + True if the signature is valid and verified by GitHub. + """ + isValid: Boolean! + + """ + Payload for GPG signing object. Raw ODB object without the signature header. + """ + payload: String! + + """ + ASCII-armored signature header from object. + """ + signature: String! + + """ + GitHub user corresponding to the email signing this commit. + """ + signer: User + + """ + The state of this signature. `VALID` if signature is valid and verified by + GitHub, otherwise represents reason why signature is considered invalid. + """ + state: GitSignatureState! + + """ + True if the signature was made with GitHub's signing key. + """ + wasSignedByGitHub: Boolean! +} + +""" +The state of a Git signature. +""" +enum GitSignatureState { + """ + Valid signature and verified by GitHub + """ + VALID + + """ + Invalid signature + """ + INVALID + + """ + Malformed signature + """ + MALFORMED_SIG + + """ + Key used for signing not known to GitHub + """ + UNKNOWN_KEY + + """ + Invalid email used for signing + """ + BAD_EMAIL + + """ + Email used for signing unverified on GitHub + """ + UNVERIFIED_EMAIL + + """ + Email used for signing not known to GitHub + """ + NO_USER + + """ + Unknown signature type + """ + UNKNOWN_SIG_TYPE + + """ + Unsigned + """ + UNSIGNED + + """ + Internal error - the GPG verification service is unavailable at the moment + """ + GPGVERIFY_UNAVAILABLE + + """ + Internal error - the GPG verification service misbehaved + """ + GPGVERIFY_ERROR + + """ + The usage flags for the key that signed this don't allow signing + """ + NOT_SIGNING_KEY + + """ + Signing key expired + """ + EXPIRED_KEY + + """ + Valid signature, pending certificate revocation checking + """ + OCSP_PENDING + + """ + Valid siganture, though certificate revocation check failed + """ + OCSP_ERROR + + """ + The signing certificate or its chain could not be verified + """ + BAD_CERT + + """ + One or more certificates in chain has been revoked + """ + OCSP_REVOKED +} + +""" +Git SSH string +""" +scalar GitSSHRemote + +""" +An ISO-8601 encoded date string. Unlike the DateTime type, GitTimestamp is not converted in UTC. +""" +scalar GitTimestamp + +""" +Represents a GPG signature on a Commit or Tag. +""" +type GpgSignature implements GitSignature { + """ + Email used to sign this object. + """ + email: String! + + """ + True if the signature is valid and verified by GitHub. + """ + isValid: Boolean! + + """ + Hex-encoded ID of the key that signed this object. + """ + keyId: String + + """ + Payload for GPG signing object. Raw ODB object without the signature header. + """ + payload: String! + + """ + ASCII-armored signature header from object. + """ + signature: String! + + """ + GitHub user corresponding to the email signing this commit. + """ + signer: User + + """ + The state of this signature. `VALID` if signature is valid and verified by + GitHub, otherwise represents reason why signature is considered invalid. + """ + state: GitSignatureState! + + """ + True if the signature was made with GitHub's signing key. + """ + wasSignedByGitHub: Boolean! +} + +""" +Represents a 'head_ref_deleted' event on a given pull request. +""" +type HeadRefDeletedEvent implements Node { + """ + Identifies the actor who performed the event. + """ + actor: Actor + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + Identifies the Ref associated with the `head_ref_deleted` event. + """ + headRef: Ref + + """ + Identifies the name of the Ref associated with the `head_ref_deleted` event. + """ + headRefName: String! + id: ID! + + """ + PullRequest referenced by event. + """ + pullRequest: PullRequest! +} + +""" +Represents a 'head_ref_force_pushed' event on a given pull request. +""" +type HeadRefForcePushedEvent implements Node { + """ + Identifies the actor who performed the event. + """ + actor: Actor + + """ + Identifies the after commit SHA for the 'head_ref_force_pushed' event. + """ + afterCommit: Commit + + """ + Identifies the before commit SHA for the 'head_ref_force_pushed' event. + """ + beforeCommit: Commit + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + id: ID! + + """ + PullRequest referenced by event. + """ + pullRequest: PullRequest! + + """ + Identifies the fully qualified ref name for the 'head_ref_force_pushed' event. + """ + ref: Ref +} + +""" +Represents a 'head_ref_restored' event on a given pull request. +""" +type HeadRefRestoredEvent implements Node { + """ + Identifies the actor who performed the event. + """ + actor: Actor + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + id: ID! + + """ + PullRequest referenced by event. + """ + pullRequest: PullRequest! +} + +""" +A string containing HTML code. +""" +scalar HTML + +""" +The possible states in which authentication can be configured with an identity provider. +""" +enum IdentityProviderConfigurationState { + """ + Authentication with an identity provider is configured and enforced. + """ + ENFORCED + + """ + Authentication with an identity provider is configured but not enforced. + """ + CONFIGURED + + """ + Authentication with an identity provider is not configured. + """ + UNCONFIGURED +} + +""" +Autogenerated input type of ImportProject +""" +input ImportProjectInput { + """ + The name of the Organization or User to create the Project under. + """ + ownerName: String! + + """ + The name of Project. + """ + name: String! + + """ + The description of Project. + """ + body: String + + """ + Whether the Project is public or not. + """ + public: Boolean = false + + """ + A list of columns containing issues and pull requests. + """ + columnImports: [ProjectColumnImport!]! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +An Issue is a place to discuss ideas, enhancements, tasks, and bugs for a project. +""" +type Issue implements Node & Assignable & Closable & Comment & Updatable & UpdatableComment & Labelable & Lockable & Reactable & RepositoryNode & Subscribable & UniformResourceLocatable { + """ + Reason that the conversation was locked. + """ + activeLockReason: LockReason + + """ + A list of Users assigned to this object. + """ + assignees( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): UserConnection! + + """ + The actor who authored the comment. + """ + author: Actor + + """ + Author's association with the subject of the comment. + """ + authorAssociation: CommentAuthorAssociation! + + """ + Identifies the body of the issue. + """ + body: String! + + """ + Identifies the body of the issue rendered to HTML. + """ + bodyHTML: HTML! + + """ + Identifies the body of the issue rendered to text. + """ + bodyText: String! + + """ + `true` if the object is closed (definition of closed may depend on type) + """ + closed: Boolean! + + """ + Identifies the date and time when the object was closed. + """ + closedAt: DateTime + + """ + A list of comments associated with the Issue. + """ + comments( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): IssueCommentConnection! + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + Check if this comment was created via an email reply. + """ + createdViaEmail: Boolean! + + """ + Identifies the primary key from the database. + """ + databaseId: Int + + """ + The actor who edited the comment. + """ + editor: Actor + id: ID! + + """ + Check if this comment was edited and includes an edit with the creation data + """ + includesCreatedEdit: Boolean! + + """ + A list of labels associated with the object. + """ + labels( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): LabelConnection + + """ + The moment the editor made the last edit + """ + lastEditedAt: DateTime + + """ + `true` if the object is locked + """ + locked: Boolean! + + """ + Identifies the milestone associated with the issue. + """ + milestone: Milestone + + """ + Identifies the issue number. + """ + number: Int! + + """ + A list of Users that are participating in the Issue conversation. + """ + participants( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): UserConnection! + + """ + List of project cards associated with this issue. + """ + projectCards( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + A list of archived states to filter the cards by + """ + archivedStates: [ProjectCardArchivedState] + ): ProjectCardConnection! + + """ + Identifies when the comment was published at. + """ + publishedAt: DateTime + + """ + A list of reactions grouped by content left on the subject. + """ + reactionGroups: [ReactionGroup!] + + """ + A list of Reactions left on the Issue. + """ + reactions( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Allows filtering Reactions by emoji. + """ + content: ReactionContent + + """ + Allows specifying the order in which reactions are returned. + """ + orderBy: ReactionOrder + ): ReactionConnection! + + """ + The repository associated with this node. + """ + repository: Repository! + + """ + The HTTP path for this issue + """ + resourcePath: URI! + + """ + Identifies the state of the issue. + """ + state: IssueState! + + """ + A list of events, comments, commits, etc. associated with the issue. + """ + timeline( + """ + Allows filtering timeline events by a `since` timestamp. + """ + since: DateTime + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): IssueTimelineConnection! + + """ + A list of events, comments, commits, etc. associated with the issue. + """ + timelineItems( + """ + Filter timeline items by a `since` timestamp. + """ + since: DateTime + + """ + Skips the first _n_ elements in the list. + """ + skip: Int + + """ + Filter timeline items by type. + """ + itemTypes: [IssueTimelineItemsItemType!] + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): IssueTimelineItemsConnection! + + """ + Identifies the issue title. + """ + title: String! + + """ + Identifies the date and time when the object was last updated. + """ + updatedAt: DateTime! + + """ + The HTTP URL for this issue + """ + url: URI! + + """ + A list of edits to this content. + """ + userContentEdits( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): UserContentEditConnection + + """ + Can user react to this subject + """ + viewerCanReact: Boolean! + + """ + Check if the viewer is able to change their subscription status for the repository. + """ + viewerCanSubscribe: Boolean! + + """ + Check if the current viewer can update this object. + """ + viewerCanUpdate: Boolean! + + """ + Reasons why the current viewer can not update this comment. + """ + viewerCannotUpdateReasons: [CommentCannotUpdateReason!]! + + """ + Did the viewer author this comment. + """ + viewerDidAuthor: Boolean! + + """ + Identifies if the viewer is watching, not watching, or ignoring the subscribable entity. + """ + viewerSubscription: SubscriptionState +} + +""" +Represents a comment on an Issue. +""" +type IssueComment implements Node & Comment & Deletable & Updatable & UpdatableComment & Reactable & RepositoryNode { + """ + The actor who authored the comment. + """ + author: Actor + + """ + Author's association with the subject of the comment. + """ + authorAssociation: CommentAuthorAssociation! + + """ + The body as Markdown. + """ + body: String! + + """ + The body rendered to HTML. + """ + bodyHTML: HTML! + + """ + The body rendered to text. + """ + bodyText: String! + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + Check if this comment was created via an email reply. + """ + createdViaEmail: Boolean! + + """ + Identifies the primary key from the database. + """ + databaseId: Int + + """ + The actor who edited the comment. + """ + editor: Actor + id: ID! + + """ + Check if this comment was edited and includes an edit with the creation data + """ + includesCreatedEdit: Boolean! + + """ + Returns whether or not a comment has been minimized. + """ + isMinimized: Boolean! + + """ + Identifies the issue associated with the comment. + """ + issue: Issue! + + """ + The moment the editor made the last edit + """ + lastEditedAt: DateTime + + """ + Returns why the comment was minimized. + """ + minimizedReason: String + + """ + Identifies when the comment was published at. + """ + publishedAt: DateTime + + """ + Returns the pull request associated with the comment, if this comment was made on a + pull request. + """ + pullRequest: PullRequest + + """ + A list of reactions grouped by content left on the subject. + """ + reactionGroups: [ReactionGroup!] + + """ + A list of Reactions left on the Issue. + """ + reactions( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Allows filtering Reactions by emoji. + """ + content: ReactionContent + + """ + Allows specifying the order in which reactions are returned. + """ + orderBy: ReactionOrder + ): ReactionConnection! + + """ + The repository associated with this node. + """ + repository: Repository! + + """ + The HTTP path for this issue comment + """ + resourcePath: URI! + + """ + Identifies the date and time when the object was last updated. + """ + updatedAt: DateTime! + + """ + The HTTP URL for this issue comment + """ + url: URI! + + """ + A list of edits to this content. + """ + userContentEdits( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): UserContentEditConnection + + """ + Check if the current viewer can delete this object. + """ + viewerCanDelete: Boolean! + + """ + Check if the current viewer can minimize this object. + """ + viewerCanMinimize: Boolean! + + """ + Can user react to this subject + """ + viewerCanReact: Boolean! + + """ + Check if the current viewer can update this object. + """ + viewerCanUpdate: Boolean! + + """ + Reasons why the current viewer can not update this comment. + """ + viewerCannotUpdateReasons: [CommentCannotUpdateReason!]! + + """ + Did the viewer author this comment. + """ + viewerDidAuthor: Boolean! +} + +""" +The connection type for IssueComment. +""" +type IssueCommentConnection { + """ + A list of edges. + """ + edges: [IssueCommentEdge] + + """ + A list of nodes. + """ + nodes: [IssueComment] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type IssueCommentEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: IssueComment +} + +""" +The connection type for Issue. +""" +type IssueConnection { + """ + A list of edges. + """ + edges: [IssueEdge] + + """ + A list of nodes. + """ + nodes: [Issue] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +This aggregates issues opened by a user within one repository. +""" +type IssueContributionsByRepository { + """ + The issue contributions. + """ + contributions( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for contributions returned from the connection. + """ + orderBy: ContributionOrder + ): CreatedIssueContributionConnection! + + """ + The repository in which the issues were opened. + """ + repository: Repository! +} + +""" +An edge in a connection. +""" +type IssueEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: Issue +} + +""" +Ways in which to filter lists of issues. +""" +input IssueFilters { + """ + List issues assigned to given name. Pass in `null` for issues with no assigned + user, and `*` for issues assigned to any user. + """ + assignee: String + + """ + List issues created by given name. + """ + createdBy: String + + """ + List issues where the list of label names exist on the issue. + """ + labels: [String!] + + """ + List issues where the given name is mentioned in the issue. + """ + mentioned: String + + """ + List issues by given milestone argument. If an string representation of an + integer is passed, it should refer to a milestone by its number field. Pass in + `null` for issues with no milestone, and `*` for issues that are assigned to any milestone. + """ + milestone: String + + """ + List issues that have been updated at or after the given date. + """ + since: DateTime + + """ + List issues filtered by the list of states given. + """ + states: [IssueState!] + + """ + List issues subscribed to by viewer. + """ + viewerSubscribed: Boolean = false +} + +""" +Ways in which lists of issues can be ordered upon return. +""" +input IssueOrder { + """ + The field in which to order issues by. + """ + field: IssueOrderField! + + """ + The direction in which to order issues by the specified field. + """ + direction: OrderDirection! +} + +""" +Properties by which issue connections can be ordered. +""" +enum IssueOrderField { + """ + Order issues by creation time + """ + CREATED_AT + + """ + Order issues by update time + """ + UPDATED_AT + + """ + Order issues by comment count + """ + COMMENTS +} + +""" +Used for return value of Repository.issueOrPullRequest. +""" +union IssueOrPullRequest = Issue | PullRequest + +""" +The possible PubSub channels for an issue. +""" +enum IssuePubSubTopic { + """ + The channel ID for observing issue updates. + """ + UPDATED + + """ + The channel ID for marking an issue as read. + """ + MARKASREAD + + """ + The channel ID for updating items on the issue timeline. + """ + TIMELINE + + """ + The channel ID for observing issue state updates. + """ + STATE +} + +""" +The possible states of an issue. +""" +enum IssueState { + """ + An issue that is still open + """ + OPEN + + """ + An issue that has been closed + """ + CLOSED +} + +""" +The connection type for IssueTimelineItem. +""" +type IssueTimelineConnection { + """ + A list of edges. + """ + edges: [IssueTimelineItemEdge] + + """ + A list of nodes. + """ + nodes: [IssueTimelineItem] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An item in an issue timeline +""" +union IssueTimelineItem = + Commit + | IssueComment + | CrossReferencedEvent + | ClosedEvent + | ReopenedEvent + | SubscribedEvent + | UnsubscribedEvent + | ReferencedEvent + | AssignedEvent + | UnassignedEvent + | LabeledEvent + | UnlabeledEvent + | UserBlockedEvent + | MilestonedEvent + | DemilestonedEvent + | RenamedTitleEvent + | LockedEvent + | UnlockedEvent + | TransferredEvent + +""" +An edge in a connection. +""" +type IssueTimelineItemEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: IssueTimelineItem +} + +""" +An item in an issue timeline +""" +union IssueTimelineItems = + IssueComment + | CrossReferencedEvent + | AddedToProjectEvent + | AssignedEvent + | ClosedEvent + | CommentDeletedEvent + | ConvertedNoteToIssueEvent + | DemilestonedEvent + | LabeledEvent + | LockedEvent + | MentionedEvent + | MilestonedEvent + | MovedColumnsInProjectEvent + | PinnedEvent + | ReferencedEvent + | RemovedFromProjectEvent + | RenamedTitleEvent + | ReopenedEvent + | SubscribedEvent + | TransferredEvent + | UnassignedEvent + | UnlabeledEvent + | UnlockedEvent + | UserBlockedEvent + | UnpinnedEvent + | UnsubscribedEvent + +""" +The connection type for IssueTimelineItems. +""" +type IssueTimelineItemsConnection { + """ + A list of edges. + """ + edges: [IssueTimelineItemsEdge] + + """ + Identifies the count of items after applying `before` and `after` filters. + """ + filteredCount: Int! + + """ + A list of nodes. + """ + nodes: [IssueTimelineItems] + + """ + Identifies the count of items after applying `before`/`after` filters and `first`/`last`/`skip` slicing. + """ + pageCount: Int! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! + + """ + Identifies the date and time when the timeline was last updated. + """ + updatedAt: DateTime! +} + +""" +An edge in a connection. +""" +type IssueTimelineItemsEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: IssueTimelineItems +} + +""" +The possible item types found in a timeline. +""" +enum IssueTimelineItemsItemType { + """ + Represents a comment on an Issue. + """ + ISSUE_COMMENT + + """ + Represents a mention made by one issue or pull request to another. + """ + CROSS_REFERENCED_EVENT + + """ + Represents a 'added_to_project' event on a given issue or pull request. + """ + ADDED_TO_PROJECT_EVENT + + """ + Represents an 'assigned' event on any assignable object. + """ + ASSIGNED_EVENT + + """ + Represents a 'closed' event on any `Closable`. + """ + CLOSED_EVENT + + """ + Represents a 'comment_deleted' event on a given issue or pull request. + """ + COMMENT_DELETED_EVENT + + """ + Represents a 'converted_note_to_issue' event on a given issue or pull request. + """ + CONVERTED_NOTE_TO_ISSUE_EVENT + + """ + Represents a 'demilestoned' event on a given issue or pull request. + """ + DEMILESTONED_EVENT + + """ + Represents a 'labeled' event on a given issue or pull request. + """ + LABELED_EVENT + + """ + Represents a 'locked' event on a given issue or pull request. + """ + LOCKED_EVENT + + """ + Represents a 'mentioned' event on a given issue or pull request. + """ + MENTIONED_EVENT + + """ + Represents a 'milestoned' event on a given issue or pull request. + """ + MILESTONED_EVENT + + """ + Represents a 'moved_columns_in_project' event on a given issue or pull request. + """ + MOVED_COLUMNS_IN_PROJECT_EVENT + + """ + Represents a 'pinned' event on a given issue or pull request. + """ + PINNED_EVENT + + """ + Represents a 'referenced' event on a given `ReferencedSubject`. + """ + REFERENCED_EVENT + + """ + Represents a 'removed_from_project' event on a given issue or pull request. + """ + REMOVED_FROM_PROJECT_EVENT + + """ + Represents a 'renamed' event on a given issue or pull request + """ + RENAMED_TITLE_EVENT + + """ + Represents a 'reopened' event on any `Closable`. + """ + REOPENED_EVENT + + """ + Represents a 'subscribed' event on a given `Subscribable`. + """ + SUBSCRIBED_EVENT + + """ + Represents a 'transferred' event on a given issue or pull request. + """ + TRANSFERRED_EVENT + + """ + Represents an 'unassigned' event on any assignable object. + """ + UNASSIGNED_EVENT + + """ + Represents an 'unlabeled' event on a given issue or pull request. + """ + UNLABELED_EVENT + + """ + Represents an 'unlocked' event on a given issue or pull request. + """ + UNLOCKED_EVENT + + """ + Represents a 'user_blocked' event on a given user. + """ + USER_BLOCKED_EVENT + + """ + Represents an 'unpinned' event on a given issue or pull request. + """ + UNPINNED_EVENT + + """ + Represents an 'unsubscribed' event on a given `Subscribable`. + """ + UNSUBSCRIBED_EVENT +} + +""" +Represents a user signing up for a GitHub account. +""" +type JoinedGitHubContribution implements Contribution { + """ + Whether this contribution is associated with a record you do not have access to. For + example, your own 'first issue' contribution may have been made on a repository you can no + longer access. + """ + isRestricted: Boolean! + + """ + When this contribution was made. + """ + occurredAt: DateTime! + + """ + The HTTP path for this contribution. + """ + resourcePath: URI! + + """ + The HTTP URL for this contribution. + """ + url: URI! + + """ + The user who made this contribution. + """ + user: User! +} + +""" +A label for categorizing Issues or Milestones with a given Repository. +""" +type Label implements Node { + """ + Identifies the label color. + """ + color: String! + + """ + Identifies the date and time when the label was created. + """ + createdAt: DateTime + + """ + A brief description of this label. + """ + description: String + id: ID! + + """ + Indicates whether or not this is a default label. + """ + isDefault: Boolean! + + """ + A list of issues associated with this label. + """ + issues( + """ + Ordering options for issues returned from the connection. + """ + orderBy: IssueOrder + + """ + A list of label names to filter the pull requests by. + """ + labels: [String!] + + """ + A list of states to filter the issues by. + """ + states: [IssueState!] + + """ + Filtering options for issues returned from the connection. + """ + filterBy: IssueFilters + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): IssueConnection! + + """ + Identifies the label name. + """ + name: String! + + """ + A list of pull requests associated with this label. + """ + pullRequests( + """ + A list of states to filter the pull requests by. + """ + states: [PullRequestState!] + + """ + A list of label names to filter the pull requests by. + """ + labels: [String!] + + """ + The head ref name to filter the pull requests by. + """ + headRefName: String + + """ + The base ref name to filter the pull requests by. + """ + baseRefName: String + + """ + Ordering options for pull requests returned from the connection. + """ + orderBy: IssueOrder + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): PullRequestConnection! + + """ + The repository associated with this label. + """ + repository: Repository! + + """ + The HTTP path for this label. + """ + resourcePath: URI! + + """ + Identifies the date and time when the label was last updated. + """ + updatedAt: DateTime + + """ + The HTTP URL for this label. + """ + url: URI! +} + +""" +An object that can have labels assigned to it. +""" +interface Labelable { + """ + A list of labels associated with the object. + """ + labels( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): LabelConnection +} + +""" +The connection type for Label. +""" +type LabelConnection { + """ + A list of edges. + """ + edges: [LabelEdge] + + """ + A list of nodes. + """ + nodes: [Label] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +Represents a 'labeled' event on a given issue or pull request. +""" +type LabeledEvent implements Node { + """ + Identifies the actor who performed the event. + """ + actor: Actor + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + id: ID! + + """ + Identifies the label associated with the 'labeled' event. + """ + label: Label! + + """ + Identifies the `Labelable` associated with the event. + """ + labelable: Labelable! +} + +""" +An edge in a connection. +""" +type LabelEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: Label +} + +""" +Represents a given language found in repositories. +""" +type Language implements Node { + """ + The color defined for the current language. + """ + color: String + id: ID! + + """ + The name of the current language. + """ + name: String! +} + +""" +A list of languages associated with the parent. +""" +type LanguageConnection { + """ + A list of edges. + """ + edges: [LanguageEdge] + + """ + A list of nodes. + """ + nodes: [Language] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! + + """ + The total size in bytes of files written in that language. + """ + totalSize: Int! +} + +""" +Represents the language of a repository. +""" +type LanguageEdge { + cursor: String! + node: Language! + + """ + The number of bytes of code written in the language. + """ + size: Int! +} + +""" +Ordering options for language connections. +""" +input LanguageOrder { + """ + The field to order languages by. + """ + field: LanguageOrderField! + + """ + The ordering direction. + """ + direction: OrderDirection! +} + +""" +Properties by which language connections can be ordered. +""" +enum LanguageOrderField { + """ + Order languages by the size of all files containing the language + """ + SIZE +} + +""" +A repository's open source license +""" +type License implements Node { + """ + The full text of the license + """ + body: String! + + """ + The conditions set by the license + """ + conditions: [LicenseRule]! + + """ + A human-readable description of the license + """ + description: String + + """ + Whether the license should be featured + """ + featured: Boolean! + + """ + Whether the license should be displayed in license pickers + """ + hidden: Boolean! + id: ID! + + """ + Instructions on how to implement the license + """ + implementation: String + + """ + The lowercased SPDX ID of the license + """ + key: String! + + """ + The limitations set by the license + """ + limitations: [LicenseRule]! + + """ + The license full name specified by + """ + name: String! + + """ + Customary short name if applicable (e.g, GPLv3) + """ + nickname: String + + """ + The permissions set by the license + """ + permissions: [LicenseRule]! + + """ + Whether the license is a pseudo-license placeholder (e.g., other, no-license) + """ + pseudoLicense: Boolean! + + """ + Short identifier specified by + """ + spdxId: String + + """ + URL to the license on + """ + url: URI +} + +""" +Describes a License's conditions, permissions, and limitations +""" +type LicenseRule { + """ + A description of the rule + """ + description: String! + + """ + The machine-readable rule key + """ + key: String! + + """ + The human-readable rule label + """ + label: String! +} + +""" +An object that can be locked. +""" +interface Lockable { + """ + Reason that the conversation was locked. + """ + activeLockReason: LockReason + + """ + `true` if the object is locked + """ + locked: Boolean! +} + +""" +Represents a 'locked' event on a given issue or pull request. +""" +type LockedEvent implements Node { + """ + Identifies the actor who performed the event. + """ + actor: Actor + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + id: ID! + + """ + Reason that the conversation was locked (optional). + """ + lockReason: LockReason + + """ + Object that was locked. + """ + lockable: Lockable! +} + +""" +Autogenerated input type of LockLockable +""" +input LockLockableInput { + """ + ID of the issue or pull request to be locked. + """ + lockableId: ID! + + """ + A reason for why the issue or pull request will be locked. + """ + lockReason: LockReason + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of LockLockable +""" +type LockLockablePayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The item that was locked. + """ + lockedRecord: Lockable +} + +""" +The possible reasons that an issue or pull request was locked. +""" +enum LockReason { + """ + The issue or pull request was locked because the conversation was off-topic. + """ + OFF_TOPIC + + """ + The issue or pull request was locked because the conversation was too heated. + """ + TOO_HEATED + + """ + The issue or pull request was locked because the conversation was resolved. + """ + RESOLVED + + """ + The issue or pull request was locked because the conversation was spam. + """ + SPAM +} + +""" +A placeholder user for attribution of imported data on GitHub. +""" +type Mannequin implements Node & Actor & UniformResourceLocatable { + """ + A URL pointing to the GitHub App's public avatar. + """ + avatarUrl( + """ + The size of the resulting square image. + """ + size: Int + ): URI! + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + Identifies the primary key from the database. + """ + databaseId: Int + id: ID! + + """ + The username of the actor. + """ + login: String! + + """ + The HTML path to this resource. + """ + resourcePath: URI! + + """ + Identifies the date and time when the object was last updated. + """ + updatedAt: DateTime! + + """ + The URL to this resource. + """ + url: URI! +} + +""" +A public description of a Marketplace category. +""" +type MarketplaceCategory implements Node { + """ + The category's description. + """ + description: String + + """ + The technical description of how apps listed in this category work with GitHub. + """ + howItWorks: String + id: ID! + + """ + The category's name. + """ + name: String! + + """ + How many Marketplace listings have this as their primary category. + """ + primaryListingCount: Int! + + """ + The HTTP path for this Marketplace category. + """ + resourcePath: URI! + + """ + How many Marketplace listings have this as their secondary category. + """ + secondaryListingCount: Int! + + """ + The short name of the category used in its URL. + """ + slug: String! + + """ + The HTTP URL for this Marketplace category. + """ + url: URI! +} + +""" +A listing in the GitHub integration marketplace. +""" +type MarketplaceListing implements Node { + """ + The GitHub App this listing represents. + """ + app: App + + """ + URL to the listing owner's company site. + """ + companyUrl: URI + + """ + The HTTP path for configuring access to the listing's integration or OAuth app + """ + configurationResourcePath: URI! + + """ + The HTTP URL for configuring access to the listing's integration or OAuth app + """ + configurationUrl: URI! + + """ + URL to the listing's documentation. + """ + documentationUrl: URI + + """ + The listing's detailed description. + """ + extendedDescription: String + + """ + The listing's detailed description rendered to HTML. + """ + extendedDescriptionHTML: HTML! + + """ + The listing's introductory description. + """ + fullDescription: String! + + """ + The listing's introductory description rendered to HTML. + """ + fullDescriptionHTML: HTML! + + """ + Whether this listing has been submitted for review from GitHub for approval to be displayed in the Marketplace. + """ + hasApprovalBeenRequested: Boolean! + @deprecated( + reason: "`hasApprovalBeenRequested` will be removed. Use `isVerificationPendingFromDraft` instead. Removal on 2019-10-01 UTC." + ) + + """ + Does this listing have any plans with a free trial? + """ + hasPublishedFreeTrialPlans: Boolean! + + """ + Does this listing have a terms of service link? + """ + hasTermsOfService: Boolean! + + """ + A technical description of how this app works with GitHub. + """ + howItWorks: String + + """ + The listing's technical description rendered to HTML. + """ + howItWorksHTML: HTML! + id: ID! + + """ + URL to install the product to the viewer's account or organization. + """ + installationUrl: URI + + """ + Whether this listing's app has been installed for the current viewer + """ + installedForViewer: Boolean! + + """ + Whether this listing has been approved for display in the Marketplace. + """ + isApproved: Boolean! + @deprecated( + reason: "`isApproved` will be removed. Use `isPublic` instead. Removal on 2019-10-01 UTC." + ) + + """ + Whether this listing has been removed from the Marketplace. + """ + isArchived: Boolean! + + """ + Whether this listing has been removed from the Marketplace. + """ + isDelisted: Boolean! + @deprecated( + reason: "`isDelisted` will be removed. Use `isArchived` instead. Removal on 2019-10-01 UTC." + ) + + """ + Whether this listing is still an editable draft that has not been submitted + for review and is not publicly visible in the Marketplace. + """ + isDraft: Boolean! + + """ + Whether the product this listing represents is available as part of a paid plan. + """ + isPaid: Boolean! + + """ + Whether this listing has been approved for display in the Marketplace. + """ + isPublic: Boolean! + + """ + Whether this listing has been rejected by GitHub for display in the Marketplace. + """ + isRejected: Boolean! + + """ + Whether this listing has been approved for unverified display in the Marketplace. + """ + isUnverified: Boolean! + + """ + Whether this draft listing has been submitted for review for approval to be unverified in the Marketplace. + """ + isUnverifiedPending: Boolean! + + """ + Whether this draft listing has been submitted for review from GitHub for approval to be verified in the Marketplace. + """ + isVerificationPendingFromDraft: Boolean! + + """ + Whether this unverified listing has been submitted for review from GitHub for approval to be verified in the Marketplace. + """ + isVerificationPendingFromUnverified: Boolean! + + """ + Whether this listing has been approved for verified display in the Marketplace. + """ + isVerified: Boolean! + + """ + The hex color code, without the leading '#', for the logo background. + """ + logoBackgroundColor: String! + + """ + URL for the listing's logo image. + """ + logoUrl( + """ + The size in pixels of the resulting square image. + """ + size: Int = 400 + ): URI + + """ + The listing's full name. + """ + name: String! + + """ + The listing's very short description without a trailing period or ampersands. + """ + normalizedShortDescription: String! + + """ + URL to the listing's detailed pricing. + """ + pricingUrl: URI + + """ + The category that best describes the listing. + """ + primaryCategory: MarketplaceCategory! + + """ + URL to the listing's privacy policy, may return an empty string for listings that do not require a privacy policy URL. + """ + privacyPolicyUrl: URI! + + """ + The HTTP path for the Marketplace listing. + """ + resourcePath: URI! + + """ + The URLs for the listing's screenshots. + """ + screenshotUrls: [String]! + + """ + An alternate category that describes the listing. + """ + secondaryCategory: MarketplaceCategory + + """ + The listing's very short description. + """ + shortDescription: String! + + """ + The short name of the listing used in its URL. + """ + slug: String! + + """ + URL to the listing's status page. + """ + statusUrl: URI + + """ + An email address for support for this listing's app. + """ + supportEmail: String + + """ + Either a URL or an email address for support for this listing's app, may + return an empty string for listings that do not require a support URL. + """ + supportUrl: URI! + + """ + URL to the listing's terms of service. + """ + termsOfServiceUrl: URI + + """ + The HTTP URL for the Marketplace listing. + """ + url: URI! + + """ + Can the current viewer add plans for this Marketplace listing. + """ + viewerCanAddPlans: Boolean! + + """ + Can the current viewer approve this Marketplace listing. + """ + viewerCanApprove: Boolean! + + """ + Can the current viewer delist this Marketplace listing. + """ + viewerCanDelist: Boolean! + + """ + Can the current viewer edit this Marketplace listing. + """ + viewerCanEdit: Boolean! + + """ + Can the current viewer edit the primary and secondary category of this + Marketplace listing. + """ + viewerCanEditCategories: Boolean! + + """ + Can the current viewer edit the plans for this Marketplace listing. + """ + viewerCanEditPlans: Boolean! + + """ + Can the current viewer return this Marketplace listing to draft state + so it becomes editable again. + """ + viewerCanRedraft: Boolean! + + """ + Can the current viewer reject this Marketplace listing by returning it to + an editable draft state or rejecting it entirely. + """ + viewerCanReject: Boolean! + + """ + Can the current viewer request this listing be reviewed for display in + the Marketplace as verified. + """ + viewerCanRequestApproval: Boolean! + + """ + Indicates whether the current user has an active subscription to this Marketplace listing. + """ + viewerHasPurchased: Boolean! + + """ + Indicates if the current user has purchased a subscription to this Marketplace listing + for all of the organizations the user owns. + """ + viewerHasPurchasedForAllOrganizations: Boolean! + + """ + Does the current viewer role allow them to administer this Marketplace listing. + """ + viewerIsListingAdmin: Boolean! +} + +""" +Look up Marketplace Listings +""" +type MarketplaceListingConnection { + """ + A list of edges. + """ + edges: [MarketplaceListingEdge] + + """ + A list of nodes. + """ + nodes: [MarketplaceListing] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type MarketplaceListingEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: MarketplaceListing +} + +""" +Entities that have members who can set status messages. +""" +interface MemberStatusable { + """ + Get the status messages members of this entity have set that are either public or visible only to the organization. + """ + memberStatuses( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for user statuses returned from the connection. + """ + orderBy: UserStatusOrder + ): UserStatusConnection! +} + +""" +Represents a 'mentioned' event on a given issue or pull request. +""" +type MentionedEvent implements Node { + """ + Identifies the actor who performed the event. + """ + actor: Actor + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + Identifies the primary key from the database. + """ + databaseId: Int + id: ID! +} + +""" +Whether or not a PullRequest can be merged. +""" +enum MergeableState { + """ + The pull request can be merged. + """ + MERGEABLE + + """ + The pull request cannot be merged due to merge conflicts. + """ + CONFLICTING + + """ + The mergeability of the pull request is still being calculated. + """ + UNKNOWN +} + +""" +Represents a 'merged' event on a given pull request. +""" +type MergedEvent implements Node & UniformResourceLocatable { + """ + Identifies the actor who performed the event. + """ + actor: Actor + + """ + Identifies the commit associated with the `merge` event. + """ + commit: Commit + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + id: ID! + + """ + Identifies the Ref associated with the `merge` event. + """ + mergeRef: Ref + + """ + Identifies the name of the Ref associated with the `merge` event. + """ + mergeRefName: String! + + """ + PullRequest referenced by event. + """ + pullRequest: PullRequest! + + """ + The HTTP path for this merged event. + """ + resourcePath: URI! + + """ + The HTTP URL for this merged event. + """ + url: URI! +} + +""" +Autogenerated input type of MergePullRequest +""" +input MergePullRequestInput { + """ + ID of the pull request to be merged. + """ + pullRequestId: ID! + + """ + Commit headline to use for the merge commit; if omitted, a default message will be used. + """ + commitHeadline: String + + """ + Commit body to use for the merge commit; if omitted, a default message will be used + """ + commitBody: String + + """ + OID that the pull request head ref must match to allow merge; if omitted, no check is performed. + """ + expectedHeadOid: GitObjectID + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of MergePullRequest +""" +type MergePullRequestPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The pull request that was merged. + """ + pullRequest: PullRequest +} + +""" +Represents a Milestone object on a given repository. +""" +type Milestone implements Node & Closable & UniformResourceLocatable { + """ + `true` if the object is closed (definition of closed may depend on type) + """ + closed: Boolean! + + """ + Identifies the date and time when the object was closed. + """ + closedAt: DateTime + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + Identifies the actor who created the milestone. + """ + creator: Actor + + """ + Identifies the description of the milestone. + """ + description: String + + """ + Identifies the due date of the milestone. + """ + dueOn: DateTime + id: ID! + + """ + A list of issues associated with the milestone. + """ + issues( + """ + Ordering options for issues returned from the connection. + """ + orderBy: IssueOrder + + """ + A list of label names to filter the pull requests by. + """ + labels: [String!] + + """ + A list of states to filter the issues by. + """ + states: [IssueState!] + + """ + Filtering options for issues returned from the connection. + """ + filterBy: IssueFilters + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): IssueConnection! + + """ + Identifies the number of the milestone. + """ + number: Int! + + """ + A list of pull requests associated with the milestone. + """ + pullRequests( + """ + A list of states to filter the pull requests by. + """ + states: [PullRequestState!] + + """ + A list of label names to filter the pull requests by. + """ + labels: [String!] + + """ + The head ref name to filter the pull requests by. + """ + headRefName: String + + """ + The base ref name to filter the pull requests by. + """ + baseRefName: String + + """ + Ordering options for pull requests returned from the connection. + """ + orderBy: IssueOrder + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): PullRequestConnection! + + """ + The repository associated with this milestone. + """ + repository: Repository! + + """ + The HTTP path for this milestone + """ + resourcePath: URI! + + """ + Identifies the state of the milestone. + """ + state: MilestoneState! + + """ + Identifies the title of the milestone. + """ + title: String! + + """ + Identifies the date and time when the object was last updated. + """ + updatedAt: DateTime! + + """ + The HTTP URL for this milestone + """ + url: URI! +} + +""" +The connection type for Milestone. +""" +type MilestoneConnection { + """ + A list of edges. + """ + edges: [MilestoneEdge] + + """ + A list of nodes. + """ + nodes: [Milestone] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +Represents a 'milestoned' event on a given issue or pull request. +""" +type MilestonedEvent implements Node { + """ + Identifies the actor who performed the event. + """ + actor: Actor + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + id: ID! + + """ + Identifies the milestone title associated with the 'milestoned' event. + """ + milestoneTitle: String! + + """ + Object referenced by event. + """ + subject: MilestoneItem! +} + +""" +An edge in a connection. +""" +type MilestoneEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: Milestone +} + +""" +Types that can be inside a Milestone. +""" +union MilestoneItem = Issue | PullRequest + +""" +Ordering options for milestone connections. +""" +input MilestoneOrder { + """ + The field to order milestones by. + """ + field: MilestoneOrderField! + + """ + The ordering direction. + """ + direction: OrderDirection! +} + +""" +Properties by which milestone connections can be ordered. +""" +enum MilestoneOrderField { + """ + Order milestones by when they are due. + """ + DUE_DATE + + """ + Order milestones by when they were created. + """ + CREATED_AT + + """ + Order milestones by when they were last updated. + """ + UPDATED_AT + + """ + Order milestones by their number. + """ + NUMBER +} + +""" +The possible states of a milestone. +""" +enum MilestoneState { + """ + A milestone that is still open. + """ + OPEN + + """ + A milestone that has been closed. + """ + CLOSED +} + +""" +Autogenerated input type of MinimizeComment +""" +input MinimizeCommentInput { + """ + The Node ID of the subject to modify. + """ + subjectId: ID! + + """ + The classification of comment + """ + classifier: ReportedContentClassifiers! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Represents a 'moved_columns_in_project' event on a given issue or pull request. +""" +type MovedColumnsInProjectEvent implements Node { + """ + Identifies the actor who performed the event. + """ + actor: Actor + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + Identifies the primary key from the database. + """ + databaseId: Int + id: ID! +} + +""" +Autogenerated input type of MoveProjectCard +""" +input MoveProjectCardInput { + """ + The id of the card to move. + """ + cardId: ID! + + """ + The id of the column to move it into. + """ + columnId: ID! + + """ + Place the new card after the card with this id. Pass null to place it at the top. + """ + afterCardId: ID + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of MoveProjectCard +""" +type MoveProjectCardPayload { + """ + The new edge of the moved card. + """ + cardEdge: ProjectCardEdge + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated input type of MoveProjectColumn +""" +input MoveProjectColumnInput { + """ + The id of the column to move. + """ + columnId: ID! + + """ + Place the new column after the column with this id. Pass null to place it at the front. + """ + afterColumnId: ID + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of MoveProjectColumn +""" +type MoveProjectColumnPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The new edge of the moved column. + """ + columnEdge: ProjectColumnEdge +} + +""" +The root query for implementing GraphQL mutations. +""" +type Mutation { + """ + Applies a suggested topic to the repository. + """ + acceptTopicSuggestion( + input: AcceptTopicSuggestionInput! + ): AcceptTopicSuggestionPayload + + """ + Adds assignees to an assignable object. + """ + addAssigneesToAssignable( + input: AddAssigneesToAssignableInput! + ): AddAssigneesToAssignablePayload + + """ + Adds a comment to an Issue or Pull Request. + """ + addComment(input: AddCommentInput!): AddCommentPayload + + """ + Adds labels to a labelable object. + """ + addLabelsToLabelable( + input: AddLabelsToLabelableInput! + ): AddLabelsToLabelablePayload + + """ + Adds a card to a ProjectColumn. Either `contentId` or `note` must be provided but **not** both. + """ + addProjectCard(input: AddProjectCardInput!): AddProjectCardPayload + + """ + Adds a column to a Project. + """ + addProjectColumn(input: AddProjectColumnInput!): AddProjectColumnPayload + + """ + Adds a review to a Pull Request. + """ + addPullRequestReview( + input: AddPullRequestReviewInput! + ): AddPullRequestReviewPayload + + """ + Adds a comment to a review. + """ + addPullRequestReviewComment( + input: AddPullRequestReviewCommentInput! + ): AddPullRequestReviewCommentPayload + + """ + Adds a reaction to a subject. + """ + addReaction(input: AddReactionInput!): AddReactionPayload + + """ + Adds a star to a Starrable. + """ + addStar(input: AddStarInput!): AddStarPayload + + """ + Update your status on GitHub. + """ + changeUserStatus(input: ChangeUserStatusInput!): ChangeUserStatusPayload + + """ + Clears all labels from a labelable object. + """ + clearLabelsFromLabelable( + input: ClearLabelsFromLabelableInput! + ): ClearLabelsFromLabelablePayload + + """ + Creates a new project by cloning configuration from an existing project. + """ + cloneProject(input: CloneProjectInput!): CloneProjectPayload + + """ + Close an issue. + """ + closeIssue(input: CloseIssueInput!): CloseIssuePayload + + """ + Close a pull request. + """ + closePullRequest(input: ClosePullRequestInput!): ClosePullRequestPayload + + """ + Convert a project note card to one associated with a newly created issue. + """ + convertProjectCardNoteToIssue( + input: ConvertProjectCardNoteToIssueInput! + ): ConvertProjectCardNoteToIssuePayload + + """ + Create a new branch protection rule + """ + createBranchProtectionRule( + input: CreateBranchProtectionRuleInput! + ): CreateBranchProtectionRulePayload + + """ + Creates a new issue. + """ + createIssue(input: CreateIssueInput!): CreateIssuePayload + + """ + Creates a new project. + """ + createProject(input: CreateProjectInput!): CreateProjectPayload + + """ + Create a new pull request + """ + createPullRequest(input: CreatePullRequestInput!): CreatePullRequestPayload + + """ + Rejects a suggested topic for the repository. + """ + declineTopicSuggestion( + input: DeclineTopicSuggestionInput! + ): DeclineTopicSuggestionPayload + + """ + Delete a branch protection rule + """ + deleteBranchProtectionRule( + input: DeleteBranchProtectionRuleInput! + ): DeleteBranchProtectionRulePayload + + """ + Deletes an Issue object. + """ + deleteIssue(input: DeleteIssueInput!): DeleteIssuePayload + + """ + Deletes an IssueComment object. + """ + deleteIssueComment(input: DeleteIssueCommentInput!): DeleteIssueCommentPayload + + """ + Deletes a project. + """ + deleteProject(input: DeleteProjectInput!): DeleteProjectPayload + + """ + Deletes a project card. + """ + deleteProjectCard(input: DeleteProjectCardInput!): DeleteProjectCardPayload + + """ + Deletes a project column. + """ + deleteProjectColumn( + input: DeleteProjectColumnInput! + ): DeleteProjectColumnPayload + + """ + Deletes a pull request review. + """ + deletePullRequestReview( + input: DeletePullRequestReviewInput! + ): DeletePullRequestReviewPayload + + """ + Deletes a pull request review comment. + """ + deletePullRequestReviewComment( + input: DeletePullRequestReviewCommentInput! + ): DeletePullRequestReviewCommentPayload + + """ + Dismisses an approved or rejected pull request review. + """ + dismissPullRequestReview( + input: DismissPullRequestReviewInput! + ): DismissPullRequestReviewPayload + + """ + Lock a lockable object + """ + lockLockable(input: LockLockableInput!): LockLockablePayload + + """ + Merge a pull request. + """ + mergePullRequest(input: MergePullRequestInput!): MergePullRequestPayload + + """ + Moves a project card to another place. + """ + moveProjectCard(input: MoveProjectCardInput!): MoveProjectCardPayload + + """ + Moves a project column to another place. + """ + moveProjectColumn(input: MoveProjectColumnInput!): MoveProjectColumnPayload + + """ + Removes assignees from an assignable object. + """ + removeAssigneesFromAssignable( + input: RemoveAssigneesFromAssignableInput! + ): RemoveAssigneesFromAssignablePayload + + """ + Removes labels from a Labelable object. + """ + removeLabelsFromLabelable( + input: RemoveLabelsFromLabelableInput! + ): RemoveLabelsFromLabelablePayload + + """ + Removes outside collaborator from all repositories in an organization. + """ + removeOutsideCollaborator( + input: RemoveOutsideCollaboratorInput! + ): RemoveOutsideCollaboratorPayload + + """ + Removes a reaction from a subject. + """ + removeReaction(input: RemoveReactionInput!): RemoveReactionPayload + + """ + Removes a star from a Starrable. + """ + removeStar(input: RemoveStarInput!): RemoveStarPayload + + """ + Reopen a issue. + """ + reopenIssue(input: ReopenIssueInput!): ReopenIssuePayload + + """ + Reopen a pull request. + """ + reopenPullRequest(input: ReopenPullRequestInput!): ReopenPullRequestPayload + + """ + Set review requests on a pull request. + """ + requestReviews(input: RequestReviewsInput!): RequestReviewsPayload + + """ + Marks a review thread as resolved. + """ + resolveReviewThread( + input: ResolveReviewThreadInput! + ): ResolveReviewThreadPayload + + """ + Submits a pending pull request review. + """ + submitPullRequestReview( + input: SubmitPullRequestReviewInput! + ): SubmitPullRequestReviewPayload + + """ + Unlock a lockable object + """ + unlockLockable(input: UnlockLockableInput!): UnlockLockablePayload + + """ + Unmark an issue as a duplicate of another issue. + """ + unmarkIssueAsDuplicate( + input: UnmarkIssueAsDuplicateInput! + ): UnmarkIssueAsDuplicatePayload + + """ + Marks a review thread as unresolved. + """ + unresolveReviewThread( + input: UnresolveReviewThreadInput! + ): UnresolveReviewThreadPayload + + """ + Create a new branch protection rule + """ + updateBranchProtectionRule( + input: UpdateBranchProtectionRuleInput! + ): UpdateBranchProtectionRulePayload + + """ + Updates an Issue. + """ + updateIssue(input: UpdateIssueInput!): UpdateIssuePayload + + """ + Updates an IssueComment object. + """ + updateIssueComment(input: UpdateIssueCommentInput!): UpdateIssueCommentPayload + + """ + Updates an existing project. + """ + updateProject(input: UpdateProjectInput!): UpdateProjectPayload + + """ + Updates an existing project card. + """ + updateProjectCard(input: UpdateProjectCardInput!): UpdateProjectCardPayload + + """ + Updates an existing project column. + """ + updateProjectColumn( + input: UpdateProjectColumnInput! + ): UpdateProjectColumnPayload + + """ + Update a pull request + """ + updatePullRequest(input: UpdatePullRequestInput!): UpdatePullRequestPayload + + """ + Updates the body of a pull request review. + """ + updatePullRequestReview( + input: UpdatePullRequestReviewInput! + ): UpdatePullRequestReviewPayload + + """ + Updates a pull request review comment. + """ + updatePullRequestReviewComment( + input: UpdatePullRequestReviewCommentInput! + ): UpdatePullRequestReviewCommentPayload + + """ + Updates the state for subscribable subjects. + """ + updateSubscription(input: UpdateSubscriptionInput!): UpdateSubscriptionPayload + + """ + Replaces the repository's topics with the given topics. + """ + updateTopics(input: UpdateTopicsInput!): UpdateTopicsPayload +} + +""" +An object with an ID. +""" +interface Node { + """ + ID of the object. + """ + id: ID! +} + +""" +Possible directions in which to order a list of items when provided an `orderBy` argument. +""" +enum OrderDirection { + """ + Specifies an ascending order for a given `orderBy` argument. + """ + ASC + + """ + Specifies a descending order for a given `orderBy` argument. + """ + DESC +} + +""" +An account on GitHub, with one or more owners, that has repositories, members and teams. +""" +type Organization implements Node & Actor & RegistryPackageOwner & RegistryPackageSearch & ProjectOwner & RepositoryOwner & UniformResourceLocatable & MemberStatusable & ProfileOwner { + """ + Determine if this repository owner has any items that can be pinned to their profile. + """ + anyPinnableItems( + """ + Filter to only a particular kind of pinnable item. + """ + type: PinnableItemType + ): Boolean! + + """ + A URL pointing to the organization's public avatar. + """ + avatarUrl( + """ + The size of the resulting square image. + """ + size: Int + ): URI! + + """ + Identifies the primary key from the database. + """ + databaseId: Int + + """ + The organization's public profile description. + """ + description: String + + """ + The organization's public email. + """ + email: String + id: ID! + + """ + Whether the organization has verified its profile email and website. + """ + isVerified: Boolean! + + """ + Showcases a selection of repositories and gists that the profile owner has + either curated or that have been selected automatically based on popularity. + """ + itemShowcase: ProfileItemShowcase! + + """ + The organization's public profile location. + """ + location: String + + """ + The organization's login name. + """ + login: String! + + """ + Get the status messages members of this entity have set that are either public or visible only to the organization. + """ + memberStatuses( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for user statuses returned from the connection. + """ + orderBy: UserStatusOrder + ): UserStatusConnection! + + """ + A list of users who are members of this organization. + """ + membersWithRole( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): OrganizationMemberConnection! + + """ + The organization's public profile name. + """ + name: String + + """ + The HTTP path creating a new team + """ + newTeamResourcePath: URI! + + """ + The HTTP URL creating a new team + """ + newTeamUrl: URI! + + """ + The billing email for the organization. + """ + organizationBillingEmail: String + + """ + A list of users who have been invited to join this organization. + """ + pendingMembers( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): UserConnection! + + """ + A list of repositories and gists this profile owner can pin to their profile. + """ + pinnableItems( + """ + Filter the types of pinnable items that are returned. + """ + types: [PinnableItemType!] + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): PinnableItemConnection! + + """ + A list of repositories and gists this profile owner has pinned to their profile + """ + pinnedItems( + """ + Filter the types of pinned items that are returned. + """ + types: [PinnableItemType!] + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): PinnableItemConnection! + + """ + Returns how many more items this profile owner can pin to their profile. + """ + pinnedItemsRemaining: Int! + + """ + A list of repositories this user has pinned to their profile + """ + pinnedRepositories( + """ + If non-null, filters repositories according to privacy + """ + privacy: RepositoryPrivacy + + """ + Ordering options for repositories returned from the connection + """ + orderBy: RepositoryOrder + + """ + Array of viewer's affiliation options for repositories returned from the + connection. For example, OWNER will include only repositories that the + current viewer owns. + """ + affiliations: [RepositoryAffiliation] + + """ + Array of owner's affiliation options for repositories returned from the + connection. For example, OWNER will include only repositories that the + organization or user being viewed owns. + """ + ownerAffiliations: [RepositoryAffiliation] + + """ + If non-null, filters repositories according to whether they have been locked + """ + isLocked: Boolean + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): RepositoryConnection! + @deprecated( + reason: "pinnedRepositories will be removed Use ProfileOwner.pinnedItems instead. Removal on 2019-07-01 UTC." + ) + + """ + Find project by number. + """ + project( + """ + The project number to find. + """ + number: Int! + ): Project + + """ + A list of projects under the owner. + """ + projects( + """ + Ordering options for projects returned from the connection + """ + orderBy: ProjectOrder + + """ + Query to search projects by, currently only searching by name. + """ + search: String + + """ + A list of states to filter the projects by. + """ + states: [ProjectState!] + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): ProjectConnection! + + """ + The HTTP path listing organization's projects + """ + projectsResourcePath: URI! + + """ + The HTTP URL listing organization's projects + """ + projectsUrl: URI! + + """ + A list of repositories that the user owns. + """ + repositories( + """ + If non-null, filters repositories according to privacy + """ + privacy: RepositoryPrivacy + + """ + Ordering options for repositories returned from the connection + """ + orderBy: RepositoryOrder + + """ + Array of viewer's affiliation options for repositories returned from the + connection. For example, OWNER will include only repositories that the + current viewer owns. + """ + affiliations: [RepositoryAffiliation] + + """ + Array of owner's affiliation options for repositories returned from the + connection. For example, OWNER will include only repositories that the + organization or user being viewed owns. + """ + ownerAffiliations: [RepositoryAffiliation] + + """ + If non-null, filters repositories according to whether they have been locked + """ + isLocked: Boolean + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + If non-null, filters repositories according to whether they are forks of another repository + """ + isFork: Boolean + ): RepositoryConnection! + + """ + Find Repository. + """ + repository( + """ + Name of Repository to find. + """ + name: String! + ): Repository + + """ + When true the organization requires all members, billing managers, and outside + collaborators to enable two-factor authentication. + """ + requiresTwoFactorAuthentication: Boolean + + """ + The HTTP path for this organization. + """ + resourcePath: URI! + + """ + The Organization's SAML identity providers + """ + samlIdentityProvider: OrganizationIdentityProvider + + """ + Find an organization's team by its slug. + """ + team( + """ + The name or slug of the team to find. + """ + slug: String! + ): Team + + """ + A list of teams in this organization. + """ + teams( + """ + If non-null, filters teams according to privacy + """ + privacy: TeamPrivacy + + """ + If non-null, filters teams according to whether the viewer is an admin or member on team + """ + role: TeamRole + + """ + If non-null, filters teams with query on team name and team slug + """ + query: String + + """ + User logins to filter by + """ + userLogins: [String!] + + """ + Ordering options for teams returned from the connection + """ + orderBy: TeamOrder + + """ + If true, filters teams that are mapped to an LDAP Group (Enterprise only) + """ + ldapMapped: Boolean + + """ + If true, restrict to only root teams + """ + rootTeamsOnly: Boolean = false + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): TeamConnection! + + """ + The HTTP path listing organization's teams + """ + teamsResourcePath: URI! + + """ + The HTTP URL listing organization's teams + """ + teamsUrl: URI! + + """ + The HTTP URL for this organization. + """ + url: URI! + + """ + Organization is adminable by the viewer. + """ + viewerCanAdminister: Boolean! + + """ + Can the viewer pin repositories and gists to the profile? + """ + viewerCanChangePinnedItems: Boolean! + + """ + Can the current viewer create new projects on this owner. + """ + viewerCanCreateProjects: Boolean! + + """ + Viewer can create repositories on this organization + """ + viewerCanCreateRepositories: Boolean! + + """ + Viewer can create teams on this organization. + """ + viewerCanCreateTeams: Boolean! + + """ + Viewer is an active member of this organization. + """ + viewerIsAMember: Boolean! + + """ + The organization's public profile URL. + """ + websiteUrl: URI +} + +""" +The connection type for Organization. +""" +type OrganizationConnection { + """ + A list of edges. + """ + edges: [OrganizationEdge] + + """ + A list of nodes. + """ + nodes: [Organization] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type OrganizationEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: Organization +} + +""" +An Identity Provider configured to provision SAML and SCIM identities for Organizations +""" +type OrganizationIdentityProvider implements Node { + """ + The digest algorithm used to sign SAML requests for the Identity Provider. + """ + digestMethod: URI + + """ + External Identities provisioned by this Identity Provider + """ + externalIdentities( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): ExternalIdentityConnection! + id: ID! + + """ + The x509 certificate used by the Identity Provder to sign assertions and responses. + """ + idpCertificate: X509Certificate + + """ + The Issuer Entity ID for the SAML Identity Provider + """ + issuer: String + + """ + Organization this Identity Provider belongs to + """ + organization: Organization + + """ + The signature algorithm used to sign SAML requests for the Identity Provider. + """ + signatureMethod: URI + + """ + The URL endpoint for the Identity Provider's SAML SSO. + """ + ssoUrl: URI +} + +""" +An Invitation for a user to an organization. +""" +type OrganizationInvitation implements Node { + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + The email address of the user invited to the organization. + """ + email: String + id: ID! + + """ + The type of invitation that was sent (e.g. email, user). + """ + invitationType: OrganizationInvitationType! + + """ + The user who was invited to the organization. + """ + invitee: User + + """ + The user who created the invitation. + """ + inviter: User! + + """ + The organization the invite is for + """ + organization: Organization! + + """ + The user's pending role in the organization (e.g. member, owner). + """ + role: OrganizationInvitationRole! +} + +""" +The connection type for OrganizationInvitation. +""" +type OrganizationInvitationConnection { + """ + A list of edges. + """ + edges: [OrganizationInvitationEdge] + + """ + A list of nodes. + """ + nodes: [OrganizationInvitation] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type OrganizationInvitationEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: OrganizationInvitation +} + +""" +The possible organization invitation roles. +""" +enum OrganizationInvitationRole { + """ + The user is invited to be a direct member of the organization. + """ + DIRECT_MEMBER + + """ + The user is invited to be an admin of the organization. + """ + ADMIN + + """ + The user is invited to be a billing manager of the organization. + """ + BILLING_MANAGER + + """ + The user's previous role will be reinstated. + """ + REINSTATE +} + +""" +The possible organization invitation types. +""" +enum OrganizationInvitationType { + """ + The invitation was to an existing user. + """ + USER + + """ + The invitation was to an email address. + """ + EMAIL +} + +""" +The connection type for User. +""" +type OrganizationMemberConnection { + """ + A list of edges. + """ + edges: [OrganizationMemberEdge] + + """ + A list of nodes. + """ + nodes: [User] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +Represents a user within an organization. +""" +type OrganizationMemberEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + Whether the organization member has two factor enabled or not. Returns null if information is not available to viewer. + """ + hasTwoFactorEnabled: Boolean + + """ + The item at the end of the edge. + """ + node: User + + """ + The role this user has in the organization. + """ + role: OrganizationMemberRole +} + +""" +The possible roles within an organization for its members. +""" +enum OrganizationMemberRole { + """ + The user is a member of the organization. + """ + MEMBER + + """ + The user is an administrator of the organization. + """ + ADMIN +} + +""" +Information about pagination in a connection. +""" +type PageInfo { + """ + When paginating forwards, the cursor to continue. + """ + endCursor: String + + """ + When paginating forwards, are there more items? + """ + hasNextPage: Boolean! + + """ + When paginating backwards, are there more items? + """ + hasPreviousPage: Boolean! + + """ + When paginating backwards, the cursor to continue. + """ + startCursor: String +} + +""" +Types that can grant permissions on a repository to a user +""" +union PermissionGranter = Organization | Repository | Team + +""" +A level of permission and source for a user's access to a repository. +""" +type PermissionSource { + """ + The organization the repository belongs to. + """ + organization: Organization! + + """ + The level of access this source has granted to the user. + """ + permission: DefaultRepositoryPermissionField! + + """ + The source of this permission. + """ + source: PermissionGranter! +} + +""" +Autogenerated input type of PinIssue +""" +input PinIssueInput { + """ + The ID of the issue to be pinned + """ + issueId: ID! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Types that can be pinned to a profile page. +""" +union PinnableItem = Gist | Repository + +""" +The connection type for PinnableItem. +""" +type PinnableItemConnection { + """ + A list of edges. + """ + edges: [PinnableItemEdge] + + """ + A list of nodes. + """ + nodes: [PinnableItem] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type PinnableItemEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: PinnableItem +} + +""" +Represents items that can be pinned to a profile page or dashboard. +""" +enum PinnableItemType { + """ + A repository. + """ + REPOSITORY + + """ + A gist. + """ + GIST + + """ + An issue. + """ + ISSUE +} + +""" +Represents a 'pinned' event on a given issue or pull request. +""" +type PinnedEvent implements Node { + """ + Identifies the actor who performed the event. + """ + actor: Actor + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + id: ID! + + """ + Identifies the issue associated with the event. + """ + issue: Issue! +} + +""" +A curatable list of repositories relating to a repository owner, which defaults +to showing the most popular repositories they own. +""" +type ProfileItemShowcase { + """ + Whether or not the owner has pinned any repositories or gists. + """ + hasPinnedItems: Boolean! + + """ + The repositories and gists in the showcase. If the profile owner has any + pinned items, those will be returned. Otherwise, the profile owner's popular + repositories will be returned. + """ + items( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): PinnableItemConnection! +} + +""" +Represents any entity on GitHub that has a profile page. +""" +interface ProfileOwner { + """ + Determine if this repository owner has any items that can be pinned to their profile. + """ + anyPinnableItems( + """ + Filter to only a particular kind of pinnable item. + """ + type: PinnableItemType + ): Boolean! + + """ + The public profile email. + """ + email: String + id: ID! + + """ + Showcases a selection of repositories and gists that the profile owner has + either curated or that have been selected automatically based on popularity. + """ + itemShowcase: ProfileItemShowcase! + + """ + The public profile location. + """ + location: String + + """ + The username used to login. + """ + login: String! + + """ + The public profile name. + """ + name: String + + """ + A list of repositories and gists this profile owner can pin to their profile. + """ + pinnableItems( + """ + Filter the types of pinnable items that are returned. + """ + types: [PinnableItemType!] + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): PinnableItemConnection! + + """ + A list of repositories and gists this profile owner has pinned to their profile + """ + pinnedItems( + """ + Filter the types of pinned items that are returned. + """ + types: [PinnableItemType!] + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): PinnableItemConnection! + + """ + Returns how many more items this profile owner can pin to their profile. + """ + pinnedItemsRemaining: Int! + + """ + Can the viewer pin repositories and gists to the profile? + """ + viewerCanChangePinnedItems: Boolean! + + """ + The public profile website URL. + """ + websiteUrl: URI +} + +""" +Projects manage issues, pull requests and notes within a project owner. +""" +type Project implements Node & Closable & Updatable { + """ + The project's description body. + """ + body: String + + """ + The projects description body rendered to HTML. + """ + bodyHTML: HTML! + + """ + `true` if the object is closed (definition of closed may depend on type) + """ + closed: Boolean! + + """ + Identifies the date and time when the object was closed. + """ + closedAt: DateTime + + """ + List of columns in the project + """ + columns( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): ProjectColumnConnection! + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + The actor who originally created the project. + """ + creator: Actor + + """ + Identifies the primary key from the database. + """ + databaseId: Int + id: ID! + + """ + The project's name. + """ + name: String! + + """ + The project's number. + """ + number: Int! + + """ + The project's owner. Currently limited to repositories, organizations, and users. + """ + owner: ProjectOwner! + + """ + List of pending cards in this project + """ + pendingCards( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + A list of archived states to filter the cards by + """ + archivedStates: [ProjectCardArchivedState] + ): ProjectCardConnection! + + """ + The HTTP path for this project + """ + resourcePath: URI! + + """ + Whether the project is open or closed. + """ + state: ProjectState! + + """ + Identifies the date and time when the object was last updated. + """ + updatedAt: DateTime! + + """ + The HTTP URL for this project + """ + url: URI! + + """ + Check if the current viewer can update this object. + """ + viewerCanUpdate: Boolean! +} + +""" +A card in a project. +""" +type ProjectCard implements Node { + """ + The project column this card is associated under. A card may only belong to one + project column at a time. The column field will be null if the card is created + in a pending state and has yet to be associated with a column. Once cards are + associated with a column, they will not become pending in the future. + """ + column: ProjectColumn + + """ + The card content item + """ + content: ProjectCardItem + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + The actor who created this card + """ + creator: Actor + + """ + Identifies the primary key from the database. + """ + databaseId: Int + id: ID! + + """ + Whether the card is archived + """ + isArchived: Boolean! + + """ + The card note + """ + note: String + + """ + The project that contains this card. + """ + project: Project! + + """ + The HTTP path for this card + """ + resourcePath: URI! + + """ + The state of ProjectCard + """ + state: ProjectCardState + + """ + Identifies the date and time when the object was last updated. + """ + updatedAt: DateTime! + + """ + The HTTP URL for this card + """ + url: URI! +} + +""" +The possible archived states of a project card. +""" +enum ProjectCardArchivedState { + """ + A project card that is archived + """ + ARCHIVED + + """ + A project card that is not archived + """ + NOT_ARCHIVED +} + +""" +The connection type for ProjectCard. +""" +type ProjectCardConnection { + """ + A list of edges. + """ + edges: [ProjectCardEdge] + + """ + A list of nodes. + """ + nodes: [ProjectCard] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type ProjectCardEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: ProjectCard +} + +""" +An issue or PR and its owning repository to be used in a project card. +""" +input ProjectCardImport { + """ + Repository name with owner (owner/repository). + """ + repository: String! + + """ + The issue or pull request number. + """ + number: Int! +} + +""" +Types that can be inside Project Cards. +""" +union ProjectCardItem = Issue | PullRequest + +""" +Various content states of a ProjectCard +""" +enum ProjectCardState { + """ + The card has content only. + """ + CONTENT_ONLY + + """ + The card has a note only. + """ + NOTE_ONLY + + """ + The card is redacted. + """ + REDACTED +} + +""" +A column inside a project. +""" +type ProjectColumn implements Node { + """ + List of cards in the column + """ + cards( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + A list of archived states to filter the cards by + """ + archivedStates: [ProjectCardArchivedState] + ): ProjectCardConnection! + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + Identifies the primary key from the database. + """ + databaseId: Int + id: ID! + + """ + The project column's name. + """ + name: String! + + """ + The project that contains this column. + """ + project: Project! + + """ + The semantic purpose of the column + """ + purpose: ProjectColumnPurpose + + """ + The HTTP path for this project column + """ + resourcePath: URI! + + """ + Identifies the date and time when the object was last updated. + """ + updatedAt: DateTime! + + """ + The HTTP URL for this project column + """ + url: URI! +} + +""" +The connection type for ProjectColumn. +""" +type ProjectColumnConnection { + """ + A list of edges. + """ + edges: [ProjectColumnEdge] + + """ + A list of nodes. + """ + nodes: [ProjectColumn] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type ProjectColumnEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: ProjectColumn +} + +""" +A project column and a list of its issues and PRs. +""" +input ProjectColumnImport { + """ + The name of the column. + """ + columnName: String! + + """ + The position of the column, starting from 0. + """ + position: Int! + + """ + A list of issues and pull requests in the column. + """ + issues: [ProjectCardImport!] +} + +""" +The semantic purpose of the column - todo, in progress, or done. +""" +enum ProjectColumnPurpose { + """ + The column contains cards still to be worked on + """ + TODO + + """ + The column contains cards which are currently being worked on + """ + IN_PROGRESS + + """ + The column contains cards which are complete + """ + DONE +} + +""" +A list of projects associated with the owner. +""" +type ProjectConnection { + """ + A list of edges. + """ + edges: [ProjectEdge] + + """ + A list of nodes. + """ + nodes: [Project] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type ProjectEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: Project +} + +""" +Ways in which lists of projects can be ordered upon return. +""" +input ProjectOrder { + """ + The field in which to order projects by. + """ + field: ProjectOrderField! + + """ + The direction in which to order projects by the specified field. + """ + direction: OrderDirection! +} + +""" +Properties by which project connections can be ordered. +""" +enum ProjectOrderField { + """ + Order projects by creation time + """ + CREATED_AT + + """ + Order projects by update time + """ + UPDATED_AT + + """ + Order projects by name + """ + NAME +} + +""" +Represents an owner of a Project. +""" +interface ProjectOwner { + id: ID! + + """ + Find project by number. + """ + project( + """ + The project number to find. + """ + number: Int! + ): Project + + """ + A list of projects under the owner. + """ + projects( + """ + Ordering options for projects returned from the connection + """ + orderBy: ProjectOrder + + """ + Query to search projects by, currently only searching by name. + """ + search: String + + """ + A list of states to filter the projects by. + """ + states: [ProjectState!] + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): ProjectConnection! + + """ + The HTTP path listing owners projects + """ + projectsResourcePath: URI! + + """ + The HTTP URL listing owners projects + """ + projectsUrl: URI! + + """ + Can the current viewer create new projects on this owner. + """ + viewerCanCreateProjects: Boolean! +} + +""" +State of the project; either 'open' or 'closed' +""" +enum ProjectState { + """ + The project is open. + """ + OPEN + + """ + The project is closed. + """ + CLOSED +} + +""" +A user's public key. +""" +type PublicKey implements Node { + """ + The last time this authorization was used to perform an action + """ + accessedAt: DateTime + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + The fingerprint for this PublicKey + """ + fingerprint: String + id: ID! + + """ + Whether this PublicKey is read-only or not + """ + isReadOnly: Boolean! + + """ + The public key string + """ + key: String! + + """ + Identifies the date and time when the object was last updated. + """ + updatedAt: DateTime! +} + +""" +The connection type for PublicKey. +""" +type PublicKeyConnection { + """ + A list of edges. + """ + edges: [PublicKeyEdge] + + """ + A list of nodes. + """ + nodes: [PublicKey] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type PublicKeyEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: PublicKey +} + +""" +A repository pull request. +""" +type PullRequest implements Node & Assignable & Closable & Comment & Updatable & UpdatableComment & Labelable & Lockable & Reactable & RepositoryNode & Subscribable & UniformResourceLocatable { + """ + Reason that the conversation was locked. + """ + activeLockReason: LockReason + + """ + The number of additions in this pull request. + """ + additions: Int! + + """ + A list of Users assigned to this object. + """ + assignees( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): UserConnection! + + """ + The actor who authored the comment. + """ + author: Actor + + """ + Author's association with the subject of the comment. + """ + authorAssociation: CommentAuthorAssociation! + + """ + Identifies the base Ref associated with the pull request. + """ + baseRef: Ref + + """ + Identifies the name of the base Ref associated with the pull request, even if the ref has been deleted. + """ + baseRefName: String! + + """ + Identifies the oid of the base ref associated with the pull request, even if the ref has been deleted. + """ + baseRefOid: GitObjectID! + + """ + The repository associated with this pull request's base Ref. + """ + baseRepository: Repository + + """ + The body as Markdown. + """ + body: String! + + """ + The body rendered to HTML. + """ + bodyHTML: HTML! + + """ + The body rendered to text. + """ + bodyText: String! + + """ + The number of changed files in this pull request. + """ + changedFiles: Int! + + """ + `true` if the pull request is closed + """ + closed: Boolean! + + """ + Identifies the date and time when the object was closed. + """ + closedAt: DateTime + + """ + A list of comments associated with the pull request. + """ + comments( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): IssueCommentConnection! + + """ + A list of commits present in this pull request's head branch not present in the base branch. + """ + commits( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): PullRequestCommitConnection! + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + Check if this comment was created via an email reply. + """ + createdViaEmail: Boolean! + + """ + Identifies the primary key from the database. + """ + databaseId: Int + + """ + The number of deletions in this pull request. + """ + deletions: Int! + + """ + The actor who edited this pull request's body. + """ + editor: Actor + + """ + Lists the files changed within this pull request. + """ + files( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): PullRequestChangedFileConnection + + """ + Identifies the head Ref associated with the pull request. + """ + headRef: Ref + + """ + Identifies the name of the head Ref associated with the pull request, even if the ref has been deleted. + """ + headRefName: String! + + """ + Identifies the oid of the head ref associated with the pull request, even if the ref has been deleted. + """ + headRefOid: GitObjectID! + + """ + The repository associated with this pull request's head Ref. + """ + headRepository: Repository + + """ + The owner of the repository associated with this pull request's head Ref. + """ + headRepositoryOwner: RepositoryOwner + id: ID! + + """ + Check if this comment was edited and includes an edit with the creation data + """ + includesCreatedEdit: Boolean! + + """ + The head and base repositories are different. + """ + isCrossRepository: Boolean! + + """ + A list of labels associated with the object. + """ + labels( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): LabelConnection + + """ + The moment the editor made the last edit + """ + lastEditedAt: DateTime + + """ + `true` if the pull request is locked + """ + locked: Boolean! + + """ + Indicates whether maintainers can modify the pull request. + """ + maintainerCanModify: Boolean! + + """ + The commit that was created when this pull request was merged. + """ + mergeCommit: Commit + + """ + Whether or not the pull request can be merged based on the existence of merge conflicts. + """ + mergeable: MergeableState! + + """ + Whether or not the pull request was merged. + """ + merged: Boolean! + + """ + The date and time that the pull request was merged. + """ + mergedAt: DateTime + + """ + The actor who merged the pull request. + """ + mergedBy: Actor + + """ + Identifies the milestone associated with the pull request. + """ + milestone: Milestone + + """ + Identifies the pull request number. + """ + number: Int! + + """ + A list of Users that are participating in the Pull Request conversation. + """ + participants( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): UserConnection! + + """ + The permalink to the pull request. + """ + permalink: URI! + + """ + The commit that GitHub automatically generated to test if this pull request + could be merged. This field will not return a value if the pull request is + merged, or if the test merge commit is still being generated. See the + `mergeable` field for more details on the mergeability of the pull request. + """ + potentialMergeCommit: Commit + + """ + List of project cards associated with this pull request. + """ + projectCards( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + A list of archived states to filter the cards by + """ + archivedStates: [ProjectCardArchivedState] + ): ProjectCardConnection! + + """ + Identifies when the comment was published at. + """ + publishedAt: DateTime + + """ + A list of reactions grouped by content left on the subject. + """ + reactionGroups: [ReactionGroup!] + + """ + A list of Reactions left on the Issue. + """ + reactions( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Allows filtering Reactions by emoji. + """ + content: ReactionContent + + """ + Allows specifying the order in which reactions are returned. + """ + orderBy: ReactionOrder + ): ReactionConnection! + + """ + The repository associated with this node. + """ + repository: Repository! + + """ + The HTTP path for this pull request. + """ + resourcePath: URI! + + """ + The HTTP path for reverting this pull request. + """ + revertResourcePath: URI! + + """ + The HTTP URL for reverting this pull request. + """ + revertUrl: URI! + + """ + A list of review requests associated with the pull request. + """ + reviewRequests( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): ReviewRequestConnection + + """ + The list of all review threads for this pull request. + """ + reviewThreads( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): PullRequestReviewThreadConnection! + + """ + A list of reviews associated with the pull request. + """ + reviews( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + A list of states to filter the reviews. + """ + states: [PullRequestReviewState!] + + """ + Filter by author of the review. + """ + author: String + ): PullRequestReviewConnection + + """ + Identifies the state of the pull request. + """ + state: PullRequestState! + + """ + A list of reviewer suggestions based on commit history and past review comments. + """ + suggestedReviewers: [SuggestedReviewer]! + + """ + A list of events, comments, commits, etc. associated with the pull request. + """ + timeline( + """ + Allows filtering timeline events by a `since` timestamp. + """ + since: DateTime + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): PullRequestTimelineConnection! + + """ + A list of events, comments, commits, etc. associated with the pull request. + """ + timelineItems( + """ + Filter timeline items by a `since` timestamp. + """ + since: DateTime + + """ + Skips the first _n_ elements in the list. + """ + skip: Int + + """ + Filter timeline items by type. + """ + itemTypes: [PullRequestTimelineItemsItemType!] + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): PullRequestTimelineItemsConnection! + + """ + Identifies the pull request title. + """ + title: String! + + """ + Identifies the date and time when the object was last updated. + """ + updatedAt: DateTime! + + """ + The HTTP URL for this pull request. + """ + url: URI! + + """ + A list of edits to this content. + """ + userContentEdits( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): UserContentEditConnection + + """ + Whether or not the viewer can apply suggestion. + """ + viewerCanApplySuggestion: Boolean! + + """ + Can user react to this subject + """ + viewerCanReact: Boolean! + + """ + Check if the viewer is able to change their subscription status for the repository. + """ + viewerCanSubscribe: Boolean! + + """ + Check if the current viewer can update this object. + """ + viewerCanUpdate: Boolean! + + """ + Reasons why the current viewer can not update this comment. + """ + viewerCannotUpdateReasons: [CommentCannotUpdateReason!]! + + """ + Did the viewer author this comment. + """ + viewerDidAuthor: Boolean! + + """ + Identifies if the viewer is watching, not watching, or ignoring the subscribable entity. + """ + viewerSubscription: SubscriptionState +} + +""" +A file changed in a pull request. +""" +type PullRequestChangedFile { + """ + The number of additions to the file. + """ + additions: Int! + + """ + The number of deletions to the file. + """ + deletions: Int! + + """ + The path of the file. + """ + path: String! +} + +""" +The connection type for PullRequestChangedFile. +""" +type PullRequestChangedFileConnection { + """ + A list of edges. + """ + edges: [PullRequestChangedFileEdge] + + """ + A list of nodes. + """ + nodes: [PullRequestChangedFile] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type PullRequestChangedFileEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: PullRequestChangedFile +} + +""" +Represents a Git commit part of a pull request. +""" +type PullRequestCommit implements Node & UniformResourceLocatable { + """ + The Git commit object + """ + commit: Commit! + id: ID! + + """ + The pull request this commit belongs to + """ + pullRequest: PullRequest! + + """ + The HTTP path for this pull request commit + """ + resourcePath: URI! + + """ + The HTTP URL for this pull request commit + """ + url: URI! +} + +""" +Represents a commit comment thread part of a pull request. +""" +type PullRequestCommitCommentThread implements Node & RepositoryNode { + """ + The comments that exist in this thread. + """ + comments( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): CommitCommentConnection! + + """ + The commit the comments were made on. + """ + commit: Commit! + id: ID! + + """ + The file the comments were made on. + """ + path: String + + """ + The position in the diff for the commit that the comment was made on. + """ + position: Int + + """ + The pull request this commit comment thread belongs to + """ + pullRequest: PullRequest! + + """ + The repository associated with this node. + """ + repository: Repository! +} + +""" +The connection type for PullRequestCommit. +""" +type PullRequestCommitConnection { + """ + A list of edges. + """ + edges: [PullRequestCommitEdge] + + """ + A list of nodes. + """ + nodes: [PullRequestCommit] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type PullRequestCommitEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: PullRequestCommit +} + +""" +The connection type for PullRequest. +""" +type PullRequestConnection { + """ + A list of edges. + """ + edges: [PullRequestEdge] + + """ + A list of nodes. + """ + nodes: [PullRequest] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +This aggregates pull requests opened by a user within one repository. +""" +type PullRequestContributionsByRepository { + """ + The pull request contributions. + """ + contributions( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for contributions returned from the connection. + """ + orderBy: ContributionOrder + ): CreatedPullRequestContributionConnection! + + """ + The repository in which the pull requests were opened. + """ + repository: Repository! +} + +""" +An edge in a connection. +""" +type PullRequestEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: PullRequest +} + +""" +Ways in which lists of issues can be ordered upon return. +""" +input PullRequestOrder { + """ + The field in which to order pull requests by. + """ + field: PullRequestOrderField! + + """ + The direction in which to order pull requests by the specified field. + """ + direction: OrderDirection! +} + +""" +Properties by which pull_requests connections can be ordered. +""" +enum PullRequestOrderField { + """ + Order pull_requests by creation time + """ + CREATED_AT + + """ + Order pull_requests by update time + """ + UPDATED_AT +} + +""" +The possible PubSub channels for a pull request. +""" +enum PullRequestPubSubTopic { + """ + The channel ID for observing pull request updates. + """ + UPDATED + + """ + The channel ID for marking an pull request as read. + """ + MARKASREAD + + """ + The channel ID for observing head ref updates. + """ + HEAD_REF + + """ + The channel ID for updating items on the pull request timeline. + """ + TIMELINE + + """ + The channel ID for observing pull request state updates. + """ + STATE +} + +""" +A review object for a given pull request. +""" +type PullRequestReview implements Node & Comment & Deletable & Updatable & UpdatableComment & Reactable & RepositoryNode { + """ + The actor who authored the comment. + """ + author: Actor + + """ + Author's association with the subject of the comment. + """ + authorAssociation: CommentAuthorAssociation! + + """ + Identifies the pull request review body. + """ + body: String! + + """ + The body of this review rendered to HTML. + """ + bodyHTML: HTML! + + """ + The body of this review rendered as plain text. + """ + bodyText: String! + + """ + A list of review comments for the current pull request review. + """ + comments( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): PullRequestReviewCommentConnection! + + """ + Identifies the commit associated with this pull request review. + """ + commit: Commit + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + Check if this comment was created via an email reply. + """ + createdViaEmail: Boolean! + + """ + Identifies the primary key from the database. + """ + databaseId: Int + + """ + The actor who edited the comment. + """ + editor: Actor + id: ID! + + """ + Check if this comment was edited and includes an edit with the creation data + """ + includesCreatedEdit: Boolean! + + """ + The moment the editor made the last edit + """ + lastEditedAt: DateTime + + """ + A list of teams that this review was made on behalf of. + """ + onBehalfOf( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): TeamConnection! + + """ + Identifies when the comment was published at. + """ + publishedAt: DateTime + + """ + Identifies the pull request associated with this pull request review. + """ + pullRequest: PullRequest! + + """ + A list of reactions grouped by content left on the subject. + """ + reactionGroups: [ReactionGroup!] + + """ + A list of Reactions left on the Issue. + """ + reactions( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Allows filtering Reactions by emoji. + """ + content: ReactionContent + + """ + Allows specifying the order in which reactions are returned. + """ + orderBy: ReactionOrder + ): ReactionConnection! + + """ + The repository associated with this node. + """ + repository: Repository! + + """ + The HTTP path permalink for this PullRequestReview. + """ + resourcePath: URI! + + """ + Identifies the current state of the pull request review. + """ + state: PullRequestReviewState! + + """ + Identifies when the Pull Request Review was submitted + """ + submittedAt: DateTime + + """ + Identifies the date and time when the object was last updated. + """ + updatedAt: DateTime! + + """ + The HTTP URL permalink for this PullRequestReview. + """ + url: URI! + + """ + A list of edits to this content. + """ + userContentEdits( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): UserContentEditConnection + + """ + Check if the current viewer can delete this object. + """ + viewerCanDelete: Boolean! + + """ + Can user react to this subject + """ + viewerCanReact: Boolean! + + """ + Check if the current viewer can update this object. + """ + viewerCanUpdate: Boolean! + + """ + Reasons why the current viewer can not update this comment. + """ + viewerCannotUpdateReasons: [CommentCannotUpdateReason!]! + + """ + Did the viewer author this comment. + """ + viewerDidAuthor: Boolean! +} + +""" +A review comment associated with a given repository pull request. +""" +type PullRequestReviewComment implements Node & Comment & Deletable & Updatable & UpdatableComment & Reactable & RepositoryNode { + """ + The actor who authored the comment. + """ + author: Actor + + """ + Author's association with the subject of the comment. + """ + authorAssociation: CommentAuthorAssociation! + + """ + The comment body of this review comment. + """ + body: String! + + """ + The comment body of this review comment rendered to HTML. + """ + bodyHTML: HTML! + + """ + The comment body of this review comment rendered as plain text. + """ + bodyText: String! + + """ + Identifies the commit associated with the comment. + """ + commit: Commit! + + """ + Identifies when the comment was created. + """ + createdAt: DateTime! + + """ + Check if this comment was created via an email reply. + """ + createdViaEmail: Boolean! + + """ + Identifies the primary key from the database. + """ + databaseId: Int + + """ + The diff hunk to which the comment applies. + """ + diffHunk: String! + + """ + Identifies when the comment was created in a draft state. + """ + draftedAt: DateTime! + + """ + The actor who edited the comment. + """ + editor: Actor + id: ID! + + """ + Check if this comment was edited and includes an edit with the creation data + """ + includesCreatedEdit: Boolean! + + """ + Returns whether or not a comment has been minimized. + """ + isMinimized: Boolean! + + """ + The moment the editor made the last edit + """ + lastEditedAt: DateTime + + """ + Returns why the comment was minimized. + """ + minimizedReason: String + + """ + Identifies the original commit associated with the comment. + """ + originalCommit: Commit + + """ + The original line index in the diff to which the comment applies. + """ + originalPosition: Int! + + """ + Identifies when the comment body is outdated + """ + outdated: Boolean! + + """ + The path to which the comment applies. + """ + path: String! + + """ + The line index in the diff to which the comment applies. + """ + position: Int + + """ + Identifies when the comment was published at. + """ + publishedAt: DateTime + + """ + The pull request associated with this review comment. + """ + pullRequest: PullRequest! + + """ + The pull request review associated with this review comment. + """ + pullRequestReview: PullRequestReview + + """ + A list of reactions grouped by content left on the subject. + """ + reactionGroups: [ReactionGroup!] + + """ + A list of Reactions left on the Issue. + """ + reactions( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Allows filtering Reactions by emoji. + """ + content: ReactionContent + + """ + Allows specifying the order in which reactions are returned. + """ + orderBy: ReactionOrder + ): ReactionConnection! + + """ + The comment this is a reply to. + """ + replyTo: PullRequestReviewComment + + """ + The repository associated with this node. + """ + repository: Repository! + + """ + The HTTP path permalink for this review comment. + """ + resourcePath: URI! + + """ + Identifies the state of the comment. + """ + state: PullRequestReviewCommentState! + + """ + Identifies when the comment was last updated. + """ + updatedAt: DateTime! + + """ + The HTTP URL permalink for this review comment. + """ + url: URI! + + """ + A list of edits to this content. + """ + userContentEdits( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): UserContentEditConnection + + """ + Check if the current viewer can delete this object. + """ + viewerCanDelete: Boolean! + + """ + Check if the current viewer can minimize this object. + """ + viewerCanMinimize: Boolean! + + """ + Can user react to this subject + """ + viewerCanReact: Boolean! + + """ + Check if the current viewer can update this object. + """ + viewerCanUpdate: Boolean! + + """ + Reasons why the current viewer can not update this comment. + """ + viewerCannotUpdateReasons: [CommentCannotUpdateReason!]! + + """ + Did the viewer author this comment. + """ + viewerDidAuthor: Boolean! +} + +""" +The connection type for PullRequestReviewComment. +""" +type PullRequestReviewCommentConnection { + """ + A list of edges. + """ + edges: [PullRequestReviewCommentEdge] + + """ + A list of nodes. + """ + nodes: [PullRequestReviewComment] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type PullRequestReviewCommentEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: PullRequestReviewComment +} + +""" +The possible states of a pull request review comment. +""" +enum PullRequestReviewCommentState { + """ + A comment that is part of a pending review + """ + PENDING + + """ + A comment that is part of a submitted review + """ + SUBMITTED +} + +""" +The connection type for PullRequestReview. +""" +type PullRequestReviewConnection { + """ + A list of edges. + """ + edges: [PullRequestReviewEdge] + + """ + A list of nodes. + """ + nodes: [PullRequestReview] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +This aggregates pull request reviews made by a user within one repository. +""" +type PullRequestReviewContributionsByRepository { + """ + The pull request review contributions. + """ + contributions( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for contributions returned from the connection. + """ + orderBy: ContributionOrder + ): CreatedPullRequestReviewContributionConnection! + + """ + The repository in which the pull request reviews were made. + """ + repository: Repository! +} + +""" +An edge in a connection. +""" +type PullRequestReviewEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: PullRequestReview +} + +""" +The possible events to perform on a pull request review. +""" +enum PullRequestReviewEvent { + """ + Submit general feedback without explicit approval. + """ + COMMENT + + """ + Submit feedback and approve merging these changes. + """ + APPROVE + + """ + Submit feedback that must be addressed before merging. + """ + REQUEST_CHANGES + + """ + Dismiss review so it now longer effects merging. + """ + DISMISS +} + +""" +The possible states of a pull request review. +""" +enum PullRequestReviewState { + """ + A review that has not yet been submitted. + """ + PENDING + + """ + An informational review. + """ + COMMENTED + + """ + A review allowing the pull request to merge. + """ + APPROVED + + """ + A review blocking the pull request from merging. + """ + CHANGES_REQUESTED + + """ + A review that has been dismissed. + """ + DISMISSED +} + +""" +A threaded list of comments for a given pull request. +""" +type PullRequestReviewThread implements Node { + """ + A list of pull request comments associated with the thread. + """ + comments( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): PullRequestReviewCommentConnection! + id: ID! + + """ + Whether this thread has been resolved + """ + isResolved: Boolean! + + """ + Identifies the pull request associated with this thread. + """ + pullRequest: PullRequest! + + """ + Identifies the repository associated with this thread. + """ + repository: Repository! + + """ + The user who resolved this thread + """ + resolvedBy: User + + """ + Whether or not the viewer can resolve this thread + """ + viewerCanResolve: Boolean! + + """ + Whether or not the viewer can unresolve this thread + """ + viewerCanUnresolve: Boolean! +} + +""" +Review comment threads for a pull request review. +""" +type PullRequestReviewThreadConnection { + """ + A list of edges. + """ + edges: [PullRequestReviewThreadEdge] + + """ + A list of nodes. + """ + nodes: [PullRequestReviewThread] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type PullRequestReviewThreadEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: PullRequestReviewThread +} + +""" +Represents the latest point in the pull request timeline for which the viewer has seen the pull request's commits. +""" +type PullRequestRevisionMarker { + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + The last commit the viewer has seen. + """ + lastSeenCommit: Commit! + + """ + The pull request to which the marker belongs. + """ + pullRequest: PullRequest! +} + +""" +The possible states of a pull request. +""" +enum PullRequestState { + """ + A pull request that is still open. + """ + OPEN + + """ + A pull request that has been closed without being merged. + """ + CLOSED + + """ + A pull request that has been closed by being merged. + """ + MERGED +} + +""" +The connection type for PullRequestTimelineItem. +""" +type PullRequestTimelineConnection { + """ + A list of edges. + """ + edges: [PullRequestTimelineItemEdge] + + """ + A list of nodes. + """ + nodes: [PullRequestTimelineItem] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An item in an pull request timeline +""" +union PullRequestTimelineItem = + Commit + | CommitCommentThread + | PullRequestReview + | PullRequestReviewThread + | PullRequestReviewComment + | IssueComment + | ClosedEvent + | ReopenedEvent + | SubscribedEvent + | UnsubscribedEvent + | MergedEvent + | ReferencedEvent + | CrossReferencedEvent + | AssignedEvent + | UnassignedEvent + | LabeledEvent + | UnlabeledEvent + | MilestonedEvent + | DemilestonedEvent + | RenamedTitleEvent + | LockedEvent + | UnlockedEvent + | DeployedEvent + | DeploymentEnvironmentChangedEvent + | HeadRefDeletedEvent + | HeadRefRestoredEvent + | HeadRefForcePushedEvent + | BaseRefForcePushedEvent + | ReviewRequestedEvent + | ReviewRequestRemovedEvent + | ReviewDismissedEvent + | UserBlockedEvent + +""" +An edge in a connection. +""" +type PullRequestTimelineItemEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: PullRequestTimelineItem +} + +""" +An item in a pull request timeline +""" +union PullRequestTimelineItems = + PullRequestCommit + | PullRequestCommitCommentThread + | PullRequestReview + | PullRequestReviewThread + | PullRequestRevisionMarker + | BaseRefChangedEvent + | BaseRefForcePushedEvent + | DeployedEvent + | DeploymentEnvironmentChangedEvent + | HeadRefDeletedEvent + | HeadRefForcePushedEvent + | HeadRefRestoredEvent + | MergedEvent + | ReviewDismissedEvent + | ReviewRequestedEvent + | ReviewRequestRemovedEvent + | IssueComment + | CrossReferencedEvent + | AddedToProjectEvent + | AssignedEvent + | ClosedEvent + | CommentDeletedEvent + | ConvertedNoteToIssueEvent + | DemilestonedEvent + | LabeledEvent + | LockedEvent + | MentionedEvent + | MilestonedEvent + | MovedColumnsInProjectEvent + | PinnedEvent + | ReferencedEvent + | RemovedFromProjectEvent + | RenamedTitleEvent + | ReopenedEvent + | SubscribedEvent + | TransferredEvent + | UnassignedEvent + | UnlabeledEvent + | UnlockedEvent + | UserBlockedEvent + | UnpinnedEvent + | UnsubscribedEvent + +""" +The connection type for PullRequestTimelineItems. +""" +type PullRequestTimelineItemsConnection { + """ + A list of edges. + """ + edges: [PullRequestTimelineItemsEdge] + + """ + Identifies the count of items after applying `before` and `after` filters. + """ + filteredCount: Int! + + """ + A list of nodes. + """ + nodes: [PullRequestTimelineItems] + + """ + Identifies the count of items after applying `before`/`after` filters and `first`/`last`/`skip` slicing. + """ + pageCount: Int! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! + + """ + Identifies the date and time when the timeline was last updated. + """ + updatedAt: DateTime! +} + +""" +An edge in a connection. +""" +type PullRequestTimelineItemsEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: PullRequestTimelineItems +} + +""" +The possible item types found in a timeline. +""" +enum PullRequestTimelineItemsItemType { + """ + Represents a Git commit part of a pull request. + """ + PULL_REQUEST_COMMIT + + """ + Represents a commit comment thread part of a pull request. + """ + PULL_REQUEST_COMMIT_COMMENT_THREAD + + """ + A review object for a given pull request. + """ + PULL_REQUEST_REVIEW + + """ + A threaded list of comments for a given pull request. + """ + PULL_REQUEST_REVIEW_THREAD + + """ + Represents the latest point in the pull request timeline for which the viewer has seen the pull request's commits. + """ + PULL_REQUEST_REVISION_MARKER + + """ + Represents a 'base_ref_changed' event on a given issue or pull request. + """ + BASE_REF_CHANGED_EVENT + + """ + Represents a 'base_ref_force_pushed' event on a given pull request. + """ + BASE_REF_FORCE_PUSHED_EVENT + + """ + Represents a 'deployed' event on a given pull request. + """ + DEPLOYED_EVENT + + """ + Represents a 'deployment_environment_changed' event on a given pull request. + """ + DEPLOYMENT_ENVIRONMENT_CHANGED_EVENT + + """ + Represents a 'head_ref_deleted' event on a given pull request. + """ + HEAD_REF_DELETED_EVENT + + """ + Represents a 'head_ref_force_pushed' event on a given pull request. + """ + HEAD_REF_FORCE_PUSHED_EVENT + + """ + Represents a 'head_ref_restored' event on a given pull request. + """ + HEAD_REF_RESTORED_EVENT + + """ + Represents a 'merged' event on a given pull request. + """ + MERGED_EVENT + + """ + Represents a 'review_dismissed' event on a given issue or pull request. + """ + REVIEW_DISMISSED_EVENT + + """ + Represents an 'review_requested' event on a given pull request. + """ + REVIEW_REQUESTED_EVENT + + """ + Represents an 'review_request_removed' event on a given pull request. + """ + REVIEW_REQUEST_REMOVED_EVENT + + """ + Represents a comment on an Issue. + """ + ISSUE_COMMENT + + """ + Represents a mention made by one issue or pull request to another. + """ + CROSS_REFERENCED_EVENT + + """ + Represents a 'added_to_project' event on a given issue or pull request. + """ + ADDED_TO_PROJECT_EVENT + + """ + Represents an 'assigned' event on any assignable object. + """ + ASSIGNED_EVENT + + """ + Represents a 'closed' event on any `Closable`. + """ + CLOSED_EVENT + + """ + Represents a 'comment_deleted' event on a given issue or pull request. + """ + COMMENT_DELETED_EVENT + + """ + Represents a 'converted_note_to_issue' event on a given issue or pull request. + """ + CONVERTED_NOTE_TO_ISSUE_EVENT + + """ + Represents a 'demilestoned' event on a given issue or pull request. + """ + DEMILESTONED_EVENT + + """ + Represents a 'labeled' event on a given issue or pull request. + """ + LABELED_EVENT + + """ + Represents a 'locked' event on a given issue or pull request. + """ + LOCKED_EVENT + + """ + Represents a 'mentioned' event on a given issue or pull request. + """ + MENTIONED_EVENT + + """ + Represents a 'milestoned' event on a given issue or pull request. + """ + MILESTONED_EVENT + + """ + Represents a 'moved_columns_in_project' event on a given issue or pull request. + """ + MOVED_COLUMNS_IN_PROJECT_EVENT + + """ + Represents a 'pinned' event on a given issue or pull request. + """ + PINNED_EVENT + + """ + Represents a 'referenced' event on a given `ReferencedSubject`. + """ + REFERENCED_EVENT + + """ + Represents a 'removed_from_project' event on a given issue or pull request. + """ + REMOVED_FROM_PROJECT_EVENT + + """ + Represents a 'renamed' event on a given issue or pull request + """ + RENAMED_TITLE_EVENT + + """ + Represents a 'reopened' event on any `Closable`. + """ + REOPENED_EVENT + + """ + Represents a 'subscribed' event on a given `Subscribable`. + """ + SUBSCRIBED_EVENT + + """ + Represents a 'transferred' event on a given issue or pull request. + """ + TRANSFERRED_EVENT + + """ + Represents an 'unassigned' event on any assignable object. + """ + UNASSIGNED_EVENT + + """ + Represents an 'unlabeled' event on a given issue or pull request. + """ + UNLABELED_EVENT + + """ + Represents an 'unlocked' event on a given issue or pull request. + """ + UNLOCKED_EVENT + + """ + Represents a 'user_blocked' event on a given user. + """ + USER_BLOCKED_EVENT + + """ + Represents an 'unpinned' event on a given issue or pull request. + """ + UNPINNED_EVENT + + """ + Represents an 'unsubscribed' event on a given `Subscribable`. + """ + UNSUBSCRIBED_EVENT +} + +""" +A team or user who has the ability to push to a protected branch. +""" +type PushAllowance implements Node { + """ + The actor that can push. + """ + actor: PushAllowanceActor + + """ + Identifies the branch protection rule associated with the allowed user or team. + """ + branchProtectionRule: BranchProtectionRule + id: ID! +} + +""" +Types that can be an actor. +""" +union PushAllowanceActor = User | Team + +""" +The connection type for PushAllowance. +""" +type PushAllowanceConnection { + """ + A list of edges. + """ + edges: [PushAllowanceEdge] + + """ + A list of nodes. + """ + nodes: [PushAllowance] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type PushAllowanceEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: PushAllowance +} + +""" +The query root of GitHub's GraphQL interface. +""" +type Query { + """ + Look up a code of conduct by its key + """ + codeOfConduct( + """ + The code of conduct's key + """ + key: String! + ): CodeOfConduct + + """ + Look up a code of conduct by its key + """ + codesOfConduct: [CodeOfConduct] + + """ + Look up an open source license by its key + """ + license( + """ + The license's downcased SPDX ID + """ + key: String! + ): License + + """ + Return a list of known open source licenses + """ + licenses: [License]! + + """ + Get alphabetically sorted list of Marketplace categories + """ + marketplaceCategories( + """ + Return only the specified categories. + """ + includeCategories: [String!] + + """ + Exclude categories with no listings. + """ + excludeEmpty: Boolean + + """ + Returns top level categories only, excluding any subcategories. + """ + excludeSubcategories: Boolean + ): [MarketplaceCategory!]! + + """ + Look up a Marketplace category by its slug. + """ + marketplaceCategory( + """ + The URL slug of the category. + """ + slug: String! + + """ + Also check topic aliases for the category slug + """ + useTopicAliases: Boolean + ): MarketplaceCategory + + """ + Look up a single Marketplace listing + """ + marketplaceListing( + """ + Select the listing that matches this slug. It's the short name of the listing used in its URL. + """ + slug: String! + ): MarketplaceListing + + """ + Look up Marketplace listings + """ + marketplaceListings( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Select only listings with the given category. + """ + categorySlug: String + + """ + Also check topic aliases for the category slug + """ + useTopicAliases: Boolean + + """ + Select listings to which user has admin access. If omitted, listings visible to the + viewer are returned. + """ + viewerCanAdmin: Boolean + + """ + Select listings that can be administered by the specified user. + """ + adminId: ID + + """ + Select listings for products owned by the specified organization. + """ + organizationId: ID + + """ + Select listings visible to the viewer even if they are not approved. If omitted or + false, only approved listings will be returned. + """ + allStates: Boolean + + """ + Select the listings with these slugs, if they are visible to the viewer. + """ + slugs: [String] + + """ + Select only listings where the primary category matches the given category slug. + """ + primaryCategoryOnly: Boolean = false + + """ + Select only listings that offer a free trial. + """ + withFreeTrialsOnly: Boolean = false + ): MarketplaceListingConnection! + + """ + Return information about the GitHub instance + """ + meta: GitHubMetadata! + + """ + Fetches an object given its ID. + """ + node( + """ + ID of the object. + """ + id: ID! + ): Node + + """ + Lookup nodes by a list of IDs. + """ + nodes( + """ + The list of node IDs. + """ + ids: [ID!]! + ): [Node]! + + """ + Lookup a organization by login. + """ + organization( + """ + The organization's login. + """ + login: String! + ): Organization + + """ + The client's rate limit information. + """ + rateLimit( + """ + If true, calculate the cost for the query without evaluating it + """ + dryRun: Boolean = false + ): RateLimit + + """ + Hack to workaround https://github.com/facebook/relay/issues/112 re-exposing the root query object + """ + relay: Query! + + """ + Lookup a given repository by the owner and repository name. + """ + repository( + """ + The login field of a user or organization + """ + owner: String! + + """ + The name of the repository + """ + name: String! + ): Repository + + """ + Lookup a repository owner (ie. either a User or an Organization) by login. + """ + repositoryOwner( + """ + The username to lookup the owner by. + """ + login: String! + ): RepositoryOwner + + """ + Lookup resource by a URL. + """ + resource( + """ + The URL. + """ + url: URI! + ): UniformResourceLocatable + + """ + Perform a search across resources. + """ + search( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + The search string to look for. + """ + query: String! + + """ + The types of search items to search within. + """ + type: SearchType! + ): SearchResultItemConnection! + + """ + GitHub Security Advisories + """ + securityAdvisories( + """ + Ordering options for the returned topics. + """ + orderBy: SecurityAdvisoryOrder + + """ + Filter advisories by identifier, e.g. GHSA or CVE. + """ + identifier: SecurityAdvisoryIdentifierFilter + + """ + Filter advisories to those published since a time in the past. + """ + publishedSince: DateTime + + """ + Filter advisories to those updated since a time in the past. + """ + updatedSince: DateTime + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): SecurityAdvisoryConnection! + + """ + Fetch a Security Advisory by its GHSA ID + """ + securityAdvisory( + """ + GitHub Security Advisory ID. + """ + ghsaId: String! + ): SecurityAdvisory + + """ + Software Vulnerabilities documented by GitHub Security Advisories + """ + securityVulnerabilities( + """ + Ordering options for the returned topics. + """ + orderBy: SecurityVulnerabilityOrder + + """ + An ecosystem to filter vulnerabilities by. + """ + ecosystem: SecurityAdvisoryEcosystem + + """ + A package name to filter vulnerabilities by. + """ + package: String + + """ + A list of severities to filter vulnerabilities by. + """ + severities: [SecurityAdvisorySeverity!] + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): SecurityVulnerabilityConnection! + + """ + Look up a topic by name. + """ + topic( + """ + The topic's name. + """ + name: String! + ): Topic + + """ + Lookup a user by login. + """ + user( + """ + The user's login. + """ + login: String! + ): User + + """ + The currently authenticated user. + """ + viewer: User! +} + +""" +Represents the client's rate limit. +""" +type RateLimit { + """ + The point cost for the current query counting against the rate limit. + """ + cost: Int! + + """ + The maximum number of points the client is permitted to consume in a 60 minute window. + """ + limit: Int! + + """ + The maximum number of nodes this query may return + """ + nodeCount: Int! + + """ + The number of points remaining in the current rate limit window. + """ + remaining: Int! + + """ + The time at which the current rate limit window resets in UTC epoch seconds. + """ + resetAt: DateTime! +} + +""" +Represents a subject that can be reacted on. +""" +interface Reactable { + """ + Identifies the primary key from the database. + """ + databaseId: Int + id: ID! + + """ + A list of reactions grouped by content left on the subject. + """ + reactionGroups: [ReactionGroup!] + + """ + A list of Reactions left on the Issue. + """ + reactions( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Allows filtering Reactions by emoji. + """ + content: ReactionContent + + """ + Allows specifying the order in which reactions are returned. + """ + orderBy: ReactionOrder + ): ReactionConnection! + + """ + Can user react to this subject + """ + viewerCanReact: Boolean! +} + +""" +The connection type for User. +""" +type ReactingUserConnection { + """ + A list of edges. + """ + edges: [ReactingUserEdge] + + """ + A list of nodes. + """ + nodes: [User] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +Represents a user that's made a reaction. +""" +type ReactingUserEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + node: User! + + """ + The moment when the user made the reaction. + """ + reactedAt: DateTime! +} + +""" +An emoji reaction to a particular piece of content. +""" +type Reaction implements Node { + """ + Identifies the emoji reaction. + """ + content: ReactionContent! + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + Identifies the primary key from the database. + """ + databaseId: Int + id: ID! + + """ + The reactable piece of content + """ + reactable: Reactable! + + """ + Identifies the user who created this reaction. + """ + user: User +} + +""" +A list of reactions that have been left on the subject. +""" +type ReactionConnection { + """ + A list of edges. + """ + edges: [ReactionEdge] + + """ + A list of nodes. + """ + nodes: [Reaction] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! + + """ + Whether or not the authenticated user has left a reaction on the subject. + """ + viewerHasReacted: Boolean! +} + +""" +Emojis that can be attached to Issues, Pull Requests and Comments. +""" +enum ReactionContent { + """ + Represents the 👍 emoji. + """ + THUMBS_UP + + """ + Represents the 👎 emoji. + """ + THUMBS_DOWN + + """ + Represents the 😄 emoji. + """ + LAUGH + + """ + Represents the 🎉 emoji. + """ + HOORAY + + """ + Represents the 😕 emoji. + """ + CONFUSED + + """ + Represents the ❤️ emoji. + """ + HEART + + """ + Represents the 🚀 emoji. + """ + ROCKET + + """ + Represents the 👀 emoji. + """ + EYES +} + +""" +An edge in a connection. +""" +type ReactionEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: Reaction +} + +""" +A group of emoji reactions to a particular piece of content. +""" +type ReactionGroup { + """ + Identifies the emoji reaction. + """ + content: ReactionContent! + + """ + Identifies when the reaction was created. + """ + createdAt: DateTime + + """ + The subject that was reacted to. + """ + subject: Reactable! + + """ + Users who have reacted to the reaction subject with the emotion represented by this reaction group + """ + users( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): ReactingUserConnection! + + """ + Whether or not the authenticated user has left a reaction on the subject. + """ + viewerHasReacted: Boolean! +} + +""" +Ways in which lists of reactions can be ordered upon return. +""" +input ReactionOrder { + """ + The field in which to order reactions by. + """ + field: ReactionOrderField! + + """ + The direction in which to order reactions by the specified field. + """ + direction: OrderDirection! +} + +""" +A list of fields that reactions can be ordered by. +""" +enum ReactionOrderField { + """ + Allows ordering a list of reactions by when they were created. + """ + CREATED_AT +} + +""" +Represents a Git reference. +""" +type Ref implements Node { + """ + A list of pull requests with this ref as the head ref. + """ + associatedPullRequests( + """ + A list of states to filter the pull requests by. + """ + states: [PullRequestState!] + + """ + A list of label names to filter the pull requests by. + """ + labels: [String!] + + """ + The head ref name to filter the pull requests by. + """ + headRefName: String + + """ + The base ref name to filter the pull requests by. + """ + baseRefName: String + + """ + Ordering options for pull requests returned from the connection. + """ + orderBy: IssueOrder + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): PullRequestConnection! + id: ID! + + """ + The ref name. + """ + name: String! + + """ + The ref's prefix, such as `refs/heads/` or `refs/tags/`. + """ + prefix: String! + + """ + The repository the ref belongs to. + """ + repository: Repository! + + """ + The object the ref points to. + """ + target: GitObject! +} + +""" +The connection type for Ref. +""" +type RefConnection { + """ + A list of edges. + """ + edges: [RefEdge] + + """ + A list of nodes. + """ + nodes: [Ref] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type RefEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: Ref +} + +""" +Represents a 'referenced' event on a given `ReferencedSubject`. +""" +type ReferencedEvent implements Node { + """ + Identifies the actor who performed the event. + """ + actor: Actor + + """ + Identifies the commit associated with the 'referenced' event. + """ + commit: Commit + + """ + Identifies the repository associated with the 'referenced' event. + """ + commitRepository: Repository! + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + id: ID! + + """ + Reference originated in a different repository. + """ + isCrossRepository: Boolean! + + """ + Checks if the commit message itself references the subject. Can be false in the case of a commit comment reference. + """ + isDirectReference: Boolean! + + """ + Object referenced by event. + """ + subject: ReferencedSubject! +} + +""" +Any referencable object +""" +union ReferencedSubject = Issue | PullRequest + +""" +Ways in which lists of git refs can be ordered upon return. +""" +input RefOrder { + """ + The field in which to order refs by. + """ + field: RefOrderField! + + """ + The direction in which to order refs by the specified field. + """ + direction: OrderDirection! +} + +""" +Properties by which ref connections can be ordered. +""" +enum RefOrderField { + """ + Order refs by underlying commit date if the ref prefix is refs/tags/ + """ + TAG_COMMIT_DATE + + """ + Order refs by their alphanumeric name + """ + ALPHABETICAL +} + +""" +Represents an owner of a registry package. +""" +interface RegistryPackageOwner { + id: ID! +} + +""" +Represents an interface to search packages on an object. +""" +interface RegistryPackageSearch { + id: ID! +} + +""" +A release contains the content for a release. +""" +type Release implements Node & UniformResourceLocatable { + """ + The author of the release + """ + author: User + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + Identifies the description of the release. + """ + description: String + id: ID! + + """ + Whether or not the release is a draft + """ + isDraft: Boolean! + + """ + Whether or not the release is a prerelease + """ + isPrerelease: Boolean! + + """ + Identifies the title of the release. + """ + name: String + + """ + Identifies the date and time when the release was created. + """ + publishedAt: DateTime + + """ + List of releases assets which are dependent on this release. + """ + releaseAssets( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + A list of names to filter the assets by. + """ + name: String + ): ReleaseAssetConnection! + + """ + The HTTP path for this issue + """ + resourcePath: URI! + + """ + The Git tag the release points to + """ + tag: Ref + + """ + The name of the release's Git tag + """ + tagName: String! + + """ + Identifies the date and time when the object was last updated. + """ + updatedAt: DateTime! + + """ + The HTTP URL for this issue + """ + url: URI! +} + +""" +A release asset contains the content for a release asset. +""" +type ReleaseAsset implements Node { + """ + The asset's content-type + """ + contentType: String! + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + The number of times this asset was downloaded + """ + downloadCount: Int! + + """ + Identifies the URL where you can download the release asset via the browser. + """ + downloadUrl: URI! + id: ID! + + """ + Identifies the title of the release asset. + """ + name: String! + + """ + Release that the asset is associated with + """ + release: Release + + """ + The size (in bytes) of the asset + """ + size: Int! + + """ + Identifies the date and time when the object was last updated. + """ + updatedAt: DateTime! + + """ + The user that performed the upload + """ + uploadedBy: User! + + """ + Identifies the URL of the release asset. + """ + url: URI! +} + +""" +The connection type for ReleaseAsset. +""" +type ReleaseAssetConnection { + """ + A list of edges. + """ + edges: [ReleaseAssetEdge] + + """ + A list of nodes. + """ + nodes: [ReleaseAsset] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type ReleaseAssetEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: ReleaseAsset +} + +""" +The connection type for Release. +""" +type ReleaseConnection { + """ + A list of edges. + """ + edges: [ReleaseEdge] + + """ + A list of nodes. + """ + nodes: [Release] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type ReleaseEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: Release +} + +""" +Ways in which lists of releases can be ordered upon return. +""" +input ReleaseOrder { + """ + The field in which to order releases by. + """ + field: ReleaseOrderField! + + """ + The direction in which to order releases by the specified field. + """ + direction: OrderDirection! +} + +""" +Properties by which release connections can be ordered. +""" +enum ReleaseOrderField { + """ + Order releases by creation time + """ + CREATED_AT + + """ + Order releases alphabetically by name + """ + NAME +} + +""" +Autogenerated input type of RemoveAssigneesFromAssignable +""" +input RemoveAssigneesFromAssignableInput { + """ + The id of the assignable object to remove assignees from. + """ + assignableId: ID! + + """ + The id of users to remove as assignees. + """ + assigneeIds: [ID!]! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of RemoveAssigneesFromAssignable +""" +type RemoveAssigneesFromAssignablePayload { + """ + The item that was unassigned. + """ + assignable: Assignable + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Represents a 'removed_from_project' event on a given issue or pull request. +""" +type RemovedFromProjectEvent implements Node { + """ + Identifies the actor who performed the event. + """ + actor: Actor + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + Identifies the primary key from the database. + """ + databaseId: Int + id: ID! +} + +""" +Autogenerated input type of RemoveLabelsFromLabelable +""" +input RemoveLabelsFromLabelableInput { + """ + The id of the Labelable to remove labels from. + """ + labelableId: ID! + + """ + The ids of labels to remove. + """ + labelIds: [ID!]! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of RemoveLabelsFromLabelable +""" +type RemoveLabelsFromLabelablePayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The Labelable the labels were removed from. + """ + labelable: Labelable +} + +""" +Autogenerated input type of RemoveOutsideCollaborator +""" +input RemoveOutsideCollaboratorInput { + """ + The ID of the outside collaborator to remove. + """ + userId: ID! + + """ + The ID of the organization to remove the outside collaborator from. + """ + organizationId: ID! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of RemoveOutsideCollaborator +""" +type RemoveOutsideCollaboratorPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The user that was removed as an outside collaborator. + """ + removedUser: User +} + +""" +Autogenerated input type of RemoveReaction +""" +input RemoveReactionInput { + """ + The Node ID of the subject to modify. + """ + subjectId: ID! + + """ + The name of the emoji reaction to remove. + """ + content: ReactionContent! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of RemoveReaction +""" +type RemoveReactionPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The reaction object. + """ + reaction: Reaction + + """ + The reactable subject. + """ + subject: Reactable +} + +""" +Autogenerated input type of RemoveStar +""" +input RemoveStarInput { + """ + The Starrable ID to unstar. + """ + starrableId: ID! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of RemoveStar +""" +type RemoveStarPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The starrable. + """ + starrable: Starrable +} + +""" +Represents a 'renamed' event on a given issue or pull request +""" +type RenamedTitleEvent implements Node { + """ + Identifies the actor who performed the event. + """ + actor: Actor + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + Identifies the current title of the issue or pull request. + """ + currentTitle: String! + id: ID! + + """ + Identifies the previous title of the issue or pull request. + """ + previousTitle: String! + + """ + Subject that was renamed. + """ + subject: RenamedTitleSubject! +} + +""" +An object which has a renamable title +""" +union RenamedTitleSubject = Issue | PullRequest + +""" +Represents a 'reopened' event on any `Closable`. +""" +type ReopenedEvent implements Node { + """ + Identifies the actor who performed the event. + """ + actor: Actor + + """ + Object that was reopened. + """ + closable: Closable! + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + id: ID! +} + +""" +Autogenerated input type of ReopenIssue +""" +input ReopenIssueInput { + """ + ID of the issue to be opened. + """ + issueId: ID! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of ReopenIssue +""" +type ReopenIssuePayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The issue that was opened. + """ + issue: Issue +} + +""" +Autogenerated input type of ReopenPullRequest +""" +input ReopenPullRequestInput { + """ + ID of the pull request to be reopened. + """ + pullRequestId: ID! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of ReopenPullRequest +""" +type ReopenPullRequestPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The pull request that was reopened. + """ + pullRequest: PullRequest +} + +""" +The reasons a piece of content can be reported or minimized. +""" +enum ReportedContentClassifiers { + """ + A spammy piece of content + """ + SPAM + + """ + An abusive or harassing piece of content + """ + ABUSE + + """ + An irrelevant piece of content + """ + OFF_TOPIC + + """ + An outdated piece of content + """ + OUTDATED + + """ + The content has been resolved + """ + RESOLVED +} + +""" +A repository contains the content for a project. +""" +type Repository implements Node & ProjectOwner & RegistryPackageOwner & Subscribable & Starrable & UniformResourceLocatable & RepositoryInfo { + """ + A list of users that can be assigned to issues in this repository. + """ + assignableUsers( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): UserConnection! + + """ + A list of branch protection rules for this repository. + """ + branchProtectionRules( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): BranchProtectionRuleConnection! + + """ + Returns the code of conduct for this repository + """ + codeOfConduct: CodeOfConduct + + """ + A list of collaborators associated with the repository. + """ + collaborators( + """ + Collaborators affiliation level with a repository. + """ + affiliation: CollaboratorAffiliation + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): RepositoryCollaboratorConnection + + """ + A list of commit comments associated with the repository. + """ + commitComments( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): CommitCommentConnection! + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + Identifies the primary key from the database. + """ + databaseId: Int + + """ + The Ref associated with the repository's default branch. + """ + defaultBranchRef: Ref + + """ + A list of deploy keys that are on this repository. + """ + deployKeys( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): DeployKeyConnection! + + """ + Deployments associated with the repository + """ + deployments( + """ + Environments to list deployments for + """ + environments: [String!] + + """ + Ordering options for deployments returned from the connection. + """ + orderBy: DeploymentOrder + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): DeploymentConnection! + + """ + The description of the repository. + """ + description: String + + """ + The description of the repository rendered to HTML. + """ + descriptionHTML: HTML! + + """ + The number of kilobytes this repository occupies on disk. + """ + diskUsage: Int + + """ + Returns how many forks there are of this repository in the whole network. + """ + forkCount: Int! + + """ + A list of direct forked repositories. + """ + forks( + """ + If non-null, filters repositories according to privacy + """ + privacy: RepositoryPrivacy + + """ + Ordering options for repositories returned from the connection + """ + orderBy: RepositoryOrder + + """ + Array of viewer's affiliation options for repositories returned from the + connection. For example, OWNER will include only repositories that the + current viewer owns. + """ + affiliations: [RepositoryAffiliation] + + """ + Array of owner's affiliation options for repositories returned from the + connection. For example, OWNER will include only repositories that the + organization or user being viewed owns. + """ + ownerAffiliations: [RepositoryAffiliation] + + """ + If non-null, filters repositories according to whether they have been locked + """ + isLocked: Boolean + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): RepositoryConnection! + + """ + Indicates if the repository has issues feature enabled. + """ + hasIssuesEnabled: Boolean! + + """ + Indicates if the repository has wiki feature enabled. + """ + hasWikiEnabled: Boolean! + + """ + The repository's URL. + """ + homepageUrl: URI + id: ID! + + """ + Indicates if the repository is unmaintained. + """ + isArchived: Boolean! + + """ + Returns whether or not this repository disabled. + """ + isDisabled: Boolean! + + """ + Identifies if the repository is a fork. + """ + isFork: Boolean! + + """ + Indicates if the repository has been locked or not. + """ + isLocked: Boolean! + + """ + Identifies if the repository is a mirror. + """ + isMirror: Boolean! + + """ + Identifies if the repository is private. + """ + isPrivate: Boolean! + + """ + Returns a single issue from the current repository by number. + """ + issue( + """ + The number for the issue to be returned. + """ + number: Int! + ): Issue + + """ + Returns a single issue-like object from the current repository by number. + """ + issueOrPullRequest( + """ + The number for the issue to be returned. + """ + number: Int! + ): IssueOrPullRequest + + """ + A list of issues that have been opened in the repository. + """ + issues( + """ + Ordering options for issues returned from the connection. + """ + orderBy: IssueOrder + + """ + A list of label names to filter the pull requests by. + """ + labels: [String!] + + """ + A list of states to filter the issues by. + """ + states: [IssueState!] + + """ + Filtering options for issues returned from the connection. + """ + filterBy: IssueFilters + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): IssueConnection! + + """ + Returns a single label by name + """ + label( + """ + Label name + """ + name: String! + ): Label + + """ + A list of labels associated with the repository. + """ + labels( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + If provided, searches labels by name and description. + """ + query: String + ): LabelConnection + + """ + A list containing a breakdown of the language composition of the repository. + """ + languages( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Order for connection + """ + orderBy: LanguageOrder + ): LanguageConnection + + """ + The license associated with the repository + """ + licenseInfo: License + + """ + The reason the repository has been locked. + """ + lockReason: RepositoryLockReason + + """ + A list of Users that can be mentioned in the context of the repository. + """ + mentionableUsers( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): UserConnection! + + """ + Whether or not PRs are merged with a merge commit on this repository. + """ + mergeCommitAllowed: Boolean! + + """ + Returns a single milestone from the current repository by number. + """ + milestone( + """ + The number for the milestone to be returned. + """ + number: Int! + ): Milestone + + """ + A list of milestones associated with the repository. + """ + milestones( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filter by the state of the milestones. + """ + states: [MilestoneState!] + + """ + Ordering options for milestones. + """ + orderBy: MilestoneOrder + ): MilestoneConnection + + """ + The repository's original mirror URL. + """ + mirrorUrl: URI + + """ + The name of the repository. + """ + name: String! + + """ + The repository's name with owner. + """ + nameWithOwner: String! + + """ + A Git object in the repository + """ + object( + """ + The Git object ID + """ + oid: GitObjectID + + """ + A Git revision expression suitable for rev-parse + """ + expression: String + ): GitObject + + """ + The User owner of the repository. + """ + owner: RepositoryOwner! + + """ + The repository parent, if this is a fork. + """ + parent: Repository + + """ + The primary language of the repository's code. + """ + primaryLanguage: Language + + """ + Find project by number. + """ + project( + """ + The project number to find. + """ + number: Int! + ): Project + + """ + A list of projects under the owner. + """ + projects( + """ + Ordering options for projects returned from the connection + """ + orderBy: ProjectOrder + + """ + Query to search projects by, currently only searching by name. + """ + search: String + + """ + A list of states to filter the projects by. + """ + states: [ProjectState!] + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): ProjectConnection! + + """ + The HTTP path listing the repository's projects + """ + projectsResourcePath: URI! + + """ + The HTTP URL listing the repository's projects + """ + projectsUrl: URI! + + """ + Returns a single pull request from the current repository by number. + """ + pullRequest( + """ + The number for the pull request to be returned. + """ + number: Int! + ): PullRequest + + """ + A list of pull requests that have been opened in the repository. + """ + pullRequests( + """ + A list of states to filter the pull requests by. + """ + states: [PullRequestState!] + + """ + A list of label names to filter the pull requests by. + """ + labels: [String!] + + """ + The head ref name to filter the pull requests by. + """ + headRefName: String + + """ + The base ref name to filter the pull requests by. + """ + baseRefName: String + + """ + Ordering options for pull requests returned from the connection. + """ + orderBy: IssueOrder + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): PullRequestConnection! + + """ + Identifies when the repository was last pushed to. + """ + pushedAt: DateTime + + """ + Whether or not rebase-merging is enabled on this repository. + """ + rebaseMergeAllowed: Boolean! + + """ + Fetch a given ref from the repository + """ + ref( + """ + The ref to retrieve. Fully qualified matches are checked in order + (`refs/heads/master`) before falling back onto checks for short name matches (`master`). + """ + qualifiedName: String! + ): Ref + + """ + Fetch a list of refs from the repository + """ + refs( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + A ref name prefix like `refs/heads/`, `refs/tags/`, etc. + """ + refPrefix: String! + + """ + DEPRECATED: use orderBy. The ordering direction. + """ + direction: OrderDirection + + """ + Ordering options for refs returned from the connection. + """ + orderBy: RefOrder + ): RefConnection + + """ + Lookup a single release given various criteria. + """ + release( + """ + The name of the Tag the Release was created from + """ + tagName: String! + ): Release + + """ + List of releases which are dependent on this repository. + """ + releases( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Order for connection + """ + orderBy: ReleaseOrder + ): ReleaseConnection! + + """ + A list of applied repository-topic associations for this repository. + """ + repositoryTopics( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): RepositoryTopicConnection! + + """ + The HTTP path for this repository + """ + resourcePath: URI! + + """ + A description of the repository, rendered to HTML without any links in it. + """ + shortDescriptionHTML( + """ + How many characters to return. + """ + limit: Int = 200 + ): HTML! + + """ + Whether or not squash-merging is enabled on this repository. + """ + squashMergeAllowed: Boolean! + + """ + The SSH URL to clone this repository + """ + sshUrl: GitSSHRemote! + + """ + A list of users who have starred this starrable. + """ + stargazers( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Order for connection + """ + orderBy: StarOrder + ): StargazerConnection! + + """ + Identifies the date and time when the object was last updated. + """ + updatedAt: DateTime! + + """ + The HTTP URL for this repository + """ + url: URI! + + """ + Indicates whether the viewer has admin permissions on this repository. + """ + viewerCanAdminister: Boolean! + + """ + Can the current viewer create new projects on this owner. + """ + viewerCanCreateProjects: Boolean! + + """ + Check if the viewer is able to change their subscription status for the repository. + """ + viewerCanSubscribe: Boolean! + + """ + Indicates whether the viewer can update the topics of this repository. + """ + viewerCanUpdateTopics: Boolean! + + """ + Returns a boolean indicating whether the viewing user has starred this starrable. + """ + viewerHasStarred: Boolean! + + """ + The users permission level on the repository. Will return null if authenticated as an GitHub App. + """ + viewerPermission: RepositoryPermission + + """ + Identifies if the viewer is watching, not watching, or ignoring the subscribable entity. + """ + viewerSubscription: SubscriptionState + + """ + A list of users watching the repository. + """ + watchers( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): UserConnection! +} + +""" +The affiliation of a user to a repository +""" +enum RepositoryAffiliation { + """ + Repositories that are owned by the authenticated user. + """ + OWNER + + """ + Repositories that the user has been added to as a collaborator. + """ + COLLABORATOR + + """ + Repositories that the user has access to through being a member of an + organization. This includes every repository on every team that the user is on. + """ + ORGANIZATION_MEMBER +} + +""" +The affiliation type between collaborator and repository. +""" +enum RepositoryCollaboratorAffiliation { + """ + All collaborators of the repository. + """ + ALL + + """ + All outside collaborators of an organization-owned repository. + """ + OUTSIDE +} + +""" +The connection type for User. +""" +type RepositoryCollaboratorConnection { + """ + A list of edges. + """ + edges: [RepositoryCollaboratorEdge] + + """ + A list of nodes. + """ + nodes: [User] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +Represents a user who is a collaborator of a repository. +""" +type RepositoryCollaboratorEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + node: User! + + """ + The permission the user has on the repository. + """ + permission: RepositoryPermission! + + """ + A list of sources for the user's access to the repository. + """ + permissionSources: [PermissionSource!] +} + +""" +A list of repositories owned by the subject. +""" +type RepositoryConnection { + """ + A list of edges. + """ + edges: [RepositoryEdge] + + """ + A list of nodes. + """ + nodes: [Repository] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! + + """ + The total size in kilobytes of all repositories in the connection. + """ + totalDiskUsage: Int! +} + +""" +The reason a repository is listed as 'contributed'. +""" +enum RepositoryContributionType { + """ + Created a commit + """ + COMMIT + + """ + Created an issue + """ + ISSUE + + """ + Created a pull request + """ + PULL_REQUEST + + """ + Created the repository + """ + REPOSITORY + + """ + Reviewed a pull request + """ + PULL_REQUEST_REVIEW +} + +""" +An edge in a connection. +""" +type RepositoryEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: Repository +} + +""" +A subset of repository info. +""" +interface RepositoryInfo { + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + The description of the repository. + """ + description: String + + """ + The description of the repository rendered to HTML. + """ + descriptionHTML: HTML! + + """ + Returns how many forks there are of this repository in the whole network. + """ + forkCount: Int! + + """ + Indicates if the repository has issues feature enabled. + """ + hasIssuesEnabled: Boolean! + + """ + Indicates if the repository has wiki feature enabled. + """ + hasWikiEnabled: Boolean! + + """ + The repository's URL. + """ + homepageUrl: URI + + """ + Indicates if the repository is unmaintained. + """ + isArchived: Boolean! + + """ + Identifies if the repository is a fork. + """ + isFork: Boolean! + + """ + Indicates if the repository has been locked or not. + """ + isLocked: Boolean! + + """ + Identifies if the repository is a mirror. + """ + isMirror: Boolean! + + """ + Identifies if the repository is private. + """ + isPrivate: Boolean! + + """ + The license associated with the repository + """ + licenseInfo: License + + """ + The reason the repository has been locked. + """ + lockReason: RepositoryLockReason + + """ + The repository's original mirror URL. + """ + mirrorUrl: URI + + """ + The name of the repository. + """ + name: String! + + """ + The repository's name with owner. + """ + nameWithOwner: String! + + """ + The User owner of the repository. + """ + owner: RepositoryOwner! + + """ + Identifies when the repository was last pushed to. + """ + pushedAt: DateTime + + """ + The HTTP path for this repository + """ + resourcePath: URI! + + """ + A description of the repository, rendered to HTML without any links in it. + """ + shortDescriptionHTML( + """ + How many characters to return. + """ + limit: Int = 200 + ): HTML! + + """ + Identifies the date and time when the object was last updated. + """ + updatedAt: DateTime! + + """ + The HTTP URL for this repository + """ + url: URI! +} + +""" +An invitation for a user to be added to a repository. +""" +type RepositoryInvitation implements Node { + id: ID! + + """ + The user who received the invitation. + """ + invitee: User! + + """ + The user who created the invitation. + """ + inviter: User! + + """ + The permission granted on this repository by this invitation. + """ + permission: RepositoryPermission! + + """ + The Repository the user is invited to. + """ + repository: RepositoryInfo +} + +""" +An edge in a connection. +""" +type RepositoryInvitationEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: RepositoryInvitation +} + +""" +The possible reasons a given repository could be in a locked state. +""" +enum RepositoryLockReason { + """ + The repository is locked due to a move. + """ + MOVING + + """ + The repository is locked due to a billing related reason. + """ + BILLING + + """ + The repository is locked due to a rename. + """ + RENAME + + """ + The repository is locked due to a migration. + """ + MIGRATING +} + +""" +Represents a object that belongs to a repository. +""" +interface RepositoryNode { + """ + The repository associated with this node. + """ + repository: Repository! +} + +""" +Ordering options for repository connections +""" +input RepositoryOrder { + """ + The field to order repositories by. + """ + field: RepositoryOrderField! + + """ + The ordering direction. + """ + direction: OrderDirection! +} + +""" +Properties by which repository connections can be ordered. +""" +enum RepositoryOrderField { + """ + Order repositories by creation time + """ + CREATED_AT + + """ + Order repositories by update time + """ + UPDATED_AT + + """ + Order repositories by push time + """ + PUSHED_AT + + """ + Order repositories by name + """ + NAME + + """ + Order repositories by number of stargazers + """ + STARGAZERS +} + +""" +Represents an owner of a Repository. +""" +interface RepositoryOwner { + """ + A URL pointing to the owner's public avatar. + """ + avatarUrl( + """ + The size of the resulting square image. + """ + size: Int + ): URI! + id: ID! + + """ + The username used to login. + """ + login: String! + + """ + A list of repositories this user has pinned to their profile + """ + pinnedRepositories( + """ + If non-null, filters repositories according to privacy + """ + privacy: RepositoryPrivacy + + """ + Ordering options for repositories returned from the connection + """ + orderBy: RepositoryOrder + + """ + Array of viewer's affiliation options for repositories returned from the + connection. For example, OWNER will include only repositories that the + current viewer owns. + """ + affiliations: [RepositoryAffiliation] + + """ + Array of owner's affiliation options for repositories returned from the + connection. For example, OWNER will include only repositories that the + organization or user being viewed owns. + """ + ownerAffiliations: [RepositoryAffiliation] + + """ + If non-null, filters repositories according to whether they have been locked + """ + isLocked: Boolean + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): RepositoryConnection! + @deprecated( + reason: "pinnedRepositories will be removed Use ProfileOwner.pinnedItems instead. Removal on 2019-07-01 UTC." + ) + + """ + A list of repositories that the user owns. + """ + repositories( + """ + If non-null, filters repositories according to privacy + """ + privacy: RepositoryPrivacy + + """ + Ordering options for repositories returned from the connection + """ + orderBy: RepositoryOrder + + """ + Array of viewer's affiliation options for repositories returned from the + connection. For example, OWNER will include only repositories that the + current viewer owns. + """ + affiliations: [RepositoryAffiliation] + + """ + Array of owner's affiliation options for repositories returned from the + connection. For example, OWNER will include only repositories that the + organization or user being viewed owns. + """ + ownerAffiliations: [RepositoryAffiliation] + + """ + If non-null, filters repositories according to whether they have been locked + """ + isLocked: Boolean + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + If non-null, filters repositories according to whether they are forks of another repository + """ + isFork: Boolean + ): RepositoryConnection! + + """ + Find Repository. + """ + repository( + """ + Name of Repository to find. + """ + name: String! + ): Repository + + """ + The HTTP URL for the owner. + """ + resourcePath: URI! + + """ + The HTTP URL for the owner. + """ + url: URI! +} + +""" +The access level to a repository +""" +enum RepositoryPermission { + """ + Can read, clone, push, and add collaborators + """ + ADMIN + + """ + Can read, clone and push + """ + WRITE + + """ + Can read and clone + """ + READ +} + +""" +The privacy of a repository +""" +enum RepositoryPrivacy { + """ + Public + """ + PUBLIC + + """ + Private + """ + PRIVATE +} + +""" +A repository-topic connects a repository to a topic. +""" +type RepositoryTopic implements Node & UniformResourceLocatable { + id: ID! + + """ + The HTTP path for this repository-topic. + """ + resourcePath: URI! + + """ + The topic. + """ + topic: Topic! + + """ + The HTTP URL for this repository-topic. + """ + url: URI! +} + +""" +The connection type for RepositoryTopic. +""" +type RepositoryTopicConnection { + """ + A list of edges. + """ + edges: [RepositoryTopicEdge] + + """ + A list of nodes. + """ + nodes: [RepositoryTopic] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type RepositoryTopicEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: RepositoryTopic +} + +""" +Types that can be requested reviewers. +""" +union RequestedReviewer = User | Team | Mannequin + +""" +Autogenerated input type of RequestReviews +""" +input RequestReviewsInput { + """ + The Node ID of the pull request to modify. + """ + pullRequestId: ID! + + """ + The Node IDs of the user to request. + """ + userIds: [ID!] + + """ + The Node IDs of the team to request. + """ + teamIds: [ID!] + + """ + Add users to the set rather than replace. + """ + union: Boolean + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of RequestReviews +""" +type RequestReviewsPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The pull request that is getting requests. + """ + pullRequest: PullRequest + + """ + The edge from the pull request to the requested reviewers. + """ + requestedReviewersEdge: UserEdge +} + +""" +Autogenerated input type of ResolveReviewThread +""" +input ResolveReviewThreadInput { + """ + The ID of the thread to resolve + """ + threadId: ID! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of ResolveReviewThread +""" +type ResolveReviewThreadPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The thread to resolve. + """ + thread: PullRequestReviewThread +} + +""" +Represents a private contribution a user made on GitHub. +""" +type RestrictedContribution implements Contribution { + """ + Whether this contribution is associated with a record you do not have access to. For + example, your own 'first issue' contribution may have been made on a repository you can no + longer access. + """ + isRestricted: Boolean! + + """ + When this contribution was made. + """ + occurredAt: DateTime! + + """ + The HTTP path for this contribution. + """ + resourcePath: URI! + + """ + The HTTP URL for this contribution. + """ + url: URI! + + """ + The user who made this contribution. + """ + user: User! +} + +""" +A team or user who has the ability to dismiss a review on a protected branch. +""" +type ReviewDismissalAllowance implements Node { + """ + The actor that can dismiss. + """ + actor: ReviewDismissalAllowanceActor + + """ + Identifies the branch protection rule associated with the allowed user or team. + """ + branchProtectionRule: BranchProtectionRule + id: ID! +} + +""" +Types that can be an actor. +""" +union ReviewDismissalAllowanceActor = User | Team + +""" +The connection type for ReviewDismissalAllowance. +""" +type ReviewDismissalAllowanceConnection { + """ + A list of edges. + """ + edges: [ReviewDismissalAllowanceEdge] + + """ + A list of nodes. + """ + nodes: [ReviewDismissalAllowance] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type ReviewDismissalAllowanceEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: ReviewDismissalAllowance +} + +""" +Represents a 'review_dismissed' event on a given issue or pull request. +""" +type ReviewDismissedEvent implements Node & UniformResourceLocatable { + """ + Identifies the actor who performed the event. + """ + actor: Actor + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + Identifies the primary key from the database. + """ + databaseId: Int + + """ + Identifies the optional message associated with the 'review_dismissed' event. + """ + dismissalMessage: String + + """ + Identifies the optional message associated with the event, rendered to HTML. + """ + dismissalMessageHTML: String + id: ID! + + """ + Identifies the message associated with the 'review_dismissed' event. + """ + message: String! + @deprecated( + reason: "`message` is being removed because it not nullable, whereas the underlying field is optional. Use `dismissalMessage` instead. Removal on 2019-07-01 UTC." + ) + + """ + The message associated with the event, rendered to HTML. + """ + messageHtml: HTML! + @deprecated( + reason: "`messageHtml` is being removed because it not nullable, whereas the underlying field is optional. Use `dismissalMessageHTML` instead. Removal on 2019-07-01 UTC." + ) + + """ + Identifies the previous state of the review with the 'review_dismissed' event. + """ + previousReviewState: PullRequestReviewState! + + """ + PullRequest referenced by event. + """ + pullRequest: PullRequest! + + """ + Identifies the commit which caused the review to become stale. + """ + pullRequestCommit: PullRequestCommit + + """ + The HTTP path for this review dismissed event. + """ + resourcePath: URI! + + """ + Identifies the review associated with the 'review_dismissed' event. + """ + review: PullRequestReview + + """ + The HTTP URL for this review dismissed event. + """ + url: URI! +} + +""" +A request for a user to review a pull request. +""" +type ReviewRequest implements Node { + """ + Identifies the primary key from the database. + """ + databaseId: Int + id: ID! + + """ + Identifies the pull request associated with this review request. + """ + pullRequest: PullRequest! + + """ + The reviewer that is requested. + """ + requestedReviewer: RequestedReviewer +} + +""" +The connection type for ReviewRequest. +""" +type ReviewRequestConnection { + """ + A list of edges. + """ + edges: [ReviewRequestEdge] + + """ + A list of nodes. + """ + nodes: [ReviewRequest] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +Represents an 'review_requested' event on a given pull request. +""" +type ReviewRequestedEvent implements Node { + """ + Identifies the actor who performed the event. + """ + actor: Actor + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + id: ID! + + """ + PullRequest referenced by event. + """ + pullRequest: PullRequest! + + """ + Identifies the reviewer whose review was requested. + """ + requestedReviewer: RequestedReviewer +} + +""" +An edge in a connection. +""" +type ReviewRequestEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: ReviewRequest +} + +""" +Represents an 'review_request_removed' event on a given pull request. +""" +type ReviewRequestRemovedEvent implements Node { + """ + Identifies the actor who performed the event. + """ + actor: Actor + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + id: ID! + + """ + PullRequest referenced by event. + """ + pullRequest: PullRequest! + + """ + Identifies the reviewer whose review request was removed. + """ + requestedReviewer: RequestedReviewer +} + +""" +The results of a search. +""" +union SearchResultItem = + Issue + | PullRequest + | Repository + | User + | Organization + | MarketplaceListing + +""" +A list of results that matched against a search query. +""" +type SearchResultItemConnection { + """ + The number of pieces of code that matched the search query. + """ + codeCount: Int! + + """ + A list of edges. + """ + edges: [SearchResultItemEdge] + + """ + The number of issues that matched the search query. + """ + issueCount: Int! + + """ + A list of nodes. + """ + nodes: [SearchResultItem] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + The number of repositories that matched the search query. + """ + repositoryCount: Int! + + """ + The number of users that matched the search query. + """ + userCount: Int! + + """ + The number of wiki pages that matched the search query. + """ + wikiCount: Int! +} + +""" +An edge in a connection. +""" +type SearchResultItemEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: SearchResultItem + + """ + Text matches on the result found. + """ + textMatches: [TextMatch] +} + +""" +Represents the individual results of a search. +""" +enum SearchType { + """ + Returns results matching issues in repositories. + """ + ISSUE + + """ + Returns results matching repositories. + """ + REPOSITORY + + """ + Returns results matching users and organizations on GitHub. + """ + USER +} + +""" +A GitHub Security Advisory +""" +type SecurityAdvisory implements Node { + """ + Identifies the primary key from the database. + """ + databaseId: Int + + """ + This is a long plaintext description of the advisory + """ + description: String! + + """ + The GitHub Security Advisory ID + """ + ghsaId: String! + id: ID! + + """ + A list of identifiers for this advisory + """ + identifiers: [SecurityAdvisoryIdentifier!]! + + """ + The organization that originated the advisory + """ + origin: String! + + """ + When the advisory was published + """ + publishedAt: DateTime! + + """ + A list of references for this advisory + """ + references: [SecurityAdvisoryReference!]! + + """ + The severity of the advisory + """ + severity: SecurityAdvisorySeverity! + + """ + A short plaintext summary of the advisory + """ + summary: String! + + """ + When the advisory was last updated + """ + updatedAt: DateTime! + + """ + Vulnerabilities associated with this Advisory + """ + vulnerabilities( + """ + Ordering options for the returned topics. + """ + orderBy: SecurityVulnerabilityOrder + + """ + An ecosystem to filter vulnerabilities by. + """ + ecosystem: SecurityAdvisoryEcosystem + + """ + A package name to filter vulnerabilities by. + """ + package: String + + """ + A list of severities to filter vulnerabilities by. + """ + severities: [SecurityAdvisorySeverity!] + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): SecurityVulnerabilityConnection! + + """ + When the advisory was withdrawn, if it has been withdrawn + """ + withdrawnAt: DateTime +} + +""" +The connection type for SecurityAdvisory. +""" +type SecurityAdvisoryConnection { + """ + A list of edges. + """ + edges: [SecurityAdvisoryEdge] + + """ + A list of nodes. + """ + nodes: [SecurityAdvisory] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +The possible ecosystems of a security vulnerability's package. +""" +enum SecurityAdvisoryEcosystem { + """ + Ruby gems hosted at RubyGems.org + """ + RUBYGEMS + + """ + JavaScript packages hosted at npmjs.com + """ + NPM + + """ + Python packages hosted at PyPI.org + """ + PIP + + """ + Java artifacts hosted at the Maven central repository + """ + MAVEN + + """ + .NET packages hosted at the NuGet Gallery + """ + NUGET +} + +""" +An edge in a connection. +""" +type SecurityAdvisoryEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: SecurityAdvisory +} + +""" +A GitHub Security Advisory Identifier +""" +type SecurityAdvisoryIdentifier { + """ + The identifier type, e.g. GHSA, CVE + """ + type: String! + + """ + The identifier + """ + value: String! +} + +""" +An advisory identifier to filter results on. +""" +input SecurityAdvisoryIdentifierFilter { + """ + The identifier type. + """ + type: SecurityAdvisoryIdentifierType! + + """ + The identifier string. Supports exact or partial matching. + """ + value: String! +} + +""" +Identifier formats available for advisories. +""" +enum SecurityAdvisoryIdentifierType { + """ + Common Vulnerabilities and Exposures Identifier. + """ + CVE + + """ + GitHub Security Advisory ID. + """ + GHSA +} + +""" +Ordering options for security advisory connections +""" +input SecurityAdvisoryOrder { + """ + The field to order security advisories by. + """ + field: SecurityAdvisoryOrderField! + + """ + The ordering direction. + """ + direction: OrderDirection! +} + +""" +Properties by which security advisory connections can be ordered. +""" +enum SecurityAdvisoryOrderField { + """ + Order advisories by publication time + """ + PUBLISHED_AT + + """ + Order advisories by update time + """ + UPDATED_AT +} + +""" +An individual package +""" +type SecurityAdvisoryPackage { + """ + The ecosystem the package belongs to, e.g. RUBYGEMS, NPM + """ + ecosystem: SecurityAdvisoryEcosystem! + + """ + The package name + """ + name: String! +} + +""" +An individual package version +""" +type SecurityAdvisoryPackageVersion { + """ + The package name or version + """ + identifier: String! +} + +""" +A GitHub Security Advisory Reference +""" +type SecurityAdvisoryReference { + """ + A publicly accessible reference + """ + url: URI! +} + +""" +Severity of the vulnerability. +""" +enum SecurityAdvisorySeverity { + """ + Low. + """ + LOW + + """ + Moderate. + """ + MODERATE + + """ + High. + """ + HIGH + + """ + Critical. + """ + CRITICAL +} + +""" +An individual vulnerability within an Advisory +""" +type SecurityVulnerability { + """ + The Advisory associated with this Vulnerability + """ + advisory: SecurityAdvisory! + + """ + The first version containing a fix for the vulnerability + """ + firstPatchedVersion: SecurityAdvisoryPackageVersion + + """ + A description of the vulnerable package + """ + package: SecurityAdvisoryPackage! + + """ + The severity of the vulnerability within this package + """ + severity: SecurityAdvisorySeverity! + + """ + When the vulnerability was last updated + """ + updatedAt: DateTime! + + """ + A string that describes the vulnerable package versions. + This string follows a basic syntax with a few forms. + + `= 0.2.0` denotes a single vulnerable version. + + `<= 1.0.8` denotes a version range up to and including the specified version + + `< 0.1.11` denotes a version range up to, but excluding, the specified version + + `>= 4.3.0, < 4.3.5` denotes a version range with a known minimum and maximum version. + + `>= 0.0.1` denotes a version range with a known minimum, but no known maximum + """ + vulnerableVersionRange: String! +} + +""" +The connection type for SecurityVulnerability. +""" +type SecurityVulnerabilityConnection { + """ + A list of edges. + """ + edges: [SecurityVulnerabilityEdge] + + """ + A list of nodes. + """ + nodes: [SecurityVulnerability] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type SecurityVulnerabilityEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: SecurityVulnerability +} + +""" +Ordering options for security vulnerability connections +""" +input SecurityVulnerabilityOrder { + """ + The field to order security vulnerabilities by. + """ + field: SecurityVulnerabilityOrderField! + + """ + The ordering direction. + """ + direction: OrderDirection! +} + +""" +Properties by which security vulnerability connections can be ordered. +""" +enum SecurityVulnerabilityOrderField { + """ + Order vulnerability by update time + """ + UPDATED_AT +} + +""" +Represents an S/MIME signature on a Commit or Tag. +""" +type SmimeSignature implements GitSignature { + """ + Email used to sign this object. + """ + email: String! + + """ + True if the signature is valid and verified by GitHub. + """ + isValid: Boolean! + + """ + Payload for GPG signing object. Raw ODB object without the signature header. + """ + payload: String! + + """ + ASCII-armored signature header from object. + """ + signature: String! + + """ + GitHub user corresponding to the email signing this commit. + """ + signer: User + + """ + The state of this signature. `VALID` if signature is valid and verified by + GitHub, otherwise represents reason why signature is considered invalid. + """ + state: GitSignatureState! + + """ + True if the signature was made with GitHub's signing key. + """ + wasSignedByGitHub: Boolean! +} + +""" +The connection type for User. +""" +type StargazerConnection { + """ + A list of edges. + """ + edges: [StargazerEdge] + + """ + A list of nodes. + """ + nodes: [User] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +Represents a user that's starred a repository. +""" +type StargazerEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + node: User! + + """ + Identifies when the item was starred. + """ + starredAt: DateTime! +} + +""" +Ways in which star connections can be ordered. +""" +input StarOrder { + """ + The field in which to order nodes by. + """ + field: StarOrderField! + + """ + The direction in which to order nodes. + """ + direction: OrderDirection! +} + +""" +Properties by which star connections can be ordered. +""" +enum StarOrderField { + """ + Allows ordering a list of stars by when they were created. + """ + STARRED_AT +} + +""" +Things that can be starred. +""" +interface Starrable { + id: ID! + + """ + A list of users who have starred this starrable. + """ + stargazers( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Order for connection + """ + orderBy: StarOrder + ): StargazerConnection! + + """ + Returns a boolean indicating whether the viewing user has starred this starrable. + """ + viewerHasStarred: Boolean! +} + +""" +The connection type for Repository. +""" +type StarredRepositoryConnection { + """ + A list of edges. + """ + edges: [StarredRepositoryEdge] + + """ + A list of nodes. + """ + nodes: [Repository] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +Represents a starred repository. +""" +type StarredRepositoryEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + node: Repository! + + """ + Identifies when the item was starred. + """ + starredAt: DateTime! +} + +""" +Represents a commit status. +""" +type Status implements Node { + """ + The commit this status is attached to. + """ + commit: Commit + + """ + Looks up an individual status context by context name. + """ + context( + """ + The context name. + """ + name: String! + ): StatusContext + + """ + The individual status contexts for this commit. + """ + contexts: [StatusContext!]! + id: ID! + + """ + The combined commit status. + """ + state: StatusState! +} + +""" +Represents an individual commit status context +""" +type StatusContext implements Node { + """ + This commit this status context is attached to. + """ + commit: Commit + + """ + The name of this status context. + """ + context: String! + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + The actor who created this status context. + """ + creator: Actor + + """ + The description for this status context. + """ + description: String + id: ID! + + """ + The state of this status context. + """ + state: StatusState! + + """ + The URL for this status context. + """ + targetUrl: URI +} + +""" +The possible commit status states. +""" +enum StatusState { + """ + Status is expected. + """ + EXPECTED + + """ + Status is errored. + """ + ERROR + + """ + Status is failing. + """ + FAILURE + + """ + Status is pending. + """ + PENDING + + """ + Status is successful. + """ + SUCCESS +} + +""" +Autogenerated input type of SubmitPullRequestReview +""" +input SubmitPullRequestReviewInput { + """ + The Pull Request Review ID to submit. + """ + pullRequestReviewId: ID! + + """ + The event to send to the Pull Request Review. + """ + event: PullRequestReviewEvent! + + """ + The text field to set on the Pull Request Review. + """ + body: String + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of SubmitPullRequestReview +""" +type SubmitPullRequestReviewPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The submitted pull request review. + """ + pullRequestReview: PullRequestReview +} + +""" +Entities that can be subscribed to for web and email notifications. +""" +interface Subscribable { + id: ID! + + """ + Check if the viewer is able to change their subscription status for the repository. + """ + viewerCanSubscribe: Boolean! + + """ + Identifies if the viewer is watching, not watching, or ignoring the subscribable entity. + """ + viewerSubscription: SubscriptionState +} + +""" +Represents a 'subscribed' event on a given `Subscribable`. +""" +type SubscribedEvent implements Node { + """ + Identifies the actor who performed the event. + """ + actor: Actor + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + id: ID! + + """ + Object referenced by event. + """ + subscribable: Subscribable! +} + +""" +The possible states of a subscription. +""" +enum SubscriptionState { + """ + The User is only notified when participating or @mentioned. + """ + UNSUBSCRIBED + + """ + The User is notified of all conversations. + """ + SUBSCRIBED + + """ + The User is never notified. + """ + IGNORED +} + +""" +A suggestion to review a pull request based on a user's commit history and review comments. +""" +type SuggestedReviewer { + """ + Is this suggestion based on past commits? + """ + isAuthor: Boolean! + + """ + Is this suggestion based on past review comments? + """ + isCommenter: Boolean! + + """ + Identifies the user suggested to review the pull request. + """ + reviewer: User! +} + +""" +Represents a Git tag. +""" +type Tag implements Node & GitObject { + """ + An abbreviated version of the Git object ID + """ + abbreviatedOid: String! + + """ + The HTTP path for this Git object + """ + commitResourcePath: URI! + + """ + The HTTP URL for this Git object + """ + commitUrl: URI! + id: ID! + + """ + The Git tag message. + """ + message: String + + """ + The Git tag name. + """ + name: String! + + """ + The Git object ID + """ + oid: GitObjectID! + + """ + The Repository the Git object belongs to + """ + repository: Repository! + + """ + Details about the tag author. + """ + tagger: GitActor + + """ + The Git object the tag points to. + """ + target: GitObject! +} + +""" +A team of users in an organization. +""" +type Team implements Node & Subscribable & MemberStatusable { + """ + A list of teams that are ancestors of this team. + """ + ancestors( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): TeamConnection! + + """ + A URL pointing to the team's avatar. + """ + avatarUrl( + """ + The size in pixels of the resulting square image. + """ + size: Int = 400 + ): URI + + """ + List of child teams belonging to this team + """ + childTeams( + """ + Order for connection + """ + orderBy: TeamOrder + + """ + User logins to filter by + """ + userLogins: [String!] + + """ + Whether to list immediate child teams or all descendant child teams. + """ + immediateOnly: Boolean = true + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): TeamConnection! + + """ + The slug corresponding to the organization and team. + """ + combinedSlug: String! + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + The description of the team. + """ + description: String + + """ + The HTTP path for editing this team + """ + editTeamResourcePath: URI! + + """ + The HTTP URL for editing this team + """ + editTeamUrl: URI! + id: ID! + + """ + A list of pending invitations for users to this team + """ + invitations( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): OrganizationInvitationConnection + + """ + Get the status messages members of this entity have set that are either public or visible only to the organization. + """ + memberStatuses( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for user statuses returned from the connection. + """ + orderBy: UserStatusOrder + ): UserStatusConnection! + + """ + A list of users who are members of this team. + """ + members( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + The search string to look for. + """ + query: String + + """ + Filter by membership type + """ + membership: TeamMembershipType = ALL + + """ + Filter by team member role + """ + role: TeamMemberRole + + """ + Order for the connection. + """ + orderBy: TeamMemberOrder + ): TeamMemberConnection! + + """ + The HTTP path for the team' members + """ + membersResourcePath: URI! + + """ + The HTTP URL for the team' members + """ + membersUrl: URI! + + """ + The name of the team. + """ + name: String! + + """ + The HTTP path creating a new team + """ + newTeamResourcePath: URI! + + """ + The HTTP URL creating a new team + """ + newTeamUrl: URI! + + """ + The organization that owns this team. + """ + organization: Organization! + + """ + The parent team of the team. + """ + parentTeam: Team + + """ + The level of privacy the team has. + """ + privacy: TeamPrivacy! + + """ + A list of repositories this team has access to. + """ + repositories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + The search string to look for. + """ + query: String + + """ + Order for the connection. + """ + orderBy: TeamRepositoryOrder + ): TeamRepositoryConnection! + + """ + The HTTP path for this team's repositories + """ + repositoriesResourcePath: URI! + + """ + The HTTP URL for this team's repositories + """ + repositoriesUrl: URI! + + """ + The HTTP path for this team + """ + resourcePath: URI! + + """ + The slug corresponding to the team. + """ + slug: String! + + """ + The HTTP path for this team's teams + """ + teamsResourcePath: URI! + + """ + The HTTP URL for this team's teams + """ + teamsUrl: URI! + + """ + Identifies the date and time when the object was last updated. + """ + updatedAt: DateTime! + + """ + The HTTP URL for this team + """ + url: URI! + + """ + Team is adminable by the viewer. + """ + viewerCanAdminister: Boolean! + + """ + Check if the viewer is able to change their subscription status for the repository. + """ + viewerCanSubscribe: Boolean! + + """ + Identifies if the viewer is watching, not watching, or ignoring the subscribable entity. + """ + viewerSubscription: SubscriptionState +} + +""" +The connection type for Team. +""" +type TeamConnection { + """ + A list of edges. + """ + edges: [TeamEdge] + + """ + A list of nodes. + """ + nodes: [Team] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type TeamEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: Team +} + +""" +The connection type for User. +""" +type TeamMemberConnection { + """ + A list of edges. + """ + edges: [TeamMemberEdge] + + """ + A list of nodes. + """ + nodes: [User] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +Represents a user who is a member of a team. +""" +type TeamMemberEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The HTTP path to the organization's member access page. + """ + memberAccessResourcePath: URI! + + """ + The HTTP URL to the organization's member access page. + """ + memberAccessUrl: URI! + node: User! + + """ + The role the member has on the team. + """ + role: TeamMemberRole! +} + +""" +Ordering options for team member connections +""" +input TeamMemberOrder { + """ + The field to order team members by. + """ + field: TeamMemberOrderField! + + """ + The ordering direction. + """ + direction: OrderDirection! +} + +""" +Properties by which team member connections can be ordered. +""" +enum TeamMemberOrderField { + """ + Order team members by login + """ + LOGIN + + """ + Order team members by creation time + """ + CREATED_AT +} + +""" +The possible team member roles; either 'maintainer' or 'member'. +""" +enum TeamMemberRole { + """ + A team maintainer has permission to add and remove team members. + """ + MAINTAINER + + """ + A team member has no administrative permissions on the team. + """ + MEMBER +} + +""" +Defines which types of team members are included in the returned list. Can be one of IMMEDIATE, CHILD_TEAM or ALL. +""" +enum TeamMembershipType { + """ + Includes only immediate members of the team. + """ + IMMEDIATE + + """ + Includes only child team members for the team. + """ + CHILD_TEAM + + """ + Includes immediate and child team members for the team. + """ + ALL +} + +""" +Ways in which team connections can be ordered. +""" +input TeamOrder { + """ + The field in which to order nodes by. + """ + field: TeamOrderField! + + """ + The direction in which to order nodes. + """ + direction: OrderDirection! +} + +""" +Properties by which team connections can be ordered. +""" +enum TeamOrderField { + """ + Allows ordering a list of teams by name. + """ + NAME +} + +""" +The possible team privacy values. +""" +enum TeamPrivacy { + """ + A secret team can only be seen by its members. + """ + SECRET + + """ + A visible team can be seen and @mentioned by every member of the organization. + """ + VISIBLE +} + +""" +The connection type for Repository. +""" +type TeamRepositoryConnection { + """ + A list of edges. + """ + edges: [TeamRepositoryEdge] + + """ + A list of nodes. + """ + nodes: [Repository] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +Represents a team repository. +""" +type TeamRepositoryEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + node: Repository! + + """ + The permission level the team has on the repository + """ + permission: RepositoryPermission! +} + +""" +Ordering options for team repository connections +""" +input TeamRepositoryOrder { + """ + The field to order repositories by. + """ + field: TeamRepositoryOrderField! + + """ + The ordering direction. + """ + direction: OrderDirection! +} + +""" +Properties by which team repository connections can be ordered. +""" +enum TeamRepositoryOrderField { + """ + Order repositories by creation time + """ + CREATED_AT + + """ + Order repositories by update time + """ + UPDATED_AT + + """ + Order repositories by push time + """ + PUSHED_AT + + """ + Order repositories by name + """ + NAME + + """ + Order repositories by permission + """ + PERMISSION + + """ + Order repositories by number of stargazers + """ + STARGAZERS +} + +""" +The role of a user on a team. +""" +enum TeamRole { + """ + User has admin rights on the team. + """ + ADMIN + + """ + User is a member of the team. + """ + MEMBER +} + +""" +A text match within a search result. +""" +type TextMatch { + """ + The specific text fragment within the property matched on. + """ + fragment: String! + + """ + Highlights within the matched fragment. + """ + highlights: [TextMatchHighlight!]! + + """ + The property matched on. + """ + property: String! +} + +""" +Represents a single highlight in a search result match. +""" +type TextMatchHighlight { + """ + The indice in the fragment where the matched text begins. + """ + beginIndice: Int! + + """ + The indice in the fragment where the matched text ends. + """ + endIndice: Int! + + """ + The text matched. + """ + text: String! +} + +""" +A topic aggregates entities that are related to a subject. +""" +type Topic implements Node & Starrable { + id: ID! + + """ + The topic's name. + """ + name: String! + + """ + A list of related topics, including aliases of this topic, sorted with the most relevant + first. Returns up to 10 Topics. + """ + relatedTopics( + """ + How many topics to return. + """ + first: Int = 3 + ): [Topic!]! + + """ + A list of users who have starred this starrable. + """ + stargazers( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Order for connection + """ + orderBy: StarOrder + ): StargazerConnection! + + """ + Returns a boolean indicating whether the viewing user has starred this starrable. + """ + viewerHasStarred: Boolean! +} + +""" +The connection type for Topic. +""" +type TopicConnection { + """ + A list of edges. + """ + edges: [TopicEdge] + + """ + A list of nodes. + """ + nodes: [Topic] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type TopicEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: Topic +} + +""" +Reason that the suggested topic is declined. +""" +enum TopicSuggestionDeclineReason { + """ + The suggested topic is not relevant to the repository. + """ + NOT_RELEVANT + + """ + The suggested topic is too specific for the repository (e.g. #ruby-on-rails-version-4-2-1). + """ + TOO_SPECIFIC + + """ + The viewer does not like the suggested topic. + """ + PERSONAL_PREFERENCE + + """ + The suggested topic is too general for the repository. + """ + TOO_GENERAL +} + +""" +Represents a 'transferred' event on a given issue or pull request. +""" +type TransferredEvent implements Node { + """ + Identifies the actor who performed the event. + """ + actor: Actor + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + The repository this came from + """ + fromRepository: Repository + id: ID! + + """ + Identifies the issue associated with the event. + """ + issue: Issue! +} + +""" +Represents a Git tree. +""" +type Tree implements Node & GitObject { + """ + An abbreviated version of the Git object ID + """ + abbreviatedOid: String! + + """ + The HTTP path for this Git object + """ + commitResourcePath: URI! + + """ + The HTTP URL for this Git object + """ + commitUrl: URI! + + """ + A list of tree entries. + """ + entries: [TreeEntry!] + id: ID! + + """ + The Git object ID + """ + oid: GitObjectID! + + """ + The Repository the Git object belongs to + """ + repository: Repository! +} + +""" +Represents a Git tree entry. +""" +type TreeEntry { + """ + Entry file mode. + """ + mode: Int! + + """ + Entry file name. + """ + name: String! + + """ + Entry file object. + """ + object: GitObject + + """ + Entry file Git object ID. + """ + oid: GitObjectID! + + """ + The Repository the tree entry belongs to + """ + repository: Repository! + + """ + Entry file type. + """ + type: String! +} + +""" +Represents an 'unassigned' event on any assignable object. +""" +type UnassignedEvent implements Node { + """ + Identifies the actor who performed the event. + """ + actor: Actor + + """ + Identifies the assignable associated with the event. + """ + assignable: Assignable! + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + id: ID! + + """ + Identifies the subject (user) who was unassigned. + """ + user: User +} + +""" +Represents a type that can be retrieved by a URL. +""" +interface UniformResourceLocatable { + """ + The HTML path to this resource. + """ + resourcePath: URI! + + """ + The URL to this resource. + """ + url: URI! +} + +""" +Represents an unknown signature on a Commit or Tag. +""" +type UnknownSignature implements GitSignature { + """ + Email used to sign this object. + """ + email: String! + + """ + True if the signature is valid and verified by GitHub. + """ + isValid: Boolean! + + """ + Payload for GPG signing object. Raw ODB object without the signature header. + """ + payload: String! + + """ + ASCII-armored signature header from object. + """ + signature: String! + + """ + GitHub user corresponding to the email signing this commit. + """ + signer: User + + """ + The state of this signature. `VALID` if signature is valid and verified by + GitHub, otherwise represents reason why signature is considered invalid. + """ + state: GitSignatureState! + + """ + True if the signature was made with GitHub's signing key. + """ + wasSignedByGitHub: Boolean! +} + +""" +Represents an 'unlabeled' event on a given issue or pull request. +""" +type UnlabeledEvent implements Node { + """ + Identifies the actor who performed the event. + """ + actor: Actor + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + id: ID! + + """ + Identifies the label associated with the 'unlabeled' event. + """ + label: Label! + + """ + Identifies the `Labelable` associated with the event. + """ + labelable: Labelable! +} + +""" +Represents an 'unlocked' event on a given issue or pull request. +""" +type UnlockedEvent implements Node { + """ + Identifies the actor who performed the event. + """ + actor: Actor + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + id: ID! + + """ + Object that was unlocked. + """ + lockable: Lockable! +} + +""" +Autogenerated input type of UnlockLockable +""" +input UnlockLockableInput { + """ + ID of the issue or pull request to be unlocked. + """ + lockableId: ID! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of UnlockLockable +""" +type UnlockLockablePayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The item that was unlocked. + """ + unlockedRecord: Lockable +} + +""" +Autogenerated input type of UnmarkIssueAsDuplicate +""" +input UnmarkIssueAsDuplicateInput { + """ + ID of the issue or pull request currently marked as a duplicate. + """ + duplicateId: ID! + + """ + ID of the issue or pull request currently considered canonical/authoritative/original. + """ + canonicalId: ID! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of UnmarkIssueAsDuplicate +""" +type UnmarkIssueAsDuplicatePayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The issue or pull request that was marked as a duplicate. + """ + duplicate: IssueOrPullRequest +} + +""" +Autogenerated input type of UnminimizeComment +""" +input UnminimizeCommentInput { + """ + The Node ID of the subject to modify. + """ + subjectId: ID! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated input type of UnpinIssue +""" +input UnpinIssueInput { + """ + The ID of the issue to be unpinned + """ + issueId: ID! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Represents an 'unpinned' event on a given issue or pull request. +""" +type UnpinnedEvent implements Node { + """ + Identifies the actor who performed the event. + """ + actor: Actor + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + id: ID! + + """ + Identifies the issue associated with the event. + """ + issue: Issue! +} + +""" +Autogenerated input type of UnresolveReviewThread +""" +input UnresolveReviewThreadInput { + """ + The ID of the thread to unresolve + """ + threadId: ID! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of UnresolveReviewThread +""" +type UnresolveReviewThreadPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The thread to resolve. + """ + thread: PullRequestReviewThread +} + +""" +Represents an 'unsubscribed' event on a given `Subscribable`. +""" +type UnsubscribedEvent implements Node { + """ + Identifies the actor who performed the event. + """ + actor: Actor + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + id: ID! + + """ + Object referenced by event. + """ + subscribable: Subscribable! +} + +""" +Entities that can be updated. +""" +interface Updatable { + """ + Check if the current viewer can update this object. + """ + viewerCanUpdate: Boolean! +} + +""" +Comments that can be updated. +""" +interface UpdatableComment { + """ + Reasons why the current viewer can not update this comment. + """ + viewerCannotUpdateReasons: [CommentCannotUpdateReason!]! +} + +""" +Autogenerated input type of UpdateBranchProtectionRule +""" +input UpdateBranchProtectionRuleInput { + """ + The global relay id of the branch protection rule to be updated. + """ + branchProtectionRuleId: ID! + + """ + The glob-like pattern used to determine matching branches. + """ + pattern: String + + """ + Are approving reviews required to update matching branches. + """ + requiresApprovingReviews: Boolean + + """ + Number of approving reviews required to update matching branches. + """ + requiredApprovingReviewCount: Int + + """ + Are commits required to be signed. + """ + requiresCommitSignatures: Boolean + + """ + Can admins overwrite branch protection. + """ + isAdminEnforced: Boolean + + """ + Are status checks required to update matching branches. + """ + requiresStatusChecks: Boolean + + """ + Are branches required to be up to date before merging. + """ + requiresStrictStatusChecks: Boolean + + """ + Are reviews from code owners required to update matching branches. + """ + requiresCodeOwnerReviews: Boolean + + """ + Will new commits pushed to matching branches dismiss pull request review approvals. + """ + dismissesStaleReviews: Boolean + + """ + Is dismissal of pull request reviews restricted. + """ + restrictsReviewDismissals: Boolean + + """ + A list of User or Team IDs allowed to dismiss reviews on pull requests targeting matching branches. + """ + reviewDismissalActorIds: [ID!] + + """ + Is pushing to matching branches restricted. + """ + restrictsPushes: Boolean + + """ + A list of User or Team IDs allowed to push to matching branches. + """ + pushActorIds: [ID!] + + """ + List of required status check contexts that must pass for commits to be accepted to matching branches. + """ + requiredStatusCheckContexts: [String!] + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of UpdateBranchProtectionRule +""" +type UpdateBranchProtectionRulePayload { + """ + The newly created BranchProtectionRule. + """ + branchProtectionRule: BranchProtectionRule + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated input type of UpdateIssueComment +""" +input UpdateIssueCommentInput { + """ + The ID of the IssueComment to modify. + """ + id: ID! + + """ + The updated text of the comment. + """ + body: String! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of UpdateIssueComment +""" +type UpdateIssueCommentPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The updated comment. + """ + issueComment: IssueComment +} + +""" +Autogenerated input type of UpdateIssue +""" +input UpdateIssueInput { + """ + The ID of the Issue to modify. + """ + id: ID! + + """ + The title for the issue. + """ + title: String + + """ + The body for the issue description. + """ + body: String + + """ + An array of Node IDs of users for this issue. + """ + assigneeIds: [ID!] + + """ + The Node ID of the milestone for this issue. + """ + milestoneId: ID + + """ + An array of Node IDs of labels for this issue. + """ + labelIds: [ID!] + + """ + The desired issue state. + """ + state: IssueState + + """ + An array of Node IDs for projects associated with this issue. + """ + projectIds: [ID!] + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of UpdateIssue +""" +type UpdateIssuePayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The issue. + """ + issue: Issue +} + +""" +Autogenerated input type of UpdateProjectCard +""" +input UpdateProjectCardInput { + """ + The ProjectCard ID to update. + """ + projectCardId: ID! + + """ + Whether or not the ProjectCard should be archived + """ + isArchived: Boolean + + """ + The note of ProjectCard. + """ + note: String + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of UpdateProjectCard +""" +type UpdateProjectCardPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The updated ProjectCard. + """ + projectCard: ProjectCard +} + +""" +Autogenerated input type of UpdateProjectColumn +""" +input UpdateProjectColumnInput { + """ + The ProjectColumn ID to update. + """ + projectColumnId: ID! + + """ + The name of project column. + """ + name: String! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of UpdateProjectColumn +""" +type UpdateProjectColumnPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The updated project column. + """ + projectColumn: ProjectColumn +} + +""" +Autogenerated input type of UpdateProject +""" +input UpdateProjectInput { + """ + The Project ID to update. + """ + projectId: ID! + + """ + The name of project. + """ + name: String + + """ + The description of project. + """ + body: String + + """ + Whether the project is open or closed. + """ + state: ProjectState + + """ + Whether the project is public or not. + """ + public: Boolean + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of UpdateProject +""" +type UpdateProjectPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The updated project. + """ + project: Project +} + +""" +Autogenerated input type of UpdatePullRequest +""" +input UpdatePullRequestInput { + """ + The Node ID of the pull request. + """ + pullRequestId: ID! + + """ + The name of the branch you want your changes pulled into. This should be an existing branch + on the current repository. + """ + baseRefName: String + + """ + The title of the pull request. + """ + title: String + + """ + The contents of the pull request. + """ + body: String + + """ + Indicates whether maintainers can modify the pull request. + """ + maintainerCanModify: Boolean + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of UpdatePullRequest +""" +type UpdatePullRequestPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The updated pull request. + """ + pullRequest: PullRequest +} + +""" +Autogenerated input type of UpdatePullRequestReviewComment +""" +input UpdatePullRequestReviewCommentInput { + """ + The Node ID of the comment to modify. + """ + pullRequestReviewCommentId: ID! + + """ + The text of the comment. + """ + body: String! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of UpdatePullRequestReviewComment +""" +type UpdatePullRequestReviewCommentPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The updated comment. + """ + pullRequestReviewComment: PullRequestReviewComment +} + +""" +Autogenerated input type of UpdatePullRequestReview +""" +input UpdatePullRequestReviewInput { + """ + The Node ID of the pull request review to modify. + """ + pullRequestReviewId: ID! + + """ + The contents of the pull request review body. + """ + body: String! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of UpdatePullRequestReview +""" +type UpdatePullRequestReviewPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The updated pull request review. + """ + pullRequestReview: PullRequestReview +} + +""" +Autogenerated input type of UpdateSubscription +""" +input UpdateSubscriptionInput { + """ + The Node ID of the subscribable object to modify. + """ + subscribableId: ID! + + """ + The new state of the subscription. + """ + state: SubscriptionState! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of UpdateSubscription +""" +type UpdateSubscriptionPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The input subscribable entity. + """ + subscribable: Subscribable +} + +""" +Autogenerated input type of UpdateTopics +""" +input UpdateTopicsInput { + """ + The Node ID of the repository. + """ + repositoryId: ID! + + """ + An array of topic names. + """ + topicNames: [String!]! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String +} + +""" +Autogenerated return type of UpdateTopics +""" +type UpdateTopicsPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + Names of the provided topics that are not valid. + """ + invalidTopicNames: [String!] + + """ + The updated repository. + """ + repository: Repository +} + +""" +An RFC 3986, RFC 3987, and RFC 6570 (level 4) compliant URI string. +""" +scalar URI + +""" +A user is an individual's account on GitHub that owns repositories and can make new content. +""" +type User implements Node & Actor & RegistryPackageOwner & RegistryPackageSearch & ProjectOwner & RepositoryOwner & UniformResourceLocatable & ProfileOwner { + """ + Determine if this repository owner has any items that can be pinned to their profile. + """ + anyPinnableItems( + """ + Filter to only a particular kind of pinnable item. + """ + type: PinnableItemType + ): Boolean! + + """ + A URL pointing to the user's public avatar. + """ + avatarUrl( + """ + The size of the resulting square image. + """ + size: Int + ): URI! + + """ + The user's public profile bio. + """ + bio: String + + """ + The user's public profile bio as HTML. + """ + bioHTML: HTML! + + """ + A list of commit comments made by this user. + """ + commitComments( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): CommitCommentConnection! + + """ + The user's public profile company. + """ + company: String + + """ + The user's public profile company as HTML. + """ + companyHTML: HTML! + + """ + The collection of contributions this user has made to different repositories. + """ + contributionsCollection( + """ + The ID of the organization used to filter contributions. + """ + organizationID: ID + + """ + Only contributions made at this time or later will be counted. If omitted, defaults to a year ago. + """ + from: DateTime + + """ + Only contributions made before and up to and including this time will be + counted. If omitted, defaults to the current time. + """ + to: DateTime + ): ContributionsCollection! + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + Identifies the primary key from the database. + """ + databaseId: Int + + """ + The user's publicly visible profile email. + """ + email: String! + + """ + A list of users the given user is followed by. + """ + followers( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): FollowerConnection! + + """ + A list of users the given user is following. + """ + following( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): FollowingConnection! + + """ + Find gist by repo name. + """ + gist( + """ + The gist name to find. + """ + name: String! + ): Gist + + """ + A list of gist comments made by this user. + """ + gistComments( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): GistCommentConnection! + + """ + A list of the Gists the user has created. + """ + gists( + """ + Filters Gists according to privacy. + """ + privacy: GistPrivacy + + """ + Ordering options for gists returned from the connection + """ + orderBy: GistOrder + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): GistConnection! + id: ID! + + """ + Whether or not this user is a participant in the GitHub Security Bug Bounty. + """ + isBountyHunter: Boolean! + + """ + Whether or not this user is a participant in the GitHub Campus Experts Program. + """ + isCampusExpert: Boolean! + + """ + Whether or not this user is a GitHub Developer Program member. + """ + isDeveloperProgramMember: Boolean! + + """ + Whether or not this user is a GitHub employee. + """ + isEmployee: Boolean! + + """ + Whether or not the user has marked themselves as for hire. + """ + isHireable: Boolean! + + """ + Whether or not this user is a site administrator. + """ + isSiteAdmin: Boolean! + + """ + Whether or not this user is the viewing user. + """ + isViewer: Boolean! + + """ + A list of issue comments made by this user. + """ + issueComments( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): IssueCommentConnection! + + """ + A list of issues associated with this user. + """ + issues( + """ + Ordering options for issues returned from the connection. + """ + orderBy: IssueOrder + + """ + A list of label names to filter the pull requests by. + """ + labels: [String!] + + """ + A list of states to filter the issues by. + """ + states: [IssueState!] + + """ + Filtering options for issues returned from the connection. + """ + filterBy: IssueFilters + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): IssueConnection! + + """ + Showcases a selection of repositories and gists that the profile owner has + either curated or that have been selected automatically based on popularity. + """ + itemShowcase: ProfileItemShowcase! + + """ + The user's public profile location. + """ + location: String + + """ + The username used to login. + """ + login: String! + + """ + The user's public profile name. + """ + name: String + + """ + Find an organization by its login that the user belongs to. + """ + organization( + """ + The login of the organization to find. + """ + login: String! + ): Organization + + """ + A list of organizations the user belongs to. + """ + organizations( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): OrganizationConnection! + + """ + A list of repositories and gists this profile owner can pin to their profile. + """ + pinnableItems( + """ + Filter the types of pinnable items that are returned. + """ + types: [PinnableItemType!] + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): PinnableItemConnection! + + """ + A list of repositories and gists this profile owner has pinned to their profile + """ + pinnedItems( + """ + Filter the types of pinned items that are returned. + """ + types: [PinnableItemType!] + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): PinnableItemConnection! + + """ + Returns how many more items this profile owner can pin to their profile. + """ + pinnedItemsRemaining: Int! + + """ + A list of repositories this user has pinned to their profile + """ + pinnedRepositories( + """ + If non-null, filters repositories according to privacy + """ + privacy: RepositoryPrivacy + + """ + Ordering options for repositories returned from the connection + """ + orderBy: RepositoryOrder + + """ + Array of viewer's affiliation options for repositories returned from the + connection. For example, OWNER will include only repositories that the + current viewer owns. + """ + affiliations: [RepositoryAffiliation] + + """ + Array of owner's affiliation options for repositories returned from the + connection. For example, OWNER will include only repositories that the + organization or user being viewed owns. + """ + ownerAffiliations: [RepositoryAffiliation] + + """ + If non-null, filters repositories according to whether they have been locked + """ + isLocked: Boolean + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): RepositoryConnection! + @deprecated( + reason: "pinnedRepositories will be removed Use ProfileOwner.pinnedItems instead. Removal on 2019-07-01 UTC." + ) + + """ + Find project by number. + """ + project( + """ + The project number to find. + """ + number: Int! + ): Project + + """ + A list of projects under the owner. + """ + projects( + """ + Ordering options for projects returned from the connection + """ + orderBy: ProjectOrder + + """ + Query to search projects by, currently only searching by name. + """ + search: String + + """ + A list of states to filter the projects by. + """ + states: [ProjectState!] + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): ProjectConnection! + + """ + The HTTP path listing user's projects + """ + projectsResourcePath: URI! + + """ + The HTTP URL listing user's projects + """ + projectsUrl: URI! + + """ + A list of public keys associated with this user. + """ + publicKeys( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): PublicKeyConnection! + + """ + A list of pull requests associated with this user. + """ + pullRequests( + """ + A list of states to filter the pull requests by. + """ + states: [PullRequestState!] + + """ + A list of label names to filter the pull requests by. + """ + labels: [String!] + + """ + The head ref name to filter the pull requests by. + """ + headRefName: String + + """ + The base ref name to filter the pull requests by. + """ + baseRefName: String + + """ + Ordering options for pull requests returned from the connection. + """ + orderBy: IssueOrder + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): PullRequestConnection! + + """ + A list of repositories that the user owns. + """ + repositories( + """ + If non-null, filters repositories according to privacy + """ + privacy: RepositoryPrivacy + + """ + Ordering options for repositories returned from the connection + """ + orderBy: RepositoryOrder + + """ + Array of viewer's affiliation options for repositories returned from the + connection. For example, OWNER will include only repositories that the + current viewer owns. + """ + affiliations: [RepositoryAffiliation] + + """ + Array of owner's affiliation options for repositories returned from the + connection. For example, OWNER will include only repositories that the + organization or user being viewed owns. + """ + ownerAffiliations: [RepositoryAffiliation] + + """ + If non-null, filters repositories according to whether they have been locked + """ + isLocked: Boolean + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + If non-null, filters repositories according to whether they are forks of another repository + """ + isFork: Boolean + ): RepositoryConnection! + + """ + A list of repositories that the user recently contributed to. + """ + repositoriesContributedTo( + """ + If non-null, filters repositories according to privacy + """ + privacy: RepositoryPrivacy + + """ + Ordering options for repositories returned from the connection + """ + orderBy: RepositoryOrder + + """ + If non-null, filters repositories according to whether they have been locked + """ + isLocked: Boolean + + """ + If true, include user repositories + """ + includeUserRepositories: Boolean + + """ + If non-null, include only the specified types of contributions. The + GitHub.com UI uses [COMMIT, ISSUE, PULL_REQUEST, REPOSITORY] + """ + contributionTypes: [RepositoryContributionType] + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): RepositoryConnection! + + """ + Find Repository. + """ + repository( + """ + Name of Repository to find. + """ + name: String! + ): Repository + + """ + The HTTP path for this user + """ + resourcePath: URI! + + """ + Repositories the user has starred. + """ + starredRepositories( + """ + Filters starred repositories to only return repositories owned by the viewer. + """ + ownedByViewer: Boolean + + """ + Order for connection + """ + orderBy: StarOrder + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): StarredRepositoryConnection! + + """ + The user's description of what they're currently doing. + """ + status: UserStatus + + """ + Identifies the date and time when the object was last updated. + """ + updatedAt: DateTime! + + """ + The HTTP URL for this user + """ + url: URI! + + """ + Can the viewer pin repositories and gists to the profile? + """ + viewerCanChangePinnedItems: Boolean! + + """ + Can the current viewer create new projects on this owner. + """ + viewerCanCreateProjects: Boolean! + + """ + Whether or not the viewer is able to follow the user. + """ + viewerCanFollow: Boolean! + + """ + Whether or not this user is followed by the viewer. + """ + viewerIsFollowing: Boolean! + + """ + A list of repositories the given user is watching. + """ + watching( + """ + If non-null, filters repositories according to privacy + """ + privacy: RepositoryPrivacy + + """ + Ordering options for repositories returned from the connection + """ + orderBy: RepositoryOrder + + """ + Affiliation options for repositories returned from the connection + """ + affiliations: [RepositoryAffiliation] + + """ + Array of owner's affiliation options for repositories returned from the + connection. For example, OWNER will include only repositories that the + organization or user being viewed owns. + """ + ownerAffiliations: [RepositoryAffiliation] + + """ + If non-null, filters repositories according to whether they have been locked + """ + isLocked: Boolean + + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): RepositoryConnection! + + """ + A URL pointing to the user's public website/blog. + """ + websiteUrl: URI +} + +""" +The possible durations that a user can be blocked for. +""" +enum UserBlockDuration { + """ + The user was blocked for 1 day + """ + ONE_DAY + + """ + The user was blocked for 3 days + """ + THREE_DAYS + + """ + The user was blocked for 7 days + """ + ONE_WEEK + + """ + The user was blocked for 30 days + """ + ONE_MONTH + + """ + The user was blocked permanently + """ + PERMANENT +} + +""" +Represents a 'user_blocked' event on a given user. +""" +type UserBlockedEvent implements Node { + """ + Identifies the actor who performed the event. + """ + actor: Actor + + """ + Number of days that the user was blocked for. + """ + blockDuration: UserBlockDuration! + + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + id: ID! + + """ + The user who was blocked. + """ + subject: User +} + +""" +The connection type for User. +""" +type UserConnection { + """ + A list of edges. + """ + edges: [UserEdge] + + """ + A list of nodes. + """ + nodes: [User] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edit on user content +""" +type UserContentEdit implements Node { + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + Identifies the date and time when the object was deleted. + """ + deletedAt: DateTime + + """ + The actor who deleted this content + """ + deletedBy: Actor + + """ + A summary of the changes for this edit + """ + diff: String + + """ + When this content was edited + """ + editedAt: DateTime! + + """ + The actor who edited this content + """ + editor: Actor + id: ID! + + """ + Identifies the date and time when the object was last updated. + """ + updatedAt: DateTime! +} + +""" +A list of edits to content. +""" +type UserContentEditConnection { + """ + A list of edges. + """ + edges: [UserContentEditEdge] + + """ + A list of nodes. + """ + nodes: [UserContentEdit] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type UserContentEditEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: UserContentEdit +} + +""" +Represents a user. +""" +type UserEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: User +} + +""" +The user's description of what they're currently doing. +""" +type UserStatus implements Node { + """ + Identifies the date and time when the object was created. + """ + createdAt: DateTime! + + """ + An emoji summarizing the user's status. + """ + emoji: String + + """ + ID of the object. + """ + id: ID! + + """ + Whether this status indicates the user is not fully available on GitHub. + """ + indicatesLimitedAvailability: Boolean! + + """ + A brief message describing what the user is doing. + """ + message: String + + """ + The organization whose members can see this status. If null, this status is publicly visible. + """ + organization: Organization + + """ + Identifies the date and time when the object was last updated. + """ + updatedAt: DateTime! + + """ + The user who has this status. + """ + user: User! +} + +""" +The connection type for UserStatus. +""" +type UserStatusConnection { + """ + A list of edges. + """ + edges: [UserStatusEdge] + + """ + A list of nodes. + """ + nodes: [UserStatus] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type UserStatusEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: UserStatus +} + +""" +Ordering options for user status connections. +""" +input UserStatusOrder { + """ + The field to order user statuses by. + """ + field: UserStatusOrderField! + + """ + The ordering direction. + """ + direction: OrderDirection! +} + +""" +Properties by which user status connections can be ordered. +""" +enum UserStatusOrderField { + """ + Order user statuses by when they were updated. + """ + UPDATED_AT +} + +""" +A valid x509 certificate string +""" +scalar X509Certificate diff --git a/benchmark/github-schema.json b/benchmark/github-schema.json new file mode 100644 index 00000000..7352a87f --- /dev/null +++ b/benchmark/github-schema.json @@ -0,0 +1,56836 @@ +{ + "data": { + "__schema": { + "queryType": { + "name": "Query" + }, + "mutationType": { + "name": "Mutation" + }, + "subscriptionType": null, + "types": [ + { + "kind": "SCALAR", + "name": "Boolean", + "description": "Represents `true` or `false` values.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "SCALAR", + "name": "String", + "description": "Represents textual data as UTF-8 character sequences. This type is most often used by GraphQL to represent free-form human-readable text.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Query", + "description": "The query root of GitHub's GraphQL interface.", + "fields": [ + { + "name": "codeOfConduct", + "description": "Look up a code of conduct by its key", + "args": [ + { + "name": "key", + "description": "The code of conduct's key", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "CodeOfConduct", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "codesOfConduct", + "description": "Look up a code of conduct by its key", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CodeOfConduct", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "license", + "description": "Look up an open source license by its key", + "args": [ + { + "name": "key", + "description": "The license's downcased SPDX ID", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "License", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "licenses", + "description": "Return a list of known open source licenses", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "License", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "marketplaceCategories", + "description": "Get alphabetically sorted list of Marketplace categories", + "args": [ + { + "name": "includeCategories", + "description": "Return only the specified categories.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "excludeEmpty", + "description": "Exclude categories with no listings.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "excludeSubcategories", + "description": "Returns top level categories only, excluding any subcategories.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "MarketplaceCategory", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "marketplaceCategory", + "description": "Look up a Marketplace category by its slug.", + "args": [ + { + "name": "slug", + "description": "The URL slug of the category.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "useTopicAliases", + "description": "Also check topic aliases for the category slug", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "MarketplaceCategory", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "marketplaceListing", + "description": "Look up a single Marketplace listing", + "args": [ + { + "name": "slug", + "description": "Select the listing that matches this slug. It's the short name of the listing used in its URL.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "MarketplaceListing", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "marketplaceListings", + "description": "Look up Marketplace listings", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "categorySlug", + "description": "Select only listings with the given category.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "useTopicAliases", + "description": "Also check topic aliases for the category slug", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "viewerCanAdmin", + "description": "Select listings to which user has admin access. If omitted, listings visible to the\nviewer are returned.\n", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "adminId", + "description": "Select listings that can be administered by the specified user.", + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "organizationId", + "description": "Select listings for products owned by the specified organization.", + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "allStates", + "description": "Select listings visible to the viewer even if they are not approved. If omitted or\nfalse, only approved listings will be returned.\n", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "slugs", + "description": "Select the listings with these slugs, if they are visible to the viewer.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "primaryCategoryOnly", + "description": "Select only listings where the primary category matches the given category slug.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false" + }, + { + "name": "withFreeTrialsOnly", + "description": "Select only listings that offer a free trial.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false" + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "MarketplaceListingConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "meta", + "description": "Return information about the GitHub instance", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "GitHubMetadata", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "Fetches an object given its ID.", + "args": [ + { + "name": "id", + "description": "ID of the object.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "Lookup nodes by a list of IDs.", + "args": [ + { + "name": "ids", + "description": "The list of node IDs.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + } + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "organization", + "description": "Lookup a organization by login.", + "args": [ + { + "name": "login", + "description": "The organization's login.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Organization", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "rateLimit", + "description": "The client's rate limit information.", + "args": [ + { + "name": "dryRun", + "description": "If true, calculate the cost for the query without evaluating it", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false" + } + ], + "type": { + "kind": "OBJECT", + "name": "RateLimit", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "relay", + "description": "Hack to workaround https://github.com/facebook/relay/issues/112 re-exposing the root query object", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Query", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repository", + "description": "Lookup a given repository by the owner and repository name.", + "args": [ + { + "name": "owner", + "description": "The login field of a user or organization", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "name", + "description": "The name of the repository", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repositoryOwner", + "description": "Lookup a repository owner (ie. either a User or an Organization) by login.", + "args": [ + { + "name": "login", + "description": "The username to lookup the owner by.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "INTERFACE", + "name": "RepositoryOwner", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resource", + "description": "Lookup resource by a URL.", + "args": [ + { + "name": "url", + "description": "The URL.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "INTERFACE", + "name": "UniformResourceLocatable", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "search", + "description": "Perform a search across resources.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "query", + "description": "The search string to look for.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "type", + "description": "The types of search items to search within.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "SearchType", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SearchResultItemConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "securityAdvisories", + "description": "GitHub Security Advisories", + "args": [ + { + "name": "orderBy", + "description": "Ordering options for the returned topics.", + "type": { + "kind": "INPUT_OBJECT", + "name": "SecurityAdvisoryOrder", + "ofType": null + }, + "defaultValue": "{field:\"UPDATED_AT\",direction:\"DESC\"}" + }, + { + "name": "identifier", + "description": "Filter advisories by identifier, e.g. GHSA or CVE.", + "type": { + "kind": "INPUT_OBJECT", + "name": "SecurityAdvisoryIdentifierFilter", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "publishedSince", + "description": "Filter advisories to those published since a time in the past.", + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "updatedSince", + "description": "Filter advisories to those updated since a time in the past.", + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SecurityAdvisoryConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "securityAdvisory", + "description": "Fetch a Security Advisory by its GHSA ID", + "args": [ + { + "name": "ghsaId", + "description": "GitHub Security Advisory ID.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "SecurityAdvisory", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "securityVulnerabilities", + "description": "Software Vulnerabilities documented by GitHub Security Advisories", + "args": [ + { + "name": "orderBy", + "description": "Ordering options for the returned topics.", + "type": { + "kind": "INPUT_OBJECT", + "name": "SecurityVulnerabilityOrder", + "ofType": null + }, + "defaultValue": "{field:\"UPDATED_AT\",direction:\"DESC\"}" + }, + { + "name": "ecosystem", + "description": "An ecosystem to filter vulnerabilities by.", + "type": { + "kind": "ENUM", + "name": "SecurityAdvisoryEcosystem", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "package", + "description": "A package name to filter vulnerabilities by.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "severities", + "description": "A list of severities to filter vulnerabilities by.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "SecurityAdvisorySeverity", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SecurityVulnerabilityConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "topic", + "description": "Look up a topic by name.", + "args": [ + { + "name": "name", + "description": "The topic's name.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Topic", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "user", + "description": "Lookup a user by login.", + "args": [ + { + "name": "login", + "description": "The user's login.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "User", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewer", + "description": "The currently authenticated user.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "User", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INTERFACE", + "name": "Node", + "description": "An object with an ID.", + "fields": [ + { + "name": "id", + "description": "ID of the object.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "AddedToProjectEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "App", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "AssignedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "BaseRefChangedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "BaseRefForcePushedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Blob", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Bot", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "BranchProtectionRule", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ClosedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "CodeOfConduct", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "CommentDeletedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Commit", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "CommitComment", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "CommitCommentThread", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ConvertedNoteToIssueEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "CrossReferencedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "DemilestonedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "DeployKey", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "DeployedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Deployment", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "DeploymentEnvironmentChangedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "DeploymentStatus", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ExternalIdentity", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Gist", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "GistComment", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "HeadRefDeletedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "HeadRefForcePushedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "HeadRefRestoredEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Issue", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "IssueComment", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Label", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "LabeledEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Language", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "License", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "LockedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Mannequin", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "MarketplaceCategory", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "MarketplaceListing", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "MentionedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "MergedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Milestone", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "MilestonedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "MovedColumnsInProjectEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Organization", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "OrganizationIdentityProvider", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "OrganizationInvitation", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PinnedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Project", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ProjectCard", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ProjectColumn", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PublicKey", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequestCommit", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequestCommitCommentThread", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequestReview", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequestReviewComment", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequestReviewThread", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PushAllowance", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Reaction", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Ref", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ReferencedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Release", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ReleaseAsset", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "RemovedFromProjectEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "RenamedTitleEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ReopenedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "RepositoryInvitation", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "RepositoryTopic", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ReviewDismissalAllowance", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ReviewDismissedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ReviewRequest", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ReviewRequestRemovedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ReviewRequestedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "SecurityAdvisory", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Status", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "StatusContext", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "SubscribedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Tag", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Team", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Topic", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "TransferredEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Tree", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "UnassignedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "UnlabeledEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "UnlockedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "UnpinnedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "UnsubscribedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "User", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "UserBlockedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "UserContentEdit", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "UserStatus", + "ofType": null + } + ] + }, + { + "kind": "SCALAR", + "name": "ID", + "description": "Represents a unique identifier that is Base64 obfuscated. It is often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `\"VXNlci0xMA==\"`) or integer (such as `4`) input value will be accepted as an ID.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INTERFACE", + "name": "UniformResourceLocatable", + "description": "Represents a type that can be retrieved by a URL.", + "fields": [ + { + "name": "resourcePath", + "description": "The HTML path to this resource.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The URL to this resource.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "Bot", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ClosedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Commit", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "CrossReferencedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Issue", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Mannequin", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "MergedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Milestone", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Organization", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequestCommit", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Release", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "RepositoryTopic", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ReviewDismissedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "User", + "ofType": null + } + ] + }, + { + "kind": "SCALAR", + "name": "URI", + "description": "An RFC 3986, RFC 3987, and RFC 6570 (level 4) compliant URI string.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "User", + "description": "A user is an individual's account on GitHub that owns repositories and can make new content.", + "fields": [ + { + "name": "anyPinnableItems", + "description": "Determine if this repository owner has any items that can be pinned to their profile.", + "args": [ + { + "name": "type", + "description": "Filter to only a particular kind of pinnable item.", + "type": { + "kind": "ENUM", + "name": "PinnableItemType", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "avatarUrl", + "description": "A URL pointing to the user's public avatar.", + "args": [ + { + "name": "size", + "description": "The size of the resulting square image.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "bio", + "description": "The user's public profile bio.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "bioHTML", + "description": "The user's public profile bio as HTML.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "HTML", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "commitComments", + "description": "A list of commit comments made by this user.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CommitCommentConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "company", + "description": "The user's public profile company.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "companyHTML", + "description": "The user's public profile company as HTML.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "HTML", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "contributionsCollection", + "description": "The collection of contributions this user has made to different repositories.", + "args": [ + { + "name": "organizationID", + "description": "The ID of the organization used to filter contributions.", + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "from", + "description": "Only contributions made at this time or later will be counted. If omitted, defaults to a year ago.", + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "to", + "description": "Only contributions made before and up to and including this time will be counted. If omitted, defaults to the current time.", + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ContributionsCollection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "databaseId", + "description": "Identifies the primary key from the database.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "email", + "description": "The user's publicly visible profile email.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "followers", + "description": "A list of users the given user is followed by.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "FollowerConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "following", + "description": "A list of users the given user is following.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "FollowingConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "gist", + "description": "Find gist by repo name.", + "args": [ + { + "name": "name", + "description": "The gist name to find.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Gist", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "gistComments", + "description": "A list of gist comments made by this user.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "GistCommentConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "gists", + "description": "A list of the Gists the user has created.", + "args": [ + { + "name": "privacy", + "description": "Filters Gists according to privacy.", + "type": { + "kind": "ENUM", + "name": "GistPrivacy", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Ordering options for gists returned from the connection", + "type": { + "kind": "INPUT_OBJECT", + "name": "GistOrder", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "GistConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isBountyHunter", + "description": "Whether or not this user is a participant in the GitHub Security Bug Bounty.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isCampusExpert", + "description": "Whether or not this user is a participant in the GitHub Campus Experts Program.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isDeveloperProgramMember", + "description": "Whether or not this user is a GitHub Developer Program member.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isEmployee", + "description": "Whether or not this user is a GitHub employee.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isHireable", + "description": "Whether or not the user has marked themselves as for hire.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isSiteAdmin", + "description": "Whether or not this user is a site administrator.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isViewer", + "description": "Whether or not this user is the viewing user.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "issueComments", + "description": "A list of issue comments made by this user.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "IssueCommentConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "issues", + "description": "A list of issues associated with this user.", + "args": [ + { + "name": "orderBy", + "description": "Ordering options for issues returned from the connection.", + "type": { + "kind": "INPUT_OBJECT", + "name": "IssueOrder", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "labels", + "description": "A list of label names to filter the pull requests by.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "states", + "description": "A list of states to filter the issues by.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "IssueState", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "filterBy", + "description": "Filtering options for issues returned from the connection.", + "type": { + "kind": "INPUT_OBJECT", + "name": "IssueFilters", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "IssueConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "itemShowcase", + "description": "Showcases a selection of repositories and gists that the profile owner has either curated or that have been selected automatically based on popularity.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ProfileItemShowcase", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "location", + "description": "The user's public profile location.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "login", + "description": "The username used to login.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The user's public profile name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "organization", + "description": "Find an organization by its login that the user belongs to.", + "args": [ + { + "name": "login", + "description": "The login of the organization to find.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Organization", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "organizations", + "description": "A list of organizations the user belongs to.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "OrganizationConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pinnableItems", + "description": "A list of repositories and gists this profile owner can pin to their profile.", + "args": [ + { + "name": "types", + "description": "Filter the types of pinnable items that are returned.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "PinnableItemType", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PinnableItemConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pinnedItems", + "description": "A list of repositories and gists this profile owner has pinned to their profile", + "args": [ + { + "name": "types", + "description": "Filter the types of pinned items that are returned.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "PinnableItemType", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PinnableItemConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pinnedItemsRemaining", + "description": "Returns how many more items this profile owner can pin to their profile.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pinnedRepositories", + "description": "A list of repositories this user has pinned to their profile", + "args": [ + { + "name": "privacy", + "description": "If non-null, filters repositories according to privacy", + "type": { + "kind": "ENUM", + "name": "RepositoryPrivacy", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Ordering options for repositories returned from the connection", + "type": { + "kind": "INPUT_OBJECT", + "name": "RepositoryOrder", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "affiliations", + "description": "Array of viewer's affiliation options for repositories returned from the connection. For example, OWNER will include only repositories that the current viewer owns.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "RepositoryAffiliation", + "ofType": null + } + }, + "defaultValue": "[\"OWNER\", \"COLLABORATOR\"]" + }, + { + "name": "ownerAffiliations", + "description": "Array of owner's affiliation options for repositories returned from the connection. For example, OWNER will include only repositories that the organization or user being viewed owns.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "RepositoryAffiliation", + "ofType": null + } + }, + "defaultValue": "[\"OWNER\", \"COLLABORATOR\"]" + }, + { + "name": "isLocked", + "description": "If non-null, filters repositories according to whether they have been locked", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "RepositoryConnection", + "ofType": null + } + }, + "isDeprecated": true, + "deprecationReason": "pinnedRepositories will be removed Use ProfileOwner.pinnedItems instead. Removal on 2019-07-01 UTC." + }, + { + "name": "project", + "description": "Find project by number.", + "args": [ + { + "name": "number", + "description": "The project number to find.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Project", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "projects", + "description": "A list of projects under the owner.", + "args": [ + { + "name": "orderBy", + "description": "Ordering options for projects returned from the connection", + "type": { + "kind": "INPUT_OBJECT", + "name": "ProjectOrder", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "search", + "description": "Query to search projects by, currently only searching by name.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "states", + "description": "A list of states to filter the projects by.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "ProjectState", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ProjectConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "projectsResourcePath", + "description": "The HTTP path listing user's projects", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "projectsUrl", + "description": "The HTTP URL listing user's projects", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "publicKeys", + "description": "A list of public keys associated with this user.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PublicKeyConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequests", + "description": "A list of pull requests associated with this user.", + "args": [ + { + "name": "states", + "description": "A list of states to filter the pull requests by.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "PullRequestState", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "labels", + "description": "A list of label names to filter the pull requests by.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "headRefName", + "description": "The head ref name to filter the pull requests by.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "baseRefName", + "description": "The base ref name to filter the pull requests by.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Ordering options for pull requests returned from the connection.", + "type": { + "kind": "INPUT_OBJECT", + "name": "IssueOrder", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequestConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repositories", + "description": "A list of repositories that the user owns.", + "args": [ + { + "name": "privacy", + "description": "If non-null, filters repositories according to privacy", + "type": { + "kind": "ENUM", + "name": "RepositoryPrivacy", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Ordering options for repositories returned from the connection", + "type": { + "kind": "INPUT_OBJECT", + "name": "RepositoryOrder", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "affiliations", + "description": "Array of viewer's affiliation options for repositories returned from the connection. For example, OWNER will include only repositories that the current viewer owns.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "RepositoryAffiliation", + "ofType": null + } + }, + "defaultValue": "[\"OWNER\", \"COLLABORATOR\"]" + }, + { + "name": "ownerAffiliations", + "description": "Array of owner's affiliation options for repositories returned from the connection. For example, OWNER will include only repositories that the organization or user being viewed owns.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "RepositoryAffiliation", + "ofType": null + } + }, + "defaultValue": "[\"OWNER\", \"COLLABORATOR\"]" + }, + { + "name": "isLocked", + "description": "If non-null, filters repositories according to whether they have been locked", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "isFork", + "description": "If non-null, filters repositories according to whether they are forks of another repository", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "RepositoryConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repositoriesContributedTo", + "description": "A list of repositories that the user recently contributed to.", + "args": [ + { + "name": "privacy", + "description": "If non-null, filters repositories according to privacy", + "type": { + "kind": "ENUM", + "name": "RepositoryPrivacy", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Ordering options for repositories returned from the connection", + "type": { + "kind": "INPUT_OBJECT", + "name": "RepositoryOrder", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "isLocked", + "description": "If non-null, filters repositories according to whether they have been locked", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "includeUserRepositories", + "description": "If true, include user repositories", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "contributionTypes", + "description": "If non-null, include only the specified types of contributions. The GitHub.com UI uses [COMMIT, ISSUE, PULL_REQUEST, REPOSITORY]", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "RepositoryContributionType", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "RepositoryConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repository", + "description": "Find Repository.", + "args": [ + { + "name": "name", + "description": "Name of Repository to find.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTTP path for this user", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "starredRepositories", + "description": "Repositories the user has starred.", + "args": [ + { + "name": "ownedByViewer", + "description": "Filters starred repositories to only return repositories owned by the viewer.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Order for connection", + "type": { + "kind": "INPUT_OBJECT", + "name": "StarOrder", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "StarredRepositoryConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "status", + "description": "The user's description of what they're currently doing.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "UserStatus", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Identifies the date and time when the object was last updated.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The HTTP URL for this user", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanChangePinnedItems", + "description": "Can the viewer pin repositories and gists to the profile?", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanCreateProjects", + "description": "Can the current viewer create new projects on this owner.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanFollow", + "description": "Whether or not the viewer is able to follow the user.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerIsFollowing", + "description": "Whether or not this user is followed by the viewer.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "watching", + "description": "A list of repositories the given user is watching.", + "args": [ + { + "name": "privacy", + "description": "If non-null, filters repositories according to privacy", + "type": { + "kind": "ENUM", + "name": "RepositoryPrivacy", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Ordering options for repositories returned from the connection", + "type": { + "kind": "INPUT_OBJECT", + "name": "RepositoryOrder", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "affiliations", + "description": "Affiliation options for repositories returned from the connection", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "RepositoryAffiliation", + "ofType": null + } + }, + "defaultValue": "[\"OWNER\", \"COLLABORATOR\", \"ORGANIZATION_MEMBER\"]" + }, + { + "name": "ownerAffiliations", + "description": "Array of owner's affiliation options for repositories returned from the connection. For example, OWNER will include only repositories that the organization or user being viewed owns.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "RepositoryAffiliation", + "ofType": null + } + }, + "defaultValue": "[\"OWNER\", \"COLLABORATOR\"]" + }, + { + "name": "isLocked", + "description": "If non-null, filters repositories according to whether they have been locked", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "RepositoryConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "websiteUrl", + "description": "A URL pointing to the user's public website/blog.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "RegistryPackageOwner", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "RegistryPackageSearch", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "ProjectOwner", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "RepositoryOwner", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "UniformResourceLocatable", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "ProfileOwner", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INTERFACE", + "name": "Actor", + "description": "Represents an object which can take actions on GitHub. Typically a User or Bot.", + "fields": [ + { + "name": "avatarUrl", + "description": "A URL pointing to the actor's public avatar.", + "args": [ + { + "name": "size", + "description": "The size of the resulting square image.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "login", + "description": "The username of the actor.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTTP path for this actor.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The HTTP URL for this actor.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "Bot", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Mannequin", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Organization", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "User", + "ofType": null + } + ] + }, + { + "kind": "SCALAR", + "name": "Int", + "description": "Represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PageInfo", + "description": "Information about pagination in a connection.", + "fields": [ + { + "name": "endCursor", + "description": "When paginating forwards, the cursor to continue.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "hasNextPage", + "description": "When paginating forwards, are there more items?", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "hasPreviousPage", + "description": "When paginating backwards, are there more items?", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "startCursor", + "description": "When paginating backwards, the cursor to continue.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "SCALAR", + "name": "DateTime", + "description": "An ISO-8601 encoded UTC date string.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INTERFACE", + "name": "RegistryPackageOwner", + "description": "Represents an owner of a registry package.", + "fields": [ + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "Organization", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "User", + "ofType": null + } + ] + }, + { + "kind": "OBJECT", + "name": "Repository", + "description": "A repository contains the content for a project.", + "fields": [ + { + "name": "assignableUsers", + "description": "A list of users that can be assigned to issues in this repository.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "UserConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "branchProtectionRules", + "description": "A list of branch protection rules for this repository.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "BranchProtectionRuleConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "codeOfConduct", + "description": "Returns the code of conduct for this repository", + "args": [], + "type": { + "kind": "OBJECT", + "name": "CodeOfConduct", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "collaborators", + "description": "A list of collaborators associated with the repository.", + "args": [ + { + "name": "affiliation", + "description": "Collaborators affiliation level with a repository.", + "type": { + "kind": "ENUM", + "name": "CollaboratorAffiliation", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "RepositoryCollaboratorConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "commitComments", + "description": "A list of commit comments associated with the repository.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CommitCommentConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "databaseId", + "description": "Identifies the primary key from the database.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "defaultBranchRef", + "description": "The Ref associated with the repository's default branch.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Ref", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deployKeys", + "description": "A list of deploy keys that are on this repository.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "DeployKeyConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deployments", + "description": "Deployments associated with the repository", + "args": [ + { + "name": "environments", + "description": "Environments to list deployments for", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Ordering options for deployments returned from the connection.", + "type": { + "kind": "INPUT_OBJECT", + "name": "DeploymentOrder", + "ofType": null + }, + "defaultValue": "{field:\"CREATED_AT\",direction:\"ASC\"}" + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "DeploymentConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description", + "description": "The description of the repository.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "descriptionHTML", + "description": "The description of the repository rendered to HTML.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "HTML", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "diskUsage", + "description": "The number of kilobytes this repository occupies on disk.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "forkCount", + "description": "Returns how many forks there are of this repository in the whole network.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "forks", + "description": "A list of direct forked repositories.", + "args": [ + { + "name": "privacy", + "description": "If non-null, filters repositories according to privacy", + "type": { + "kind": "ENUM", + "name": "RepositoryPrivacy", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Ordering options for repositories returned from the connection", + "type": { + "kind": "INPUT_OBJECT", + "name": "RepositoryOrder", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "affiliations", + "description": "Array of viewer's affiliation options for repositories returned from the connection. For example, OWNER will include only repositories that the current viewer owns.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "RepositoryAffiliation", + "ofType": null + } + }, + "defaultValue": "[\"OWNER\", \"COLLABORATOR\"]" + }, + { + "name": "ownerAffiliations", + "description": "Array of owner's affiliation options for repositories returned from the connection. For example, OWNER will include only repositories that the organization or user being viewed owns.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "RepositoryAffiliation", + "ofType": null + } + }, + "defaultValue": "[\"OWNER\", \"COLLABORATOR\"]" + }, + { + "name": "isLocked", + "description": "If non-null, filters repositories according to whether they have been locked", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "RepositoryConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "hasIssuesEnabled", + "description": "Indicates if the repository has issues feature enabled.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "hasWikiEnabled", + "description": "Indicates if the repository has wiki feature enabled.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "homepageUrl", + "description": "The repository's URL.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isArchived", + "description": "Indicates if the repository is unmaintained.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isDisabled", + "description": "Returns whether or not this repository disabled.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isFork", + "description": "Identifies if the repository is a fork.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isLocked", + "description": "Indicates if the repository has been locked or not.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isMirror", + "description": "Identifies if the repository is a mirror.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isPrivate", + "description": "Identifies if the repository is private.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "issue", + "description": "Returns a single issue from the current repository by number.", + "args": [ + { + "name": "number", + "description": "The number for the issue to be returned.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Issue", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "issueOrPullRequest", + "description": "Returns a single issue-like object from the current repository by number.", + "args": [ + { + "name": "number", + "description": "The number for the issue to be returned.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "UNION", + "name": "IssueOrPullRequest", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "issues", + "description": "A list of issues that have been opened in the repository.", + "args": [ + { + "name": "orderBy", + "description": "Ordering options for issues returned from the connection.", + "type": { + "kind": "INPUT_OBJECT", + "name": "IssueOrder", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "labels", + "description": "A list of label names to filter the pull requests by.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "states", + "description": "A list of states to filter the issues by.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "IssueState", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "filterBy", + "description": "Filtering options for issues returned from the connection.", + "type": { + "kind": "INPUT_OBJECT", + "name": "IssueFilters", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "IssueConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "label", + "description": "Returns a single label by name", + "args": [ + { + "name": "name", + "description": "Label name", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Label", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "labels", + "description": "A list of labels associated with the repository.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "query", + "description": "If provided, searches labels by name and description.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "LabelConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "languages", + "description": "A list containing a breakdown of the language composition of the repository.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Order for connection", + "type": { + "kind": "INPUT_OBJECT", + "name": "LanguageOrder", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "LanguageConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "licenseInfo", + "description": "The license associated with the repository", + "args": [], + "type": { + "kind": "OBJECT", + "name": "License", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "lockReason", + "description": "The reason the repository has been locked.", + "args": [], + "type": { + "kind": "ENUM", + "name": "RepositoryLockReason", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "mentionableUsers", + "description": "A list of Users that can be mentioned in the context of the repository.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "UserConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "mergeCommitAllowed", + "description": "Whether or not PRs are merged with a merge commit on this repository.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "milestone", + "description": "Returns a single milestone from the current repository by number.", + "args": [ + { + "name": "number", + "description": "The number for the milestone to be returned.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Milestone", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "milestones", + "description": "A list of milestones associated with the repository.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "states", + "description": "Filter by the state of the milestones.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "MilestoneState", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Ordering options for milestones.", + "type": { + "kind": "INPUT_OBJECT", + "name": "MilestoneOrder", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "MilestoneConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "mirrorUrl", + "description": "The repository's original mirror URL.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The name of the repository.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nameWithOwner", + "description": "The repository's name with owner.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "object", + "description": "A Git object in the repository", + "args": [ + { + "name": "oid", + "description": "The Git object ID", + "type": { + "kind": "SCALAR", + "name": "GitObjectID", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "expression", + "description": "A Git revision expression suitable for rev-parse", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "INTERFACE", + "name": "GitObject", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "owner", + "description": "The User owner of the repository.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INTERFACE", + "name": "RepositoryOwner", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "parent", + "description": "The repository parent, if this is a fork.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "primaryLanguage", + "description": "The primary language of the repository's code.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Language", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "project", + "description": "Find project by number.", + "args": [ + { + "name": "number", + "description": "The project number to find.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Project", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "projects", + "description": "A list of projects under the owner.", + "args": [ + { + "name": "orderBy", + "description": "Ordering options for projects returned from the connection", + "type": { + "kind": "INPUT_OBJECT", + "name": "ProjectOrder", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "search", + "description": "Query to search projects by, currently only searching by name.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "states", + "description": "A list of states to filter the projects by.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "ProjectState", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ProjectConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "projectsResourcePath", + "description": "The HTTP path listing the repository's projects", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "projectsUrl", + "description": "The HTTP URL listing the repository's projects", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequest", + "description": "Returns a single pull request from the current repository by number.", + "args": [ + { + "name": "number", + "description": "The number for the pull request to be returned.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequests", + "description": "A list of pull requests that have been opened in the repository.", + "args": [ + { + "name": "states", + "description": "A list of states to filter the pull requests by.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "PullRequestState", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "labels", + "description": "A list of label names to filter the pull requests by.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "headRefName", + "description": "The head ref name to filter the pull requests by.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "baseRefName", + "description": "The base ref name to filter the pull requests by.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Ordering options for pull requests returned from the connection.", + "type": { + "kind": "INPUT_OBJECT", + "name": "IssueOrder", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequestConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pushedAt", + "description": "Identifies when the repository was last pushed to.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "rebaseMergeAllowed", + "description": "Whether or not rebase-merging is enabled on this repository.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ref", + "description": "Fetch a given ref from the repository", + "args": [ + { + "name": "qualifiedName", + "description": "The ref to retrieve. Fully qualified matches are checked in order (`refs/heads/master`) before falling back onto checks for short name matches (`master`).", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Ref", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "refs", + "description": "Fetch a list of refs from the repository", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "refPrefix", + "description": "A ref name prefix like `refs/heads/`, `refs/tags/`, etc.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "direction", + "description": "DEPRECATED: use orderBy. The ordering direction.", + "type": { + "kind": "ENUM", + "name": "OrderDirection", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Ordering options for refs returned from the connection.", + "type": { + "kind": "INPUT_OBJECT", + "name": "RefOrder", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "RefConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "release", + "description": "Lookup a single release given various criteria.", + "args": [ + { + "name": "tagName", + "description": "The name of the Tag the Release was created from", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Release", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "releases", + "description": "List of releases which are dependent on this repository.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Order for connection", + "type": { + "kind": "INPUT_OBJECT", + "name": "ReleaseOrder", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ReleaseConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repositoryTopics", + "description": "A list of applied repository-topic associations for this repository.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "RepositoryTopicConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTTP path for this repository", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "shortDescriptionHTML", + "description": "A description of the repository, rendered to HTML without any links in it.", + "args": [ + { + "name": "limit", + "description": "How many characters to return.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": "200" + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "HTML", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "squashMergeAllowed", + "description": "Whether or not squash-merging is enabled on this repository.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "sshUrl", + "description": "The SSH URL to clone this repository", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "GitSSHRemote", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "stargazers", + "description": "A list of users who have starred this starrable.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Order for connection", + "type": { + "kind": "INPUT_OBJECT", + "name": "StarOrder", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "StargazerConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Identifies the date and time when the object was last updated.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The HTTP URL for this repository", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanAdminister", + "description": "Indicates whether the viewer has admin permissions on this repository.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanCreateProjects", + "description": "Can the current viewer create new projects on this owner.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanSubscribe", + "description": "Check if the viewer is able to change their subscription status for the repository.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanUpdateTopics", + "description": "Indicates whether the viewer can update the topics of this repository.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerHasStarred", + "description": "Returns a boolean indicating whether the viewing user has starred this starrable.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerPermission", + "description": "The users permission level on the repository. Will return null if authenticated as an GitHub App.", + "args": [], + "type": { + "kind": "ENUM", + "name": "RepositoryPermission", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerSubscription", + "description": "Identifies if the viewer is watching, not watching, or ignoring the subscribable entity.", + "args": [], + "type": { + "kind": "ENUM", + "name": "SubscriptionState", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "watchers", + "description": "A list of users watching the repository.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "UserConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "ProjectOwner", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "RegistryPackageOwner", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Subscribable", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Starrable", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "UniformResourceLocatable", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "RepositoryInfo", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INTERFACE", + "name": "ProjectOwner", + "description": "Represents an owner of a Project.", + "fields": [ + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "project", + "description": "Find project by number.", + "args": [ + { + "name": "number", + "description": "The project number to find.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Project", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "projects", + "description": "A list of projects under the owner.", + "args": [ + { + "name": "orderBy", + "description": "Ordering options for projects returned from the connection", + "type": { + "kind": "INPUT_OBJECT", + "name": "ProjectOrder", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "search", + "description": "Query to search projects by, currently only searching by name.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "states", + "description": "A list of states to filter the projects by.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "ProjectState", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ProjectConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "projectsResourcePath", + "description": "The HTTP path listing owners projects", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "projectsUrl", + "description": "The HTTP URL listing owners projects", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanCreateProjects", + "description": "Can the current viewer create new projects on this owner.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "Organization", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "User", + "ofType": null + } + ] + }, + { + "kind": "OBJECT", + "name": "Project", + "description": "Projects manage issues, pull requests and notes within a project owner.", + "fields": [ + { + "name": "body", + "description": "The project's description body.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "bodyHTML", + "description": "The projects description body rendered to HTML.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "HTML", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "closed", + "description": "`true` if the object is closed (definition of closed may depend on type)", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "closedAt", + "description": "Identifies the date and time when the object was closed.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "columns", + "description": "List of columns in the project", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ProjectColumnConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "creator", + "description": "The actor who originally created the project.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "databaseId", + "description": "Identifies the primary key from the database.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The project's name.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "number", + "description": "The project's number.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "owner", + "description": "The project's owner. Currently limited to repositories, organizations, and users.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INTERFACE", + "name": "ProjectOwner", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pendingCards", + "description": "List of pending cards in this project", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "archivedStates", + "description": "A list of archived states to filter the cards by", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "ProjectCardArchivedState", + "ofType": null + } + }, + "defaultValue": "[\"ARCHIVED\", \"NOT_ARCHIVED\"]" + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ProjectCardConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTTP path for this project", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "state", + "description": "Whether the project is open or closed.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "ProjectState", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Identifies the date and time when the object was last updated.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The HTTP URL for this project", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanUpdate", + "description": "Check if the current viewer can update this object.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Closable", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Updatable", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INTERFACE", + "name": "Closable", + "description": "An object that can be closed", + "fields": [ + { + "name": "closed", + "description": "`true` if the object is closed (definition of closed may depend on type)", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "closedAt", + "description": "Identifies the date and time when the object was closed.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "Issue", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Milestone", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Project", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + } + ] + }, + { + "kind": "INTERFACE", + "name": "Updatable", + "description": "Entities that can be updated.", + "fields": [ + { + "name": "viewerCanUpdate", + "description": "Check if the current viewer can update this object.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "CommitComment", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "GistComment", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Issue", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "IssueComment", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Project", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequestReview", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequestReviewComment", + "ofType": null + } + ] + }, + { + "kind": "ENUM", + "name": "ProjectState", + "description": "State of the project; either 'open' or 'closed'", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "OPEN", + "description": "The project is open.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "CLOSED", + "description": "The project is closed.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "SCALAR", + "name": "HTML", + "description": "A string containing HTML code.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ProjectColumnConnection", + "description": "The connection type for ProjectColumn.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ProjectColumnEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ProjectColumn", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ProjectColumnEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "ProjectColumn", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ProjectColumn", + "description": "A column inside a project.", + "fields": [ + { + "name": "cards", + "description": "List of cards in the column", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "archivedStates", + "description": "A list of archived states to filter the cards by", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "ProjectCardArchivedState", + "ofType": null + } + }, + "defaultValue": "[\"ARCHIVED\", \"NOT_ARCHIVED\"]" + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ProjectCardConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "databaseId", + "description": "Identifies the primary key from the database.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The project column's name.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "project", + "description": "The project that contains this column.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Project", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "purpose", + "description": "The semantic purpose of the column", + "args": [], + "type": { + "kind": "ENUM", + "name": "ProjectColumnPurpose", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTTP path for this project column", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Identifies the date and time when the object was last updated.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The HTTP URL for this project column", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "ProjectColumnPurpose", + "description": "The semantic purpose of the column - todo, in progress, or done.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "TODO", + "description": "The column contains cards still to be worked on", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "IN_PROGRESS", + "description": "The column contains cards which are currently being worked on", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "DONE", + "description": "The column contains cards which are complete", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ProjectCardConnection", + "description": "The connection type for ProjectCard.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ProjectCardEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ProjectCard", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ProjectCardEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "ProjectCard", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ProjectCard", + "description": "A card in a project.", + "fields": [ + { + "name": "column", + "description": "The project column this card is associated under. A card may only belong to one\nproject column at a time. The column field will be null if the card is created\nin a pending state and has yet to be associated with a column. Once cards are\nassociated with a column, they will not become pending in the future.\n", + "args": [], + "type": { + "kind": "OBJECT", + "name": "ProjectColumn", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "content", + "description": "The card content item", + "args": [], + "type": { + "kind": "UNION", + "name": "ProjectCardItem", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "creator", + "description": "The actor who created this card", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "databaseId", + "description": "Identifies the primary key from the database.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isArchived", + "description": "Whether the card is archived", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "note", + "description": "The card note", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "project", + "description": "The project that contains this card.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Project", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTTP path for this card", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "state", + "description": "The state of ProjectCard", + "args": [], + "type": { + "kind": "ENUM", + "name": "ProjectCardState", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Identifies the date and time when the object was last updated.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The HTTP URL for this card", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "ProjectCardState", + "description": "Various content states of a ProjectCard", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "CONTENT_ONLY", + "description": "The card has content only.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "NOTE_ONLY", + "description": "The card has a note only.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "REDACTED", + "description": "The card is redacted.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "UNION", + "name": "ProjectCardItem", + "description": "Types that can be inside Project Cards.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "Issue", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + } + ] + }, + { + "kind": "OBJECT", + "name": "Issue", + "description": "An Issue is a place to discuss ideas, enhancements, tasks, and bugs for a project.", + "fields": [ + { + "name": "activeLockReason", + "description": "Reason that the conversation was locked.", + "args": [], + "type": { + "kind": "ENUM", + "name": "LockReason", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "assignees", + "description": "A list of Users assigned to this object.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "UserConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "author", + "description": "The actor who authored the comment.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "authorAssociation", + "description": "Author's association with the subject of the comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "CommentAuthorAssociation", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "body", + "description": "Identifies the body of the issue.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "bodyHTML", + "description": "Identifies the body of the issue rendered to HTML.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "HTML", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "bodyText", + "description": "Identifies the body of the issue rendered to text.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "closed", + "description": "`true` if the object is closed (definition of closed may depend on type)", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "closedAt", + "description": "Identifies the date and time when the object was closed.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "comments", + "description": "A list of comments associated with the Issue.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "IssueCommentConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdViaEmail", + "description": "Check if this comment was created via an email reply.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "databaseId", + "description": "Identifies the primary key from the database.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "editor", + "description": "The actor who edited the comment.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "includesCreatedEdit", + "description": "Check if this comment was edited and includes an edit with the creation data", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "labels", + "description": "A list of labels associated with the object.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "LabelConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "lastEditedAt", + "description": "The moment the editor made the last edit", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "locked", + "description": "`true` if the object is locked", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "milestone", + "description": "Identifies the milestone associated with the issue.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Milestone", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "number", + "description": "Identifies the issue number.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "participants", + "description": "A list of Users that are participating in the Issue conversation.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "UserConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "projectCards", + "description": "List of project cards associated with this issue.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "archivedStates", + "description": "A list of archived states to filter the cards by", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "ProjectCardArchivedState", + "ofType": null + } + }, + "defaultValue": "[\"ARCHIVED\", \"NOT_ARCHIVED\"]" + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ProjectCardConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "publishedAt", + "description": "Identifies when the comment was published at.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "reactionGroups", + "description": "A list of reactions grouped by content left on the subject.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ReactionGroup", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "reactions", + "description": "A list of Reactions left on the Issue.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "content", + "description": "Allows filtering Reactions by emoji.", + "type": { + "kind": "ENUM", + "name": "ReactionContent", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Allows specifying the order in which reactions are returned.", + "type": { + "kind": "INPUT_OBJECT", + "name": "ReactionOrder", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ReactionConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repository", + "description": "The repository associated with this node.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTTP path for this issue", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "state", + "description": "Identifies the state of the issue.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "IssueState", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "timeline", + "description": "A list of events, comments, commits, etc. associated with the issue.", + "args": [ + { + "name": "since", + "description": "Allows filtering timeline events by a `since` timestamp.", + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "IssueTimelineConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "timelineItems", + "description": "A list of events, comments, commits, etc. associated with the issue.", + "args": [ + { + "name": "since", + "description": "Filter timeline items by a `since` timestamp.", + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "skip", + "description": "Skips the first _n_ elements in the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "itemTypes", + "description": "Filter timeline items by type.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "IssueTimelineItemsItemType", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "IssueTimelineItemsConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "title", + "description": "Identifies the issue title.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Identifies the date and time when the object was last updated.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The HTTP URL for this issue", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "userContentEdits", + "description": "A list of edits to this content.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "UserContentEditConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanReact", + "description": "Can user react to this subject", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanSubscribe", + "description": "Check if the viewer is able to change their subscription status for the repository.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanUpdate", + "description": "Check if the current viewer can update this object.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCannotUpdateReasons", + "description": "Reasons why the current viewer can not update this comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "CommentCannotUpdateReason", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerDidAuthor", + "description": "Did the viewer author this comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerSubscription", + "description": "Identifies if the viewer is watching, not watching, or ignoring the subscribable entity.", + "args": [], + "type": { + "kind": "ENUM", + "name": "SubscriptionState", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Assignable", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Closable", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Comment", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Updatable", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "UpdatableComment", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Labelable", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Lockable", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Reactable", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "RepositoryNode", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Subscribable", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "UniformResourceLocatable", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INTERFACE", + "name": "Assignable", + "description": "An object that can have users assigned to it.", + "fields": [ + { + "name": "assignees", + "description": "A list of Users assigned to this object.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "UserConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "Issue", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + } + ] + }, + { + "kind": "OBJECT", + "name": "UserConnection", + "description": "The connection type for User.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "UserEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "User", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "UserEdge", + "description": "Represents a user.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "User", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INTERFACE", + "name": "Comment", + "description": "Represents a comment.", + "fields": [ + { + "name": "author", + "description": "The actor who authored the comment.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "authorAssociation", + "description": "Author's association with the subject of the comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "CommentAuthorAssociation", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "body", + "description": "The body as Markdown.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "bodyHTML", + "description": "The body rendered to HTML.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "HTML", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "bodyText", + "description": "The body rendered to text.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdViaEmail", + "description": "Check if this comment was created via an email reply.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "editor", + "description": "The actor who edited the comment.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "includesCreatedEdit", + "description": "Check if this comment was edited and includes an edit with the creation data", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "lastEditedAt", + "description": "The moment the editor made the last edit", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "publishedAt", + "description": "Identifies when the comment was published at.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Identifies the date and time when the object was last updated.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "userContentEdits", + "description": "A list of edits to this content.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "UserContentEditConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerDidAuthor", + "description": "Did the viewer author this comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "CommitComment", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "GistComment", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Issue", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "IssueComment", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequestReview", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequestReviewComment", + "ofType": null + } + ] + }, + { + "kind": "OBJECT", + "name": "UserContentEditConnection", + "description": "A list of edits to content.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "UserContentEditEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "UserContentEdit", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "UserContentEditEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "UserContentEdit", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "UserContentEdit", + "description": "An edit on user content", + "fields": [ + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deletedAt", + "description": "Identifies the date and time when the object was deleted.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deletedBy", + "description": "The actor who deleted this content", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "diff", + "description": "A summary of the changes for this edit", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "editedAt", + "description": "When this content was edited", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "editor", + "description": "The actor who edited this content", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Identifies the date and time when the object was last updated.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "CommentAuthorAssociation", + "description": "A comment author association with repository.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "MEMBER", + "description": "Author is a member of the organization that owns the repository.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "OWNER", + "description": "Author is the owner of the repository.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "COLLABORATOR", + "description": "Author has been invited to collaborate on the repository.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "CONTRIBUTOR", + "description": "Author has previously committed to the repository.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "FIRST_TIME_CONTRIBUTOR", + "description": "Author has not previously committed to the repository.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "FIRST_TIMER", + "description": "Author has not previously committed to GitHub.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "NONE", + "description": "Author has no association with the repository.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "INTERFACE", + "name": "UpdatableComment", + "description": "Comments that can be updated.", + "fields": [ + { + "name": "viewerCannotUpdateReasons", + "description": "Reasons why the current viewer can not update this comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "CommentCannotUpdateReason", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "CommitComment", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "GistComment", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Issue", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "IssueComment", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequestReview", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequestReviewComment", + "ofType": null + } + ] + }, + { + "kind": "ENUM", + "name": "CommentCannotUpdateReason", + "description": "The possible errors that will prevent a user from updating a comment.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "INSUFFICIENT_ACCESS", + "description": "You must be the author or have write access to this repository to update this comment.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "LOCKED", + "description": "Unable to create comment because issue is locked.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "LOGIN_REQUIRED", + "description": "You must be logged in to update this comment.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "MAINTENANCE", + "description": "Repository is under maintenance.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "VERIFIED_EMAIL_REQUIRED", + "description": "At least one email address must be verified to update this comment.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "DENIED", + "description": "You cannot update this comment", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "INTERFACE", + "name": "Labelable", + "description": "An object that can have labels assigned to it.", + "fields": [ + { + "name": "labels", + "description": "A list of labels associated with the object.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "LabelConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "Issue", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + } + ] + }, + { + "kind": "OBJECT", + "name": "LabelConnection", + "description": "The connection type for Label.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "LabelEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Label", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "LabelEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Label", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Label", + "description": "A label for categorizing Issues or Milestones with a given Repository.", + "fields": [ + { + "name": "color", + "description": "Identifies the label color.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the label was created.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description", + "description": "A brief description of this label.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isDefault", + "description": "Indicates whether or not this is a default label.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "issues", + "description": "A list of issues associated with this label.", + "args": [ + { + "name": "orderBy", + "description": "Ordering options for issues returned from the connection.", + "type": { + "kind": "INPUT_OBJECT", + "name": "IssueOrder", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "labels", + "description": "A list of label names to filter the pull requests by.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "states", + "description": "A list of states to filter the issues by.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "IssueState", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "filterBy", + "description": "Filtering options for issues returned from the connection.", + "type": { + "kind": "INPUT_OBJECT", + "name": "IssueFilters", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "IssueConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "Identifies the label name.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequests", + "description": "A list of pull requests associated with this label.", + "args": [ + { + "name": "states", + "description": "A list of states to filter the pull requests by.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "PullRequestState", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "labels", + "description": "A list of label names to filter the pull requests by.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "headRefName", + "description": "The head ref name to filter the pull requests by.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "baseRefName", + "description": "The base ref name to filter the pull requests by.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Ordering options for pull requests returned from the connection.", + "type": { + "kind": "INPUT_OBJECT", + "name": "IssueOrder", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequestConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repository", + "description": "The repository associated with this label.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTTP path for this label.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Identifies the date and time when the label was last updated.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The HTTP URL for this label.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "IssueConnection", + "description": "The connection type for Issue.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "IssueEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Issue", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "IssueEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Issue", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "IssueOrder", + "description": "Ways in which lists of issues can be ordered upon return.", + "fields": null, + "inputFields": [ + { + "name": "field", + "description": "The field in which to order issues by.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "IssueOrderField", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "direction", + "description": "The direction in which to order issues by the specified field.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "OrderDirection", + "ofType": null + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "IssueOrderField", + "description": "Properties by which issue connections can be ordered.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "CREATED_AT", + "description": "Order issues by creation time", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "UPDATED_AT", + "description": "Order issues by update time", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "COMMENTS", + "description": "Order issues by comment count", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "OrderDirection", + "description": "Possible directions in which to order a list of items when provided an `orderBy` argument.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "ASC", + "description": "Specifies an ascending order for a given `orderBy` argument.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "DESC", + "description": "Specifies a descending order for a given `orderBy` argument.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "IssueState", + "description": "The possible states of an issue.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "OPEN", + "description": "An issue that is still open", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "CLOSED", + "description": "An issue that has been closed", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "IssueFilters", + "description": "Ways in which to filter lists of issues.", + "fields": null, + "inputFields": [ + { + "name": "assignee", + "description": "List issues assigned to given name. Pass in `null` for issues with no assigned user, and `*` for issues assigned to any user.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "createdBy", + "description": "List issues created by given name.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "labels", + "description": "List issues where the list of label names exist on the issue.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "mentioned", + "description": "List issues where the given name is mentioned in the issue.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "milestone", + "description": "List issues by given milestone argument. If an string representation of an integer is passed, it should refer to a milestone by its number field. Pass in `null` for issues with no milestone, and `*` for issues that are assigned to any milestone.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "since", + "description": "List issues that have been updated at or after the given date.", + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "states", + "description": "List issues filtered by the list of states given.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "IssueState", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "viewerSubscribed", + "description": "List issues subscribed to by viewer.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false" + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PullRequestConnection", + "description": "The connection type for PullRequest.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequestEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PullRequestEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PullRequest", + "description": "A repository pull request.", + "fields": [ + { + "name": "activeLockReason", + "description": "Reason that the conversation was locked.", + "args": [], + "type": { + "kind": "ENUM", + "name": "LockReason", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "additions", + "description": "The number of additions in this pull request.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "assignees", + "description": "A list of Users assigned to this object.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "UserConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "author", + "description": "The actor who authored the comment.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "authorAssociation", + "description": "Author's association with the subject of the comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "CommentAuthorAssociation", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "baseRef", + "description": "Identifies the base Ref associated with the pull request.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Ref", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "baseRefName", + "description": "Identifies the name of the base Ref associated with the pull request, even if the ref has been deleted.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "baseRefOid", + "description": "Identifies the oid of the base ref associated with the pull request, even if the ref has been deleted.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "GitObjectID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "baseRepository", + "description": "The repository associated with this pull request's base Ref.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "body", + "description": "The body as Markdown.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "bodyHTML", + "description": "The body rendered to HTML.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "HTML", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "bodyText", + "description": "The body rendered to text.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "changedFiles", + "description": "The number of changed files in this pull request.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "closed", + "description": "`true` if the pull request is closed", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "closedAt", + "description": "Identifies the date and time when the object was closed.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "comments", + "description": "A list of comments associated with the pull request.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "IssueCommentConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "commits", + "description": "A list of commits present in this pull request's head branch not present in the base branch.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequestCommitConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdViaEmail", + "description": "Check if this comment was created via an email reply.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "databaseId", + "description": "Identifies the primary key from the database.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deletions", + "description": "The number of deletions in this pull request.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "editor", + "description": "The actor who edited this pull request's body.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "files", + "description": "Lists the files changed within this pull request.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "PullRequestChangedFileConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "headRef", + "description": "Identifies the head Ref associated with the pull request.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Ref", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "headRefName", + "description": "Identifies the name of the head Ref associated with the pull request, even if the ref has been deleted.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "headRefOid", + "description": "Identifies the oid of the head ref associated with the pull request, even if the ref has been deleted.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "GitObjectID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "headRepository", + "description": "The repository associated with this pull request's head Ref.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "headRepositoryOwner", + "description": "The owner of the repository associated with this pull request's head Ref.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "RepositoryOwner", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "includesCreatedEdit", + "description": "Check if this comment was edited and includes an edit with the creation data", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isCrossRepository", + "description": "The head and base repositories are different.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "labels", + "description": "A list of labels associated with the object.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "LabelConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "lastEditedAt", + "description": "The moment the editor made the last edit", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "locked", + "description": "`true` if the pull request is locked", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "maintainerCanModify", + "description": "Indicates whether maintainers can modify the pull request.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "mergeCommit", + "description": "The commit that was created when this pull request was merged.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Commit", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "mergeable", + "description": "Whether or not the pull request can be merged based on the existence of merge conflicts.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "MergeableState", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "merged", + "description": "Whether or not the pull request was merged.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "mergedAt", + "description": "The date and time that the pull request was merged.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "mergedBy", + "description": "The actor who merged the pull request.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "milestone", + "description": "Identifies the milestone associated with the pull request.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Milestone", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "number", + "description": "Identifies the pull request number.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "participants", + "description": "A list of Users that are participating in the Pull Request conversation.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "UserConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "permalink", + "description": "The permalink to the pull request.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "potentialMergeCommit", + "description": "The commit that GitHub automatically generated to test if this pull request could be merged. This field will not return a value if the pull request is merged, or if the test merge commit is still being generated. See the `mergeable` field for more details on the mergeability of the pull request.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Commit", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "projectCards", + "description": "List of project cards associated with this pull request.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "archivedStates", + "description": "A list of archived states to filter the cards by", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "ProjectCardArchivedState", + "ofType": null + } + }, + "defaultValue": "[\"ARCHIVED\", \"NOT_ARCHIVED\"]" + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ProjectCardConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "publishedAt", + "description": "Identifies when the comment was published at.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "reactionGroups", + "description": "A list of reactions grouped by content left on the subject.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ReactionGroup", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "reactions", + "description": "A list of Reactions left on the Issue.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "content", + "description": "Allows filtering Reactions by emoji.", + "type": { + "kind": "ENUM", + "name": "ReactionContent", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Allows specifying the order in which reactions are returned.", + "type": { + "kind": "INPUT_OBJECT", + "name": "ReactionOrder", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ReactionConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repository", + "description": "The repository associated with this node.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTTP path for this pull request.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "revertResourcePath", + "description": "The HTTP path for reverting this pull request.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "revertUrl", + "description": "The HTTP URL for reverting this pull request.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "reviewRequests", + "description": "A list of review requests associated with the pull request.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "ReviewRequestConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "reviewThreads", + "description": "The list of all review threads for this pull request.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequestReviewThreadConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "reviews", + "description": "A list of reviews associated with the pull request.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "states", + "description": "A list of states to filter the reviews.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "PullRequestReviewState", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "author", + "description": "Filter by author of the review.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "PullRequestReviewConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "state", + "description": "Identifies the state of the pull request.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "PullRequestState", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "suggestedReviewers", + "description": "A list of reviewer suggestions based on commit history and past review comments.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SuggestedReviewer", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "timeline", + "description": "A list of events, comments, commits, etc. associated with the pull request.", + "args": [ + { + "name": "since", + "description": "Allows filtering timeline events by a `since` timestamp.", + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequestTimelineConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "timelineItems", + "description": "A list of events, comments, commits, etc. associated with the pull request.", + "args": [ + { + "name": "since", + "description": "Filter timeline items by a `since` timestamp.", + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "skip", + "description": "Skips the first _n_ elements in the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "itemTypes", + "description": "Filter timeline items by type.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "PullRequestTimelineItemsItemType", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequestTimelineItemsConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "title", + "description": "Identifies the pull request title.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Identifies the date and time when the object was last updated.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The HTTP URL for this pull request.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "userContentEdits", + "description": "A list of edits to this content.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "UserContentEditConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanApplySuggestion", + "description": "Whether or not the viewer can apply suggestion.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanReact", + "description": "Can user react to this subject", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanSubscribe", + "description": "Check if the viewer is able to change their subscription status for the repository.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanUpdate", + "description": "Check if the current viewer can update this object.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCannotUpdateReasons", + "description": "Reasons why the current viewer can not update this comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "CommentCannotUpdateReason", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerDidAuthor", + "description": "Did the viewer author this comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerSubscription", + "description": "Identifies if the viewer is watching, not watching, or ignoring the subscribable entity.", + "args": [], + "type": { + "kind": "ENUM", + "name": "SubscriptionState", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Assignable", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Closable", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Comment", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Updatable", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "UpdatableComment", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Labelable", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Lockable", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Reactable", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "RepositoryNode", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Subscribable", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "UniformResourceLocatable", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INTERFACE", + "name": "Lockable", + "description": "An object that can be locked.", + "fields": [ + { + "name": "activeLockReason", + "description": "Reason that the conversation was locked.", + "args": [], + "type": { + "kind": "ENUM", + "name": "LockReason", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "locked", + "description": "`true` if the object is locked", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "Issue", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + } + ] + }, + { + "kind": "ENUM", + "name": "LockReason", + "description": "The possible reasons that an issue or pull request was locked.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "OFF_TOPIC", + "description": "The issue or pull request was locked because the conversation was off-topic.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "TOO_HEATED", + "description": "The issue or pull request was locked because the conversation was too heated.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "RESOLVED", + "description": "The issue or pull request was locked because the conversation was resolved.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "SPAM", + "description": "The issue or pull request was locked because the conversation was spam.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "App", + "description": "A GitHub App.", + "fields": [ + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "databaseId", + "description": "Identifies the primary key from the database.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description", + "description": "The description of the app.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "logoBackgroundColor", + "description": "The hex color code, without the leading '#', for the logo background.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "logoUrl", + "description": "A URL pointing to the app's logo.", + "args": [ + { + "name": "size", + "description": "The size of the resulting image.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The name of the app.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "slug", + "description": "A slug based on the name of the app for use in URLs.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Identifies the date and time when the object was last updated.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The URL to the app's homepage.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "MarketplaceListing", + "description": "A listing in the GitHub integration marketplace.", + "fields": [ + { + "name": "app", + "description": "The GitHub App this listing represents.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "App", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "companyUrl", + "description": "URL to the listing owner's company site.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "configurationResourcePath", + "description": "The HTTP path for configuring access to the listing's integration or OAuth app", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "configurationUrl", + "description": "The HTTP URL for configuring access to the listing's integration or OAuth app", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "documentationUrl", + "description": "URL to the listing's documentation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "extendedDescription", + "description": "The listing's detailed description.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "extendedDescriptionHTML", + "description": "The listing's detailed description rendered to HTML.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "HTML", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "fullDescription", + "description": "The listing's introductory description.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "fullDescriptionHTML", + "description": "The listing's introductory description rendered to HTML.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "HTML", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "hasApprovalBeenRequested", + "description": "Whether this listing has been submitted for review from GitHub for approval to be displayed in the Marketplace.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": true, + "deprecationReason": "`hasApprovalBeenRequested` will be removed. Use `isVerificationPendingFromDraft` instead. Removal on 2019-10-01 UTC." + }, + { + "name": "hasPublishedFreeTrialPlans", + "description": "Does this listing have any plans with a free trial?", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "hasTermsOfService", + "description": "Does this listing have a terms of service link?", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "howItWorks", + "description": "A technical description of how this app works with GitHub.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "howItWorksHTML", + "description": "The listing's technical description rendered to HTML.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "HTML", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "installationUrl", + "description": "URL to install the product to the viewer's account or organization.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "installedForViewer", + "description": "Whether this listing's app has been installed for the current viewer", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isApproved", + "description": "Whether this listing has been approved for display in the Marketplace.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": true, + "deprecationReason": "`isApproved` will be removed. Use `isPublic` instead. Removal on 2019-10-01 UTC." + }, + { + "name": "isArchived", + "description": "Whether this listing has been removed from the Marketplace.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isDelisted", + "description": "Whether this listing has been removed from the Marketplace.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": true, + "deprecationReason": "`isDelisted` will be removed. Use `isArchived` instead. Removal on 2019-10-01 UTC." + }, + { + "name": "isDraft", + "description": "Whether this listing is still an editable draft that has not been submitted for review and is not publicly visible in the Marketplace.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isPaid", + "description": "Whether the product this listing represents is available as part of a paid plan.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isPublic", + "description": "Whether this listing has been approved for display in the Marketplace.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isRejected", + "description": "Whether this listing has been rejected by GitHub for display in the Marketplace.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isUnverified", + "description": "Whether this listing has been approved for unverified display in the Marketplace.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isUnverifiedPending", + "description": "Whether this draft listing has been submitted for review for approval to be unverified in the Marketplace.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isVerificationPendingFromDraft", + "description": "Whether this draft listing has been submitted for review from GitHub for approval to be verified in the Marketplace.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isVerificationPendingFromUnverified", + "description": "Whether this unverified listing has been submitted for review from GitHub for approval to be verified in the Marketplace.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isVerified", + "description": "Whether this listing has been approved for verified display in the Marketplace.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "logoBackgroundColor", + "description": "The hex color code, without the leading '#', for the logo background.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "logoUrl", + "description": "URL for the listing's logo image.", + "args": [ + { + "name": "size", + "description": "The size in pixels of the resulting square image.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": "400" + } + ], + "type": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The listing's full name.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "normalizedShortDescription", + "description": "The listing's very short description without a trailing period or ampersands.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pricingUrl", + "description": "URL to the listing's detailed pricing.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "primaryCategory", + "description": "The category that best describes the listing.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "MarketplaceCategory", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "privacyPolicyUrl", + "description": "URL to the listing's privacy policy, may return an empty string for listings that do not require a privacy policy URL.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTTP path for the Marketplace listing.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "screenshotUrls", + "description": "The URLs for the listing's screenshots.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "secondaryCategory", + "description": "An alternate category that describes the listing.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "MarketplaceCategory", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "shortDescription", + "description": "The listing's very short description.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "slug", + "description": "The short name of the listing used in its URL.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "statusUrl", + "description": "URL to the listing's status page.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "supportEmail", + "description": "An email address for support for this listing's app.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "supportUrl", + "description": "Either a URL or an email address for support for this listing's app, may return an empty string for listings that do not require a support URL.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "termsOfServiceUrl", + "description": "URL to the listing's terms of service.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The HTTP URL for the Marketplace listing.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanAddPlans", + "description": "Can the current viewer add plans for this Marketplace listing.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanApprove", + "description": "Can the current viewer approve this Marketplace listing.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanDelist", + "description": "Can the current viewer delist this Marketplace listing.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanEdit", + "description": "Can the current viewer edit this Marketplace listing.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanEditCategories", + "description": "Can the current viewer edit the primary and secondary category of this\nMarketplace listing.\n", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanEditPlans", + "description": "Can the current viewer edit the plans for this Marketplace listing.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanRedraft", + "description": "Can the current viewer return this Marketplace listing to draft state\nso it becomes editable again.\n", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanReject", + "description": "Can the current viewer reject this Marketplace listing by returning it to\nan editable draft state or rejecting it entirely.\n", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanRequestApproval", + "description": "Can the current viewer request this listing be reviewed for display in\nthe Marketplace as verified.\n", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerHasPurchased", + "description": "Indicates whether the current user has an active subscription to this Marketplace listing.\n", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerHasPurchasedForAllOrganizations", + "description": "Indicates if the current user has purchased a subscription to this Marketplace listing\nfor all of the organizations the user owns.\n", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerIsListingAdmin", + "description": "Does the current viewer role allow them to administer this Marketplace listing.\n", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Organization", + "description": "An account on GitHub, with one or more owners, that has repositories, members and teams.", + "fields": [ + { + "name": "anyPinnableItems", + "description": "Determine if this repository owner has any items that can be pinned to their profile.", + "args": [ + { + "name": "type", + "description": "Filter to only a particular kind of pinnable item.", + "type": { + "kind": "ENUM", + "name": "PinnableItemType", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "avatarUrl", + "description": "A URL pointing to the organization's public avatar.", + "args": [ + { + "name": "size", + "description": "The size of the resulting square image.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "databaseId", + "description": "Identifies the primary key from the database.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description", + "description": "The organization's public profile description.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "email", + "description": "The organization's public email.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isVerified", + "description": "Whether the organization has verified its profile email and website.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "itemShowcase", + "description": "Showcases a selection of repositories and gists that the profile owner has either curated or that have been selected automatically based on popularity.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ProfileItemShowcase", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "location", + "description": "The organization's public profile location.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "login", + "description": "The organization's login name.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "memberStatuses", + "description": "Get the status messages members of this entity have set that are either public or visible only to the organization.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Ordering options for user statuses returned from the connection.", + "type": { + "kind": "INPUT_OBJECT", + "name": "UserStatusOrder", + "ofType": null + }, + "defaultValue": "{field:\"UPDATED_AT\",direction:\"DESC\"}" + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "UserStatusConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "membersWithRole", + "description": "A list of users who are members of this organization.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "OrganizationMemberConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The organization's public profile name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "newTeamResourcePath", + "description": "The HTTP path creating a new team", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "newTeamUrl", + "description": "The HTTP URL creating a new team", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "organizationBillingEmail", + "description": "The billing email for the organization.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pendingMembers", + "description": "A list of users who have been invited to join this organization.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "UserConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pinnableItems", + "description": "A list of repositories and gists this profile owner can pin to their profile.", + "args": [ + { + "name": "types", + "description": "Filter the types of pinnable items that are returned.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "PinnableItemType", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PinnableItemConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pinnedItems", + "description": "A list of repositories and gists this profile owner has pinned to their profile", + "args": [ + { + "name": "types", + "description": "Filter the types of pinned items that are returned.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "PinnableItemType", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PinnableItemConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pinnedItemsRemaining", + "description": "Returns how many more items this profile owner can pin to their profile.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pinnedRepositories", + "description": "A list of repositories this user has pinned to their profile", + "args": [ + { + "name": "privacy", + "description": "If non-null, filters repositories according to privacy", + "type": { + "kind": "ENUM", + "name": "RepositoryPrivacy", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Ordering options for repositories returned from the connection", + "type": { + "kind": "INPUT_OBJECT", + "name": "RepositoryOrder", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "affiliations", + "description": "Array of viewer's affiliation options for repositories returned from the connection. For example, OWNER will include only repositories that the current viewer owns.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "RepositoryAffiliation", + "ofType": null + } + }, + "defaultValue": "[\"OWNER\", \"COLLABORATOR\"]" + }, + { + "name": "ownerAffiliations", + "description": "Array of owner's affiliation options for repositories returned from the connection. For example, OWNER will include only repositories that the organization or user being viewed owns.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "RepositoryAffiliation", + "ofType": null + } + }, + "defaultValue": "[\"OWNER\", \"COLLABORATOR\"]" + }, + { + "name": "isLocked", + "description": "If non-null, filters repositories according to whether they have been locked", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "RepositoryConnection", + "ofType": null + } + }, + "isDeprecated": true, + "deprecationReason": "pinnedRepositories will be removed Use ProfileOwner.pinnedItems instead. Removal on 2019-07-01 UTC." + }, + { + "name": "project", + "description": "Find project by number.", + "args": [ + { + "name": "number", + "description": "The project number to find.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Project", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "projects", + "description": "A list of projects under the owner.", + "args": [ + { + "name": "orderBy", + "description": "Ordering options for projects returned from the connection", + "type": { + "kind": "INPUT_OBJECT", + "name": "ProjectOrder", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "search", + "description": "Query to search projects by, currently only searching by name.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "states", + "description": "A list of states to filter the projects by.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "ProjectState", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ProjectConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "projectsResourcePath", + "description": "The HTTP path listing organization's projects", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "projectsUrl", + "description": "The HTTP URL listing organization's projects", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repositories", + "description": "A list of repositories that the user owns.", + "args": [ + { + "name": "privacy", + "description": "If non-null, filters repositories according to privacy", + "type": { + "kind": "ENUM", + "name": "RepositoryPrivacy", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Ordering options for repositories returned from the connection", + "type": { + "kind": "INPUT_OBJECT", + "name": "RepositoryOrder", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "affiliations", + "description": "Array of viewer's affiliation options for repositories returned from the connection. For example, OWNER will include only repositories that the current viewer owns.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "RepositoryAffiliation", + "ofType": null + } + }, + "defaultValue": "[\"OWNER\", \"COLLABORATOR\"]" + }, + { + "name": "ownerAffiliations", + "description": "Array of owner's affiliation options for repositories returned from the connection. For example, OWNER will include only repositories that the organization or user being viewed owns.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "RepositoryAffiliation", + "ofType": null + } + }, + "defaultValue": "[\"OWNER\", \"COLLABORATOR\"]" + }, + { + "name": "isLocked", + "description": "If non-null, filters repositories according to whether they have been locked", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "isFork", + "description": "If non-null, filters repositories according to whether they are forks of another repository", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "RepositoryConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repository", + "description": "Find Repository.", + "args": [ + { + "name": "name", + "description": "Name of Repository to find.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "requiresTwoFactorAuthentication", + "description": "When true the organization requires all members, billing managers, and outside collaborators to enable two-factor authentication.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTTP path for this organization.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "samlIdentityProvider", + "description": "The Organization's SAML identity providers", + "args": [], + "type": { + "kind": "OBJECT", + "name": "OrganizationIdentityProvider", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "team", + "description": "Find an organization's team by its slug.", + "args": [ + { + "name": "slug", + "description": "The name or slug of the team to find.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Team", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "teams", + "description": "A list of teams in this organization.", + "args": [ + { + "name": "privacy", + "description": "If non-null, filters teams according to privacy", + "type": { + "kind": "ENUM", + "name": "TeamPrivacy", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "role", + "description": "If non-null, filters teams according to whether the viewer is an admin or member on team", + "type": { + "kind": "ENUM", + "name": "TeamRole", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "query", + "description": "If non-null, filters teams with query on team name and team slug", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "userLogins", + "description": "User logins to filter by", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Ordering options for teams returned from the connection", + "type": { + "kind": "INPUT_OBJECT", + "name": "TeamOrder", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "ldapMapped", + "description": "If true, filters teams that are mapped to an LDAP Group (Enterprise only)", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "rootTeamsOnly", + "description": "If true, restrict to only root teams", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false" + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "TeamConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "teamsResourcePath", + "description": "The HTTP path listing organization's teams", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "teamsUrl", + "description": "The HTTP URL listing organization's teams", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The HTTP URL for this organization.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanAdminister", + "description": "Organization is adminable by the viewer.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanChangePinnedItems", + "description": "Can the viewer pin repositories and gists to the profile?", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanCreateProjects", + "description": "Can the current viewer create new projects on this owner.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanCreateRepositories", + "description": "Viewer can create repositories on this organization", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanCreateTeams", + "description": "Viewer can create teams on this organization.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerIsAMember", + "description": "Viewer is an active member of this organization.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "websiteUrl", + "description": "The organization's public profile URL.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "RegistryPackageOwner", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "RegistryPackageSearch", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "ProjectOwner", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "RepositoryOwner", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "UniformResourceLocatable", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "MemberStatusable", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "ProfileOwner", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INTERFACE", + "name": "RegistryPackageSearch", + "description": "Represents an interface to search packages on an object.", + "fields": [ + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "Organization", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "User", + "ofType": null + } + ] + }, + { + "kind": "INTERFACE", + "name": "RepositoryOwner", + "description": "Represents an owner of a Repository.", + "fields": [ + { + "name": "avatarUrl", + "description": "A URL pointing to the owner's public avatar.", + "args": [ + { + "name": "size", + "description": "The size of the resulting square image.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "login", + "description": "The username used to login.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pinnedRepositories", + "description": "A list of repositories this user has pinned to their profile", + "args": [ + { + "name": "privacy", + "description": "If non-null, filters repositories according to privacy", + "type": { + "kind": "ENUM", + "name": "RepositoryPrivacy", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Ordering options for repositories returned from the connection", + "type": { + "kind": "INPUT_OBJECT", + "name": "RepositoryOrder", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "affiliations", + "description": "Array of viewer's affiliation options for repositories returned from the connection. For example, OWNER will include only repositories that the current viewer owns.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "RepositoryAffiliation", + "ofType": null + } + }, + "defaultValue": "[\"OWNER\", \"COLLABORATOR\"]" + }, + { + "name": "ownerAffiliations", + "description": "Array of owner's affiliation options for repositories returned from the connection. For example, OWNER will include only repositories that the organization or user being viewed owns.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "RepositoryAffiliation", + "ofType": null + } + }, + "defaultValue": "[\"OWNER\", \"COLLABORATOR\"]" + }, + { + "name": "isLocked", + "description": "If non-null, filters repositories according to whether they have been locked", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "RepositoryConnection", + "ofType": null + } + }, + "isDeprecated": true, + "deprecationReason": "pinnedRepositories will be removed Use ProfileOwner.pinnedItems instead. Removal on 2019-07-01 UTC." + }, + { + "name": "repositories", + "description": "A list of repositories that the user owns.", + "args": [ + { + "name": "privacy", + "description": "If non-null, filters repositories according to privacy", + "type": { + "kind": "ENUM", + "name": "RepositoryPrivacy", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Ordering options for repositories returned from the connection", + "type": { + "kind": "INPUT_OBJECT", + "name": "RepositoryOrder", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "affiliations", + "description": "Array of viewer's affiliation options for repositories returned from the connection. For example, OWNER will include only repositories that the current viewer owns.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "RepositoryAffiliation", + "ofType": null + } + }, + "defaultValue": "[\"OWNER\", \"COLLABORATOR\"]" + }, + { + "name": "ownerAffiliations", + "description": "Array of owner's affiliation options for repositories returned from the connection. For example, OWNER will include only repositories that the organization or user being viewed owns.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "RepositoryAffiliation", + "ofType": null + } + }, + "defaultValue": "[\"OWNER\", \"COLLABORATOR\"]" + }, + { + "name": "isLocked", + "description": "If non-null, filters repositories according to whether they have been locked", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "isFork", + "description": "If non-null, filters repositories according to whether they are forks of another repository", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "RepositoryConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repository", + "description": "Find Repository.", + "args": [ + { + "name": "name", + "description": "Name of Repository to find.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTTP URL for the owner.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The HTTP URL for the owner.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "Organization", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "User", + "ofType": null + } + ] + }, + { + "kind": "OBJECT", + "name": "RepositoryConnection", + "description": "A list of repositories owned by the subject.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "RepositoryEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalDiskUsage", + "description": "The total size in kilobytes of all repositories in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "RepositoryEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "RepositoryPrivacy", + "description": "The privacy of a repository", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "PUBLIC", + "description": "Public", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "PRIVATE", + "description": "Private", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "RepositoryOrder", + "description": "Ordering options for repository connections", + "fields": null, + "inputFields": [ + { + "name": "field", + "description": "The field to order repositories by.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "RepositoryOrderField", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "direction", + "description": "The ordering direction.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "OrderDirection", + "ofType": null + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "RepositoryOrderField", + "description": "Properties by which repository connections can be ordered.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "CREATED_AT", + "description": "Order repositories by creation time", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "UPDATED_AT", + "description": "Order repositories by update time", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "PUSHED_AT", + "description": "Order repositories by push time", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "NAME", + "description": "Order repositories by name", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "STARGAZERS", + "description": "Order repositories by number of stargazers", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "RepositoryAffiliation", + "description": "The affiliation of a user to a repository", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "OWNER", + "description": "Repositories that are owned by the authenticated user.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "COLLABORATOR", + "description": "Repositories that the user has been added to as a collaborator.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ORGANIZATION_MEMBER", + "description": "Repositories that the user has access to through being a member of an organization. This includes every repository on every team that the user is on.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "SCALAR", + "name": "Float", + "description": "Represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point).", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INTERFACE", + "name": "MemberStatusable", + "description": "Entities that have members who can set status messages.", + "fields": [ + { + "name": "memberStatuses", + "description": "Get the status messages members of this entity have set that are either public or visible only to the organization.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Ordering options for user statuses returned from the connection.", + "type": { + "kind": "INPUT_OBJECT", + "name": "UserStatusOrder", + "ofType": null + }, + "defaultValue": "{field:\"UPDATED_AT\",direction:\"DESC\"}" + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "UserStatusConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "Organization", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Team", + "ofType": null + } + ] + }, + { + "kind": "OBJECT", + "name": "UserStatusConnection", + "description": "The connection type for UserStatus.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "UserStatusEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "UserStatus", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "UserStatusEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "UserStatus", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "UserStatus", + "description": "The user's description of what they're currently doing.", + "fields": [ + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "emoji", + "description": "An emoji summarizing the user's status.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": "ID of the object.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "indicatesLimitedAvailability", + "description": "Whether this status indicates the user is not fully available on GitHub.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "message", + "description": "A brief message describing what the user is doing.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "organization", + "description": "The organization whose members can see this status. If null, this status is publicly visible.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Organization", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Identifies the date and time when the object was last updated.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "user", + "description": "The user who has this status.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "User", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "UserStatusOrder", + "description": "Ordering options for user status connections.", + "fields": null, + "inputFields": [ + { + "name": "field", + "description": "The field to order user statuses by.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "UserStatusOrderField", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "direction", + "description": "The ordering direction.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "OrderDirection", + "ofType": null + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "UserStatusOrderField", + "description": "Properties by which user status connections can be ordered.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "UPDATED_AT", + "description": "Order user statuses by when they were updated.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "INTERFACE", + "name": "ProfileOwner", + "description": "Represents any entity on GitHub that has a profile page.", + "fields": [ + { + "name": "anyPinnableItems", + "description": "Determine if this repository owner has any items that can be pinned to their profile.", + "args": [ + { + "name": "type", + "description": "Filter to only a particular kind of pinnable item.", + "type": { + "kind": "ENUM", + "name": "PinnableItemType", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "email", + "description": "The public profile email.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "itemShowcase", + "description": "Showcases a selection of repositories and gists that the profile owner has either curated or that have been selected automatically based on popularity.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ProfileItemShowcase", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "location", + "description": "The public profile location.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "login", + "description": "The username used to login.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The public profile name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pinnableItems", + "description": "A list of repositories and gists this profile owner can pin to their profile.", + "args": [ + { + "name": "types", + "description": "Filter the types of pinnable items that are returned.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "PinnableItemType", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PinnableItemConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pinnedItems", + "description": "A list of repositories and gists this profile owner has pinned to their profile", + "args": [ + { + "name": "types", + "description": "Filter the types of pinned items that are returned.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "PinnableItemType", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PinnableItemConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pinnedItemsRemaining", + "description": "Returns how many more items this profile owner can pin to their profile.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanChangePinnedItems", + "description": "Can the viewer pin repositories and gists to the profile?", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "websiteUrl", + "description": "The public profile website URL.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "Organization", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "User", + "ofType": null + } + ] + }, + { + "kind": "OBJECT", + "name": "ProfileItemShowcase", + "description": "A curatable list of repositories relating to a repository owner, which defaults to showing the most popular repositories they own.", + "fields": [ + { + "name": "hasPinnedItems", + "description": "Whether or not the owner has pinned any repositories or gists.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "items", + "description": "The repositories and gists in the showcase. If the profile owner has any pinned items, those will be returned. Otherwise, the profile owner's popular repositories will be returned.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PinnableItemConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PinnableItemConnection", + "description": "The connection type for PinnableItem.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PinnableItemEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "UNION", + "name": "PinnableItem", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PinnableItemEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "UNION", + "name": "PinnableItem", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "UNION", + "name": "PinnableItem", + "description": "Types that can be pinned to a profile page.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "Gist", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + } + ] + }, + { + "kind": "OBJECT", + "name": "Gist", + "description": "A Gist.", + "fields": [ + { + "name": "comments", + "description": "A list of comments associated with the gist", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "GistCommentConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description", + "description": "The gist description.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "files", + "description": "The files in this gist.", + "args": [ + { + "name": "limit", + "description": "The maximum number of files to return.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": "10" + } + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "GistFile", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isFork", + "description": "Identifies if the gist is a fork.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isPublic", + "description": "Whether the gist is public or not.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The gist name.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "owner", + "description": "The gist owner.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "RepositoryOwner", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pushedAt", + "description": "Identifies when the gist was last pushed to.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "stargazers", + "description": "A list of users who have starred this starrable.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Order for connection", + "type": { + "kind": "INPUT_OBJECT", + "name": "StarOrder", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "StargazerConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Identifies the date and time when the object was last updated.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerHasStarred", + "description": "Returns a boolean indicating whether the viewing user has starred this starrable.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Starrable", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INTERFACE", + "name": "Starrable", + "description": "Things that can be starred.", + "fields": [ + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "stargazers", + "description": "A list of users who have starred this starrable.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Order for connection", + "type": { + "kind": "INPUT_OBJECT", + "name": "StarOrder", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "StargazerConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerHasStarred", + "description": "Returns a boolean indicating whether the viewing user has starred this starrable.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "Gist", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Topic", + "ofType": null + } + ] + }, + { + "kind": "OBJECT", + "name": "StargazerConnection", + "description": "The connection type for User.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "StargazerEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "User", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "StargazerEdge", + "description": "Represents a user that's starred a repository.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "User", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "starredAt", + "description": "Identifies when the item was starred.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "StarOrder", + "description": "Ways in which star connections can be ordered.", + "fields": null, + "inputFields": [ + { + "name": "field", + "description": "The field in which to order nodes by.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "StarOrderField", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "direction", + "description": "The direction in which to order nodes.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "OrderDirection", + "ofType": null + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "StarOrderField", + "description": "Properties by which star connections can be ordered.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "STARRED_AT", + "description": "Allows ordering a list of stars by when they were created.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "GistCommentConnection", + "description": "The connection type for GistComment.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "GistCommentEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "GistComment", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "GistCommentEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "GistComment", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "GistComment", + "description": "Represents a comment on an Gist.", + "fields": [ + { + "name": "author", + "description": "The actor who authored the comment.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "authorAssociation", + "description": "Author's association with the gist.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "CommentAuthorAssociation", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "body", + "description": "Identifies the comment body.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "bodyHTML", + "description": "The comment body rendered to HTML.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "HTML", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "bodyText", + "description": "The body rendered to text.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdViaEmail", + "description": "Check if this comment was created via an email reply.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "databaseId", + "description": "Identifies the primary key from the database.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "editor", + "description": "The actor who edited the comment.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "gist", + "description": "The associated gist.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Gist", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "includesCreatedEdit", + "description": "Check if this comment was edited and includes an edit with the creation data", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isMinimized", + "description": "Returns whether or not a comment has been minimized.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "lastEditedAt", + "description": "The moment the editor made the last edit", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "minimizedReason", + "description": "Returns why the comment was minimized.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "publishedAt", + "description": "Identifies when the comment was published at.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Identifies the date and time when the object was last updated.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "userContentEdits", + "description": "A list of edits to this content.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "UserContentEditConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanDelete", + "description": "Check if the current viewer can delete this object.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanMinimize", + "description": "Check if the current viewer can minimize this object.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanUpdate", + "description": "Check if the current viewer can update this object.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCannotUpdateReasons", + "description": "Reasons why the current viewer can not update this comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "CommentCannotUpdateReason", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerDidAuthor", + "description": "Did the viewer author this comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Comment", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Deletable", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Updatable", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "UpdatableComment", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INTERFACE", + "name": "Deletable", + "description": "Entities that can be deleted.", + "fields": [ + { + "name": "viewerCanDelete", + "description": "Check if the current viewer can delete this object.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "CommitComment", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "GistComment", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "IssueComment", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequestReview", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequestReviewComment", + "ofType": null + } + ] + }, + { + "kind": "OBJECT", + "name": "GistFile", + "description": "A file in a gist.", + "fields": [ + { + "name": "encodedName", + "description": "The file name encoded to remove characters that are invalid in URL paths.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "encoding", + "description": "The gist file encoding.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "extension", + "description": "The file extension from the file name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isImage", + "description": "Indicates if this file is an image.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isTruncated", + "description": "Whether the file's contents were truncated.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "language", + "description": "The programming language this file is written in.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Language", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The gist file name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "size", + "description": "The gist file size in bytes.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "text", + "description": "UTF8 text data or null if the file is binary", + "args": [ + { + "name": "truncate", + "description": "Optionally truncate the returned file to this length.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Language", + "description": "Represents a given language found in repositories.", + "fields": [ + { + "name": "color", + "description": "The color defined for the current language.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The name of the current language.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "PinnableItemType", + "description": "Represents items that can be pinned to a profile page or dashboard.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "REPOSITORY", + "description": "A repository.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "GIST", + "description": "A gist.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ISSUE", + "description": "An issue.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ProjectConnection", + "description": "A list of projects associated with the owner.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ProjectEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Project", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ProjectEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Project", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "ProjectOrder", + "description": "Ways in which lists of projects can be ordered upon return.", + "fields": null, + "inputFields": [ + { + "name": "field", + "description": "The field in which to order projects by.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "ProjectOrderField", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "direction", + "description": "The direction in which to order projects by the specified field.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "OrderDirection", + "ofType": null + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "ProjectOrderField", + "description": "Properties by which project connections can be ordered.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "CREATED_AT", + "description": "Order projects by creation time", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "UPDATED_AT", + "description": "Order projects by update time", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "NAME", + "description": "Order projects by name", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Bot", + "description": "A special type of user which takes actions on behalf of GitHub Apps.", + "fields": [ + { + "name": "avatarUrl", + "description": "A URL pointing to the GitHub App's public avatar.", + "args": [ + { + "name": "size", + "description": "The size of the resulting square image.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "databaseId", + "description": "Identifies the primary key from the database.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "login", + "description": "The username of the actor.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTTP path for this bot", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Identifies the date and time when the object was last updated.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The HTTP URL for this bot", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "UniformResourceLocatable", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "IssueComment", + "description": "Represents a comment on an Issue.", + "fields": [ + { + "name": "author", + "description": "The actor who authored the comment.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "authorAssociation", + "description": "Author's association with the subject of the comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "CommentAuthorAssociation", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "body", + "description": "The body as Markdown.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "bodyHTML", + "description": "The body rendered to HTML.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "HTML", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "bodyText", + "description": "The body rendered to text.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdViaEmail", + "description": "Check if this comment was created via an email reply.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "databaseId", + "description": "Identifies the primary key from the database.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "editor", + "description": "The actor who edited the comment.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "includesCreatedEdit", + "description": "Check if this comment was edited and includes an edit with the creation data", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isMinimized", + "description": "Returns whether or not a comment has been minimized.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "issue", + "description": "Identifies the issue associated with the comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Issue", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "lastEditedAt", + "description": "The moment the editor made the last edit", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "minimizedReason", + "description": "Returns why the comment was minimized.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "publishedAt", + "description": "Identifies when the comment was published at.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequest", + "description": "Returns the pull request associated with the comment, if this comment was made on a\npull request.\n", + "args": [], + "type": { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "reactionGroups", + "description": "A list of reactions grouped by content left on the subject.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ReactionGroup", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "reactions", + "description": "A list of Reactions left on the Issue.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "content", + "description": "Allows filtering Reactions by emoji.", + "type": { + "kind": "ENUM", + "name": "ReactionContent", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Allows specifying the order in which reactions are returned.", + "type": { + "kind": "INPUT_OBJECT", + "name": "ReactionOrder", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ReactionConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repository", + "description": "The repository associated with this node.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTTP path for this issue comment", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Identifies the date and time when the object was last updated.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The HTTP URL for this issue comment", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "userContentEdits", + "description": "A list of edits to this content.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "UserContentEditConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanDelete", + "description": "Check if the current viewer can delete this object.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanMinimize", + "description": "Check if the current viewer can minimize this object.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanReact", + "description": "Can user react to this subject", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanUpdate", + "description": "Check if the current viewer can update this object.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCannotUpdateReasons", + "description": "Reasons why the current viewer can not update this comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "CommentCannotUpdateReason", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerDidAuthor", + "description": "Did the viewer author this comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Comment", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Deletable", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Updatable", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "UpdatableComment", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Reactable", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "RepositoryNode", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INTERFACE", + "name": "Reactable", + "description": "Represents a subject that can be reacted on.", + "fields": [ + { + "name": "databaseId", + "description": "Identifies the primary key from the database.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "reactionGroups", + "description": "A list of reactions grouped by content left on the subject.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ReactionGroup", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "reactions", + "description": "A list of Reactions left on the Issue.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "content", + "description": "Allows filtering Reactions by emoji.", + "type": { + "kind": "ENUM", + "name": "ReactionContent", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Allows specifying the order in which reactions are returned.", + "type": { + "kind": "INPUT_OBJECT", + "name": "ReactionOrder", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ReactionConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanReact", + "description": "Can user react to this subject", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "CommitComment", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Issue", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "IssueComment", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequestReview", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequestReviewComment", + "ofType": null + } + ] + }, + { + "kind": "OBJECT", + "name": "ReactionGroup", + "description": "A group of emoji reactions to a particular piece of content.", + "fields": [ + { + "name": "content", + "description": "Identifies the emoji reaction.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "ReactionContent", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies when the reaction was created.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subject", + "description": "The subject that was reacted to.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INTERFACE", + "name": "Reactable", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "users", + "description": "Users who have reacted to the reaction subject with the emotion represented by this reaction group", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ReactingUserConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerHasReacted", + "description": "Whether or not the authenticated user has left a reaction on the subject.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "ReactionContent", + "description": "Emojis that can be attached to Issues, Pull Requests and Comments.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "THUMBS_UP", + "description": "Represents the 👍 emoji.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "THUMBS_DOWN", + "description": "Represents the 👎 emoji.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "LAUGH", + "description": "Represents the 😄 emoji.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "HOORAY", + "description": "Represents the 🎉 emoji.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "CONFUSED", + "description": "Represents the 😕 emoji.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "HEART", + "description": "Represents the ❤️ emoji.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ROCKET", + "description": "Represents the 🚀 emoji.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "EYES", + "description": "Represents the 👀 emoji.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ReactingUserConnection", + "description": "The connection type for User.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ReactingUserEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "User", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ReactingUserEdge", + "description": "Represents a user that's made a reaction.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "User", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "reactedAt", + "description": "The moment when the user made the reaction.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ReactionConnection", + "description": "A list of reactions that have been left on the subject.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ReactionEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Reaction", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerHasReacted", + "description": "Whether or not the authenticated user has left a reaction on the subject.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ReactionEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Reaction", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Reaction", + "description": "An emoji reaction to a particular piece of content.", + "fields": [ + { + "name": "content", + "description": "Identifies the emoji reaction.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "ReactionContent", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "databaseId", + "description": "Identifies the primary key from the database.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "reactable", + "description": "The reactable piece of content", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INTERFACE", + "name": "Reactable", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "user", + "description": "Identifies the user who created this reaction.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "User", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "ReactionOrder", + "description": "Ways in which lists of reactions can be ordered upon return.", + "fields": null, + "inputFields": [ + { + "name": "field", + "description": "The field in which to order reactions by.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "ReactionOrderField", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "direction", + "description": "The direction in which to order reactions by the specified field.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "OrderDirection", + "ofType": null + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "ReactionOrderField", + "description": "A list of fields that reactions can be ordered by.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "CREATED_AT", + "description": "Allows ordering a list of reactions by when they were created.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "INTERFACE", + "name": "RepositoryInfo", + "description": "A subset of repository info.", + "fields": [ + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description", + "description": "The description of the repository.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "descriptionHTML", + "description": "The description of the repository rendered to HTML.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "HTML", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "forkCount", + "description": "Returns how many forks there are of this repository in the whole network.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "hasIssuesEnabled", + "description": "Indicates if the repository has issues feature enabled.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "hasWikiEnabled", + "description": "Indicates if the repository has wiki feature enabled.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "homepageUrl", + "description": "The repository's URL.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isArchived", + "description": "Indicates if the repository is unmaintained.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isFork", + "description": "Identifies if the repository is a fork.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isLocked", + "description": "Indicates if the repository has been locked or not.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isMirror", + "description": "Identifies if the repository is a mirror.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isPrivate", + "description": "Identifies if the repository is private.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "licenseInfo", + "description": "The license associated with the repository", + "args": [], + "type": { + "kind": "OBJECT", + "name": "License", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "lockReason", + "description": "The reason the repository has been locked.", + "args": [], + "type": { + "kind": "ENUM", + "name": "RepositoryLockReason", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "mirrorUrl", + "description": "The repository's original mirror URL.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The name of the repository.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nameWithOwner", + "description": "The repository's name with owner.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "owner", + "description": "The User owner of the repository.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INTERFACE", + "name": "RepositoryOwner", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pushedAt", + "description": "Identifies when the repository was last pushed to.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTTP path for this repository", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "shortDescriptionHTML", + "description": "A description of the repository, rendered to HTML without any links in it.", + "args": [ + { + "name": "limit", + "description": "How many characters to return.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": "200" + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "HTML", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Identifies the date and time when the object was last updated.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The HTTP URL for this repository", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + } + ] + }, + { + "kind": "ENUM", + "name": "RepositoryLockReason", + "description": "The possible reasons a given repository could be in a locked state.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "MOVING", + "description": "The repository is locked due to a move.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "BILLING", + "description": "The repository is locked due to a billing related reason.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "RENAME", + "description": "The repository is locked due to a rename.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "MIGRATING", + "description": "The repository is locked due to a migration.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "License", + "description": "A repository's open source license", + "fields": [ + { + "name": "body", + "description": "The full text of the license", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "conditions", + "description": "The conditions set by the license", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "LicenseRule", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description", + "description": "A human-readable description of the license", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "featured", + "description": "Whether the license should be featured", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "hidden", + "description": "Whether the license should be displayed in license pickers", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "implementation", + "description": "Instructions on how to implement the license", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "key", + "description": "The lowercased SPDX ID of the license", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "limitations", + "description": "The limitations set by the license", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "LicenseRule", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The license full name specified by ", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nickname", + "description": "Customary short name if applicable (e.g, GPLv3)", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "permissions", + "description": "The permissions set by the license", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "LicenseRule", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pseudoLicense", + "description": "Whether the license is a pseudo-license placeholder (e.g., other, no-license)", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "spdxId", + "description": "Short identifier specified by ", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "URL to the license on ", + "args": [], + "type": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "LicenseRule", + "description": "Describes a License's conditions, permissions, and limitations", + "fields": [ + { + "name": "description", + "description": "A description of the rule", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "key", + "description": "The machine-readable rule key", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "label", + "description": "The human-readable rule label", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "RepositoryTopicConnection", + "description": "The connection type for RepositoryTopic.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "RepositoryTopicEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "RepositoryTopic", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "RepositoryTopicEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "RepositoryTopic", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "RepositoryTopic", + "description": "A repository-topic connects a repository to a topic.", + "fields": [ + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTTP path for this repository-topic.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "topic", + "description": "The topic.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Topic", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The HTTP URL for this repository-topic.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "UniformResourceLocatable", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Topic", + "description": "A topic aggregates entities that are related to a subject.", + "fields": [ + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The topic's name.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "relatedTopics", + "description": "A list of related topics, including aliases of this topic, sorted with the most relevant\nfirst. Returns up to 10 Topics.\n", + "args": [ + { + "name": "first", + "description": "How many topics to return.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": "3" + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Topic", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "stargazers", + "description": "A list of users who have starred this starrable.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Order for connection", + "type": { + "kind": "INPUT_OBJECT", + "name": "StarOrder", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "StargazerConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerHasStarred", + "description": "Returns a boolean indicating whether the viewing user has starred this starrable.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Starrable", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Release", + "description": "A release contains the content for a release.", + "fields": [ + { + "name": "author", + "description": "The author of the release", + "args": [], + "type": { + "kind": "OBJECT", + "name": "User", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description", + "description": "Identifies the description of the release.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isDraft", + "description": "Whether or not the release is a draft", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isPrerelease", + "description": "Whether or not the release is a prerelease", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "Identifies the title of the release.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "publishedAt", + "description": "Identifies the date and time when the release was created.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "releaseAssets", + "description": "List of releases assets which are dependent on this release.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "name", + "description": "A list of names to filter the assets by.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ReleaseAssetConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTTP path for this issue", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "tag", + "description": "The Git tag the release points to", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Ref", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "tagName", + "description": "The name of the release's Git tag", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Identifies the date and time when the object was last updated.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The HTTP URL for this issue", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "UniformResourceLocatable", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Ref", + "description": "Represents a Git reference.", + "fields": [ + { + "name": "associatedPullRequests", + "description": "A list of pull requests with this ref as the head ref.", + "args": [ + { + "name": "states", + "description": "A list of states to filter the pull requests by.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "PullRequestState", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "labels", + "description": "A list of label names to filter the pull requests by.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "headRefName", + "description": "The head ref name to filter the pull requests by.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "baseRefName", + "description": "The base ref name to filter the pull requests by.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Ordering options for pull requests returned from the connection.", + "type": { + "kind": "INPUT_OBJECT", + "name": "IssueOrder", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequestConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The ref name.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "prefix", + "description": "The ref's prefix, such as `refs/heads/` or `refs/tags/`.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repository", + "description": "The repository the ref belongs to.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "target", + "description": "The object the ref points to.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INTERFACE", + "name": "GitObject", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INTERFACE", + "name": "GitObject", + "description": "Represents a Git object.", + "fields": [ + { + "name": "abbreviatedOid", + "description": "An abbreviated version of the Git object ID", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "commitResourcePath", + "description": "The HTTP path for this Git object", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "commitUrl", + "description": "The HTTP URL for this Git object", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "oid", + "description": "The Git object ID", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "GitObjectID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repository", + "description": "The Repository the Git object belongs to", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "Blob", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Commit", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Tag", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Tree", + "ofType": null + } + ] + }, + { + "kind": "SCALAR", + "name": "GitObjectID", + "description": "A Git object ID.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INTERFACE", + "name": "RepositoryNode", + "description": "Represents a object that belongs to a repository.", + "fields": [ + { + "name": "repository", + "description": "The repository associated with this node.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "CommitComment", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "CommitCommentThread", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Issue", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "IssueComment", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequestCommitCommentThread", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequestReview", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequestReviewComment", + "ofType": null + } + ] + }, + { + "kind": "OBJECT", + "name": "Blob", + "description": "Represents a Git blob.", + "fields": [ + { + "name": "abbreviatedOid", + "description": "An abbreviated version of the Git object ID", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "byteSize", + "description": "Byte size of Blob object", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "commitResourcePath", + "description": "The HTTP path for this Git object", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "commitUrl", + "description": "The HTTP URL for this Git object", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isBinary", + "description": "Indicates whether the Blob is binary or text", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isTruncated", + "description": "Indicates whether the contents is truncated", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "oid", + "description": "The Git object ID", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "GitObjectID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repository", + "description": "The Repository the Git object belongs to", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "text", + "description": "UTF8 text data or null if the Blob is binary", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "GitObject", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Commit", + "description": "Represents a Git commit.", + "fields": [ + { + "name": "abbreviatedOid", + "description": "An abbreviated version of the Git object ID", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "additions", + "description": "The number of additions in this commit.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "associatedPullRequests", + "description": "The pull requests associated with a commit", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Ordering options for pull requests.", + "type": { + "kind": "INPUT_OBJECT", + "name": "PullRequestOrder", + "ofType": null + }, + "defaultValue": "{field:\"CREATED_AT\",direction:\"ASC\"}" + } + ], + "type": { + "kind": "OBJECT", + "name": "PullRequestConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "author", + "description": "Authorship details of the commit.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "GitActor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "authoredByCommitter", + "description": "Check if the committer and the author match.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "authoredDate", + "description": "The datetime when this commit was authored.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "blame", + "description": "Fetches `git blame` information.", + "args": [ + { + "name": "path", + "description": "The file whose Git blame information you want.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Blame", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "changedFiles", + "description": "The number of changed files in this commit.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "comments", + "description": "Comments made on the commit.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CommitCommentConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "commitResourcePath", + "description": "The HTTP path for this Git object", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "commitUrl", + "description": "The HTTP URL for this Git object", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "committedDate", + "description": "The datetime when this commit was committed.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "committedViaWeb", + "description": "Check if commited via GitHub web UI.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "committer", + "description": "Committership details of the commit.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "GitActor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deletions", + "description": "The number of deletions in this commit.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deployments", + "description": "The deployments associated with a commit.", + "args": [ + { + "name": "environments", + "description": "Environments to list deployments for", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Ordering options for deployments returned from the connection.", + "type": { + "kind": "INPUT_OBJECT", + "name": "DeploymentOrder", + "ofType": null + }, + "defaultValue": "{field:\"CREATED_AT\",direction:\"ASC\"}" + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "DeploymentConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "history", + "description": "The linear commit history starting from (and including) this commit, in the same order as `git log`.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "path", + "description": "If non-null, filters history to only show commits touching files under this path.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "author", + "description": "If non-null, filters history to only show commits with matching authorship.", + "type": { + "kind": "INPUT_OBJECT", + "name": "CommitAuthor", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "since", + "description": "Allows specifying a beginning time or date for fetching commits.", + "type": { + "kind": "SCALAR", + "name": "GitTimestamp", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "until", + "description": "Allows specifying an ending time or date for fetching commits.", + "type": { + "kind": "SCALAR", + "name": "GitTimestamp", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CommitHistoryConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "message", + "description": "The Git commit message", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "messageBody", + "description": "The Git commit message body", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "messageBodyHTML", + "description": "The commit message body rendered to HTML.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "HTML", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "messageHeadline", + "description": "The Git commit message headline", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "messageHeadlineHTML", + "description": "The commit message headline rendered to HTML.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "HTML", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "oid", + "description": "The Git object ID", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "GitObjectID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "parents", + "description": "The parents of a commit.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CommitConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pushedDate", + "description": "The datetime when this commit was pushed.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repository", + "description": "The Repository this commit belongs to", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTTP path for this commit", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "signature", + "description": "Commit signing information, if present.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "GitSignature", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "status", + "description": "Status information for this commit", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Status", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "tarballUrl", + "description": "Returns a URL to download a tarball archive for a repository.\nNote: For private repositories, these links are temporary and expire after five minutes.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "tree", + "description": "Commit's root Tree", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Tree", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "treeResourcePath", + "description": "The HTTP path for the tree of this commit", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "treeUrl", + "description": "The HTTP URL for the tree of this commit", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The HTTP URL for this commit", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanSubscribe", + "description": "Check if the viewer is able to change their subscription status for the repository.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerSubscription", + "description": "Identifies if the viewer is watching, not watching, or ignoring the subscribable entity.", + "args": [], + "type": { + "kind": "ENUM", + "name": "SubscriptionState", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "zipballUrl", + "description": "Returns a URL to download a zipball archive for a repository.\nNote: For private repositories, these links are temporary and expire after five minutes.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "GitObject", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Subscribable", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "UniformResourceLocatable", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INTERFACE", + "name": "Subscribable", + "description": "Entities that can be subscribed to for web and email notifications.", + "fields": [ + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanSubscribe", + "description": "Check if the viewer is able to change their subscription status for the repository.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerSubscription", + "description": "Identifies if the viewer is watching, not watching, or ignoring the subscribable entity.", + "args": [], + "type": { + "kind": "ENUM", + "name": "SubscriptionState", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "Commit", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Issue", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Team", + "ofType": null + } + ] + }, + { + "kind": "ENUM", + "name": "SubscriptionState", + "description": "The possible states of a subscription.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "UNSUBSCRIBED", + "description": "The User is only notified when participating or @mentioned.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "SUBSCRIBED", + "description": "The User is notified of all conversations.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "IGNORED", + "description": "The User is never notified.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Tree", + "description": "Represents a Git tree.", + "fields": [ + { + "name": "abbreviatedOid", + "description": "An abbreviated version of the Git object ID", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "commitResourcePath", + "description": "The HTTP path for this Git object", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "commitUrl", + "description": "The HTTP URL for this Git object", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "entries", + "description": "A list of tree entries.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "TreeEntry", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "oid", + "description": "The Git object ID", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "GitObjectID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repository", + "description": "The Repository the Git object belongs to", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "GitObject", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "TreeEntry", + "description": "Represents a Git tree entry.", + "fields": [ + { + "name": "mode", + "description": "Entry file mode.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "Entry file name.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "object", + "description": "Entry file object.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "GitObject", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "oid", + "description": "Entry file Git object ID.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "GitObjectID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repository", + "description": "The Repository the tree entry belongs to", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "type", + "description": "Entry file type.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "GitActor", + "description": "Represents an actor in a Git commit (ie. an author or committer).", + "fields": [ + { + "name": "avatarUrl", + "description": "A URL pointing to the author's public avatar.", + "args": [ + { + "name": "size", + "description": "The size of the resulting square image.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "date", + "description": "The timestamp of the Git action (authoring or committing).", + "args": [], + "type": { + "kind": "SCALAR", + "name": "GitTimestamp", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "email", + "description": "The email in the Git commit.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The name in the Git commit.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "user", + "description": "The GitHub user corresponding to the email field. Null if no such user exists.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "User", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "SCALAR", + "name": "GitTimestamp", + "description": "An ISO-8601 encoded date string. Unlike the DateTime type, GitTimestamp is not converted in UTC.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CommitConnection", + "description": "The connection type for Commit.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CommitEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Commit", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CommitEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Commit", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CommitHistoryConnection", + "description": "The connection type for Commit.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CommitEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Commit", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "CommitAuthor", + "description": "Specifies an author for filtering Git commits.", + "fields": null, + "inputFields": [ + { + "name": "id", + "description": "ID of a User to filter by. If non-null, only commits authored by this user will be returned. This field takes precedence over emails.", + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "emails", + "description": "Email addresses to filter by. Commits authored by any of the specified email addresses will be returned.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CommitCommentConnection", + "description": "The connection type for CommitComment.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CommitCommentEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CommitComment", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CommitCommentEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "CommitComment", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CommitComment", + "description": "Represents a comment on a given Commit.", + "fields": [ + { + "name": "author", + "description": "The actor who authored the comment.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "authorAssociation", + "description": "Author's association with the subject of the comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "CommentAuthorAssociation", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "body", + "description": "Identifies the comment body.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "bodyHTML", + "description": "Identifies the comment body rendered to HTML.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "HTML", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "bodyText", + "description": "The body rendered to text.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "commit", + "description": "Identifies the commit associated with the comment, if the commit exists.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Commit", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdViaEmail", + "description": "Check if this comment was created via an email reply.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "databaseId", + "description": "Identifies the primary key from the database.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "editor", + "description": "The actor who edited the comment.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "includesCreatedEdit", + "description": "Check if this comment was edited and includes an edit with the creation data", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isMinimized", + "description": "Returns whether or not a comment has been minimized.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "lastEditedAt", + "description": "The moment the editor made the last edit", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "minimizedReason", + "description": "Returns why the comment was minimized.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "path", + "description": "Identifies the file path associated with the comment.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "position", + "description": "Identifies the line position associated with the comment.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "publishedAt", + "description": "Identifies when the comment was published at.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "reactionGroups", + "description": "A list of reactions grouped by content left on the subject.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ReactionGroup", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "reactions", + "description": "A list of Reactions left on the Issue.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "content", + "description": "Allows filtering Reactions by emoji.", + "type": { + "kind": "ENUM", + "name": "ReactionContent", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Allows specifying the order in which reactions are returned.", + "type": { + "kind": "INPUT_OBJECT", + "name": "ReactionOrder", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ReactionConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repository", + "description": "The repository associated with this node.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTTP path permalink for this commit comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Identifies the date and time when the object was last updated.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The HTTP URL permalink for this commit comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "userContentEdits", + "description": "A list of edits to this content.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "UserContentEditConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanDelete", + "description": "Check if the current viewer can delete this object.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanMinimize", + "description": "Check if the current viewer can minimize this object.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanReact", + "description": "Can user react to this subject", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanUpdate", + "description": "Check if the current viewer can update this object.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCannotUpdateReasons", + "description": "Reasons why the current viewer can not update this comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "CommentCannotUpdateReason", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerDidAuthor", + "description": "Did the viewer author this comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Comment", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Deletable", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Updatable", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "UpdatableComment", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Reactable", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "RepositoryNode", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INTERFACE", + "name": "GitSignature", + "description": "Information about a signature (GPG or S/MIME) on a Commit or Tag.", + "fields": [ + { + "name": "email", + "description": "Email used to sign this object.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isValid", + "description": "True if the signature is valid and verified by GitHub.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "payload", + "description": "Payload for GPG signing object. Raw ODB object without the signature header.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "signature", + "description": "ASCII-armored signature header from object.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "signer", + "description": "GitHub user corresponding to the email signing this commit.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "User", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "state", + "description": "The state of this signature. `VALID` if signature is valid and verified by GitHub, otherwise represents reason why signature is considered invalid.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "GitSignatureState", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "wasSignedByGitHub", + "description": "True if the signature was made with GitHub's signing key.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "GpgSignature", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "SmimeSignature", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "UnknownSignature", + "ofType": null + } + ] + }, + { + "kind": "ENUM", + "name": "GitSignatureState", + "description": "The state of a Git signature.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "VALID", + "description": "Valid signature and verified by GitHub", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INVALID", + "description": "Invalid signature", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "MALFORMED_SIG", + "description": "Malformed signature", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "UNKNOWN_KEY", + "description": "Key used for signing not known to GitHub", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "BAD_EMAIL", + "description": "Invalid email used for signing", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "UNVERIFIED_EMAIL", + "description": "Email used for signing unverified on GitHub", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "NO_USER", + "description": "Email used for signing not known to GitHub", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "UNKNOWN_SIG_TYPE", + "description": "Unknown signature type", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "UNSIGNED", + "description": "Unsigned", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "GPGVERIFY_UNAVAILABLE", + "description": "Internal error - the GPG verification service is unavailable at the moment", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "GPGVERIFY_ERROR", + "description": "Internal error - the GPG verification service misbehaved", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "NOT_SIGNING_KEY", + "description": "The usage flags for the key that signed this don't allow signing", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "EXPIRED_KEY", + "description": "Signing key expired", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "OCSP_PENDING", + "description": "Valid signature, pending certificate revocation checking", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "OCSP_ERROR", + "description": "Valid siganture, though certificate revocation check failed", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "BAD_CERT", + "description": "The signing certificate or its chain could not be verified", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "OCSP_REVOKED", + "description": "One or more certificates in chain has been revoked", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Status", + "description": "Represents a commit status.", + "fields": [ + { + "name": "commit", + "description": "The commit this status is attached to.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Commit", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "context", + "description": "Looks up an individual status context by context name.", + "args": [ + { + "name": "name", + "description": "The context name.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "StatusContext", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "contexts", + "description": "The individual status contexts for this commit.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "StatusContext", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "state", + "description": "The combined commit status.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "StatusState", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "StatusState", + "description": "The possible commit status states.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "EXPECTED", + "description": "Status is expected.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ERROR", + "description": "Status is errored.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "FAILURE", + "description": "Status is failing.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "PENDING", + "description": "Status is pending.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "SUCCESS", + "description": "Status is successful.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "StatusContext", + "description": "Represents an individual commit status context", + "fields": [ + { + "name": "commit", + "description": "This commit this status context is attached to.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Commit", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "context", + "description": "The name of this status context.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "creator", + "description": "The actor who created this status context.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description", + "description": "The description for this status context.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "state", + "description": "The state of this status context.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "StatusState", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "targetUrl", + "description": "The URL for this status context.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "PullRequestState", + "description": "The possible states of a pull request.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "OPEN", + "description": "A pull request that is still open.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "CLOSED", + "description": "A pull request that has been closed without being merged.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "MERGED", + "description": "A pull request that has been closed by being merged.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Blame", + "description": "Represents a Git blame.", + "fields": [ + { + "name": "ranges", + "description": "The list of ranges from a Git blame.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "BlameRange", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "BlameRange", + "description": "Represents a range of information from a Git blame.", + "fields": [ + { + "name": "age", + "description": "Identifies the recency of the change, from 1 (new) to 10 (old). This is calculated as a 2-quantile and determines the length of distance between the median age of all the changes in the file and the recency of the current range's change.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "commit", + "description": "Identifies the line author", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Commit", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "endingLine", + "description": "The ending line for the range", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "startingLine", + "description": "The starting line for the range", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "DeploymentConnection", + "description": "The connection type for Deployment.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "DeploymentEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Deployment", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "DeploymentEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Deployment", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Deployment", + "description": "Represents triggered deployment instance.", + "fields": [ + { + "name": "commit", + "description": "Identifies the commit sha of the deployment.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Commit", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "commitOid", + "description": "Identifies the oid of the deployment commit, even if the commit has been deleted.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "creator", + "description": "Identifies the actor who triggered the deployment.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "databaseId", + "description": "Identifies the primary key from the database.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description", + "description": "The deployment description.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "environment", + "description": "The environment to which this deployment was made.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "latestStatus", + "description": "The latest status of this deployment.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "DeploymentStatus", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "payload", + "description": "Extra information that a deployment system might need.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ref", + "description": "Identifies the Ref of the deployment, if the deployment was created by ref.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Ref", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repository", + "description": "Identifies the repository associated with the deployment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "state", + "description": "The current state of the deployment.", + "args": [], + "type": { + "kind": "ENUM", + "name": "DeploymentState", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "statuses", + "description": "A list of statuses associated with the deployment.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "DeploymentStatusConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "task", + "description": "The deployment task.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Identifies the date and time when the object was last updated.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "DeploymentStatusConnection", + "description": "The connection type for DeploymentStatus.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "DeploymentStatusEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "DeploymentStatus", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "DeploymentStatusEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "DeploymentStatus", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "DeploymentStatus", + "description": "Describes the status of a given deployment attempt.", + "fields": [ + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "creator", + "description": "Identifies the actor who triggered the deployment.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deployment", + "description": "Identifies the deployment associated with status.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Deployment", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description", + "description": "Identifies the description of the deployment.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "environmentUrl", + "description": "Identifies the environment URL of the deployment.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "logUrl", + "description": "Identifies the log URL of the deployment.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "state", + "description": "Identifies the current state of the deployment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "DeploymentStatusState", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Identifies the date and time when the object was last updated.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "DeploymentStatusState", + "description": "The possible states for a deployment status.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "PENDING", + "description": "The deployment is pending.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "SUCCESS", + "description": "The deployment was successful.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "FAILURE", + "description": "The deployment has failed.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INACTIVE", + "description": "The deployment is inactive.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ERROR", + "description": "The deployment experienced an error.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "QUEUED", + "description": "The deployment is queued", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "IN_PROGRESS", + "description": "The deployment is in progress.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "DeploymentState", + "description": "The possible states in which a deployment can be.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "ABANDONED", + "description": "The pending deployment was not updated after 30 minutes.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ACTIVE", + "description": "The deployment is currently active.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "DESTROYED", + "description": "An inactive transient deployment.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ERROR", + "description": "The deployment experienced an error.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "FAILURE", + "description": "The deployment has failed.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INACTIVE", + "description": "The deployment is inactive.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "PENDING", + "description": "The deployment is pending.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "QUEUED", + "description": "The deployment has queued", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "IN_PROGRESS", + "description": "The deployment is in progress.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "DeploymentOrder", + "description": "Ordering options for deployment connections", + "fields": null, + "inputFields": [ + { + "name": "field", + "description": "The field to order deployments by.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "DeploymentOrderField", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "direction", + "description": "The ordering direction.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "OrderDirection", + "ofType": null + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "DeploymentOrderField", + "description": "Properties by which deployment connections can be ordered.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "CREATED_AT", + "description": "Order collection by creation time", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "PullRequestOrder", + "description": "Ways in which lists of issues can be ordered upon return.", + "fields": null, + "inputFields": [ + { + "name": "field", + "description": "The field in which to order pull requests by.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "PullRequestOrderField", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "direction", + "description": "The direction in which to order pull requests by the specified field.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "OrderDirection", + "ofType": null + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "PullRequestOrderField", + "description": "Properties by which pull_requests connections can be ordered.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "CREATED_AT", + "description": "Order pull_requests by creation time", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "UPDATED_AT", + "description": "Order pull_requests by update time", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ReleaseAssetConnection", + "description": "The connection type for ReleaseAsset.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ReleaseAssetEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ReleaseAsset", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ReleaseAssetEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "ReleaseAsset", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ReleaseAsset", + "description": "A release asset contains the content for a release asset.", + "fields": [ + { + "name": "contentType", + "description": "The asset's content-type", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "downloadCount", + "description": "The number of times this asset was downloaded", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "downloadUrl", + "description": "Identifies the URL where you can download the release asset via the browser.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "Identifies the title of the release asset.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "release", + "description": "Release that the asset is associated with", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Release", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "size", + "description": "The size (in bytes) of the asset", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Identifies the date and time when the object was last updated.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "uploadedBy", + "description": "The user that performed the upload", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "User", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "Identifies the URL of the release asset.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "MarketplaceCategory", + "description": "A public description of a Marketplace category.", + "fields": [ + { + "name": "description", + "description": "The category's description.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "howItWorks", + "description": "The technical description of how apps listed in this category work with GitHub.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The category's name.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "primaryListingCount", + "description": "How many Marketplace listings have this as their primary category.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTTP path for this Marketplace category.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "secondaryListingCount", + "description": "How many Marketplace listings have this as their secondary category.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "slug", + "description": "The short name of the category used in its URL.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The HTTP URL for this Marketplace category.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "MarketplaceListingConnection", + "description": "Look up Marketplace Listings", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "MarketplaceListingEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "MarketplaceListing", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "MarketplaceListingEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "MarketplaceListing", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ReleaseConnection", + "description": "The connection type for Release.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ReleaseEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Release", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ReleaseEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Release", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "ReleaseOrder", + "description": "Ways in which lists of releases can be ordered upon return.", + "fields": null, + "inputFields": [ + { + "name": "field", + "description": "The field in which to order releases by.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "ReleaseOrderField", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "direction", + "description": "The direction in which to order releases by the specified field.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "OrderDirection", + "ofType": null + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "ReleaseOrderField", + "description": "Properties by which release connections can be ordered.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "CREATED_AT", + "description": "Order releases by creation time", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "NAME", + "description": "Order releases alphabetically by name", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "IssuePubSubTopic", + "description": "The possible PubSub channels for an issue.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "UPDATED", + "description": "The channel ID for observing issue updates.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "MARKASREAD", + "description": "The channel ID for marking an issue as read.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "TIMELINE", + "description": "The channel ID for updating items on the issue timeline.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "STATE", + "description": "The channel ID for observing issue state updates.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "OrganizationConnection", + "description": "The connection type for Organization.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "OrganizationEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Organization", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "OrganizationEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Organization", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "OrganizationInvitation", + "description": "An Invitation for a user to an organization.", + "fields": [ + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "email", + "description": "The email address of the user invited to the organization.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "invitationType", + "description": "The type of invitation that was sent (e.g. email, user).", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "OrganizationInvitationType", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "invitee", + "description": "The user who was invited to the organization.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "User", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "inviter", + "description": "The user who created the invitation.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "User", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "organization", + "description": "The organization the invite is for", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Organization", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "role", + "description": "The user's pending role in the organization (e.g. member, owner).", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "OrganizationInvitationRole", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "OrganizationInvitationType", + "description": "The possible organization invitation types.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "USER", + "description": "The invitation was to an existing user.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "EMAIL", + "description": "The invitation was to an email address.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "OrganizationInvitationRole", + "description": "The possible organization invitation roles.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "DIRECT_MEMBER", + "description": "The user is invited to be a direct member of the organization.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ADMIN", + "description": "The user is invited to be an admin of the organization.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "BILLING_MANAGER", + "description": "The user is invited to be a billing manager of the organization.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "REINSTATE", + "description": "The user's previous role will be reinstated.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "TeamConnection", + "description": "The connection type for Team.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "TeamEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Team", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "TeamEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Team", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Team", + "description": "A team of users in an organization.", + "fields": [ + { + "name": "ancestors", + "description": "A list of teams that are ancestors of this team.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "TeamConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "avatarUrl", + "description": "A URL pointing to the team's avatar.", + "args": [ + { + "name": "size", + "description": "The size in pixels of the resulting square image.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": "400" + } + ], + "type": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "childTeams", + "description": "List of child teams belonging to this team", + "args": [ + { + "name": "orderBy", + "description": "Order for connection", + "type": { + "kind": "INPUT_OBJECT", + "name": "TeamOrder", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "userLogins", + "description": "User logins to filter by", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "immediateOnly", + "description": "Whether to list immediate child teams or all descendant child teams.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "true" + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "TeamConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "combinedSlug", + "description": "The slug corresponding to the organization and team.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description", + "description": "The description of the team.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "editTeamResourcePath", + "description": "The HTTP path for editing this team", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "editTeamUrl", + "description": "The HTTP URL for editing this team", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "invitations", + "description": "A list of pending invitations for users to this team", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "OrganizationInvitationConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "memberStatuses", + "description": "Get the status messages members of this entity have set that are either public or visible only to the organization.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Ordering options for user statuses returned from the connection.", + "type": { + "kind": "INPUT_OBJECT", + "name": "UserStatusOrder", + "ofType": null + }, + "defaultValue": "{field:\"UPDATED_AT\",direction:\"DESC\"}" + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "UserStatusConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "members", + "description": "A list of users who are members of this team.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "query", + "description": "The search string to look for.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "membership", + "description": "Filter by membership type", + "type": { + "kind": "ENUM", + "name": "TeamMembershipType", + "ofType": null + }, + "defaultValue": "ALL" + }, + { + "name": "role", + "description": "Filter by team member role", + "type": { + "kind": "ENUM", + "name": "TeamMemberRole", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Order for the connection.", + "type": { + "kind": "INPUT_OBJECT", + "name": "TeamMemberOrder", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "TeamMemberConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "membersResourcePath", + "description": "The HTTP path for the team' members", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "membersUrl", + "description": "The HTTP URL for the team' members", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The name of the team.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "newTeamResourcePath", + "description": "The HTTP path creating a new team", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "newTeamUrl", + "description": "The HTTP URL creating a new team", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "organization", + "description": "The organization that owns this team.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Organization", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "parentTeam", + "description": "The parent team of the team.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Team", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "privacy", + "description": "The level of privacy the team has.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "TeamPrivacy", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repositories", + "description": "A list of repositories this team has access to.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "query", + "description": "The search string to look for.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Order for the connection.", + "type": { + "kind": "INPUT_OBJECT", + "name": "TeamRepositoryOrder", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "TeamRepositoryConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repositoriesResourcePath", + "description": "The HTTP path for this team's repositories", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repositoriesUrl", + "description": "The HTTP URL for this team's repositories", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTTP path for this team", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "slug", + "description": "The slug corresponding to the team.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "teamsResourcePath", + "description": "The HTTP path for this team's teams", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "teamsUrl", + "description": "The HTTP URL for this team's teams", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Identifies the date and time when the object was last updated.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The HTTP URL for this team", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanAdminister", + "description": "Team is adminable by the viewer.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanSubscribe", + "description": "Check if the viewer is able to change their subscription status for the repository.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerSubscription", + "description": "Identifies if the viewer is watching, not watching, or ignoring the subscribable entity.", + "args": [], + "type": { + "kind": "ENUM", + "name": "SubscriptionState", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Subscribable", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "MemberStatusable", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "TeamPrivacy", + "description": "The possible team privacy values.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "SECRET", + "description": "A secret team can only be seen by its members.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "VISIBLE", + "description": "A visible team can be seen and @mentioned by every member of the organization.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "TeamMemberConnection", + "description": "The connection type for User.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "TeamMemberEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "User", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "TeamMemberEdge", + "description": "Represents a user who is a member of a team.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "memberAccessResourcePath", + "description": "The HTTP path to the organization's member access page.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "memberAccessUrl", + "description": "The HTTP URL to the organization's member access page.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "User", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "role", + "description": "The role the member has on the team.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "TeamMemberRole", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "TeamMemberRole", + "description": "The possible team member roles; either 'maintainer' or 'member'.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "MAINTAINER", + "description": "A team maintainer has permission to add and remove team members.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "MEMBER", + "description": "A team member has no administrative permissions on the team.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "TeamMembershipType", + "description": "Defines which types of team members are included in the returned list. Can be one of IMMEDIATE, CHILD_TEAM or ALL.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "IMMEDIATE", + "description": "Includes only immediate members of the team.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "CHILD_TEAM", + "description": "Includes only child team members for the team.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ALL", + "description": "Includes immediate and child team members for the team.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "TeamMemberOrder", + "description": "Ordering options for team member connections", + "fields": null, + "inputFields": [ + { + "name": "field", + "description": "The field to order team members by.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "TeamMemberOrderField", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "direction", + "description": "The ordering direction.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "OrderDirection", + "ofType": null + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "TeamMemberOrderField", + "description": "Properties by which team member connections can be ordered.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "LOGIN", + "description": "Order team members by login", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "CREATED_AT", + "description": "Order team members by creation time", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "TeamRepositoryConnection", + "description": "The connection type for Repository.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "TeamRepositoryEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "TeamRepositoryEdge", + "description": "Represents a team repository.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "permission", + "description": "The permission level the team has on the repository", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "RepositoryPermission", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "RepositoryPermission", + "description": "The access level to a repository", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "ADMIN", + "description": "Can read, clone, push, and add collaborators", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "WRITE", + "description": "Can read, clone and push", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "READ", + "description": "Can read and clone", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "TeamRepositoryOrder", + "description": "Ordering options for team repository connections", + "fields": null, + "inputFields": [ + { + "name": "field", + "description": "The field to order repositories by.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "TeamRepositoryOrderField", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "direction", + "description": "The ordering direction.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "OrderDirection", + "ofType": null + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "TeamRepositoryOrderField", + "description": "Properties by which team repository connections can be ordered.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "CREATED_AT", + "description": "Order repositories by creation time", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "UPDATED_AT", + "description": "Order repositories by update time", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "PUSHED_AT", + "description": "Order repositories by push time", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "NAME", + "description": "Order repositories by name", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "PERMISSION", + "description": "Order repositories by permission", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "STARGAZERS", + "description": "Order repositories by number of stargazers", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "OrganizationInvitationConnection", + "description": "The connection type for OrganizationInvitation.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "OrganizationInvitationEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "OrganizationInvitation", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "OrganizationInvitationEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "OrganizationInvitation", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "TeamOrder", + "description": "Ways in which team connections can be ordered.", + "fields": null, + "inputFields": [ + { + "name": "field", + "description": "The field in which to order nodes by.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "TeamOrderField", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "direction", + "description": "The direction in which to order nodes.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "OrderDirection", + "ofType": null + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "TeamOrderField", + "description": "Properties by which team connections can be ordered.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "NAME", + "description": "Allows ordering a list of teams by name.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "DefaultRepositoryPermissionField", + "description": "The possible default permissions for repositories.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "NONE", + "description": "No access", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "READ", + "description": "Can read repos by default", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "WRITE", + "description": "Can read and write repos by default", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ADMIN", + "description": "Can read, write, and administrate repos by default", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ExternalIdentityConnection", + "description": "The connection type for ExternalIdentity.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ExternalIdentityEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ExternalIdentity", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ExternalIdentityEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "ExternalIdentity", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ExternalIdentity", + "description": "An external identity provisioned by SAML SSO or SCIM.", + "fields": [ + { + "name": "guid", + "description": "The GUID for this identity", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "organizationInvitation", + "description": "Organization invitation for this SCIM-provisioned external identity", + "args": [], + "type": { + "kind": "OBJECT", + "name": "OrganizationInvitation", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "samlIdentity", + "description": "SAML Identity attributes", + "args": [], + "type": { + "kind": "OBJECT", + "name": "ExternalIdentitySamlAttributes", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "scimIdentity", + "description": "SCIM Identity attributes", + "args": [], + "type": { + "kind": "OBJECT", + "name": "ExternalIdentityScimAttributes", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "user", + "description": "User linked to this external identity. Will be NULL if this identity has not been claimed by an organization member.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "User", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ExternalIdentitySamlAttributes", + "description": "SAML attributes for the External Identity", + "fields": [ + { + "name": "nameId", + "description": "The NameID of the SAML identity", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ExternalIdentityScimAttributes", + "description": "SCIM attributes for the External Identity", + "fields": [ + { + "name": "username", + "description": "The userName of the SCIM identity", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PublicKey", + "description": "A user's public key.", + "fields": [ + { + "name": "accessedAt", + "description": "The last time this authorization was used to perform an action", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "fingerprint", + "description": "The fingerprint for this PublicKey", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isReadOnly", + "description": "Whether this PublicKey is read-only or not", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "key", + "description": "The public key string", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Identifies the date and time when the object was last updated.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "SCALAR", + "name": "X509Certificate", + "description": "A valid x509 certificate string", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "IdentityProviderConfigurationState", + "description": "The possible states in which authentication can be configured with an identity provider.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "ENFORCED", + "description": "Authentication with an identity provider is configured and enforced.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "CONFIGURED", + "description": "Authentication with an identity provider is configured but not enforced.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "UNCONFIGURED", + "description": "Authentication with an identity provider is not configured.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "SCALAR", + "name": "Date", + "description": "An ISO-8601 encoded date string.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "OrganizationIdentityProvider", + "description": "An Identity Provider configured to provision SAML and SCIM identities for Organizations", + "fields": [ + { + "name": "digestMethod", + "description": "The digest algorithm used to sign SAML requests for the Identity Provider.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "externalIdentities", + "description": "External Identities provisioned by this Identity Provider", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ExternalIdentityConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "idpCertificate", + "description": "The x509 certificate used by the Identity Provder to sign assertions and responses.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "X509Certificate", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "issuer", + "description": "The Issuer Entity ID for the SAML Identity Provider", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "organization", + "description": "Organization this Identity Provider belongs to", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Organization", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "signatureMethod", + "description": "The signature algorithm used to sign SAML requests for the Identity Provider.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ssoUrl", + "description": "The URL endpoint for the Identity Provider's SAML SSO.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "OrganizationMemberConnection", + "description": "The connection type for User.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "OrganizationMemberEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "User", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "OrganizationMemberEdge", + "description": "Represents a user within an organization.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "hasTwoFactorEnabled", + "description": "Whether the organization member has two factor enabled or not. Returns null if information is not available to viewer.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "User", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "role", + "description": "The role this user has in the organization.", + "args": [], + "type": { + "kind": "ENUM", + "name": "OrganizationMemberRole", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "OrganizationMemberRole", + "description": "The possible roles within an organization for its members.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "MEMBER", + "description": "The user is a member of the organization.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ADMIN", + "description": "The user is an administrator of the organization.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "TeamRole", + "description": "The role of a user on a team.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "ADMIN", + "description": "User has admin rights on the team.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "MEMBER", + "description": "User is a member of the team.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "GistConnection", + "description": "The connection type for Gist.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "GistEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Gist", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "GistEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Gist", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "GistPrivacy", + "description": "The privacy of a Gist", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "PUBLIC", + "description": "Public", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "SECRET", + "description": "Secret", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ALL", + "description": "Gists that are public and secret", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "GistOrder", + "description": "Ordering options for gist connections", + "fields": null, + "inputFields": [ + { + "name": "field", + "description": "The field to order repositories by.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "GistOrderField", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "direction", + "description": "The ordering direction.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "OrderDirection", + "ofType": null + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "GistOrderField", + "description": "Properties by which gist connections can be ordered.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "CREATED_AT", + "description": "Order gists by creation time", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "UPDATED_AT", + "description": "Order gists by update time", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "PUSHED_AT", + "description": "Order gists by push time", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "RepositoryInvitationEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "RepositoryInvitation", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "RepositoryInvitation", + "description": "An invitation for a user to be added to a repository.", + "fields": [ + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "invitee", + "description": "The user who received the invitation.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "User", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "inviter", + "description": "The user who created the invitation.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "User", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "permission", + "description": "The permission granted on this repository by this invitation.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "RepositoryPermission", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repository", + "description": "The Repository the user is invited to.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "RepositoryInfo", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Mannequin", + "description": "A placeholder user for attribution of imported data on GitHub.", + "fields": [ + { + "name": "avatarUrl", + "description": "A URL pointing to the GitHub App's public avatar.", + "args": [ + { + "name": "size", + "description": "The size of the resulting square image.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "databaseId", + "description": "Identifies the primary key from the database.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "login", + "description": "The username of the actor.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTML path to this resource.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Identifies the date and time when the object was last updated.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The URL to this resource.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "UniformResourceLocatable", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "LanguageConnection", + "description": "A list of languages associated with the parent.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "LanguageEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Language", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalSize", + "description": "The total size in bytes of files written in that language.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "LanguageEdge", + "description": "Represents the language of a repository.", + "fields": [ + { + "name": "cursor", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Language", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "size", + "description": "The number of bytes of code written in the language.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Milestone", + "description": "Represents a Milestone object on a given repository.", + "fields": [ + { + "name": "closed", + "description": "`true` if the object is closed (definition of closed may depend on type)", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "closedAt", + "description": "Identifies the date and time when the object was closed.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "creator", + "description": "Identifies the actor who created the milestone.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description", + "description": "Identifies the description of the milestone.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "dueOn", + "description": "Identifies the due date of the milestone.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "issues", + "description": "A list of issues associated with the milestone.", + "args": [ + { + "name": "orderBy", + "description": "Ordering options for issues returned from the connection.", + "type": { + "kind": "INPUT_OBJECT", + "name": "IssueOrder", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "labels", + "description": "A list of label names to filter the pull requests by.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "states", + "description": "A list of states to filter the issues by.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "IssueState", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "filterBy", + "description": "Filtering options for issues returned from the connection.", + "type": { + "kind": "INPUT_OBJECT", + "name": "IssueFilters", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "IssueConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "number", + "description": "Identifies the number of the milestone.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequests", + "description": "A list of pull requests associated with the milestone.", + "args": [ + { + "name": "states", + "description": "A list of states to filter the pull requests by.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "PullRequestState", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "labels", + "description": "A list of label names to filter the pull requests by.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "headRefName", + "description": "The head ref name to filter the pull requests by.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "baseRefName", + "description": "The base ref name to filter the pull requests by.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Ordering options for pull requests returned from the connection.", + "type": { + "kind": "INPUT_OBJECT", + "name": "IssueOrder", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequestConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repository", + "description": "The repository associated with this milestone.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTTP path for this milestone", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "state", + "description": "Identifies the state of the milestone.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "MilestoneState", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "title", + "description": "Identifies the title of the milestone.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Identifies the date and time when the object was last updated.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The HTTP URL for this milestone", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Closable", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "UniformResourceLocatable", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "MilestoneState", + "description": "The possible states of a milestone.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "OPEN", + "description": "A milestone that is still open.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "CLOSED", + "description": "A milestone that has been closed.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PullRequestChangedFileConnection", + "description": "The connection type for PullRequestChangedFile.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequestChangedFileEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequestChangedFile", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PullRequestChangedFileEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "PullRequestChangedFile", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PullRequestChangedFile", + "description": "A file changed in a pull request.", + "fields": [ + { + "name": "additions", + "description": "The number of additions to the file.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deletions", + "description": "The number of deletions to the file.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "path", + "description": "The path of the file.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "MergeableState", + "description": "Whether or not a PullRequest can be merged.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "MERGEABLE", + "description": "The pull request can be merged.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "CONFLICTING", + "description": "The pull request cannot be merged due to merge conflicts.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "UNKNOWN", + "description": "The mergeability of the pull request is still being calculated.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PullRequestReviewComment", + "description": "A review comment associated with a given repository pull request.", + "fields": [ + { + "name": "author", + "description": "The actor who authored the comment.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "authorAssociation", + "description": "Author's association with the subject of the comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "CommentAuthorAssociation", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "body", + "description": "The comment body of this review comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "bodyHTML", + "description": "The comment body of this review comment rendered to HTML.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "HTML", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "bodyText", + "description": "The comment body of this review comment rendered as plain text.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "commit", + "description": "Identifies the commit associated with the comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Commit", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies when the comment was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdViaEmail", + "description": "Check if this comment was created via an email reply.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "databaseId", + "description": "Identifies the primary key from the database.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "diffHunk", + "description": "The diff hunk to which the comment applies.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "draftedAt", + "description": "Identifies when the comment was created in a draft state.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "editor", + "description": "The actor who edited the comment.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "includesCreatedEdit", + "description": "Check if this comment was edited and includes an edit with the creation data", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isMinimized", + "description": "Returns whether or not a comment has been minimized.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "lastEditedAt", + "description": "The moment the editor made the last edit", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "minimizedReason", + "description": "Returns why the comment was minimized.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "originalCommit", + "description": "Identifies the original commit associated with the comment.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Commit", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "originalPosition", + "description": "The original line index in the diff to which the comment applies.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "outdated", + "description": "Identifies when the comment body is outdated", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "path", + "description": "The path to which the comment applies.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "position", + "description": "The line index in the diff to which the comment applies.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "publishedAt", + "description": "Identifies when the comment was published at.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequest", + "description": "The pull request associated with this review comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequestReview", + "description": "The pull request review associated with this review comment.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "PullRequestReview", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "reactionGroups", + "description": "A list of reactions grouped by content left on the subject.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ReactionGroup", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "reactions", + "description": "A list of Reactions left on the Issue.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "content", + "description": "Allows filtering Reactions by emoji.", + "type": { + "kind": "ENUM", + "name": "ReactionContent", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Allows specifying the order in which reactions are returned.", + "type": { + "kind": "INPUT_OBJECT", + "name": "ReactionOrder", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ReactionConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "replyTo", + "description": "The comment this is a reply to.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "PullRequestReviewComment", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repository", + "description": "The repository associated with this node.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTTP path permalink for this review comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "state", + "description": "Identifies the state of the comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "PullRequestReviewCommentState", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Identifies when the comment was last updated.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The HTTP URL permalink for this review comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "userContentEdits", + "description": "A list of edits to this content.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "UserContentEditConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanDelete", + "description": "Check if the current viewer can delete this object.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanMinimize", + "description": "Check if the current viewer can minimize this object.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanReact", + "description": "Can user react to this subject", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanUpdate", + "description": "Check if the current viewer can update this object.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCannotUpdateReasons", + "description": "Reasons why the current viewer can not update this comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "CommentCannotUpdateReason", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerDidAuthor", + "description": "Did the viewer author this comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Comment", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Deletable", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Updatable", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "UpdatableComment", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Reactable", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "RepositoryNode", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PullRequestReview", + "description": "A review object for a given pull request.", + "fields": [ + { + "name": "author", + "description": "The actor who authored the comment.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "authorAssociation", + "description": "Author's association with the subject of the comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "CommentAuthorAssociation", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "body", + "description": "Identifies the pull request review body.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "bodyHTML", + "description": "The body of this review rendered to HTML.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "HTML", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "bodyText", + "description": "The body of this review rendered as plain text.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "comments", + "description": "A list of review comments for the current pull request review.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequestReviewCommentConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "commit", + "description": "Identifies the commit associated with this pull request review.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Commit", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdViaEmail", + "description": "Check if this comment was created via an email reply.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "databaseId", + "description": "Identifies the primary key from the database.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "editor", + "description": "The actor who edited the comment.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "includesCreatedEdit", + "description": "Check if this comment was edited and includes an edit with the creation data", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "lastEditedAt", + "description": "The moment the editor made the last edit", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "onBehalfOf", + "description": "A list of teams that this review was made on behalf of.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "TeamConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "publishedAt", + "description": "Identifies when the comment was published at.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequest", + "description": "Identifies the pull request associated with this pull request review.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "reactionGroups", + "description": "A list of reactions grouped by content left on the subject.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ReactionGroup", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "reactions", + "description": "A list of Reactions left on the Issue.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "content", + "description": "Allows filtering Reactions by emoji.", + "type": { + "kind": "ENUM", + "name": "ReactionContent", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Allows specifying the order in which reactions are returned.", + "type": { + "kind": "INPUT_OBJECT", + "name": "ReactionOrder", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ReactionConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repository", + "description": "The repository associated with this node.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTTP path permalink for this PullRequestReview.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "state", + "description": "Identifies the current state of the pull request review.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "PullRequestReviewState", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "submittedAt", + "description": "Identifies when the Pull Request Review was submitted", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Identifies the date and time when the object was last updated.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The HTTP URL permalink for this PullRequestReview.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "userContentEdits", + "description": "A list of edits to this content.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "UserContentEditConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanDelete", + "description": "Check if the current viewer can delete this object.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanReact", + "description": "Can user react to this subject", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanUpdate", + "description": "Check if the current viewer can update this object.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCannotUpdateReasons", + "description": "Reasons why the current viewer can not update this comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "CommentCannotUpdateReason", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerDidAuthor", + "description": "Did the viewer author this comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Comment", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Deletable", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Updatable", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "UpdatableComment", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Reactable", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "RepositoryNode", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "PullRequestReviewState", + "description": "The possible states of a pull request review.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "PENDING", + "description": "A review that has not yet been submitted.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "COMMENTED", + "description": "An informational review.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "APPROVED", + "description": "A review allowing the pull request to merge.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "CHANGES_REQUESTED", + "description": "A review blocking the pull request from merging.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "DISMISSED", + "description": "A review that has been dismissed.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PullRequestReviewCommentConnection", + "description": "The connection type for PullRequestReviewComment.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequestReviewCommentEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequestReviewComment", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PullRequestReviewCommentEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "PullRequestReviewComment", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PullRequestReviewThread", + "description": "A threaded list of comments for a given pull request.", + "fields": [ + { + "name": "comments", + "description": "A list of pull request comments associated with the thread.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequestReviewCommentConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isResolved", + "description": "Whether this thread has been resolved", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequest", + "description": "Identifies the pull request associated with this thread.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repository", + "description": "Identifies the repository associated with this thread.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resolvedBy", + "description": "The user who resolved this thread", + "args": [], + "type": { + "kind": "OBJECT", + "name": "User", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanResolve", + "description": "Whether or not the viewer can resolve this thread", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewerCanUnresolve", + "description": "Whether or not the viewer can unresolve this thread", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PullRequestCommit", + "description": "Represents a Git commit part of a pull request.", + "fields": [ + { + "name": "commit", + "description": "The Git commit object", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Commit", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequest", + "description": "The pull request this commit belongs to", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTTP path for this pull request commit", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The HTTP URL for this pull request commit", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "UniformResourceLocatable", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PullRequestReviewThreadConnection", + "description": "Review comment threads for a pull request review.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequestReviewThreadEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequestReviewThread", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PullRequestReviewThreadEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "PullRequestReviewThread", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "PullRequestReviewCommentState", + "description": "The possible states of a pull request review comment.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "PENDING", + "description": "A comment that is part of a pending review", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "SUBMITTED", + "description": "A comment that is part of a submitted review", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "PullRequestPubSubTopic", + "description": "The possible PubSub channels for a pull request.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "UPDATED", + "description": "The channel ID for observing pull request updates.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "MARKASREAD", + "description": "The channel ID for marking an pull request as read.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "HEAD_REF", + "description": "The channel ID for observing head ref updates.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "TIMELINE", + "description": "The channel ID for updating items on the pull request timeline.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "STATE", + "description": "The channel ID for observing pull request state updates.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "IssueCommentConnection", + "description": "The connection type for IssueComment.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "IssueCommentEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "IssueComment", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "IssueCommentEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "IssueComment", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PullRequestReviewConnection", + "description": "The connection type for PullRequestReview.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequestReviewEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequestReview", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PullRequestReviewEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "PullRequestReview", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PullRequestCommitConnection", + "description": "The connection type for PullRequestCommit.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequestCommitEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequestCommit", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PullRequestCommitEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "PullRequestCommit", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ReviewRequestConnection", + "description": "The connection type for ReviewRequest.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ReviewRequestEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ReviewRequest", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ReviewRequestEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "ReviewRequest", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ReviewRequest", + "description": "A request for a user to review a pull request.", + "fields": [ + { + "name": "databaseId", + "description": "Identifies the primary key from the database.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequest", + "description": "Identifies the pull request associated with this review request.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "requestedReviewer", + "description": "The reviewer that is requested.", + "args": [], + "type": { + "kind": "UNION", + "name": "RequestedReviewer", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "UNION", + "name": "RequestedReviewer", + "description": "Types that can be requested reviewers.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "User", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Team", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Mannequin", + "ofType": null + } + ] + }, + { + "kind": "OBJECT", + "name": "PullRequestTimelineConnection", + "description": "The connection type for PullRequestTimelineItem.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequestTimelineItemEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "UNION", + "name": "PullRequestTimelineItem", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PullRequestTimelineItemEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "UNION", + "name": "PullRequestTimelineItem", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "UNION", + "name": "PullRequestTimelineItem", + "description": "An item in an pull request timeline", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "Commit", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "CommitCommentThread", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequestReview", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequestReviewThread", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequestReviewComment", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "IssueComment", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ClosedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ReopenedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "SubscribedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "UnsubscribedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "MergedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ReferencedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "CrossReferencedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "AssignedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "UnassignedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "LabeledEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "UnlabeledEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "MilestonedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "DemilestonedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "RenamedTitleEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "LockedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "UnlockedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "DeployedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "DeploymentEnvironmentChangedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "HeadRefDeletedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "HeadRefRestoredEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "HeadRefForcePushedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "BaseRefForcePushedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ReviewRequestedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ReviewRequestRemovedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ReviewDismissedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "UserBlockedEvent", + "ofType": null + } + ] + }, + { + "kind": "OBJECT", + "name": "CommitCommentThread", + "description": "A thread of comments on a commit.", + "fields": [ + { + "name": "comments", + "description": "The comments that exist in this thread.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CommitCommentConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "commit", + "description": "The commit the comments were made on.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Commit", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "path", + "description": "The file the comments were made on.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "position", + "description": "The position in the diff for the commit that the comment was made on.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repository", + "description": "The repository associated with this node.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "RepositoryNode", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ClosedEvent", + "description": "Represents a 'closed' event on any `Closable`.", + "fields": [ + { + "name": "actor", + "description": "Identifies the actor who performed the event.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "closable", + "description": "Object that was closed.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INTERFACE", + "name": "Closable", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "closer", + "description": "Object which triggered the creation of this event.", + "args": [], + "type": { + "kind": "UNION", + "name": "Closer", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTTP path for this closed event.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The HTTP URL for this closed event.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "UniformResourceLocatable", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "UNION", + "name": "Closer", + "description": "The object which triggered a `ClosedEvent`.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "Commit", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + } + ] + }, + { + "kind": "OBJECT", + "name": "ReopenedEvent", + "description": "Represents a 'reopened' event on any `Closable`.", + "fields": [ + { + "name": "actor", + "description": "Identifies the actor who performed the event.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "closable", + "description": "Object that was reopened.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INTERFACE", + "name": "Closable", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SubscribedEvent", + "description": "Represents a 'subscribed' event on a given `Subscribable`.", + "fields": [ + { + "name": "actor", + "description": "Identifies the actor who performed the event.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subscribable", + "description": "Object referenced by event.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INTERFACE", + "name": "Subscribable", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "UnsubscribedEvent", + "description": "Represents an 'unsubscribed' event on a given `Subscribable`.", + "fields": [ + { + "name": "actor", + "description": "Identifies the actor who performed the event.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subscribable", + "description": "Object referenced by event.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INTERFACE", + "name": "Subscribable", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "MergedEvent", + "description": "Represents a 'merged' event on a given pull request.", + "fields": [ + { + "name": "actor", + "description": "Identifies the actor who performed the event.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "commit", + "description": "Identifies the commit associated with the `merge` event.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Commit", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "mergeRef", + "description": "Identifies the Ref associated with the `merge` event.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Ref", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "mergeRefName", + "description": "Identifies the name of the Ref associated with the `merge` event.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequest", + "description": "PullRequest referenced by event.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTTP path for this merged event.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The HTTP URL for this merged event.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "UniformResourceLocatable", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ReferencedEvent", + "description": "Represents a 'referenced' event on a given `ReferencedSubject`.", + "fields": [ + { + "name": "actor", + "description": "Identifies the actor who performed the event.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "commit", + "description": "Identifies the commit associated with the 'referenced' event.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Commit", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "commitRepository", + "description": "Identifies the repository associated with the 'referenced' event.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isCrossRepository", + "description": "Reference originated in a different repository.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isDirectReference", + "description": "Checks if the commit message itself references the subject. Can be false in the case of a commit comment reference.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subject", + "description": "Object referenced by event.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "UNION", + "name": "ReferencedSubject", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "UNION", + "name": "ReferencedSubject", + "description": "Any referencable object", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "Issue", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + } + ] + }, + { + "kind": "OBJECT", + "name": "CrossReferencedEvent", + "description": "Represents a mention made by one issue or pull request to another.", + "fields": [ + { + "name": "actor", + "description": "Identifies the actor who performed the event.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isCrossRepository", + "description": "Reference originated in a different repository.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "referencedAt", + "description": "Identifies when the reference was made.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTTP path for this pull request.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "source", + "description": "Issue or pull request that made the reference.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "UNION", + "name": "ReferencedSubject", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "target", + "description": "Issue or pull request to which the reference was made.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "UNION", + "name": "ReferencedSubject", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The HTTP URL for this pull request.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "willCloseTarget", + "description": "Checks if the target will be closed when the source is merged.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "UniformResourceLocatable", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "AssignedEvent", + "description": "Represents an 'assigned' event on any assignable object.", + "fields": [ + { + "name": "actor", + "description": "Identifies the actor who performed the event.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "assignable", + "description": "Identifies the assignable associated with the event.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INTERFACE", + "name": "Assignable", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "user", + "description": "Identifies the user who was assigned.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "User", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "UnassignedEvent", + "description": "Represents an 'unassigned' event on any assignable object.", + "fields": [ + { + "name": "actor", + "description": "Identifies the actor who performed the event.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "assignable", + "description": "Identifies the assignable associated with the event.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INTERFACE", + "name": "Assignable", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "user", + "description": "Identifies the subject (user) who was unassigned.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "User", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "LabeledEvent", + "description": "Represents a 'labeled' event on a given issue or pull request.", + "fields": [ + { + "name": "actor", + "description": "Identifies the actor who performed the event.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "label", + "description": "Identifies the label associated with the 'labeled' event.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Label", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "labelable", + "description": "Identifies the `Labelable` associated with the event.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INTERFACE", + "name": "Labelable", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "UnlabeledEvent", + "description": "Represents an 'unlabeled' event on a given issue or pull request.", + "fields": [ + { + "name": "actor", + "description": "Identifies the actor who performed the event.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "label", + "description": "Identifies the label associated with the 'unlabeled' event.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Label", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "labelable", + "description": "Identifies the `Labelable` associated with the event.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INTERFACE", + "name": "Labelable", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "MilestonedEvent", + "description": "Represents a 'milestoned' event on a given issue or pull request.", + "fields": [ + { + "name": "actor", + "description": "Identifies the actor who performed the event.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "milestoneTitle", + "description": "Identifies the milestone title associated with the 'milestoned' event.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subject", + "description": "Object referenced by event.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "UNION", + "name": "MilestoneItem", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "UNION", + "name": "MilestoneItem", + "description": "Types that can be inside a Milestone.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "Issue", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + } + ] + }, + { + "kind": "OBJECT", + "name": "DemilestonedEvent", + "description": "Represents a 'demilestoned' event on a given issue or pull request.", + "fields": [ + { + "name": "actor", + "description": "Identifies the actor who performed the event.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "milestoneTitle", + "description": "Identifies the milestone title associated with the 'demilestoned' event.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subject", + "description": "Object referenced by event.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "UNION", + "name": "MilestoneItem", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "RenamedTitleEvent", + "description": "Represents a 'renamed' event on a given issue or pull request", + "fields": [ + { + "name": "actor", + "description": "Identifies the actor who performed the event.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "currentTitle", + "description": "Identifies the current title of the issue or pull request.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "previousTitle", + "description": "Identifies the previous title of the issue or pull request.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subject", + "description": "Subject that was renamed.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "UNION", + "name": "RenamedTitleSubject", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "UNION", + "name": "RenamedTitleSubject", + "description": "An object which has a renamable title", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "Issue", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + } + ] + }, + { + "kind": "OBJECT", + "name": "LockedEvent", + "description": "Represents a 'locked' event on a given issue or pull request.", + "fields": [ + { + "name": "actor", + "description": "Identifies the actor who performed the event.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "lockReason", + "description": "Reason that the conversation was locked (optional).", + "args": [], + "type": { + "kind": "ENUM", + "name": "LockReason", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "lockable", + "description": "Object that was locked.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INTERFACE", + "name": "Lockable", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "UnlockedEvent", + "description": "Represents an 'unlocked' event on a given issue or pull request.", + "fields": [ + { + "name": "actor", + "description": "Identifies the actor who performed the event.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "lockable", + "description": "Object that was unlocked.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INTERFACE", + "name": "Lockable", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "DeployedEvent", + "description": "Represents a 'deployed' event on a given pull request.", + "fields": [ + { + "name": "actor", + "description": "Identifies the actor who performed the event.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "databaseId", + "description": "Identifies the primary key from the database.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deployment", + "description": "The deployment associated with the 'deployed' event.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Deployment", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequest", + "description": "PullRequest referenced by event.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ref", + "description": "The ref associated with the 'deployed' event.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Ref", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "DeploymentEnvironmentChangedEvent", + "description": "Represents a 'deployment_environment_changed' event on a given pull request.", + "fields": [ + { + "name": "actor", + "description": "Identifies the actor who performed the event.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deploymentStatus", + "description": "The deployment status that updated the deployment environment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "DeploymentStatus", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequest", + "description": "PullRequest referenced by event.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "HeadRefDeletedEvent", + "description": "Represents a 'head_ref_deleted' event on a given pull request.", + "fields": [ + { + "name": "actor", + "description": "Identifies the actor who performed the event.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "headRef", + "description": "Identifies the Ref associated with the `head_ref_deleted` event.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Ref", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "headRefName", + "description": "Identifies the name of the Ref associated with the `head_ref_deleted` event.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequest", + "description": "PullRequest referenced by event.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "HeadRefRestoredEvent", + "description": "Represents a 'head_ref_restored' event on a given pull request.", + "fields": [ + { + "name": "actor", + "description": "Identifies the actor who performed the event.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequest", + "description": "PullRequest referenced by event.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "HeadRefForcePushedEvent", + "description": "Represents a 'head_ref_force_pushed' event on a given pull request.", + "fields": [ + { + "name": "actor", + "description": "Identifies the actor who performed the event.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "afterCommit", + "description": "Identifies the after commit SHA for the 'head_ref_force_pushed' event.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Commit", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "beforeCommit", + "description": "Identifies the before commit SHA for the 'head_ref_force_pushed' event.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Commit", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequest", + "description": "PullRequest referenced by event.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ref", + "description": "Identifies the fully qualified ref name for the 'head_ref_force_pushed' event.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Ref", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "BaseRefForcePushedEvent", + "description": "Represents a 'base_ref_force_pushed' event on a given pull request.", + "fields": [ + { + "name": "actor", + "description": "Identifies the actor who performed the event.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "afterCommit", + "description": "Identifies the after commit SHA for the 'base_ref_force_pushed' event.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Commit", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "beforeCommit", + "description": "Identifies the before commit SHA for the 'base_ref_force_pushed' event.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Commit", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequest", + "description": "PullRequest referenced by event.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ref", + "description": "Identifies the fully qualified ref name for the 'base_ref_force_pushed' event.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Ref", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ReviewRequestedEvent", + "description": "Represents an 'review_requested' event on a given pull request.", + "fields": [ + { + "name": "actor", + "description": "Identifies the actor who performed the event.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequest", + "description": "PullRequest referenced by event.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "requestedReviewer", + "description": "Identifies the reviewer whose review was requested.", + "args": [], + "type": { + "kind": "UNION", + "name": "RequestedReviewer", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ReviewRequestRemovedEvent", + "description": "Represents an 'review_request_removed' event on a given pull request.", + "fields": [ + { + "name": "actor", + "description": "Identifies the actor who performed the event.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequest", + "description": "PullRequest referenced by event.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "requestedReviewer", + "description": "Identifies the reviewer whose review request was removed.", + "args": [], + "type": { + "kind": "UNION", + "name": "RequestedReviewer", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ReviewDismissedEvent", + "description": "Represents a 'review_dismissed' event on a given issue or pull request.", + "fields": [ + { + "name": "actor", + "description": "Identifies the actor who performed the event.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "databaseId", + "description": "Identifies the primary key from the database.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "dismissalMessage", + "description": "Identifies the optional message associated with the 'review_dismissed' event.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "dismissalMessageHTML", + "description": "Identifies the optional message associated with the event, rendered to HTML.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "message", + "description": "Identifies the message associated with the 'review_dismissed' event.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": true, + "deprecationReason": "`message` is being removed because it not nullable, whereas the underlying field is optional. Use `dismissalMessage` instead. Removal on 2019-07-01 UTC." + }, + { + "name": "messageHtml", + "description": "The message associated with the event, rendered to HTML.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "HTML", + "ofType": null + } + }, + "isDeprecated": true, + "deprecationReason": "`messageHtml` is being removed because it not nullable, whereas the underlying field is optional. Use `dismissalMessageHTML` instead. Removal on 2019-07-01 UTC." + }, + { + "name": "previousReviewState", + "description": "Identifies the previous state of the review with the 'review_dismissed' event.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "PullRequestReviewState", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequest", + "description": "PullRequest referenced by event.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequestCommit", + "description": "Identifies the commit which caused the review to become stale.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "PullRequestCommit", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTTP path for this review dismissed event.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "review", + "description": "Identifies the review associated with the 'review_dismissed' event.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "PullRequestReview", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The HTTP URL for this review dismissed event.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "UniformResourceLocatable", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "UserBlockedEvent", + "description": "Represents a 'user_blocked' event on a given user.", + "fields": [ + { + "name": "actor", + "description": "Identifies the actor who performed the event.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "blockDuration", + "description": "Number of days that the user was blocked for.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "UserBlockDuration", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subject", + "description": "The user who was blocked.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "User", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "UserBlockDuration", + "description": "The possible durations that a user can be blocked for.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "ONE_DAY", + "description": "The user was blocked for 1 day", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "THREE_DAYS", + "description": "The user was blocked for 3 days", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ONE_WEEK", + "description": "The user was blocked for 7 days", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ONE_MONTH", + "description": "The user was blocked for 30 days", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "PERMANENT", + "description": "The user was blocked permanently", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PullRequestTimelineItemsConnection", + "description": "The connection type for PullRequestTimelineItems.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequestTimelineItemsEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "filteredCount", + "description": "Identifies the count of items after applying `before` and `after` filters.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "UNION", + "name": "PullRequestTimelineItems", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageCount", + "description": "Identifies the count of items after applying `before`/`after` filters and `first`/`last`/`skip` slicing.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Identifies the date and time when the timeline was last updated.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PullRequestTimelineItemsEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "UNION", + "name": "PullRequestTimelineItems", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "UNION", + "name": "PullRequestTimelineItems", + "description": "An item in a pull request timeline", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "PullRequestCommit", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequestCommitCommentThread", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequestReview", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequestReviewThread", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequestRevisionMarker", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "BaseRefChangedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "BaseRefForcePushedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "DeployedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "DeploymentEnvironmentChangedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "HeadRefDeletedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "HeadRefForcePushedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "HeadRefRestoredEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "MergedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ReviewDismissedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ReviewRequestedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ReviewRequestRemovedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "IssueComment", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "CrossReferencedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "AddedToProjectEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "AssignedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ClosedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "CommentDeletedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ConvertedNoteToIssueEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "DemilestonedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "LabeledEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "LockedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "MentionedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "MilestonedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "MovedColumnsInProjectEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PinnedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ReferencedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "RemovedFromProjectEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "RenamedTitleEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ReopenedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "SubscribedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "TransferredEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "UnassignedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "UnlabeledEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "UnlockedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "UserBlockedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "UnpinnedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "UnsubscribedEvent", + "ofType": null + } + ] + }, + { + "kind": "OBJECT", + "name": "PullRequestCommitCommentThread", + "description": "Represents a commit comment thread part of a pull request.", + "fields": [ + { + "name": "comments", + "description": "The comments that exist in this thread.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CommitCommentConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "commit", + "description": "The commit the comments were made on.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Commit", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "path", + "description": "The file the comments were made on.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "position", + "description": "The position in the diff for the commit that the comment was made on.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequest", + "description": "The pull request this commit comment thread belongs to", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repository", + "description": "The repository associated with this node.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "RepositoryNode", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PullRequestRevisionMarker", + "description": "Represents the latest point in the pull request timeline for which the viewer has seen the pull request's commits.", + "fields": [ + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "lastSeenCommit", + "description": "The last commit the viewer has seen.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Commit", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequest", + "description": "The pull request to which the marker belongs.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "BaseRefChangedEvent", + "description": "Represents a 'base_ref_changed' event on a given issue or pull request.", + "fields": [ + { + "name": "actor", + "description": "Identifies the actor who performed the event.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "databaseId", + "description": "Identifies the primary key from the database.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "AddedToProjectEvent", + "description": "Represents a 'added_to_project' event on a given issue or pull request.", + "fields": [ + { + "name": "actor", + "description": "Identifies the actor who performed the event.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "databaseId", + "description": "Identifies the primary key from the database.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CommentDeletedEvent", + "description": "Represents a 'comment_deleted' event on a given issue or pull request.", + "fields": [ + { + "name": "actor", + "description": "Identifies the actor who performed the event.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "databaseId", + "description": "Identifies the primary key from the database.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ConvertedNoteToIssueEvent", + "description": "Represents a 'converted_note_to_issue' event on a given issue or pull request.", + "fields": [ + { + "name": "actor", + "description": "Identifies the actor who performed the event.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "databaseId", + "description": "Identifies the primary key from the database.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "UNION", + "name": "IssueOrPullRequest", + "description": "Used for return value of Repository.issueOrPullRequest.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "Issue", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + } + ] + }, + { + "kind": "OBJECT", + "name": "MentionedEvent", + "description": "Represents a 'mentioned' event on a given issue or pull request.", + "fields": [ + { + "name": "actor", + "description": "Identifies the actor who performed the event.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "databaseId", + "description": "Identifies the primary key from the database.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "MovedColumnsInProjectEvent", + "description": "Represents a 'moved_columns_in_project' event on a given issue or pull request.", + "fields": [ + { + "name": "actor", + "description": "Identifies the actor who performed the event.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "databaseId", + "description": "Identifies the primary key from the database.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PinnedEvent", + "description": "Represents a 'pinned' event on a given issue or pull request.", + "fields": [ + { + "name": "actor", + "description": "Identifies the actor who performed the event.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "issue", + "description": "Identifies the issue associated with the event.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Issue", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "RemovedFromProjectEvent", + "description": "Represents a 'removed_from_project' event on a given issue or pull request.", + "fields": [ + { + "name": "actor", + "description": "Identifies the actor who performed the event.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "databaseId", + "description": "Identifies the primary key from the database.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "TransferredEvent", + "description": "Represents a 'transferred' event on a given issue or pull request.", + "fields": [ + { + "name": "actor", + "description": "Identifies the actor who performed the event.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "fromRepository", + "description": "The repository this came from", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "issue", + "description": "Identifies the issue associated with the event.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Issue", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "UnpinnedEvent", + "description": "Represents an 'unpinned' event on a given issue or pull request.", + "fields": [ + { + "name": "actor", + "description": "Identifies the actor who performed the event.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "issue", + "description": "Identifies the issue associated with the event.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Issue", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "PullRequestTimelineItemsItemType", + "description": "The possible item types found in a timeline.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "PULL_REQUEST_COMMIT", + "description": "Represents a Git commit part of a pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "PULL_REQUEST_COMMIT_COMMENT_THREAD", + "description": "Represents a commit comment thread part of a pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "PULL_REQUEST_REVIEW", + "description": "A review object for a given pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "PULL_REQUEST_REVIEW_THREAD", + "description": "A threaded list of comments for a given pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "PULL_REQUEST_REVISION_MARKER", + "description": "Represents the latest point in the pull request timeline for which the viewer has seen the pull request's commits.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "BASE_REF_CHANGED_EVENT", + "description": "Represents a 'base_ref_changed' event on a given issue or pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "BASE_REF_FORCE_PUSHED_EVENT", + "description": "Represents a 'base_ref_force_pushed' event on a given pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "DEPLOYED_EVENT", + "description": "Represents a 'deployed' event on a given pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "DEPLOYMENT_ENVIRONMENT_CHANGED_EVENT", + "description": "Represents a 'deployment_environment_changed' event on a given pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "HEAD_REF_DELETED_EVENT", + "description": "Represents a 'head_ref_deleted' event on a given pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "HEAD_REF_FORCE_PUSHED_EVENT", + "description": "Represents a 'head_ref_force_pushed' event on a given pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "HEAD_REF_RESTORED_EVENT", + "description": "Represents a 'head_ref_restored' event on a given pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "MERGED_EVENT", + "description": "Represents a 'merged' event on a given pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "REVIEW_DISMISSED_EVENT", + "description": "Represents a 'review_dismissed' event on a given issue or pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "REVIEW_REQUESTED_EVENT", + "description": "Represents an 'review_requested' event on a given pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "REVIEW_REQUEST_REMOVED_EVENT", + "description": "Represents an 'review_request_removed' event on a given pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ISSUE_COMMENT", + "description": "Represents a comment on an Issue.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "CROSS_REFERENCED_EVENT", + "description": "Represents a mention made by one issue or pull request to another.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ADDED_TO_PROJECT_EVENT", + "description": "Represents a 'added_to_project' event on a given issue or pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ASSIGNED_EVENT", + "description": "Represents an 'assigned' event on any assignable object.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "CLOSED_EVENT", + "description": "Represents a 'closed' event on any `Closable`.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "COMMENT_DELETED_EVENT", + "description": "Represents a 'comment_deleted' event on a given issue or pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "CONVERTED_NOTE_TO_ISSUE_EVENT", + "description": "Represents a 'converted_note_to_issue' event on a given issue or pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "DEMILESTONED_EVENT", + "description": "Represents a 'demilestoned' event on a given issue or pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "LABELED_EVENT", + "description": "Represents a 'labeled' event on a given issue or pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "LOCKED_EVENT", + "description": "Represents a 'locked' event on a given issue or pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "MENTIONED_EVENT", + "description": "Represents a 'mentioned' event on a given issue or pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "MILESTONED_EVENT", + "description": "Represents a 'milestoned' event on a given issue or pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "MOVED_COLUMNS_IN_PROJECT_EVENT", + "description": "Represents a 'moved_columns_in_project' event on a given issue or pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "PINNED_EVENT", + "description": "Represents a 'pinned' event on a given issue or pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "REFERENCED_EVENT", + "description": "Represents a 'referenced' event on a given `ReferencedSubject`.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "REMOVED_FROM_PROJECT_EVENT", + "description": "Represents a 'removed_from_project' event on a given issue or pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "RENAMED_TITLE_EVENT", + "description": "Represents a 'renamed' event on a given issue or pull request", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "REOPENED_EVENT", + "description": "Represents a 'reopened' event on any `Closable`.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "SUBSCRIBED_EVENT", + "description": "Represents a 'subscribed' event on a given `Subscribable`.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "TRANSFERRED_EVENT", + "description": "Represents a 'transferred' event on a given issue or pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "UNASSIGNED_EVENT", + "description": "Represents an 'unassigned' event on any assignable object.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "UNLABELED_EVENT", + "description": "Represents an 'unlabeled' event on a given issue or pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "UNLOCKED_EVENT", + "description": "Represents an 'unlocked' event on a given issue or pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "USER_BLOCKED_EVENT", + "description": "Represents a 'user_blocked' event on a given user.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "UNPINNED_EVENT", + "description": "Represents an 'unpinned' event on a given issue or pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "UNSUBSCRIBED_EVENT", + "description": "Represents an 'unsubscribed' event on a given `Subscribable`.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SuggestedReviewer", + "description": "A suggestion to review a pull request based on a user's commit history and review comments.", + "fields": [ + { + "name": "isAuthor", + "description": "Is this suggestion based on past commits?", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isCommenter", + "description": "Is this suggestion based on past review comments?", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "reviewer", + "description": "Identifies the user suggested to review the pull request.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "User", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "ProjectCardArchivedState", + "description": "The possible archived states of a project card.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "ARCHIVED", + "description": "A project card that is archived", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "NOT_ARCHIVED", + "description": "A project card that is not archived", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "IssueTimelineConnection", + "description": "The connection type for IssueTimelineItem.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "IssueTimelineItemEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "UNION", + "name": "IssueTimelineItem", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "IssueTimelineItemEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "UNION", + "name": "IssueTimelineItem", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "UNION", + "name": "IssueTimelineItem", + "description": "An item in an issue timeline", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "Commit", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "IssueComment", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "CrossReferencedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ClosedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ReopenedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "SubscribedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "UnsubscribedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ReferencedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "AssignedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "UnassignedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "LabeledEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "UnlabeledEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "UserBlockedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "MilestonedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "DemilestonedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "RenamedTitleEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "LockedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "UnlockedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "TransferredEvent", + "ofType": null + } + ] + }, + { + "kind": "OBJECT", + "name": "IssueTimelineItemsConnection", + "description": "The connection type for IssueTimelineItems.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "IssueTimelineItemsEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "filteredCount", + "description": "Identifies the count of items after applying `before` and `after` filters.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "UNION", + "name": "IssueTimelineItems", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageCount", + "description": "Identifies the count of items after applying `before`/`after` filters and `first`/`last`/`skip` slicing.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Identifies the date and time when the timeline was last updated.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "IssueTimelineItemsEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "UNION", + "name": "IssueTimelineItems", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "UNION", + "name": "IssueTimelineItems", + "description": "An item in an issue timeline", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "IssueComment", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "CrossReferencedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "AddedToProjectEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "AssignedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ClosedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "CommentDeletedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ConvertedNoteToIssueEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "DemilestonedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "LabeledEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "LockedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "MentionedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "MilestonedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "MovedColumnsInProjectEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PinnedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ReferencedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "RemovedFromProjectEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "RenamedTitleEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ReopenedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "SubscribedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "TransferredEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "UnassignedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "UnlabeledEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "UnlockedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "UserBlockedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "UnpinnedEvent", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "UnsubscribedEvent", + "ofType": null + } + ] + }, + { + "kind": "ENUM", + "name": "IssueTimelineItemsItemType", + "description": "The possible item types found in a timeline.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "ISSUE_COMMENT", + "description": "Represents a comment on an Issue.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "CROSS_REFERENCED_EVENT", + "description": "Represents a mention made by one issue or pull request to another.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ADDED_TO_PROJECT_EVENT", + "description": "Represents a 'added_to_project' event on a given issue or pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ASSIGNED_EVENT", + "description": "Represents an 'assigned' event on any assignable object.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "CLOSED_EVENT", + "description": "Represents a 'closed' event on any `Closable`.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "COMMENT_DELETED_EVENT", + "description": "Represents a 'comment_deleted' event on a given issue or pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "CONVERTED_NOTE_TO_ISSUE_EVENT", + "description": "Represents a 'converted_note_to_issue' event on a given issue or pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "DEMILESTONED_EVENT", + "description": "Represents a 'demilestoned' event on a given issue or pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "LABELED_EVENT", + "description": "Represents a 'labeled' event on a given issue or pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "LOCKED_EVENT", + "description": "Represents a 'locked' event on a given issue or pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "MENTIONED_EVENT", + "description": "Represents a 'mentioned' event on a given issue or pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "MILESTONED_EVENT", + "description": "Represents a 'milestoned' event on a given issue or pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "MOVED_COLUMNS_IN_PROJECT_EVENT", + "description": "Represents a 'moved_columns_in_project' event on a given issue or pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "PINNED_EVENT", + "description": "Represents a 'pinned' event on a given issue or pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "REFERENCED_EVENT", + "description": "Represents a 'referenced' event on a given `ReferencedSubject`.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "REMOVED_FROM_PROJECT_EVENT", + "description": "Represents a 'removed_from_project' event on a given issue or pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "RENAMED_TITLE_EVENT", + "description": "Represents a 'renamed' event on a given issue or pull request", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "REOPENED_EVENT", + "description": "Represents a 'reopened' event on any `Closable`.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "SUBSCRIBED_EVENT", + "description": "Represents a 'subscribed' event on a given `Subscribable`.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "TRANSFERRED_EVENT", + "description": "Represents a 'transferred' event on a given issue or pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "UNASSIGNED_EVENT", + "description": "Represents an 'unassigned' event on any assignable object.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "UNLABELED_EVENT", + "description": "Represents an 'unlabeled' event on a given issue or pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "UNLOCKED_EVENT", + "description": "Represents an 'unlocked' event on a given issue or pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "USER_BLOCKED_EVENT", + "description": "Represents a 'user_blocked' event on a given user.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "UNPINNED_EVENT", + "description": "Represents an 'unpinned' event on a given issue or pull request.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "UNSUBSCRIBED_EVENT", + "description": "Represents an 'unsubscribed' event on a given `Subscribable`.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "CollaboratorAffiliation", + "description": "Collaborators affiliation level with a subject.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "OUTSIDE", + "description": "All outside collaborators of an organization-owned subject.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "DIRECT", + "description": "All collaborators with permissions to an organization-owned subject, regardless of organization membership status.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ALL", + "description": "All collaborators the authenticated user can see.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "DeployKeyConnection", + "description": "The connection type for DeployKey.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "DeployKeyEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "DeployKey", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "DeployKeyEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "DeployKey", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "DeployKey", + "description": "A repository deploy key.", + "fields": [ + { + "name": "createdAt", + "description": "Identifies the date and time when the object was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "key", + "description": "The deploy key.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "readOnly", + "description": "Whether or not the deploy key is read only.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "title", + "description": "The deploy key title.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "verified", + "description": "Whether or not the deploy key has been verified.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "RepositoryCollaboratorAffiliation", + "description": "The affiliation type between collaborator and repository.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "ALL", + "description": "All collaborators of the repository.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "OUTSIDE", + "description": "All outside collaborators of an organization-owned repository.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "BranchProtectionRuleConnection", + "description": "The connection type for BranchProtectionRule.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "BranchProtectionRuleEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "BranchProtectionRule", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "BranchProtectionRuleEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "BranchProtectionRule", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "BranchProtectionRule", + "description": "A branch protection rule.", + "fields": [ + { + "name": "branchProtectionRuleConflicts", + "description": "A list of conflicts matching branches protection rule and other branch protection rules", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "BranchProtectionRuleConflictConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "creator", + "description": "The actor who created this branch protection rule.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "databaseId", + "description": "Identifies the primary key from the database.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "dismissesStaleReviews", + "description": "Will new commits pushed to matching branches dismiss pull request review approvals.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isAdminEnforced", + "description": "Can admins overwrite branch protection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "matchingRefs", + "description": "Repository refs that are protected by this rule", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "RefConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pattern", + "description": "Identifies the protection rule pattern.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pushAllowances", + "description": "A list push allowances for this branch protection rule.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PushAllowanceConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repository", + "description": "The repository associated with this branch protection rule.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "requiredApprovingReviewCount", + "description": "Number of approving reviews required to update matching branches.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "requiredStatusCheckContexts", + "description": "List of required status check contexts that must pass for commits to be accepted to matching branches.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "requiresApprovingReviews", + "description": "Are approving reviews required to update matching branches.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "requiresCommitSignatures", + "description": "Are commits required to be signed.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "requiresStatusChecks", + "description": "Are status checks required to update matching branches.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "requiresStrictStatusChecks", + "description": "Are branches required to be up to date before merging.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "restrictsPushes", + "description": "Is pushing to matching branches restricted.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "restrictsReviewDismissals", + "description": "Is dismissal of pull request reviews restricted.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "reviewDismissalAllowances", + "description": "A list review dismissal allowances for this branch protection rule.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ReviewDismissalAllowanceConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ReviewDismissalAllowanceConnection", + "description": "The connection type for ReviewDismissalAllowance.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ReviewDismissalAllowanceEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ReviewDismissalAllowance", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ReviewDismissalAllowanceEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "ReviewDismissalAllowance", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ReviewDismissalAllowance", + "description": "A team or user who has the ability to dismiss a review on a protected branch.", + "fields": [ + { + "name": "actor", + "description": "The actor that can dismiss.", + "args": [], + "type": { + "kind": "UNION", + "name": "ReviewDismissalAllowanceActor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "branchProtectionRule", + "description": "Identifies the branch protection rule associated with the allowed user or team.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "BranchProtectionRule", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "UNION", + "name": "ReviewDismissalAllowanceActor", + "description": "Types that can be an actor.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "User", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Team", + "ofType": null + } + ] + }, + { + "kind": "OBJECT", + "name": "PushAllowanceConnection", + "description": "The connection type for PushAllowance.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PushAllowanceEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PushAllowance", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PushAllowanceEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "PushAllowance", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PushAllowance", + "description": "A team or user who has the ability to push to a protected branch.", + "fields": [ + { + "name": "actor", + "description": "The actor that can push.", + "args": [], + "type": { + "kind": "UNION", + "name": "PushAllowanceActor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "branchProtectionRule", + "description": "Identifies the branch protection rule associated with the allowed user or team.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "BranchProtectionRule", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "UNION", + "name": "PushAllowanceActor", + "description": "Types that can be an actor.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "User", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Team", + "ofType": null + } + ] + }, + { + "kind": "OBJECT", + "name": "RefConnection", + "description": "The connection type for Ref.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "RefEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Ref", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "RefEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Ref", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "BranchProtectionRuleConflictConnection", + "description": "The connection type for BranchProtectionRuleConflict.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "BranchProtectionRuleConflictEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "BranchProtectionRuleConflict", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "BranchProtectionRuleConflictEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "BranchProtectionRuleConflict", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "BranchProtectionRuleConflict", + "description": "A conflict between two branch protection rules.", + "fields": [ + { + "name": "branchProtectionRule", + "description": "Identifies the branch protection rule.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "BranchProtectionRule", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "conflictingBranchProtectionRule", + "description": "Identifies the conflicting branch protection rule.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "BranchProtectionRule", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ref", + "description": "Identifies the branch ref that has conflicting rules", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Ref", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "MilestoneConnection", + "description": "The connection type for Milestone.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "MilestoneEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Milestone", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "MilestoneEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Milestone", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "MilestoneOrder", + "description": "Ordering options for milestone connections.", + "fields": null, + "inputFields": [ + { + "name": "field", + "description": "The field to order milestones by.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "MilestoneOrderField", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "direction", + "description": "The ordering direction.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "OrderDirection", + "ofType": null + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "MilestoneOrderField", + "description": "Properties by which milestone connections can be ordered.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "DUE_DATE", + "description": "Order milestones by when they are due.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "CREATED_AT", + "description": "Order milestones by when they were created.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "UPDATED_AT", + "description": "Order milestones by when they were last updated.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "NUMBER", + "description": "Order milestones by their number.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CodeOfConduct", + "description": "The Code of Conduct for a repository", + "fields": [ + { + "name": "body", + "description": "The body of the Code of Conduct", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "key", + "description": "The key for the Code of Conduct", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The formal name of the Code of Conduct", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTTP path for this Code of Conduct", + "args": [], + "type": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The HTTP URL for this Code of Conduct", + "args": [], + "type": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "RepositoryCollaboratorConnection", + "description": "The connection type for User.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "RepositoryCollaboratorEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "User", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "RepositoryCollaboratorEdge", + "description": "Represents a user who is a collaborator of a repository.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "User", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "permission", + "description": "The permission the user has on the repository.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "RepositoryPermission", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "permissionSources", + "description": "A list of sources for the user's access to the repository.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PermissionSource", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PermissionSource", + "description": "A level of permission and source for a user's access to a repository.", + "fields": [ + { + "name": "organization", + "description": "The organization the repository belongs to.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Organization", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "permission", + "description": "The level of access this source has granted to the user.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "DefaultRepositoryPermissionField", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "source", + "description": "The source of this permission.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "UNION", + "name": "PermissionGranter", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "UNION", + "name": "PermissionGranter", + "description": "Types that can grant permissions on a repository to a user", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "Organization", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Team", + "ofType": null + } + ] + }, + { + "kind": "INPUT_OBJECT", + "name": "LanguageOrder", + "description": "Ordering options for language connections.", + "fields": null, + "inputFields": [ + { + "name": "field", + "description": "The field to order languages by.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "LanguageOrderField", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "direction", + "description": "The ordering direction.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "OrderDirection", + "ofType": null + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "LanguageOrderField", + "description": "Properties by which language connections can be ordered.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "SIZE", + "description": "Order languages by the size of all files containing the language", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "RefOrder", + "description": "Ways in which lists of git refs can be ordered upon return.", + "fields": null, + "inputFields": [ + { + "name": "field", + "description": "The field in which to order refs by.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "RefOrderField", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "direction", + "description": "The direction in which to order refs by the specified field.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "OrderDirection", + "ofType": null + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "RefOrderField", + "description": "Properties by which ref connections can be ordered.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "TAG_COMMIT_DATE", + "description": "Order refs by underlying commit date if the ref prefix is refs/tags/", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ALPHABETICAL", + "description": "Order refs by their alphanumeric name", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SecurityAdvisory", + "description": "A GitHub Security Advisory", + "fields": [ + { + "name": "databaseId", + "description": "Identifies the primary key from the database.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description", + "description": "This is a long plaintext description of the advisory", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ghsaId", + "description": "The GitHub Security Advisory ID", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "identifiers", + "description": "A list of identifiers for this advisory", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SecurityAdvisoryIdentifier", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "origin", + "description": "The organization that originated the advisory", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "publishedAt", + "description": "When the advisory was published", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "references", + "description": "A list of references for this advisory", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SecurityAdvisoryReference", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "severity", + "description": "The severity of the advisory", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "SecurityAdvisorySeverity", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "summary", + "description": "A short plaintext summary of the advisory", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "When the advisory was last updated", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "vulnerabilities", + "description": "Vulnerabilities associated with this Advisory", + "args": [ + { + "name": "orderBy", + "description": "Ordering options for the returned topics.", + "type": { + "kind": "INPUT_OBJECT", + "name": "SecurityVulnerabilityOrder", + "ofType": null + }, + "defaultValue": "{field:\"UPDATED_AT\",direction:\"DESC\"}" + }, + { + "name": "ecosystem", + "description": "An ecosystem to filter vulnerabilities by.", + "type": { + "kind": "ENUM", + "name": "SecurityAdvisoryEcosystem", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "package", + "description": "A package name to filter vulnerabilities by.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "severities", + "description": "A list of severities to filter vulnerabilities by.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "SecurityAdvisorySeverity", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SecurityVulnerabilityConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "withdrawnAt", + "description": "When the advisory was withdrawn, if it has been withdrawn", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "SecurityAdvisorySeverity", + "description": "Severity of the vulnerability.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "LOW", + "description": "Low.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "MODERATE", + "description": "Moderate.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "HIGH", + "description": "High.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "CRITICAL", + "description": "Critical.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SecurityAdvisoryIdentifier", + "description": "A GitHub Security Advisory Identifier", + "fields": [ + { + "name": "type", + "description": "The identifier type, e.g. GHSA, CVE", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "value", + "description": "The identifier", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SecurityAdvisoryReference", + "description": "A GitHub Security Advisory Reference", + "fields": [ + { + "name": "url", + "description": "A publicly accessible reference", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SecurityVulnerabilityConnection", + "description": "The connection type for SecurityVulnerability.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SecurityVulnerabilityEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SecurityVulnerability", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SecurityVulnerabilityEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "SecurityVulnerability", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SecurityVulnerability", + "description": "An individual vulnerability within an Advisory", + "fields": [ + { + "name": "advisory", + "description": "The Advisory associated with this Vulnerability", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SecurityAdvisory", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "firstPatchedVersion", + "description": "The first version containing a fix for the vulnerability", + "args": [], + "type": { + "kind": "OBJECT", + "name": "SecurityAdvisoryPackageVersion", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "package", + "description": "A description of the vulnerable package", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SecurityAdvisoryPackage", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "severity", + "description": "The severity of the vulnerability within this package", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "SecurityAdvisorySeverity", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "When the vulnerability was last updated", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "vulnerableVersionRange", + "description": "A string that describes the vulnerable package versions.\nThis string follows a basic syntax with a few forms.\n+ `= 0.2.0` denotes a single vulnerable version.\n+ `<= 1.0.8` denotes a version range up to and including the specified version\n+ `< 0.1.11` denotes a version range up to, but excluding, the specified version\n+ `>= 4.3.0, < 4.3.5` denotes a version range with a known minimum and maximum version.\n+ `>= 0.0.1` denotes a version range with a known minimum, but no known maximum\n", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SecurityAdvisoryPackage", + "description": "An individual package", + "fields": [ + { + "name": "ecosystem", + "description": "The ecosystem the package belongs to, e.g. RUBYGEMS, NPM", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "SecurityAdvisoryEcosystem", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The package name", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "SecurityAdvisoryEcosystem", + "description": "The possible ecosystems of a security vulnerability's package.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "RUBYGEMS", + "description": "Ruby gems hosted at RubyGems.org", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "NPM", + "description": "JavaScript packages hosted at npmjs.com", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "PIP", + "description": "Python packages hosted at PyPI.org", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "MAVEN", + "description": "Java artifacts hosted at the Maven central repository", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "NUGET", + "description": ".NET packages hosted at the NuGet Gallery", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SecurityAdvisoryPackageVersion", + "description": "An individual package version", + "fields": [ + { + "name": "identifier", + "description": "The package name or version", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "SecurityVulnerabilityOrder", + "description": "Ordering options for security vulnerability connections", + "fields": null, + "inputFields": [ + { + "name": "field", + "description": "The field to order security vulnerabilities by.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "SecurityVulnerabilityOrderField", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "direction", + "description": "The ordering direction.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "OrderDirection", + "ofType": null + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "SecurityVulnerabilityOrderField", + "description": "Properties by which security vulnerability connections can be ordered.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "UPDATED_AT", + "description": "Order vulnerability by update time", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "SCALAR", + "name": "GitSSHRemote", + "description": "Git SSH string", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "TopicConnection", + "description": "The connection type for Topic.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "TopicEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Topic", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "TopicEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Topic", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ContributionsCollection", + "description": "A contributions collection aggregates contributions such as opened issues and commits created by a user.", + "fields": [ + { + "name": "commitContributionsByRepository", + "description": "Commit contributions made by the user, grouped by repository.", + "args": [ + { + "name": "maxRepositories", + "description": "How many repositories should be included.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": "25" + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CommitContributionsByRepository", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "contributionCalendar", + "description": "A calendar of this user's contributions on GitHub.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ContributionCalendar", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "contributionYears", + "description": "The years the user has been making contributions with the most recent year first.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "doesEndInCurrentMonth", + "description": "Determine if this collection's time span ends in the current month.\n", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "earliestRestrictedContributionDate", + "description": "The date of the first restricted contribution the user made in this time period. Can only be non-null when the user has enabled private contribution counts.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Date", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "endedAt", + "description": "The ending date and time of this collection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "firstIssueContribution", + "description": "The first issue the user opened on GitHub. This will be null if that issue was opened outside the collection's time range and ignoreTimeRange is false. If the issue is not visible but the user has opted to show private contributions, a RestrictedContribution will be returned.", + "args": [ + { + "name": "ignoreTimeRange", + "description": "If true, the first issue will be returned even if it was opened outside of the collection's time range.\n\n**Upcoming Change on 2019-07-01 UTC**\n**Description:** `ignoreTimeRange` will be removed. Use a `ContributionsCollection` starting sufficiently far back\n**Reason:** ignore_time_range will be removed\n", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false" + } + ], + "type": { + "kind": "UNION", + "name": "CreatedIssueOrRestrictedContribution", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "firstPullRequestContribution", + "description": "The first pull request the user opened on GitHub. This will be null if that pull request was opened outside the collection's time range and ignoreTimeRange is not true. If the pull request is not visible but the user has opted to show private contributions, a RestrictedContribution will be returned.", + "args": [ + { + "name": "ignoreTimeRange", + "description": "If true, the first pull request will be returned even if it was opened outside of the collection's time range.\n\n**Upcoming Change on 2019-07-01 UTC**\n**Description:** `ignoreTimeRange` will be removed. Use a `ContributionsCollection` starting sufficiently far back\n**Reason:** ignore_time_range will be removed\n", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false" + } + ], + "type": { + "kind": "UNION", + "name": "CreatedPullRequestOrRestrictedContribution", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "firstRepositoryContribution", + "description": "The first repository the user created on GitHub. This will be null if that first repository was created outside the collection's time range and ignoreTimeRange is false. If the repository is not visible, then a RestrictedContribution is returned.", + "args": [ + { + "name": "ignoreTimeRange", + "description": "If true, the first repository will be returned even if it was opened outside of the collection's time range.\n\n**Upcoming Change on 2019-07-01 UTC**\n**Description:** `ignoreTimeRange` will be removed. Use a `ContributionsCollection` starting sufficiently far back\n**Reason:** ignore_time_range will be removed\n", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false" + } + ], + "type": { + "kind": "UNION", + "name": "CreatedRepositoryOrRestrictedContribution", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "hasActivityInThePast", + "description": "Does the user have any more activity in the timeline that occurred prior to the collection's time range?", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "hasAnyContributions", + "description": "Determine if there are any contributions in this collection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "hasAnyRestrictedContributions", + "description": "Determine if the user made any contributions in this time frame whose details are not visible because they were made in a private repository. Can only be true if the user enabled private contribution counts.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isSingleDay", + "description": "Whether or not the collector's time span is all within the same day.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "issueContributions", + "description": "A list of issues the user opened.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "excludeFirst", + "description": "Should the user's first issue ever be excluded from the result.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false" + }, + { + "name": "excludePopular", + "description": "Should the user's most commented issue be excluded from the result.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false" + }, + { + "name": "orderBy", + "description": "Ordering options for contributions returned from the connection.", + "type": { + "kind": "INPUT_OBJECT", + "name": "ContributionOrder", + "ofType": null + }, + "defaultValue": "{field:\"OCCURRED_AT\",direction:\"DESC\"}" + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CreatedIssueContributionConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "issueContributionsByRepository", + "description": "Issue contributions made by the user, grouped by repository.", + "args": [ + { + "name": "maxRepositories", + "description": "How many repositories should be included.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": "25" + }, + { + "name": "excludeFirst", + "description": "Should the user's first issue ever be excluded from the result.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false" + }, + { + "name": "excludePopular", + "description": "Should the user's most commented issue be excluded from the result.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false" + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "IssueContributionsByRepository", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "joinedGitHubContribution", + "description": "When the user signed up for GitHub. This will be null if that sign up date falls outside the collection's time range and ignoreTimeRange is false.", + "args": [ + { + "name": "ignoreTimeRange", + "description": "If true, the contribution will be returned even if the user signed up outside of the collection's time range.\n\n**Upcoming Change on 2019-07-01 UTC**\n**Description:** `ignoreTimeRange` will be removed. Use a `ContributionsCollection` starting sufficiently far back\n**Reason:** ignore_time_range will be removed\n", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false" + } + ], + "type": { + "kind": "OBJECT", + "name": "JoinedGitHubContribution", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "latestRestrictedContributionDate", + "description": "The date of the most recent restricted contribution the user made in this time period. Can only be non-null when the user has enabled private contribution counts.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Date", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "mostRecentCollectionWithActivity", + "description": "When this collection's time range does not include any activity from the user, use this\nto get a different collection from an earlier time range that does have activity.\n", + "args": [], + "type": { + "kind": "OBJECT", + "name": "ContributionsCollection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "mostRecentCollectionWithoutActivity", + "description": "Returns a different contributions collection from an earlier time range than this one\nthat does not have any contributions.\n", + "args": [], + "type": { + "kind": "OBJECT", + "name": "ContributionsCollection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "popularIssueContribution", + "description": "The issue the user opened on GitHub that received the most comments in the specified\ntime frame.\n", + "args": [], + "type": { + "kind": "OBJECT", + "name": "CreatedIssueContribution", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "popularPullRequestContribution", + "description": "The pull request the user opened on GitHub that received the most comments in the\nspecified time frame.\n", + "args": [], + "type": { + "kind": "OBJECT", + "name": "CreatedPullRequestContribution", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequestContributions", + "description": "Pull request contributions made by the user.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "excludeFirst", + "description": "Should the user's first pull request ever be excluded from the result.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false" + }, + { + "name": "excludePopular", + "description": "Should the user's most commented pull request be excluded from the result.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false" + }, + { + "name": "orderBy", + "description": "Ordering options for contributions returned from the connection.", + "type": { + "kind": "INPUT_OBJECT", + "name": "ContributionOrder", + "ofType": null + }, + "defaultValue": "{field:\"OCCURRED_AT\",direction:\"DESC\"}" + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CreatedPullRequestContributionConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequestContributionsByRepository", + "description": "Pull request contributions made by the user, grouped by repository.", + "args": [ + { + "name": "maxRepositories", + "description": "How many repositories should be included.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": "25" + }, + { + "name": "excludeFirst", + "description": "Should the user's first pull request ever be excluded from the result.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false" + }, + { + "name": "excludePopular", + "description": "Should the user's most commented pull request be excluded from the result.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false" + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequestContributionsByRepository", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequestReviewContributions", + "description": "Pull request review contributions made by the user.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Ordering options for contributions returned from the connection.", + "type": { + "kind": "INPUT_OBJECT", + "name": "ContributionOrder", + "ofType": null + }, + "defaultValue": "{field:\"OCCURRED_AT\",direction:\"DESC\"}" + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CreatedPullRequestReviewContributionConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequestReviewContributionsByRepository", + "description": "Pull request review contributions made by the user, grouped by repository.", + "args": [ + { + "name": "maxRepositories", + "description": "How many repositories should be included.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": "25" + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequestReviewContributionsByRepository", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repositoryContributions", + "description": "A list of repositories owned by the user that the user created in this time range.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "excludeFirst", + "description": "Should the user's first repository ever be excluded from the result.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false" + }, + { + "name": "orderBy", + "description": "Ordering options for contributions returned from the connection.", + "type": { + "kind": "INPUT_OBJECT", + "name": "ContributionOrder", + "ofType": null + }, + "defaultValue": "{field:\"OCCURRED_AT\",direction:\"DESC\"}" + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CreatedRepositoryContributionConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "restrictedContributionsCount", + "description": "A count of contributions made by the user that the viewer cannot access. Only non-zero when the user has chosen to share their private contribution counts.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "startedAt", + "description": "The beginning date and time of this collection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCommitContributions", + "description": "How many commits were made by the user in this time span.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalIssueContributions", + "description": "How many issues the user opened.", + "args": [ + { + "name": "excludeFirst", + "description": "Should the user's first issue ever be excluded from this count.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false" + }, + { + "name": "excludePopular", + "description": "Should the user's most commented issue be excluded from this count.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false" + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalPullRequestContributions", + "description": "How many pull requests the user opened.", + "args": [ + { + "name": "excludeFirst", + "description": "Should the user's first pull request ever be excluded from this count.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false" + }, + { + "name": "excludePopular", + "description": "Should the user's most commented pull request be excluded from this count.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false" + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalPullRequestReviewContributions", + "description": "How many pull request reviews the user left.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalRepositoriesWithContributedCommits", + "description": "How many different repositories the user committed to.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalRepositoriesWithContributedIssues", + "description": "How many different repositories the user opened issues in.", + "args": [ + { + "name": "excludeFirst", + "description": "Should the user's first issue ever be excluded from this count.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false" + }, + { + "name": "excludePopular", + "description": "Should the user's most commented issue be excluded from this count.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false" + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalRepositoriesWithContributedPullRequestReviews", + "description": "How many different repositories the user left pull request reviews in.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalRepositoriesWithContributedPullRequests", + "description": "How many different repositories the user opened pull requests in.", + "args": [ + { + "name": "excludeFirst", + "description": "Should the user's first pull request ever be excluded from this count.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false" + }, + { + "name": "excludePopular", + "description": "Should the user's most commented pull request be excluded from this count.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false" + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalRepositoryContributions", + "description": "How many repositories the user created.", + "args": [ + { + "name": "excludeFirst", + "description": "Should the user's first repository ever be excluded from this count.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false" + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "user", + "description": "The user who made the contributions in this collection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "User", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CreatedIssueContributionConnection", + "description": "The connection type for CreatedIssueContribution.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CreatedIssueContributionEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CreatedIssueContribution", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CreatedIssueContributionEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "CreatedIssueContribution", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CreatedIssueContribution", + "description": "Represents the contribution a user made on GitHub by opening an issue.", + "fields": [ + { + "name": "isRestricted", + "description": "Whether this contribution is associated with a record you do not have access to. For\nexample, your own 'first issue' contribution may have been made on a repository you can no\nlonger access.\n", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "issue", + "description": "The issue that was opened.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Issue", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "occurredAt", + "description": "When this contribution was made.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTTP path for this contribution.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The HTTP URL for this contribution.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "user", + "description": "The user who made this contribution.\n", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "User", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Contribution", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INTERFACE", + "name": "Contribution", + "description": "Represents a contribution a user made on GitHub, such as opening an issue.", + "fields": [ + { + "name": "isRestricted", + "description": "Whether this contribution is associated with a record you do not have access to. For\nexample, your own 'first issue' contribution may have been made on a repository you can no\nlonger access.\n", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "occurredAt", + "description": "When this contribution was made.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTTP path for this contribution.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The HTTP URL for this contribution.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "user", + "description": "The user who made this contribution.\n", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "User", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "CreatedCommitContribution", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "CreatedIssueContribution", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "CreatedPullRequestContribution", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "CreatedPullRequestReviewContribution", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "CreatedRepositoryContribution", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "JoinedGitHubContribution", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "RestrictedContribution", + "ofType": null + } + ] + }, + { + "kind": "INPUT_OBJECT", + "name": "ContributionOrder", + "description": "Ordering options for contribution connections.", + "fields": null, + "inputFields": [ + { + "name": "field", + "description": "The field by which to order contributions.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "ContributionOrderField", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "direction", + "description": "The ordering direction.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "OrderDirection", + "ofType": null + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "ContributionOrderField", + "description": "Properties by which contribution connections can be ordered.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "OCCURRED_AT", + "description": "Order contributions by when they were made.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CreatedRepositoryContributionConnection", + "description": "The connection type for CreatedRepositoryContribution.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CreatedRepositoryContributionEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CreatedRepositoryContribution", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CreatedRepositoryContributionEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "CreatedRepositoryContribution", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CreatedRepositoryContribution", + "description": "Represents the contribution a user made on GitHub by creating a repository.", + "fields": [ + { + "name": "isRestricted", + "description": "Whether this contribution is associated with a record you do not have access to. For\nexample, your own 'first issue' contribution may have been made on a repository you can no\nlonger access.\n", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "occurredAt", + "description": "When this contribution was made.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repository", + "description": "The repository that was created.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTTP path for this contribution.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The HTTP URL for this contribution.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "user", + "description": "The user who made this contribution.\n", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "User", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Contribution", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "JoinedGitHubContribution", + "description": "Represents a user signing up for a GitHub account.", + "fields": [ + { + "name": "isRestricted", + "description": "Whether this contribution is associated with a record you do not have access to. For\nexample, your own 'first issue' contribution may have been made on a repository you can no\nlonger access.\n", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "occurredAt", + "description": "When this contribution was made.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTTP path for this contribution.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The HTTP URL for this contribution.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "user", + "description": "The user who made this contribution.\n", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "User", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Contribution", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "UNION", + "name": "CreatedRepositoryOrRestrictedContribution", + "description": "Represents either a repository the viewer can access or a restricted contribution.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "CreatedRepositoryContribution", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "RestrictedContribution", + "ofType": null + } + ] + }, + { + "kind": "OBJECT", + "name": "RestrictedContribution", + "description": "Represents a private contribution a user made on GitHub.", + "fields": [ + { + "name": "isRestricted", + "description": "Whether this contribution is associated with a record you do not have access to. For\nexample, your own 'first issue' contribution may have been made on a repository you can no\nlonger access.\n", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "occurredAt", + "description": "When this contribution was made.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTTP path for this contribution.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The HTTP URL for this contribution.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "user", + "description": "The user who made this contribution.\n", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "User", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Contribution", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "UNION", + "name": "CreatedIssueOrRestrictedContribution", + "description": "Represents either a issue the viewer can access or a restricted contribution.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "CreatedIssueContribution", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "RestrictedContribution", + "ofType": null + } + ] + }, + { + "kind": "UNION", + "name": "CreatedPullRequestOrRestrictedContribution", + "description": "Represents either a pull request the viewer can access or a restricted contribution.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "CreatedPullRequestContribution", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "RestrictedContribution", + "ofType": null + } + ] + }, + { + "kind": "OBJECT", + "name": "CreatedPullRequestContribution", + "description": "Represents the contribution a user made on GitHub by opening a pull request.", + "fields": [ + { + "name": "isRestricted", + "description": "Whether this contribution is associated with a record you do not have access to. For\nexample, your own 'first issue' contribution may have been made on a repository you can no\nlonger access.\n", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "occurredAt", + "description": "When this contribution was made.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequest", + "description": "The pull request that was opened.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTTP path for this contribution.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The HTTP URL for this contribution.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "user", + "description": "The user who made this contribution.\n", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "User", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Contribution", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ContributionCalendar", + "description": "A calendar of contributions made on GitHub by a user.", + "fields": [ + { + "name": "colors", + "description": "A list of hex color codes used in this calendar. The darker the color, the more contributions it represents.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isHalloween", + "description": "Determine if the color set was chosen because it's currently Halloween.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "months", + "description": "A list of the months of contributions in this calendar.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ContributionCalendarMonth", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalContributions", + "description": "The count of total contributions in the calendar.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "weeks", + "description": "A list of the weeks of contributions in this calendar.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ContributionCalendarWeek", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ContributionCalendarWeek", + "description": "A week of contributions in a user's contribution graph.", + "fields": [ + { + "name": "contributionDays", + "description": "The days of contributions in this week.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ContributionCalendarDay", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "firstDay", + "description": "The date of the earliest square in this week.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Date", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ContributionCalendarDay", + "description": "Represents a single day of contributions on GitHub by a user.", + "fields": [ + { + "name": "color", + "description": "The hex color code that represents how many contributions were made on this day compared to others in the calendar.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "contributionCount", + "description": "How many contributions were made by the user on this day.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "date", + "description": "The day this square represents.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Date", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "weekday", + "description": "A number representing which day of the week this square represents, e.g., 1 is Monday.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ContributionCalendarMonth", + "description": "A month of contributions in a user's contribution graph.", + "fields": [ + { + "name": "firstDay", + "description": "The date of the first day of this month.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Date", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The name of the month.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalWeeks", + "description": "How many weeks started in this month.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "year", + "description": "The year the month occurred in.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CreatedPullRequestReviewContributionConnection", + "description": "The connection type for CreatedPullRequestReviewContribution.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CreatedPullRequestReviewContributionEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CreatedPullRequestReviewContribution", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CreatedPullRequestReviewContributionEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "CreatedPullRequestReviewContribution", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CreatedPullRequestReviewContribution", + "description": "Represents the contribution a user made by leaving a review on a pull request.", + "fields": [ + { + "name": "isRestricted", + "description": "Whether this contribution is associated with a record you do not have access to. For\nexample, your own 'first issue' contribution may have been made on a repository you can no\nlonger access.\n", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "occurredAt", + "description": "When this contribution was made.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequest", + "description": "The pull request the user reviewed.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequestReview", + "description": "The review the user left on the pull request.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PullRequestReview", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repository", + "description": "The repository containing the pull request that the user reviewed.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTTP path for this contribution.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The HTTP URL for this contribution.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "user", + "description": "The user who made this contribution.\n", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "User", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Contribution", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PullRequestReviewContributionsByRepository", + "description": "This aggregates pull request reviews made by a user within one repository.", + "fields": [ + { + "name": "contributions", + "description": "The pull request review contributions.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Ordering options for contributions returned from the connection.", + "type": { + "kind": "INPUT_OBJECT", + "name": "ContributionOrder", + "ofType": null + }, + "defaultValue": "{field:\"OCCURRED_AT\",direction:\"DESC\"}" + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CreatedPullRequestReviewContributionConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repository", + "description": "The repository in which the pull request reviews were made.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CommitContributionsByRepository", + "description": "This aggregates commits made by a user within one repository.", + "fields": [ + { + "name": "contributions", + "description": "The commit contributions, each representing a day.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Ordering options for commit contributions returned from the connection.", + "type": { + "kind": "INPUT_OBJECT", + "name": "CommitContributionOrder", + "ofType": null + }, + "defaultValue": "{field:\"OCCURRED_AT\",direction:\"DESC\"}" + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CreatedCommitContributionConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repository", + "description": "The repository in which the commits were made.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTTP path for the user's commits to the repository in this time range.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The HTTP URL for the user's commits to the repository in this time range.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CreatedCommitContributionConnection", + "description": "The connection type for CreatedCommitContribution.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CreatedCommitContributionEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CreatedCommitContribution", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of commits across days and repositories in the connection.\n", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CreatedCommitContributionEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "CreatedCommitContribution", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CreatedCommitContribution", + "description": "Represents the contribution a user made by committing to a repository.", + "fields": [ + { + "name": "commitCount", + "description": "How many commits were made on this day to this repository by the user.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isRestricted", + "description": "Whether this contribution is associated with a record you do not have access to. For\nexample, your own 'first issue' contribution may have been made on a repository you can no\nlonger access.\n", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "occurredAt", + "description": "When this contribution was made.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repository", + "description": "The repository the user made a commit in.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resourcePath", + "description": "The HTTP path for this contribution.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The HTTP URL for this contribution.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "user", + "description": "The user who made this contribution.\n", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "User", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Contribution", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "CommitContributionOrder", + "description": "Ordering options for commit contribution connections.", + "fields": null, + "inputFields": [ + { + "name": "field", + "description": "The field by which to order commit contributions.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "CommitContributionOrderField", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "direction", + "description": "The ordering direction.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "OrderDirection", + "ofType": null + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "CommitContributionOrderField", + "description": "Properties by which commit contribution connections can be ordered.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "OCCURRED_AT", + "description": "Order commit contributions by when they were made.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "COMMIT_COUNT", + "description": "Order commit contributions by how many commits they represent.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CreatedPullRequestContributionConnection", + "description": "The connection type for CreatedPullRequestContribution.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CreatedPullRequestContributionEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CreatedPullRequestContribution", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CreatedPullRequestContributionEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "CreatedPullRequestContribution", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PullRequestContributionsByRepository", + "description": "This aggregates pull requests opened by a user within one repository.", + "fields": [ + { + "name": "contributions", + "description": "The pull request contributions.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Ordering options for contributions returned from the connection.", + "type": { + "kind": "INPUT_OBJECT", + "name": "ContributionOrder", + "ofType": null + }, + "defaultValue": "{field:\"OCCURRED_AT\",direction:\"DESC\"}" + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CreatedPullRequestContributionConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repository", + "description": "The repository in which the pull requests were opened.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "IssueContributionsByRepository", + "description": "This aggregates issues opened by a user within one repository.", + "fields": [ + { + "name": "contributions", + "description": "The issue contributions.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Ordering options for contributions returned from the connection.", + "type": { + "kind": "INPUT_OBJECT", + "name": "ContributionOrder", + "ofType": null + }, + "defaultValue": "{field:\"OCCURRED_AT\",direction:\"DESC\"}" + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CreatedIssueContributionConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repository", + "description": "The repository in which the issues were opened.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "RepositoryContributionType", + "description": "The reason a repository is listed as 'contributed'.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "COMMIT", + "description": "Created a commit", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ISSUE", + "description": "Created an issue", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "PULL_REQUEST", + "description": "Created a pull request", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "REPOSITORY", + "description": "Created the repository", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "PULL_REQUEST_REVIEW", + "description": "Reviewed a pull request", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PublicKeyConnection", + "description": "The connection type for PublicKey.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PublicKeyEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PublicKey", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PublicKeyEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "PublicKey", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "FollowingConnection", + "description": "The connection type for User.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "UserEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "User", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "FollowerConnection", + "description": "The connection type for User.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "UserEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "User", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "StarredRepositoryConnection", + "description": "The connection type for Repository.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "StarredRepositoryEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "StarredRepositoryEdge", + "description": "Represents a starred repository.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "starredAt", + "description": "Identifies when the item was starred.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "AppEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "App", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "RateLimit", + "description": "Represents the client's rate limit.", + "fields": [ + { + "name": "cost", + "description": "The point cost for the current query counting against the rate limit.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "limit", + "description": "The maximum number of points the client is permitted to consume in a 60 minute window.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodeCount", + "description": "The maximum number of nodes this query may return", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "remaining", + "description": "The number of points remaining in the current rate limit window.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resetAt", + "description": "The time at which the current rate limit window resets in UTC epoch seconds.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SearchResultItemConnection", + "description": "A list of results that matched against a search query.", + "fields": [ + { + "name": "codeCount", + "description": "The number of pieces of code that matched the search query.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SearchResultItemEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "issueCount", + "description": "The number of issues that matched the search query.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "UNION", + "name": "SearchResultItem", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repositoryCount", + "description": "The number of repositories that matched the search query.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "userCount", + "description": "The number of users that matched the search query.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "wikiCount", + "description": "The number of wiki pages that matched the search query.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SearchResultItemEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "UNION", + "name": "SearchResultItem", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "textMatches", + "description": "Text matches on the result found.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "TextMatch", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "UNION", + "name": "SearchResultItem", + "description": "The results of a search.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "Issue", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "User", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Organization", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "MarketplaceListing", + "ofType": null + } + ] + }, + { + "kind": "OBJECT", + "name": "TextMatch", + "description": "A text match within a search result.", + "fields": [ + { + "name": "fragment", + "description": "The specific text fragment within the property matched on.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "highlights", + "description": "Highlights within the matched fragment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "TextMatchHighlight", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "property", + "description": "The property matched on.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "TextMatchHighlight", + "description": "Represents a single highlight in a search result match.", + "fields": [ + { + "name": "beginIndice", + "description": "The indice in the fragment where the matched text begins.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "endIndice", + "description": "The indice in the fragment where the matched text ends.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "text", + "description": "The text matched.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "SearchType", + "description": "Represents the individual results of a search.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "ISSUE", + "description": "Returns results matching issues in repositories.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "REPOSITORY", + "description": "Returns results matching repositories.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "USER", + "description": "Returns results matching users and organizations on GitHub.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "UNION", + "name": "CollectionItemContent", + "description": "Types that can be inside Collection Items.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Organization", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "User", + "ofType": null + } + ] + }, + { + "kind": "OBJECT", + "name": "GitHubMetadata", + "description": "Represents information about the GitHub instance.", + "fields": [ + { + "name": "gitHubServicesSha", + "description": "Returns a String that's a SHA of `github-services`", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "GitObjectID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "gitIpAddresses", + "description": "IP addresses that users connect to for git operations", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "hookIpAddresses", + "description": "IP addresses that service hooks are sent from", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "importerIpAddresses", + "description": "IP addresses that the importer connects from", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isPasswordAuthenticationVerifiable", + "description": "Whether or not users are verified", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pagesIpAddresses", + "description": "IP addresses for GitHub Pages' A records", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SecurityAdvisoryConnection", + "description": "The connection type for SecurityAdvisory.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SecurityAdvisoryEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SecurityAdvisory", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SecurityAdvisoryEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "SecurityAdvisory", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "SecurityAdvisoryOrder", + "description": "Ordering options for security advisory connections", + "fields": null, + "inputFields": [ + { + "name": "field", + "description": "The field to order security advisories by.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "SecurityAdvisoryOrderField", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "direction", + "description": "The ordering direction.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "OrderDirection", + "ofType": null + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "SecurityAdvisoryOrderField", + "description": "Properties by which security advisory connections can be ordered.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "PUBLISHED_AT", + "description": "Order advisories by publication time", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "UPDATED_AT", + "description": "Order advisories by update time", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "SecurityAdvisoryIdentifierFilter", + "description": "An advisory identifier to filter results on.", + "fields": null, + "inputFields": [ + { + "name": "type", + "description": "The identifier type.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "SecurityAdvisoryIdentifierType", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "value", + "description": "The identifier string. Supports exact or partial matching.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "SecurityAdvisoryIdentifierType", + "description": "Identifier formats available for advisories.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "CVE", + "description": "Common Vulnerabilities and Exposures Identifier.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "GHSA", + "description": "GitHub Security Advisory ID.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Mutation", + "description": "The root query for implementing GraphQL mutations.", + "fields": [ + { + "name": "acceptTopicSuggestion", + "description": "Applies a suggested topic to the repository.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "AcceptTopicSuggestionInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "AcceptTopicSuggestionPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "addAssigneesToAssignable", + "description": "Adds assignees to an assignable object.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "AddAssigneesToAssignableInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "AddAssigneesToAssignablePayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "addComment", + "description": "Adds a comment to an Issue or Pull Request.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "AddCommentInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "AddCommentPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "addLabelsToLabelable", + "description": "Adds labels to a labelable object.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "AddLabelsToLabelableInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "AddLabelsToLabelablePayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "addProjectCard", + "description": "Adds a card to a ProjectColumn. Either `contentId` or `note` must be provided but **not** both.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "AddProjectCardInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "AddProjectCardPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "addProjectColumn", + "description": "Adds a column to a Project.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "AddProjectColumnInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "AddProjectColumnPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "addPullRequestReview", + "description": "Adds a review to a Pull Request.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "AddPullRequestReviewInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "AddPullRequestReviewPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "addPullRequestReviewComment", + "description": "Adds a comment to a review.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "AddPullRequestReviewCommentInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "AddPullRequestReviewCommentPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "addReaction", + "description": "Adds a reaction to a subject.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "AddReactionInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "AddReactionPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "addStar", + "description": "Adds a star to a Starrable.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "AddStarInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "AddStarPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "changeUserStatus", + "description": "Update your status on GitHub.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "ChangeUserStatusInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "ChangeUserStatusPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "clearLabelsFromLabelable", + "description": "Clears all labels from a labelable object.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "ClearLabelsFromLabelableInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "ClearLabelsFromLabelablePayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "cloneProject", + "description": "Creates a new project by cloning configuration from an existing project.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "CloneProjectInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "CloneProjectPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "closeIssue", + "description": "Close an issue.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "CloseIssueInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "CloseIssuePayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "closePullRequest", + "description": "Close a pull request.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "ClosePullRequestInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "ClosePullRequestPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "convertProjectCardNoteToIssue", + "description": "Convert a project note card to one associated with a newly created issue.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "ConvertProjectCardNoteToIssueInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "ConvertProjectCardNoteToIssuePayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createBranchProtectionRule", + "description": "Create a new branch protection rule", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "CreateBranchProtectionRuleInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "CreateBranchProtectionRulePayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createIssue", + "description": "Creates a new issue.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "CreateIssueInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "CreateIssuePayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createProject", + "description": "Creates a new project.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "CreateProjectInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "CreateProjectPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createPullRequest", + "description": "Create a new pull request", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "CreatePullRequestInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "CreatePullRequestPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "declineTopicSuggestion", + "description": "Rejects a suggested topic for the repository.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "DeclineTopicSuggestionInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "DeclineTopicSuggestionPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deleteBranchProtectionRule", + "description": "Delete a branch protection rule", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "DeleteBranchProtectionRuleInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "DeleteBranchProtectionRulePayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deleteIssue", + "description": "Deletes an Issue object.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "DeleteIssueInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "DeleteIssuePayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deleteIssueComment", + "description": "Deletes an IssueComment object.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "DeleteIssueCommentInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "DeleteIssueCommentPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deleteProject", + "description": "Deletes a project.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "DeleteProjectInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "DeleteProjectPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deleteProjectCard", + "description": "Deletes a project card.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "DeleteProjectCardInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "DeleteProjectCardPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deleteProjectColumn", + "description": "Deletes a project column.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "DeleteProjectColumnInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "DeleteProjectColumnPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deletePullRequestReview", + "description": "Deletes a pull request review.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "DeletePullRequestReviewInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "DeletePullRequestReviewPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deletePullRequestReviewComment", + "description": "Deletes a pull request review comment.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "DeletePullRequestReviewCommentInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "DeletePullRequestReviewCommentPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "dismissPullRequestReview", + "description": "Dismisses an approved or rejected pull request review.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "DismissPullRequestReviewInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "DismissPullRequestReviewPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "lockLockable", + "description": "Lock a lockable object", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "LockLockableInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "LockLockablePayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "mergePullRequest", + "description": "Merge a pull request.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "MergePullRequestInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "MergePullRequestPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "moveProjectCard", + "description": "Moves a project card to another place.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "MoveProjectCardInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "MoveProjectCardPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "moveProjectColumn", + "description": "Moves a project column to another place.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "MoveProjectColumnInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "MoveProjectColumnPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "removeAssigneesFromAssignable", + "description": "Removes assignees from an assignable object.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "RemoveAssigneesFromAssignableInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "RemoveAssigneesFromAssignablePayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "removeLabelsFromLabelable", + "description": "Removes labels from a Labelable object.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "RemoveLabelsFromLabelableInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "RemoveLabelsFromLabelablePayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "removeOutsideCollaborator", + "description": "Removes outside collaborator from all repositories in an organization.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "RemoveOutsideCollaboratorInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "RemoveOutsideCollaboratorPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "removeReaction", + "description": "Removes a reaction from a subject.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "RemoveReactionInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "RemoveReactionPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "removeStar", + "description": "Removes a star from a Starrable.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "RemoveStarInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "RemoveStarPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "reopenIssue", + "description": "Reopen a issue.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "ReopenIssueInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "ReopenIssuePayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "reopenPullRequest", + "description": "Reopen a pull request.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "ReopenPullRequestInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "ReopenPullRequestPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "requestReviews", + "description": "Set review requests on a pull request.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "RequestReviewsInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "RequestReviewsPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "resolveReviewThread", + "description": "Marks a review thread as resolved.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "ResolveReviewThreadInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "ResolveReviewThreadPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "submitPullRequestReview", + "description": "Submits a pending pull request review.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "SubmitPullRequestReviewInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "SubmitPullRequestReviewPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "unlockLockable", + "description": "Unlock a lockable object", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "UnlockLockableInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "UnlockLockablePayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "unmarkIssueAsDuplicate", + "description": "Unmark an issue as a duplicate of another issue.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "UnmarkIssueAsDuplicateInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "UnmarkIssueAsDuplicatePayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "unresolveReviewThread", + "description": "Marks a review thread as unresolved.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "UnresolveReviewThreadInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "UnresolveReviewThreadPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updateBranchProtectionRule", + "description": "Create a new branch protection rule", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "UpdateBranchProtectionRuleInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "UpdateBranchProtectionRulePayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updateIssue", + "description": "Updates an Issue.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "UpdateIssueInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "UpdateIssuePayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updateIssueComment", + "description": "Updates an IssueComment object.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "UpdateIssueCommentInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "UpdateIssueCommentPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updateProject", + "description": "Updates an existing project.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "UpdateProjectInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "UpdateProjectPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updateProjectCard", + "description": "Updates an existing project card.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "UpdateProjectCardInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "UpdateProjectCardPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updateProjectColumn", + "description": "Updates an existing project column.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "UpdateProjectColumnInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "UpdateProjectColumnPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatePullRequest", + "description": "Update a pull request", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "UpdatePullRequestInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "UpdatePullRequestPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatePullRequestReview", + "description": "Updates the body of a pull request review.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "UpdatePullRequestReviewInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "UpdatePullRequestReviewPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatePullRequestReviewComment", + "description": "Updates a pull request review comment.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "UpdatePullRequestReviewCommentInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "UpdatePullRequestReviewCommentPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updateSubscription", + "description": "Updates the state for subscribable subjects.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "UpdateSubscriptionInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "UpdateSubscriptionPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updateTopics", + "description": "Replaces the repository's topics with the given topics.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "UpdateTopicsInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "UpdateTopicsPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "AddReactionPayload", + "description": "Autogenerated return type of AddReaction", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "reaction", + "description": "The reaction object.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Reaction", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subject", + "description": "The reactable subject.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Reactable", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "AddReactionInput", + "description": "Autogenerated input type of AddReaction", + "fields": null, + "inputFields": [ + { + "name": "subjectId", + "description": "The Node ID of the subject to modify.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "content", + "description": "The name of the emoji to react with.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "ReactionContent", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "RemoveReactionPayload", + "description": "Autogenerated return type of RemoveReaction", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "reaction", + "description": "The reaction object.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Reaction", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subject", + "description": "The reactable subject.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Reactable", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "RemoveReactionInput", + "description": "Autogenerated input type of RemoveReaction", + "fields": null, + "inputFields": [ + { + "name": "subjectId", + "description": "The Node ID of the subject to modify.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "content", + "description": "The name of the emoji reaction to remove.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "ReactionContent", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "UpdateSubscriptionPayload", + "description": "Autogenerated return type of UpdateSubscription", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subscribable", + "description": "The input subscribable entity.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Subscribable", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "UpdateSubscriptionInput", + "description": "Autogenerated input type of UpdateSubscription", + "fields": null, + "inputFields": [ + { + "name": "subscribableId", + "description": "The Node ID of the subscribable object to modify.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "state", + "description": "The new state of the subscription.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "SubscriptionState", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "AddCommentPayload", + "description": "Autogenerated return type of AddComment", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "commentEdge", + "description": "The edge from the subject's comment connection.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "IssueCommentEdge", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subject", + "description": "The subject", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "timelineEdge", + "description": "The edge from the subject's timeline connection.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "IssueTimelineItemEdge", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "AddCommentInput", + "description": "Autogenerated input type of AddComment", + "fields": null, + "inputFields": [ + { + "name": "subjectId", + "description": "The Node ID of the subject to modify.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "body", + "description": "The contents of the comment.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "MinimizeCommentInput", + "description": "Autogenerated input type of MinimizeComment", + "fields": null, + "inputFields": [ + { + "name": "subjectId", + "description": "The Node ID of the subject to modify.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "classifier", + "description": "The classification of comment", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "ReportedContentClassifiers", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "ReportedContentClassifiers", + "description": "The reasons a piece of content can be reported or minimized.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "SPAM", + "description": "A spammy piece of content", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ABUSE", + "description": "An abusive or harassing piece of content", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "OFF_TOPIC", + "description": "An irrelevant piece of content", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "OUTDATED", + "description": "An outdated piece of content", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "RESOLVED", + "description": "The content has been resolved", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "UnminimizeCommentInput", + "description": "Autogenerated input type of UnminimizeComment", + "fields": null, + "inputFields": [ + { + "name": "subjectId", + "description": "The Node ID of the subject to modify.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "UpdateIssueCommentPayload", + "description": "Autogenerated return type of UpdateIssueComment", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "issueComment", + "description": "The updated comment.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "IssueComment", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "UpdateIssueCommentInput", + "description": "Autogenerated input type of UpdateIssueComment", + "fields": null, + "inputFields": [ + { + "name": "id", + "description": "The ID of the IssueComment to modify.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "body", + "description": "The updated text of the comment.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CreateProjectPayload", + "description": "Autogenerated return type of CreateProject", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "project", + "description": "The new project.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Project", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "CreateProjectInput", + "description": "Autogenerated input type of CreateProject", + "fields": null, + "inputFields": [ + { + "name": "ownerId", + "description": "The owner ID to create the project under.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "name", + "description": "The name of project.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "body", + "description": "The description of project.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "UpdateProjectPayload", + "description": "Autogenerated return type of UpdateProject", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "project", + "description": "The updated project.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Project", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "UpdateProjectInput", + "description": "Autogenerated input type of UpdateProject", + "fields": null, + "inputFields": [ + { + "name": "projectId", + "description": "The Project ID to update.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "name", + "description": "The name of project.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "body", + "description": "The description of project.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "state", + "description": "Whether the project is open or closed.", + "type": { + "kind": "ENUM", + "name": "ProjectState", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "public", + "description": "Whether the project is public or not.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "DeleteProjectPayload", + "description": "Autogenerated return type of DeleteProject", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "owner", + "description": "The repository or organization the project was removed from.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "ProjectOwner", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "DeleteProjectInput", + "description": "Autogenerated input type of DeleteProject", + "fields": null, + "inputFields": [ + { + "name": "projectId", + "description": "The Project ID to update.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CloneProjectPayload", + "description": "Autogenerated return type of CloneProject", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "jobStatusId", + "description": "The id of the JobStatus for populating cloned fields.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "project", + "description": "The new cloned project.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Project", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "CloneProjectInput", + "description": "Autogenerated input type of CloneProject", + "fields": null, + "inputFields": [ + { + "name": "targetOwnerId", + "description": "The owner ID to create the project under.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "sourceId", + "description": "The source project to clone.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "includeWorkflows", + "description": "Whether or not to clone the source project's workflows.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "name", + "description": "The name of the project.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "body", + "description": "The description of the project.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "public", + "description": "The visibility of the project, defaults to false (private).", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "ImportProjectInput", + "description": "Autogenerated input type of ImportProject", + "fields": null, + "inputFields": [ + { + "name": "ownerName", + "description": "The name of the Organization or User to create the Project under.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "name", + "description": "The name of Project.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "body", + "description": "The description of Project.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "public", + "description": "Whether the Project is public or not.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false" + }, + { + "name": "columnImports", + "description": "A list of columns containing issues and pull requests.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "ProjectColumnImport", + "ofType": null + } + } + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "ProjectColumnImport", + "description": "A project column and a list of its issues and PRs.", + "fields": null, + "inputFields": [ + { + "name": "columnName", + "description": "The name of the column.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "position", + "description": "The position of the column, starting from 0.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "issues", + "description": "A list of issues and pull requests in the column.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "ProjectCardImport", + "ofType": null + } + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "ProjectCardImport", + "description": "An issue or PR and its owning repository to be used in a project card.", + "fields": null, + "inputFields": [ + { + "name": "repository", + "description": "Repository name with owner (owner/repository).", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "number", + "description": "The issue or pull request number.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "AddProjectColumnPayload", + "description": "Autogenerated return type of AddProjectColumn", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "columnEdge", + "description": "The edge from the project's column connection.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "ProjectColumnEdge", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "project", + "description": "The project", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Project", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "AddProjectColumnInput", + "description": "Autogenerated input type of AddProjectColumn", + "fields": null, + "inputFields": [ + { + "name": "projectId", + "description": "The Node ID of the project.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "name", + "description": "The name of the column.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "MoveProjectColumnPayload", + "description": "Autogenerated return type of MoveProjectColumn", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "columnEdge", + "description": "The new edge of the moved column.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "ProjectColumnEdge", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "MoveProjectColumnInput", + "description": "Autogenerated input type of MoveProjectColumn", + "fields": null, + "inputFields": [ + { + "name": "columnId", + "description": "The id of the column to move.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "afterColumnId", + "description": "Place the new column after the column with this id. Pass null to place it at the front.", + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "UpdateProjectColumnPayload", + "description": "Autogenerated return type of UpdateProjectColumn", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "projectColumn", + "description": "The updated project column.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "ProjectColumn", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "UpdateProjectColumnInput", + "description": "Autogenerated input type of UpdateProjectColumn", + "fields": null, + "inputFields": [ + { + "name": "projectColumnId", + "description": "The ProjectColumn ID to update.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "name", + "description": "The name of project column.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "DeleteProjectColumnPayload", + "description": "Autogenerated return type of DeleteProjectColumn", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deletedColumnId", + "description": "The deleted column ID.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "project", + "description": "The project the deleted column was in.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Project", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "DeleteProjectColumnInput", + "description": "Autogenerated input type of DeleteProjectColumn", + "fields": null, + "inputFields": [ + { + "name": "columnId", + "description": "The id of the column to delete.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "AddProjectCardPayload", + "description": "Autogenerated return type of AddProjectCard", + "fields": [ + { + "name": "cardEdge", + "description": "The edge from the ProjectColumn's card connection.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "ProjectCardEdge", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "projectColumn", + "description": "The ProjectColumn", + "args": [], + "type": { + "kind": "OBJECT", + "name": "ProjectColumn", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "AddProjectCardInput", + "description": "Autogenerated input type of AddProjectCard", + "fields": null, + "inputFields": [ + { + "name": "projectColumnId", + "description": "The Node ID of the ProjectColumn.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "contentId", + "description": "The content of the card. Must be a member of the ProjectCardItem union", + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "note", + "description": "The note on the card.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "UpdateProjectCardPayload", + "description": "Autogenerated return type of UpdateProjectCard", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "projectCard", + "description": "The updated ProjectCard.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "ProjectCard", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "UpdateProjectCardInput", + "description": "Autogenerated input type of UpdateProjectCard", + "fields": null, + "inputFields": [ + { + "name": "projectCardId", + "description": "The ProjectCard ID to update.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "isArchived", + "description": "Whether or not the ProjectCard should be archived", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "note", + "description": "The note of ProjectCard.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "MoveProjectCardPayload", + "description": "Autogenerated return type of MoveProjectCard", + "fields": [ + { + "name": "cardEdge", + "description": "The new edge of the moved card.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "ProjectCardEdge", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "MoveProjectCardInput", + "description": "Autogenerated input type of MoveProjectCard", + "fields": null, + "inputFields": [ + { + "name": "cardId", + "description": "The id of the card to move.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "columnId", + "description": "The id of the column to move it into.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "afterCardId", + "description": "Place the new card after the card with this id. Pass null to place it at the top.", + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "DeleteProjectCardPayload", + "description": "Autogenerated return type of DeleteProjectCard", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "column", + "description": "The column the deleted card was in.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "ProjectColumn", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deletedCardId", + "description": "The deleted card ID.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "DeleteProjectCardInput", + "description": "Autogenerated input type of DeleteProjectCard", + "fields": null, + "inputFields": [ + { + "name": "cardId", + "description": "The id of the card to delete.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ConvertProjectCardNoteToIssuePayload", + "description": "Autogenerated return type of ConvertProjectCardNoteToIssue", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "projectCard", + "description": "The updated ProjectCard.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "ProjectCard", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "ConvertProjectCardNoteToIssueInput", + "description": "Autogenerated input type of ConvertProjectCardNoteToIssue", + "fields": null, + "inputFields": [ + { + "name": "projectCardId", + "description": "The ProjectCard ID to convert.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "repositoryId", + "description": "The ID of the repository to create the issue in.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "title", + "description": "The title of the newly created issue. Defaults to the card's note text.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "body", + "description": "The body of the newly created issue.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "UnmarkIssueAsDuplicatePayload", + "description": "Autogenerated return type of UnmarkIssueAsDuplicate", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "duplicate", + "description": "The issue or pull request that was marked as a duplicate.", + "args": [], + "type": { + "kind": "UNION", + "name": "IssueOrPullRequest", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "UnmarkIssueAsDuplicateInput", + "description": "Autogenerated input type of UnmarkIssueAsDuplicate", + "fields": null, + "inputFields": [ + { + "name": "duplicateId", + "description": "ID of the issue or pull request currently marked as a duplicate.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "canonicalId", + "description": "ID of the issue or pull request currently considered canonical/authoritative/original.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "LockLockablePayload", + "description": "Autogenerated return type of LockLockable", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "lockedRecord", + "description": "The item that was locked.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Lockable", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "LockLockableInput", + "description": "Autogenerated input type of LockLockable", + "fields": null, + "inputFields": [ + { + "name": "lockableId", + "description": "ID of the issue or pull request to be locked.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "lockReason", + "description": "A reason for why the issue or pull request will be locked.", + "type": { + "kind": "ENUM", + "name": "LockReason", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "UnlockLockablePayload", + "description": "Autogenerated return type of UnlockLockable", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "unlockedRecord", + "description": "The item that was unlocked.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Lockable", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "UnlockLockableInput", + "description": "Autogenerated input type of UnlockLockable", + "fields": null, + "inputFields": [ + { + "name": "lockableId", + "description": "ID of the issue or pull request to be unlocked.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "AddAssigneesToAssignablePayload", + "description": "Autogenerated return type of AddAssigneesToAssignable", + "fields": [ + { + "name": "assignable", + "description": "The item that was assigned.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Assignable", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "AddAssigneesToAssignableInput", + "description": "Autogenerated input type of AddAssigneesToAssignable", + "fields": null, + "inputFields": [ + { + "name": "assignableId", + "description": "The id of the assignable object to add assignees to.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "assigneeIds", + "description": "The id of users to add as assignees.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + } + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "RemoveAssigneesFromAssignablePayload", + "description": "Autogenerated return type of RemoveAssigneesFromAssignable", + "fields": [ + { + "name": "assignable", + "description": "The item that was unassigned.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Assignable", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "RemoveAssigneesFromAssignableInput", + "description": "Autogenerated input type of RemoveAssigneesFromAssignable", + "fields": null, + "inputFields": [ + { + "name": "assignableId", + "description": "The id of the assignable object to remove assignees from.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "assigneeIds", + "description": "The id of users to remove as assignees.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + } + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "AddLabelsToLabelablePayload", + "description": "Autogenerated return type of AddLabelsToLabelable", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "labelable", + "description": "The item that was labeled.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Labelable", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "AddLabelsToLabelableInput", + "description": "Autogenerated input type of AddLabelsToLabelable", + "fields": null, + "inputFields": [ + { + "name": "labelableId", + "description": "The id of the labelable object to add labels to.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "labelIds", + "description": "The ids of the labels to add.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + } + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CreateIssuePayload", + "description": "Autogenerated return type of CreateIssue", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "issue", + "description": "The new issue.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Issue", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "CreateIssueInput", + "description": "Autogenerated input type of CreateIssue", + "fields": null, + "inputFields": [ + { + "name": "repositoryId", + "description": "The Node ID of the repository.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "title", + "description": "The title for the issue.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "body", + "description": "The body for the issue description.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "assigneeIds", + "description": "The Node ID for the user assignee for this issue.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "milestoneId", + "description": "The Node ID of the milestone for this issue.", + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "labelIds", + "description": "An array of Node IDs of labels for this issue.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "projectIds", + "description": "An array of Node IDs for projects associated with this issue.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ClearLabelsFromLabelablePayload", + "description": "Autogenerated return type of ClearLabelsFromLabelable", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "labelable", + "description": "The item that was unlabeled.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Labelable", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "ClearLabelsFromLabelableInput", + "description": "Autogenerated input type of ClearLabelsFromLabelable", + "fields": null, + "inputFields": [ + { + "name": "labelableId", + "description": "The id of the labelable object to clear the labels from.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "RemoveLabelsFromLabelablePayload", + "description": "Autogenerated return type of RemoveLabelsFromLabelable", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "labelable", + "description": "The Labelable the labels were removed from.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Labelable", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "RemoveLabelsFromLabelableInput", + "description": "Autogenerated input type of RemoveLabelsFromLabelable", + "fields": null, + "inputFields": [ + { + "name": "labelableId", + "description": "The id of the Labelable to remove labels from.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "labelIds", + "description": "The ids of labels to remove.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + } + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CloseIssuePayload", + "description": "Autogenerated return type of CloseIssue", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "issue", + "description": "The issue that was closed.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Issue", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "CloseIssueInput", + "description": "Autogenerated input type of CloseIssue", + "fields": null, + "inputFields": [ + { + "name": "issueId", + "description": "ID of the issue to be closed.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ReopenIssuePayload", + "description": "Autogenerated return type of ReopenIssue", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "issue", + "description": "The issue that was opened.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Issue", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "ReopenIssueInput", + "description": "Autogenerated input type of ReopenIssue", + "fields": null, + "inputFields": [ + { + "name": "issueId", + "description": "ID of the issue to be opened.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "DeleteIssueCommentPayload", + "description": "Autogenerated return type of DeleteIssueComment", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "DeleteIssueCommentInput", + "description": "Autogenerated input type of DeleteIssueComment", + "fields": null, + "inputFields": [ + { + "name": "id", + "description": "The ID of the comment to delete.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "UpdateIssuePayload", + "description": "Autogenerated return type of UpdateIssue", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "issue", + "description": "The issue.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Issue", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "UpdateIssueInput", + "description": "Autogenerated input type of UpdateIssue", + "fields": null, + "inputFields": [ + { + "name": "id", + "description": "The ID of the Issue to modify.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "title", + "description": "The title for the issue.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "body", + "description": "The body for the issue description.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "assigneeIds", + "description": "An array of Node IDs of users for this issue.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "milestoneId", + "description": "The Node ID of the milestone for this issue.", + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "labelIds", + "description": "An array of Node IDs of labels for this issue.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "state", + "description": "The desired issue state.", + "type": { + "kind": "ENUM", + "name": "IssueState", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "projectIds", + "description": "An array of Node IDs for projects associated with this issue.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "DeleteIssuePayload", + "description": "Autogenerated return type of DeleteIssue", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repository", + "description": "The repository the issue belonged to", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "DeleteIssueInput", + "description": "Autogenerated input type of DeleteIssue", + "fields": null, + "inputFields": [ + { + "name": "issueId", + "description": "The ID of the issue to delete.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "PinIssueInput", + "description": "Autogenerated input type of PinIssue", + "fields": null, + "inputFields": [ + { + "name": "issueId", + "description": "The ID of the issue to be pinned", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "UnpinIssueInput", + "description": "Autogenerated input type of UnpinIssue", + "fields": null, + "inputFields": [ + { + "name": "issueId", + "description": "The ID of the issue to be unpinned", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CreatePullRequestPayload", + "description": "Autogenerated return type of CreatePullRequest", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequest", + "description": "The new pull request.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "CreatePullRequestInput", + "description": "Autogenerated input type of CreatePullRequest", + "fields": null, + "inputFields": [ + { + "name": "repositoryId", + "description": "The Node ID of the repository.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "baseRefName", + "description": "The name of the branch you want your changes pulled into. This should be an existing branch\non the current repository. You cannot update the base branch on a pull request to point\nto another repository.\n", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "headRefName", + "description": "The name of the branch where your changes are implemented. For cross-repository pull requests\nin the same network, namespace `head_ref_name` with a user like this: `username:branch`.\n", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "title", + "description": "The title of the pull request.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "body", + "description": "The contents of the pull request.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "maintainerCanModify", + "description": "Indicates whether maintainers can modify the pull request.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "true" + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "UpdatePullRequestPayload", + "description": "Autogenerated return type of UpdatePullRequest", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequest", + "description": "The updated pull request.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "UpdatePullRequestInput", + "description": "Autogenerated input type of UpdatePullRequest", + "fields": null, + "inputFields": [ + { + "name": "pullRequestId", + "description": "The Node ID of the pull request.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "baseRefName", + "description": "The name of the branch you want your changes pulled into. This should be an existing branch\non the current repository.\n", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "title", + "description": "The title of the pull request.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "body", + "description": "The contents of the pull request.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "maintainerCanModify", + "description": "Indicates whether maintainers can modify the pull request.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ClosePullRequestPayload", + "description": "Autogenerated return type of ClosePullRequest", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequest", + "description": "The pull request that was closed.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "ClosePullRequestInput", + "description": "Autogenerated input type of ClosePullRequest", + "fields": null, + "inputFields": [ + { + "name": "pullRequestId", + "description": "ID of the pull request to be closed.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ReopenPullRequestPayload", + "description": "Autogenerated return type of ReopenPullRequest", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequest", + "description": "The pull request that was reopened.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "ReopenPullRequestInput", + "description": "Autogenerated input type of ReopenPullRequest", + "fields": null, + "inputFields": [ + { + "name": "pullRequestId", + "description": "ID of the pull request to be reopened.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "MergePullRequestPayload", + "description": "Autogenerated return type of MergePullRequest", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequest", + "description": "The pull request that was merged.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "MergePullRequestInput", + "description": "Autogenerated input type of MergePullRequest", + "fields": null, + "inputFields": [ + { + "name": "pullRequestId", + "description": "ID of the pull request to be merged.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "commitHeadline", + "description": "Commit headline to use for the merge commit; if omitted, a default message will be used.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "commitBody", + "description": "Commit body to use for the merge commit; if omitted, a default message will be used", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "expectedHeadOid", + "description": "OID that the pull request head ref must match to allow merge; if omitted, no check is performed.", + "type": { + "kind": "SCALAR", + "name": "GitObjectID", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "DeletePullRequestReviewCommentPayload", + "description": "Autogenerated return type of DeletePullRequestReviewComment", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequestReview", + "description": "The pull request review the deleted comment belonged to.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "PullRequestReview", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "DeletePullRequestReviewCommentInput", + "description": "Autogenerated input type of DeletePullRequestReviewComment", + "fields": null, + "inputFields": [ + { + "name": "id", + "description": "The ID of the comment to delete.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "AddPullRequestReviewPayload", + "description": "Autogenerated return type of AddPullRequestReview", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequestReview", + "description": "The newly created pull request review.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "PullRequestReview", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "reviewEdge", + "description": "The edge from the pull request's review connection.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "PullRequestReviewEdge", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "AddPullRequestReviewInput", + "description": "Autogenerated input type of AddPullRequestReview", + "fields": null, + "inputFields": [ + { + "name": "pullRequestId", + "description": "The Node ID of the pull request to modify.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "commitOID", + "description": "The commit OID the review pertains to.", + "type": { + "kind": "SCALAR", + "name": "GitObjectID", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "body", + "description": "The contents of the review body comment.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "event", + "description": "The event to perform on the pull request review.", + "type": { + "kind": "ENUM", + "name": "PullRequestReviewEvent", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "comments", + "description": "The review line comments.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "DraftPullRequestReviewComment", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "PullRequestReviewEvent", + "description": "The possible events to perform on a pull request review.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "COMMENT", + "description": "Submit general feedback without explicit approval.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "APPROVE", + "description": "Submit feedback and approve merging these changes.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "REQUEST_CHANGES", + "description": "Submit feedback that must be addressed before merging.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "DISMISS", + "description": "Dismiss review so it now longer effects merging.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "DraftPullRequestReviewComment", + "description": "Specifies a review comment to be left with a Pull Request Review.", + "fields": null, + "inputFields": [ + { + "name": "path", + "description": "Path to the file being commented on.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "position", + "description": "Position in the file to leave a comment on.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "body", + "description": "Body of the comment to leave.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SubmitPullRequestReviewPayload", + "description": "Autogenerated return type of SubmitPullRequestReview", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequestReview", + "description": "The submitted pull request review.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "PullRequestReview", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "SubmitPullRequestReviewInput", + "description": "Autogenerated input type of SubmitPullRequestReview", + "fields": null, + "inputFields": [ + { + "name": "pullRequestReviewId", + "description": "The Pull Request Review ID to submit.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "event", + "description": "The event to send to the Pull Request Review.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "PullRequestReviewEvent", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "body", + "description": "The text field to set on the Pull Request Review.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "UpdatePullRequestReviewPayload", + "description": "Autogenerated return type of UpdatePullRequestReview", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequestReview", + "description": "The updated pull request review.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "PullRequestReview", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "UpdatePullRequestReviewInput", + "description": "Autogenerated input type of UpdatePullRequestReview", + "fields": null, + "inputFields": [ + { + "name": "pullRequestReviewId", + "description": "The Node ID of the pull request review to modify.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "body", + "description": "The contents of the pull request review body.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "DismissPullRequestReviewPayload", + "description": "Autogenerated return type of DismissPullRequestReview", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequestReview", + "description": "The dismissed pull request review.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "PullRequestReview", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "DismissPullRequestReviewInput", + "description": "Autogenerated input type of DismissPullRequestReview", + "fields": null, + "inputFields": [ + { + "name": "pullRequestReviewId", + "description": "The Node ID of the pull request review to modify.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "message", + "description": "The contents of the pull request review dismissal message.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "DeletePullRequestReviewPayload", + "description": "Autogenerated return type of DeletePullRequestReview", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequestReview", + "description": "The deleted pull request review.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "PullRequestReview", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "DeletePullRequestReviewInput", + "description": "Autogenerated input type of DeletePullRequestReview", + "fields": null, + "inputFields": [ + { + "name": "pullRequestReviewId", + "description": "The Node ID of the pull request review to delete.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ResolveReviewThreadPayload", + "description": "Autogenerated return type of ResolveReviewThread", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "thread", + "description": "The thread to resolve.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "PullRequestReviewThread", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "ResolveReviewThreadInput", + "description": "Autogenerated input type of ResolveReviewThread", + "fields": null, + "inputFields": [ + { + "name": "threadId", + "description": "The ID of the thread to resolve", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "UnresolveReviewThreadPayload", + "description": "Autogenerated return type of UnresolveReviewThread", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "thread", + "description": "The thread to resolve.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "PullRequestReviewThread", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "UnresolveReviewThreadInput", + "description": "Autogenerated input type of UnresolveReviewThread", + "fields": null, + "inputFields": [ + { + "name": "threadId", + "description": "The ID of the thread to unresolve", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "AddPullRequestReviewCommentPayload", + "description": "Autogenerated return type of AddPullRequestReviewComment", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "comment", + "description": "The newly created comment.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "PullRequestReviewComment", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "commentEdge", + "description": "The edge from the review's comment connection.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "PullRequestReviewCommentEdge", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "AddPullRequestReviewCommentInput", + "description": "Autogenerated input type of AddPullRequestReviewComment", + "fields": null, + "inputFields": [ + { + "name": "pullRequestReviewId", + "description": "The Node ID of the review to modify.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "commitOID", + "description": "The SHA of the commit to comment on.", + "type": { + "kind": "SCALAR", + "name": "GitObjectID", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "body", + "description": "The text of the comment.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "path", + "description": "The relative path of the file to comment on.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "position", + "description": "The line index in the diff to comment on.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "inReplyTo", + "description": "The comment id to reply to.", + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "UpdatePullRequestReviewCommentPayload", + "description": "Autogenerated return type of UpdatePullRequestReviewComment", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequestReviewComment", + "description": "The updated comment.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "PullRequestReviewComment", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "UpdatePullRequestReviewCommentInput", + "description": "Autogenerated input type of UpdatePullRequestReviewComment", + "fields": null, + "inputFields": [ + { + "name": "pullRequestReviewCommentId", + "description": "The Node ID of the comment to modify.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "body", + "description": "The text of the comment.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "RemoveOutsideCollaboratorPayload", + "description": "Autogenerated return type of RemoveOutsideCollaborator", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "removedUser", + "description": "The user that was removed as an outside collaborator.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "User", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "RemoveOutsideCollaboratorInput", + "description": "Autogenerated input type of RemoveOutsideCollaborator", + "fields": null, + "inputFields": [ + { + "name": "userId", + "description": "The ID of the outside collaborator to remove.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "organizationId", + "description": "The ID of the organization to remove the outside collaborator from.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "RequestReviewsPayload", + "description": "Autogenerated return type of RequestReviews", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pullRequest", + "description": "The pull request that is getting requests.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "requestedReviewersEdge", + "description": "The edge from the pull request to the requested reviewers.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "UserEdge", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "RequestReviewsInput", + "description": "Autogenerated input type of RequestReviews", + "fields": null, + "inputFields": [ + { + "name": "pullRequestId", + "description": "The Node ID of the pull request to modify.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "userIds", + "description": "The Node IDs of the user to request.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "teamIds", + "description": "The Node IDs of the team to request.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "union", + "description": "Add users to the set rather than replace.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "AddStarPayload", + "description": "Autogenerated return type of AddStar", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "starrable", + "description": "The starrable.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Starrable", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "AddStarInput", + "description": "Autogenerated input type of AddStar", + "fields": null, + "inputFields": [ + { + "name": "starrableId", + "description": "The Starrable ID to star.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "RemoveStarPayload", + "description": "Autogenerated return type of RemoveStar", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "starrable", + "description": "The starrable.", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Starrable", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "RemoveStarInput", + "description": "Autogenerated input type of RemoveStar", + "fields": null, + "inputFields": [ + { + "name": "starrableId", + "description": "The Starrable ID to unstar.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "AcceptTopicSuggestionPayload", + "description": "Autogenerated return type of AcceptTopicSuggestion", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "topic", + "description": "The accepted topic.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Topic", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "AcceptTopicSuggestionInput", + "description": "Autogenerated input type of AcceptTopicSuggestion", + "fields": null, + "inputFields": [ + { + "name": "repositoryId", + "description": "The Node ID of the repository.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "name", + "description": "The name of the suggested topic.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "DeclineTopicSuggestionPayload", + "description": "Autogenerated return type of DeclineTopicSuggestion", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "topic", + "description": "The declined topic.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Topic", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "DeclineTopicSuggestionInput", + "description": "Autogenerated input type of DeclineTopicSuggestion", + "fields": null, + "inputFields": [ + { + "name": "repositoryId", + "description": "The Node ID of the repository.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "name", + "description": "The name of the suggested topic.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "reason", + "description": "The reason why the suggested topic is declined.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "TopicSuggestionDeclineReason", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "TopicSuggestionDeclineReason", + "description": "Reason that the suggested topic is declined.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "NOT_RELEVANT", + "description": "The suggested topic is not relevant to the repository.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "TOO_SPECIFIC", + "description": "The suggested topic is too specific for the repository (e.g. #ruby-on-rails-version-4-2-1).", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "PERSONAL_PREFERENCE", + "description": "The viewer does not like the suggested topic.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "TOO_GENERAL", + "description": "The suggested topic is too general for the repository.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "UpdateTopicsPayload", + "description": "Autogenerated return type of UpdateTopics", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "invalidTopicNames", + "description": "Names of the provided topics that are not valid.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repository", + "description": "The updated repository.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "UpdateTopicsInput", + "description": "Autogenerated input type of UpdateTopics", + "fields": null, + "inputFields": [ + { + "name": "repositoryId", + "description": "The Node ID of the repository.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "topicNames", + "description": "An array of topic names.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CreateBranchProtectionRulePayload", + "description": "Autogenerated return type of CreateBranchProtectionRule", + "fields": [ + { + "name": "branchProtectionRule", + "description": "The newly created BranchProtectionRule.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "BranchProtectionRule", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "CreateBranchProtectionRuleInput", + "description": "Autogenerated input type of CreateBranchProtectionRule", + "fields": null, + "inputFields": [ + { + "name": "repositoryId", + "description": "The global relay id of the repository in which a new branch protection rule should be created in.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "pattern", + "description": "The glob-like pattern used to determine matching branches.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "requiresApprovingReviews", + "description": "Are approving reviews required to update matching branches.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "requiredApprovingReviewCount", + "description": "Number of approving reviews required to update matching branches.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "requiresCommitSignatures", + "description": "Are commits required to be signed.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "isAdminEnforced", + "description": "Can admins overwrite branch protection.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "requiresStatusChecks", + "description": "Are status checks required to update matching branches.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "requiresStrictStatusChecks", + "description": "Are branches required to be up to date before merging.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "requiresCodeOwnerReviews", + "description": "Are reviews from code owners required to update matching branches.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "dismissesStaleReviews", + "description": "Will new commits pushed to matching branches dismiss pull request review approvals.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "restrictsReviewDismissals", + "description": "Is dismissal of pull request reviews restricted.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "reviewDismissalActorIds", + "description": "A list of User or Team IDs allowed to dismiss reviews on pull requests targeting matching branches.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "restrictsPushes", + "description": "Is pushing to matching branches restricted.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "pushActorIds", + "description": "A list of User or Team IDs allowed to push to matching branches.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "requiredStatusCheckContexts", + "description": "List of required status check contexts that must pass for commits to be accepted to matching branches.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "UpdateBranchProtectionRulePayload", + "description": "Autogenerated return type of UpdateBranchProtectionRule", + "fields": [ + { + "name": "branchProtectionRule", + "description": "The newly created BranchProtectionRule.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "BranchProtectionRule", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "UpdateBranchProtectionRuleInput", + "description": "Autogenerated input type of UpdateBranchProtectionRule", + "fields": null, + "inputFields": [ + { + "name": "branchProtectionRuleId", + "description": "The global relay id of the branch protection rule to be updated.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "pattern", + "description": "The glob-like pattern used to determine matching branches.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "requiresApprovingReviews", + "description": "Are approving reviews required to update matching branches.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "requiredApprovingReviewCount", + "description": "Number of approving reviews required to update matching branches.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "requiresCommitSignatures", + "description": "Are commits required to be signed.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "isAdminEnforced", + "description": "Can admins overwrite branch protection.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "requiresStatusChecks", + "description": "Are status checks required to update matching branches.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "requiresStrictStatusChecks", + "description": "Are branches required to be up to date before merging.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "requiresCodeOwnerReviews", + "description": "Are reviews from code owners required to update matching branches.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "dismissesStaleReviews", + "description": "Will new commits pushed to matching branches dismiss pull request review approvals.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "restrictsReviewDismissals", + "description": "Is dismissal of pull request reviews restricted.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "reviewDismissalActorIds", + "description": "A list of User or Team IDs allowed to dismiss reviews on pull requests targeting matching branches.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "restrictsPushes", + "description": "Is pushing to matching branches restricted.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "pushActorIds", + "description": "A list of User or Team IDs allowed to push to matching branches.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "requiredStatusCheckContexts", + "description": "List of required status check contexts that must pass for commits to be accepted to matching branches.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "DeleteBranchProtectionRulePayload", + "description": "Autogenerated return type of DeleteBranchProtectionRule", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "DeleteBranchProtectionRuleInput", + "description": "Autogenerated input type of DeleteBranchProtectionRule", + "fields": null, + "inputFields": [ + { + "name": "branchProtectionRuleId", + "description": "The global relay id of the branch protection rule to be deleted.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ChangeUserStatusPayload", + "description": "Autogenerated return type of ChangeUserStatus", + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "status", + "description": "Your updated status.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "UserStatus", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "ChangeUserStatusInput", + "description": "Autogenerated input type of ChangeUserStatus", + "fields": null, + "inputFields": [ + { + "name": "emoji", + "description": "The emoji to represent your status. Can either be a native Unicode emoji or an emoji name with colons, e.g., :grinning:.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "message", + "description": "A short description of your current status.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "organizationId", + "description": "The ID of the organization whose members will be allowed to see the status. If omitted, the status will be publicly visible.", + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "limitedAvailability", + "description": "Whether this status should indicate you are not fully available on GitHub, e.g., you are away.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false" + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ContentAttachment", + "description": "A content attachment", + "fields": [ + { + "name": "body", + "description": "The body text of the content attachment. This parameter supports markdown.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "contentReference", + "description": "The content reference that the content attachment is attached to.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ContentReference", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "databaseId", + "description": "Identifies the primary key from the database.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "title", + "description": "The title of the content attachment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ContentReference", + "description": "A content reference", + "fields": [ + { + "name": "databaseId", + "description": "Identifies the primary key from the database.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "reference", + "description": "The reference of the content reference.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "CreateContentAttachmentInput", + "description": "Autogenerated input type of CreateContentAttachment", + "fields": null, + "inputFields": [ + { + "name": "contentReferenceId", + "description": "The node ID of the content_reference.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "title", + "description": "The title of the content attachment.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "body", + "description": "The body of the content attachment, which may contain markdown.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "__Schema", + "description": "A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.", + "fields": [ + { + "name": "directives", + "description": "A list of all directives supported by this server.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__Directive", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "mutationType", + "description": "If this server supports mutation, the type that mutation operations will be rooted at.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "queryType", + "description": "The type that query operations will be rooted at.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subscriptionType", + "description": "If this server support subscription, the type that subscription operations will be rooted at.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "types", + "description": "A list of all types supported by this server.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "__Type", + "description": "The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name and description, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.", + "fields": [ + { + "name": "description", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "enumValues", + "description": null, + "args": [ + { + "name": "includeDeprecated", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false" + } + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__EnumValue", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "fields", + "description": null, + "args": [ + { + "name": "includeDeprecated", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false" + } + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__Field", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "inputFields", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__InputValue", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "interfaces", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "kind", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "__TypeKind", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ofType", + "description": null, + "args": [], + "type": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "possibleTypes", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "__Field", + "description": "Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.", + "fields": [ + { + "name": "args", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__InputValue", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deprecationReason", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isDeprecated", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "type", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "__Directive", + "description": "A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.", + "fields": [ + { + "name": "args", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__InputValue", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "locations", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "__DirectiveLocation", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "onField", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": true, + "deprecationReason": "Use `locations`." + }, + { + "name": "onFragment", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": true, + "deprecationReason": "Use `locations`." + }, + { + "name": "onOperation", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": true, + "deprecationReason": "Use `locations`." + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "__EnumValue", + "description": "One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.", + "fields": [ + { + "name": "deprecationReason", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isDeprecated", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "__InputValue", + "description": "Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.", + "fields": [ + { + "name": "defaultValue", + "description": "A GraphQL-formatted string representing the default value for this input value.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "type", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "__TypeKind", + "description": "An enum describing what kind of type a given `__Type` is.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "SCALAR", + "description": "Indicates this type is a scalar.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "OBJECT", + "description": "Indicates this type is an object. `fields` and `interfaces` are valid fields.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INTERFACE", + "description": "Indicates this type is an interface. `fields` and `possibleTypes` are valid fields.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "UNION", + "description": "Indicates this type is a union. `possibleTypes` is a valid field.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ENUM", + "description": "Indicates this type is an enum. `enumValues` is a valid field.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INPUT_OBJECT", + "description": "Indicates this type is an input object. `inputFields` is a valid field.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "LIST", + "description": "Indicates this type is a list. `ofType` is a valid field.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "NON_NULL", + "description": "Indicates this type is a non-null. `ofType` is a valid field.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "__DirectiveLocation", + "description": "A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "QUERY", + "description": "Location adjacent to a query operation.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "MUTATION", + "description": "Location adjacent to a mutation operation.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "SUBSCRIPTION", + "description": "Location adjacent to a subscription operation.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "FIELD", + "description": "Location adjacent to a field.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "FRAGMENT_DEFINITION", + "description": "Location adjacent to a fragment definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "FRAGMENT_SPREAD", + "description": "Location adjacent to a fragment spread.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INLINE_FRAGMENT", + "description": "Location adjacent to an inline fragment.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "SCHEMA", + "description": "Location adjacent to a schema definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "SCALAR", + "description": "Location adjacent to a scalar definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "OBJECT", + "description": "Location adjacent to an object type definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "FIELD_DEFINITION", + "description": "Location adjacent to a field definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ARGUMENT_DEFINITION", + "description": "Location adjacent to an argument definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INTERFACE", + "description": "Location adjacent to an interface definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "UNION", + "description": "Location adjacent to a union definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ENUM", + "description": "Location adjacent to an enum definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ENUM_VALUE", + "description": "Location adjacent to an enum value definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INPUT_OBJECT", + "description": "Location adjacent to an input object type definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INPUT_FIELD_DEFINITION", + "description": "Location adjacent to an input object field definition.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "GpgSignature", + "description": "Represents a GPG signature on a Commit or Tag.", + "fields": [ + { + "name": "email", + "description": "Email used to sign this object.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isValid", + "description": "True if the signature is valid and verified by GitHub.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "keyId", + "description": "Hex-encoded ID of the key that signed this object.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "payload", + "description": "Payload for GPG signing object. Raw ODB object without the signature header.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "signature", + "description": "ASCII-armored signature header from object.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "signer", + "description": "GitHub user corresponding to the email signing this commit.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "User", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "state", + "description": "The state of this signature. `VALID` if signature is valid and verified by GitHub, otherwise represents reason why signature is considered invalid.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "GitSignatureState", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "wasSignedByGitHub", + "description": "True if the signature was made with GitHub's signing key.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "GitSignature", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SmimeSignature", + "description": "Represents an S/MIME signature on a Commit or Tag.", + "fields": [ + { + "name": "email", + "description": "Email used to sign this object.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isValid", + "description": "True if the signature is valid and verified by GitHub.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "payload", + "description": "Payload for GPG signing object. Raw ODB object without the signature header.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "signature", + "description": "ASCII-armored signature header from object.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "signer", + "description": "GitHub user corresponding to the email signing this commit.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "User", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "state", + "description": "The state of this signature. `VALID` if signature is valid and verified by GitHub, otherwise represents reason why signature is considered invalid.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "GitSignatureState", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "wasSignedByGitHub", + "description": "True if the signature was made with GitHub's signing key.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "GitSignature", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Tag", + "description": "Represents a Git tag.", + "fields": [ + { + "name": "abbreviatedOid", + "description": "An abbreviated version of the Git object ID", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "commitResourcePath", + "description": "The HTTP path for this Git object", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "commitUrl", + "description": "The HTTP URL for this Git object", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "URI", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "message", + "description": "The Git tag message.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The Git tag name.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "oid", + "description": "The Git object ID", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "GitObjectID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "repository", + "description": "The Repository the Git object belongs to", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "tagger", + "description": "Details about the tag author.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "GitActor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "target", + "description": "The Git object the tag points to.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INTERFACE", + "name": "GitObject", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "GitObject", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "UnknownSignature", + "description": "Represents an unknown signature on a Commit or Tag.", + "fields": [ + { + "name": "email", + "description": "Email used to sign this object.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isValid", + "description": "True if the signature is valid and verified by GitHub.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "payload", + "description": "Payload for GPG signing object. Raw ODB object without the signature header.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "signature", + "description": "ASCII-armored signature header from object.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "signer", + "description": "GitHub user corresponding to the email signing this commit.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "User", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "state", + "description": "The state of this signature. `VALID` if signature is valid and verified by GitHub, otherwise represents reason why signature is considered invalid.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "GitSignatureState", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "wasSignedByGitHub", + "description": "True if the signature was made with GitHub's signing key.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "GitSignature", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + } + ], + "directives": [ + { + "name": "include", + "description": "Directs the executor to include this field or fragment only when the `if` argument is true.", + "locations": ["FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT"], + "args": [ + { + "name": "if", + "description": "Included when true.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "defaultValue": null + } + ] + }, + { + "name": "skip", + "description": "Directs the executor to skip this field or fragment when the `if` argument is true.", + "locations": ["FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT"], + "args": [ + { + "name": "if", + "description": "Skipped when true.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "defaultValue": null + } + ] + }, + { + "name": "deprecated", + "description": "Marks an element of a GraphQL schema as no longer supported.", + "locations": ["FIELD_DEFINITION", "ENUM_VALUE"], + "args": [ + { + "name": "reason", + "description": "Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted in [Markdown](https://daringfireball.net/projects/markdown/).", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": "\"No longer supported\"" + } + ] + } + ] + } + } +} diff --git a/benchmark/introspectionFromSchema-benchmark.js b/benchmark/introspectionFromSchema-benchmark.js new file mode 100644 index 00000000..125ca9c3 --- /dev/null +++ b/benchmark/introspectionFromSchema-benchmark.js @@ -0,0 +1,21 @@ +'use strict'; + +const { parse } = require('graphql/language/parser.js'); +const { executeSync } = require('graphql/execution/execute.js'); +const { buildSchema } = require('graphql/utilities/buildASTSchema.js'); +const { + getIntrospectionQuery, +} = require('graphql/utilities/getIntrospectionQuery.js'); + +const { bigSchemaSDL } = require('./fixtures.js'); + +const schema = buildSchema(bigSchemaSDL, { assumeValid: true }); +const document = parse(getIntrospectionQuery()); + +module.exports = { + name: 'Execute Introspection Query', + count: 10, + measure() { + executeSync({ schema, document }); + }, +}; diff --git a/benchmark/parser-benchmark.js b/benchmark/parser-benchmark.js new file mode 100644 index 00000000..7f2e7931 --- /dev/null +++ b/benchmark/parser-benchmark.js @@ -0,0 +1,16 @@ +'use strict'; + +const { parse } = require('graphql/language/parser.js'); +const { + getIntrospectionQuery, +} = require('graphql/utilities/getIntrospectionQuery.js'); + +const introspectionQuery = getIntrospectionQuery(); + +module.exports = { + name: 'Parse introspection query', + count: 1000, + measure() { + parse(introspectionQuery); + }, +}; diff --git a/benchmark/validateGQL-benchmark.js b/benchmark/validateGQL-benchmark.js new file mode 100644 index 00000000..cc60a7ad --- /dev/null +++ b/benchmark/validateGQL-benchmark.js @@ -0,0 +1,21 @@ +'use strict'; + +const { parse } = require('graphql/language/parser.js'); +const { validate } = require('graphql/validation/validate.js'); +const { buildSchema } = require('graphql/utilities/buildASTSchema.js'); +const { + getIntrospectionQuery, +} = require('graphql/utilities/getIntrospectionQuery.js'); + +const { bigSchemaSDL } = require('./fixtures.js'); + +const schema = buildSchema(bigSchemaSDL, { assumeValid: true }); +const queryAST = parse(getIntrospectionQuery()); + +module.exports = { + name: 'Validate Introspection Query', + count: 50, + measure() { + validate(schema, queryAST); + }, +}; diff --git a/benchmark/validateInvalidGQL-benchmark.js b/benchmark/validateInvalidGQL-benchmark.js new file mode 100644 index 00000000..1e44b489 --- /dev/null +++ b/benchmark/validateInvalidGQL-benchmark.js @@ -0,0 +1,30 @@ +'use strict'; + +const { parse } = require('graphql/language/parser.js'); +const { validate } = require('graphql/validation/validate.js'); +const { buildSchema } = require('graphql/utilities/buildASTSchema.js'); + +const { bigSchemaSDL } = require('./fixtures.js'); + +const schema = buildSchema(bigSchemaSDL, { assumeValid: true }); +const queryAST = parse(` + { + unknownField + ... on unknownType { + anotherUnknownField + ...unknownFragment + } + } + + fragment TestFragment on anotherUnknownType { + yetAnotherUnknownField + } +`); + +module.exports = { + name: 'Validate Invalid Query', + count: 50, + measure() { + validate(schema, queryAST); + }, +}; diff --git a/benchmark/validateSDL-benchmark.js b/benchmark/validateSDL-benchmark.js new file mode 100644 index 00000000..93c80bbc --- /dev/null +++ b/benchmark/validateSDL-benchmark.js @@ -0,0 +1,16 @@ +'use strict'; + +const { parse } = require('graphql/language/parser.js'); +const { validateSDL } = require('graphql/validation/validate.js'); + +const { bigSchemaSDL } = require('./fixtures.js'); + +const sdlAST = parse(bigSchemaSDL); + +module.exports = { + name: 'Validate SDL Document', + count: 10, + measure() { + validateSDL(sdlAST); + }, +}; diff --git a/benchmark/visit-benchmark.js b/benchmark/visit-benchmark.js new file mode 100644 index 00000000..ab6a2baa --- /dev/null +++ b/benchmark/visit-benchmark.js @@ -0,0 +1,25 @@ +'use strict'; + +const { parse } = require('graphql/language/parser.js'); +const { visit } = require('graphql/language/visitor.js'); + +const { bigSchemaSDL } = require('./fixtures.js'); + +const documentAST = parse(bigSchemaSDL); + +const visitor = { + enter() { + /* do nothing */ + }, + leave() { + /* do nothing */ + }, +}; + +module.exports = { + name: 'Visit all AST nodes', + count: 10, + measure() { + visit(documentAST, visitor); + }, +}; diff --git a/benchmark/visitInParallel-benchmark.js b/benchmark/visitInParallel-benchmark.js new file mode 100644 index 00000000..cd835dd1 --- /dev/null +++ b/benchmark/visitInParallel-benchmark.js @@ -0,0 +1,25 @@ +'use strict'; + +const { parse } = require('graphql/language/parser.js'); +const { visit, visitInParallel } = require('graphql/language/visitor.js'); + +const { bigSchemaSDL } = require('./fixtures.js'); + +const documentAST = parse(bigSchemaSDL); + +const visitors = new Array(50).fill({ + enter() { + /* do nothing */ + }, + leave() { + /* do nothing */ + }, +}); + +module.exports = { + name: 'Visit all AST nodes in parallel', + count: 10, + measure() { + visit(documentAST, visitInParallel(visitors)); + }, +}; diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000..ca5256f7 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,14 @@ +codecov: + notify: + require_ci_to_pass: yes + +parsers: + javascript: + enable_partials: yes + +comment: no +coverage: + status: + project: + default: + target: auto diff --git a/cspell.yml b/cspell.yml new file mode 100644 index 00000000..5b4e41d5 --- /dev/null +++ b/cspell.yml @@ -0,0 +1,50 @@ +language: en +useGitignore: true +# TODO enableGlobDot: true +ignorePaths: + # Excluded from spelling check + - cspell.yml + - package.json + - package-lock.json + - tsconfig.json + - benchmark/github-schema.graphql + - benchmark/github-schema.json +overrides: + - filename: '**/docs/APIReference-*.md' + ignoreRegExpList: ['/href="[^"]*"/'] + +ignoreRegExpList: + - u\{[0-9a-f]{1,8}\} + +words: + - graphiql + - sublinks + - instanceof + + # Different names used inside tests + - Skywalker + - Leia + - Wilhuff + - Tarkin + - Artoo + - Threepio + - Odie + - Odie's + - Damerau + - Alderaan + - Tatooine + - astromech + + # TODO: contribute upstream + - deno + - codecov + + # TODO: remove bellow words + - QLID # GraphQLID + - QLJS # GraphQLJS + - iface + - Reqs + - FXXX + - XXXF + - bfnrt + - wrds diff --git a/docs/APIReference-Errors.md b/docs/APIReference-Errors.md new file mode 100644 index 00000000..eccd0934 --- /dev/null +++ b/docs/APIReference-Errors.md @@ -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 + + + +## Errors + +### GraphQLError + +```js +class GraphQLError extends Error { + constructor( + message: string, + nodes?: Array, + stack?: ?string, + source?: Source, + positions?: Array, + 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): 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 +}; + +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. diff --git a/docs/APIReference-Execution.md b/docs/APIReference-Execution.md new file mode 100644 index 00000000..750c2889 --- /dev/null +++ b/docs/APIReference-Execution.md @@ -0,0 +1,60 @@ +--- +title: graphql/execution +layout: ../_core/GraphQLJSLayout +category: API Reference +permalink: /graphql-js/execution/ +sublinks: execute +next: /graphql-js/language/ +--- + +The `graphql/execution` module is responsible for the execution phase of +fulfilling a GraphQL request. You can import either from the `graphql/execution` module, or from the root `graphql` module. For example: + +```js +import { execute } from 'graphql'; // ES6 +var { execute } = require('graphql'); // CommonJS +``` + +## Overview + + + +## Execution + +### execute + +```js +export function execute( + schema: GraphQLSchema, + documentAST: Document, + rootValue?: mixed, + contextValue?: mixed, + variableValues?: ?{[key: string]: mixed}, + operationName?: ?string +): MaybePromise + +type MaybePromise = Promise | T; + +type ExecutionResult = { + data: ?Object; + errors?: Array; +} +``` + +Implements the "Evaluating requests" section of the GraphQL specification. + +Returns a Promise that will eventually be resolved and never rejected. + +If the arguments to this function do not result in a legal execution context, +a GraphQLError will be thrown immediately explaining the invalid input. + +`ExecutionResult` represents the result of execution. `data` is the result of +executing the query, `errors` is null if no errors occurred, and is a +non-empty array if an error occurred. diff --git a/docs/APIReference-ExpressGraphQL.md b/docs/APIReference-ExpressGraphQL.md new file mode 100644 index 00000000..eac9f42b --- /dev/null +++ b/docs/APIReference-ExpressGraphQL.md @@ -0,0 +1,35 @@ +--- +title: express-graphql +layout: ../_core/GraphQLJSLayout +category: API Reference +permalink: /graphql-js/express-graphql/ +sublinks: graphqlHTTP +next: /graphql-js/graphql/ +--- + +The `express-graphql` module provides a simple way to create an [Express](https://expressjs.com/) server that runs a GraphQL API. + +```js +import { graphqlHTTP } from 'express-graphql'; // ES6 +var { graphqlHTTP } = require('express-graphql'); // CommonJS +``` + +### graphqlHTTP + +```js +graphqlHTTP({ + schema: GraphQLSchema, + graphiql?: ?boolean, + rootValue?: ?any, + context?: ?any, + pretty?: ?boolean, + formatError?: ?Function, + validationRules?: ?Array, +}): Middleware +``` + +Constructs an Express application based on a GraphQL schema. + +See the [express-graphql tutorial](/graphql-js/running-an-express-graphql-server/) for sample usage. + +See the [GitHub README](https://github.com/graphql/express-graphql) for more extensive documentation of the details of this method. diff --git a/docs/APIReference-GraphQL.md b/docs/APIReference-GraphQL.md new file mode 100644 index 00000000..3aea9e87 --- /dev/null +++ b/docs/APIReference-GraphQL.md @@ -0,0 +1,179 @@ +--- +title: graphql +layout: ../_core/GraphQLJSLayout +category: API Reference +permalink: /graphql-js/graphql/ +sublinks: graphql +next: /graphql-js/error/ +--- + +The `graphql` module exports a core subset of GraphQL functionality for creation +of GraphQL type systems and servers. + +```js +import { graphql } from 'graphql'; // ES6 +var { graphql } = require('graphql'); // CommonJS +``` + +## Overview + +_Entry Point_ + + + +_Schema_ + + + +_Type Definitions_ + + + +_Scalars_ + + + +_Errors_ + + + +## Entry Point + +### graphql + +```js +graphql( + schema: GraphQLSchema, + requestString: string, + rootValue?: ?any, + contextValue?: ?any, + variableValues?: ?{[key: string]: any}, + operationName?: ?string +): Promise +``` + +The `graphql` function lexes, parses, validates and executes a GraphQL request. +It requires a `schema` and a `requestString`. Optional arguments include a +`rootValue`, which will get passed as the root value to the executor, a `contextValue`, +which will get passed to all resolve functions, +`variableValues`, which will get passed to the executor to provide values for +any variables in `requestString`, and `operationName`, which allows the caller +to specify which operation in `requestString` will be run, in cases where +`requestString` contains multiple top-level operations. + +## Schema + +See the [Type System API Reference](../type#schema). + +## Type Definitions + +See the [Type System API Reference](../type#definitions). + +## Scalars + +See the [Type System API Reference](../type#scalars). + +## Errors + +See the [Errors API Reference](../error) diff --git a/docs/APIReference-Language.md b/docs/APIReference-Language.md new file mode 100644 index 00000000..4d430c37 --- /dev/null +++ b/docs/APIReference-Language.md @@ -0,0 +1,311 @@ +--- +title: graphql/language +layout: ../_core/GraphQLJSLayout +category: API Reference +permalink: /graphql-js/language/ +sublinks: BREAK,getLocation,Kind,lex,parse,parseValue,printSource,visit +next: /graphql-js/type/ +--- + +The `graphql/language` module is responsible for parsing and operating on the GraphQL language. You can import either from the `graphql/language` module, or from the root `graphql` module. For example: + +```js +import { Source } from 'graphql'; // ES6 +var { Source } = require('graphql'); // CommonJS +``` + +## Overview + +_Source_ + + + +_Lexer_ + + + +_Parser_ + + + +_Visitor_ + + + +_Printer_ + + + +## Source + +### Source + +```js +export class Source { + constructor(body: string, name?: string, locationOffset?: Location) +} + +type Location = { + line: number; + column: number; +} +``` + +A representation of source input to GraphQL. The `name` and `locationOffset` parameters are +optional, but they are useful for clients who store GraphQL documents in source files. +For example, if the GraphQL input starts at line 40 in a file named `Foo.graphql`, it might +be useful for `name` to be `"Foo.graphql"` and location to be `{ line: 40, column: 1 }`. +The `line` and `column` properties in `locationOffset` are 1-indexed. + +### getLocation + +```js +function getLocation(source: Source, position: number): SourceLocation + +type SourceLocation = { + line: number; + column: number; +} +``` + +Takes a Source and a UTF-8 character offset, and returns the corresponding +line and column as a SourceLocation. + +## Lexer + +### lex + +```js +function lex(source: Source): Lexer; + +type Lexer = (resetPosition?: number) => Token; + +export type Token = { + kind: number; + start: number; + end: number; + value: ?string; +}; +``` + +Given a Source object, this returns a Lexer for that source. +A Lexer is a function that acts as a generator in that every time +it is called, it returns the next token in the Source. Assuming the +source lexes, the final Token emitted by the lexer will be of kind +EOF, after which the lexer will repeatedly return EOF tokens whenever +called. + +The argument to the lexer function is optional and can be used to +rewind or fast forward the lexer to a new position in the source. + +## Parser + +### parse + +```js +export function parse( + source: Source | string, + options?: ParseOptions +): Document +``` + +Given a GraphQL source, parses it into a Document. + +Throws GraphQLError if a syntax error is encountered. + +### parseValue + +```js +export function parseValue( + source: Source | string, + options?: ParseOptions +): Value +``` + +Given a string containing a GraphQL value, parse the AST for that value. + +Throws GraphQLError if a syntax error is encountered. + +This is useful within tools that operate upon GraphQL Values directly and +in isolation of complete GraphQL documents. + +### Kind + +An enum that describes the different kinds of AST nodes. + +## Visitor + +### visit + +```js +function visit(root, visitor, keyMap) +``` + +visit() will walk through an AST using a depth-first traversal, calling +the visitor's enter function at each node in the traversal, and calling the +leave function after visiting that node and all of its child nodes. + +By returning different values from the enter and leave functions, the +behavior of the visitor can be altered, including skipping over a sub-tree of +the AST (by returning false), editing the AST by returning a value or null +to remove the value, or to stop the whole traversal by returning BREAK. + +When using visit() to edit an AST, the original AST will not be modified, and +a new version of the AST with the changes applied will be returned from the +visit function. + +```js +var editedAST = visit(ast, { + enter(node, key, parent, path, ancestors) { + // @return + // undefined: no action + // false: skip visiting this node + // visitor.BREAK: stop visiting altogether + // null: delete this node + // any value: replace this node with the returned value + }, + leave(node, key, parent, path, ancestors) { + // @return + // undefined: no action + // false: no action + // visitor.BREAK: stop visiting altogether + // null: delete this node + // any value: replace this node with the returned value + }, +}); +``` + +Alternatively to providing enter() and leave() functions, a visitor can +instead provide functions named the same as the kinds of AST nodes, or +enter/leave visitors at a named key, leading to four permutations of the +visitor API: + +1. Named visitors triggered when entering a node of a specific kind. + +```js +visit(ast, { + Kind(node) { + // enter the "Kind" node + }, +}); +``` + +2. Named visitors that trigger upon entering and leaving a node of + a specific kind. + +```js +visit(ast, { + Kind: { + enter(node) { + // enter the "Kind" node + } + leave(node) { + // leave the "Kind" node + } + } +}); +``` + +3. Generic visitors that trigger upon entering and leaving any node. + +```js +visit(ast, { + enter(node) { + // enter any node + }, + leave(node) { + // leave any node + }, +}); +``` + +4. Parallel visitors for entering and leaving nodes of a specific kind. + +```js +visit(ast, { + enter: { + Kind(node) { + // enter the "Kind" node + }, + }, + leave: { + Kind(node) { + // leave the "Kind" node + }, + }, +}); +``` + +### BREAK + +The sentinel `BREAK` value described in the documentation of `visitor`. + +## Printer + +### print + +```js +function print(ast): string +``` + +Converts an AST into a string, using one set of reasonable +formatting rules. diff --git a/docs/APIReference-TypeSystem.md b/docs/APIReference-TypeSystem.md new file mode 100644 index 00000000..5b5047c3 --- /dev/null +++ b/docs/APIReference-TypeSystem.md @@ -0,0 +1,667 @@ +--- +title: graphql/type +layout: ../_core/GraphQLJSLayout +category: API Reference +permalink: /graphql-js/type/ +sublinks: getNamedType,getNullableType,GraphQLBoolean,GraphQLEnumType,GraphQLFloat,GraphQLID,GraphQLInputObjectType,GraphQLInt,GraphQLInterfaceType,GraphQLList,GraphQLNonNull,GraphQLObjectType,GraphQLScalarType,GraphQLSchema,GraphQLString,GraphQLUnionType,isAbstractType,isCompositeType,isInputType,isLeafType,isOutputType +next: /graphql-js/utilities/ +--- + +The `graphql/type` module is responsible for defining GraphQL types and schema. You can import either from the `graphql/type` module, or from the root `graphql` module. For example: + +```js +import { GraphQLSchema } from 'graphql'; // ES6 +var { GraphQLSchema } = require('graphql'); // CommonJS +``` + +## Overview + +_Schema_ + + + +_Definitions_ + + + +_Predicates_ + + + +_Un-modifiers_ + + + +_Scalars_ + + + +## Schema + +### GraphQLSchema + +```js +class GraphQLSchema { + constructor(config: GraphQLSchemaConfig) +} + +type GraphQLSchemaConfig = { + query: GraphQLObjectType; + mutation?: ?GraphQLObjectType; +} +``` + +A Schema is created by supplying the root types of each type of operation, +query and mutation (optional). A schema definition is then supplied to the +validator and executor. + +#### Example + +```js +var MyAppSchema = new GraphQLSchema({ + query: MyAppQueryRootType + mutation: MyAppMutationRootType +}); +``` + +## Definitions + +### GraphQLScalarType + +```js +class GraphQLScalarType { + constructor(config: GraphQLScalarTypeConfig) +} + +type GraphQLScalarTypeConfig = { + name: string; + description?: ?string; + specifiedByURL?: string; + serialize: (value: mixed) => ?InternalType; + parseValue?: (value: mixed) => ?InternalType; + parseLiteral?: (valueAST: Value) => ?InternalType; +} +``` + +The leaf values of any request and input values to arguments are +Scalars (or Enums) and are defined with a name and a series of serialization +functions used to ensure validity. + +#### Example + +```js +var OddType = new GraphQLScalarType({ + name: 'Odd', + serialize: oddValue, + parseValue: oddValue, + parseLiteral(ast) { + if (ast.kind === Kind.INT) { + return oddValue(parseInt(ast.value, 10)); + } + return null; + }, +}); + +function oddValue(value) { + return value % 2 === 1 ? value : null; +} +``` + +### GraphQLObjectType + +```js +class GraphQLObjectType { + constructor(config: GraphQLObjectTypeConfig) +} + +type GraphQLObjectTypeConfig = { + name: string; + interfaces?: GraphQLInterfacesThunk | Array; + fields: GraphQLFieldConfigMapThunk | GraphQLFieldConfigMap; + isTypeOf?: (value: any, info?: GraphQLResolveInfo) => boolean; + description?: ?string +} + +type GraphQLInterfacesThunk = () => Array; + +type GraphQLFieldConfigMapThunk = () => GraphQLFieldConfigMap; + +// See below about resolver functions. +type GraphQLFieldResolveFn = ( + source?: any, + args?: {[argName: string]: any}, + context?: any, + info?: GraphQLResolveInfo +) => any + +type GraphQLResolveInfo = { + fieldName: string, + fieldNodes: Array, + returnType: GraphQLOutputType, + parentType: GraphQLCompositeType, + schema: GraphQLSchema, + fragments: { [fragmentName: string]: FragmentDefinition }, + rootValue: any, + operation: OperationDefinition, + variableValues: { [variableName: string]: any }, +} + +type GraphQLFieldConfig = { + type: GraphQLOutputType; + args?: GraphQLFieldConfigArgumentMap; + resolve?: GraphQLFieldResolveFn; + deprecationReason?: string; + description?: ?string; +} + +type GraphQLFieldConfigArgumentMap = { + [argName: string]: GraphQLArgumentConfig; +}; + +type GraphQLArgumentConfig = { + type: GraphQLInputType; + defaultValue?: any; + description?: ?string; +} + +type GraphQLFieldConfigMap = { + [fieldName: string]: GraphQLFieldConfig; +}; +``` + +Almost all of the GraphQL types you define will be object types. Object types +have a name, but most importantly describe their fields. + +When two types need to refer to each other, or a type needs to refer to +itself in a field, you can use a function expression (aka a closure or a +thunk) to supply the fields lazily. + +Note that resolver functions are provided the `source` object as the first parameter. +However, if a resolver function is not provided, then the default resolver is +used, which looks for a method on `source` of the same name as the field. If found, +the method is called with `(args, context, info)`. Since it is a method on `source`, +that value can always be referenced with `this`. + +#### Examples + +```js +var AddressType = new GraphQLObjectType({ + name: 'Address', + fields: { + street: { type: GraphQLString }, + number: { type: GraphQLInt }, + formatted: { + type: GraphQLString, + resolve(obj) { + return obj.number + ' ' + obj.street; + }, + }, + }, +}); + +var PersonType = new GraphQLObjectType({ + name: 'Person', + fields: () => ({ + name: { type: GraphQLString }, + bestFriend: { type: PersonType }, + }), +}); +``` + +### GraphQLInterfaceType + +```js +class GraphQLInterfaceType { + constructor(config: GraphQLInterfaceTypeConfig) +} + +type GraphQLInterfaceTypeConfig = { + name: string, + fields: GraphQLFieldConfigMapThunk | GraphQLFieldConfigMap, + resolveType?: (value: any, info?: GraphQLResolveInfo) => ?GraphQLObjectType, + description?: ?string +}; +``` + +When a field can return one of a heterogeneous set of types, a Interface type +is used to describe what types are possible, what fields are in common across +all types, as well as a function to determine which type is actually used +when the field is resolved. + +#### Example + +```js +var EntityType = new GraphQLInterfaceType({ + name: 'Entity', + fields: { + name: { type: GraphQLString }, + }, +}); +``` + +### GraphQLUnionType + +```js +class GraphQLUnionType { + constructor(config: GraphQLUnionTypeConfig) +} + +type GraphQLUnionTypeConfig = { + name: string, + types: GraphQLObjectsThunk | Array, + resolveType?: (value: any, info?: GraphQLResolveInfo) => ?GraphQLObjectType; + description?: ?string; +}; + +type GraphQLObjectsThunk = () => Array; +``` + +When a field can return one of a heterogeneous set of types, a Union type +is used to describe what types are possible as well as providing a function +to determine which type is actually used when the field is resolved. + +### Example + +```js +var PetType = new GraphQLUnionType({ + name: 'Pet', + types: [DogType, CatType], + resolveType(value) { + if (value instanceof Dog) { + return DogType; + } + if (value instanceof Cat) { + return CatType; + } + }, +}); +``` + +### GraphQLEnumType + +```js +class GraphQLEnumType { + constructor(config: GraphQLEnumTypeConfig) +} + +type GraphQLEnumTypeConfig = { + name: string; + values: GraphQLEnumValueConfigMap; + description?: ?string; +} + +type GraphQLEnumValueConfigMap = { + [valueName: string]: GraphQLEnumValueConfig; +}; + +type GraphQLEnumValueConfig = { + value?: any; + deprecationReason?: string; + description?: ?string; +} + +type GraphQLEnumValueDefinition = { + name: string; + value?: any; + deprecationReason?: string; + description?: ?string; +} +``` + +Some leaf values of requests and input values are Enums. GraphQL serializes +Enum values as strings, however internally Enums can be represented by any +kind of type, often integers. + +Note: If a value is not provided in a definition, the name of the enum value +will be used as its internal value. + +#### Example + +```js +var RGBType = new GraphQLEnumType({ + name: 'RGB', + values: { + RED: { value: 0 }, + GREEN: { value: 1 }, + BLUE: { value: 2 }, + }, +}); +``` + +### GraphQLInputObjectType + +```js +class GraphQLInputObjectType { + constructor(config: GraphQLInputObjectConfig) +} + +type GraphQLInputObjectConfig = { + name: string; + fields: GraphQLInputObjectConfigFieldMapThunk | GraphQLInputObjectConfigFieldMap; + description?: ?string; +} + +type GraphQLInputObjectConfigFieldMapThunk = () => GraphQLInputObjectConfigFieldMap; + +type GraphQLInputObjectFieldConfig = { + type: GraphQLInputType; + defaultValue?: any; + description?: ?string; +} + +type GraphQLInputObjectConfigFieldMap = { + [fieldName: string]: GraphQLInputObjectFieldConfig; +}; + +type GraphQLInputObjectField = { + name: string; + type: GraphQLInputType; + defaultValue?: any; + description?: ?string; +} + +type GraphQLInputObjectFieldMap = { + [fieldName: string]: GraphQLInputObjectField; +}; +``` + +An input object defines a structured collection of fields which may be +supplied to a field argument. + +Using `NonNull` will ensure that a value must be provided by the query + +#### Example + +```js +var GeoPoint = new GraphQLInputObjectType({ + name: 'GeoPoint', + fields: { + lat: { type: new GraphQLNonNull(GraphQLFloat) }, + lon: { type: new GraphQLNonNull(GraphQLFloat) }, + alt: { type: GraphQLFloat, defaultValue: 0 }, + }, +}); +``` + +### GraphQLList + +```js +class GraphQLList { + constructor(type: GraphQLType) +} +``` + +A list is a kind of type marker, a wrapping type which points to another +type. Lists are often created within the context of defining the fields of +an object type. + +#### Example + +```js +var PersonType = new GraphQLObjectType({ + name: 'Person', + fields: () => ({ + parents: { type: new GraphQLList(Person) }, + children: { type: new GraphQLList(Person) }, + }), +}); +``` + +### GraphQLNonNull + +```js +class GraphQLNonNull { + constructor(type: GraphQLType) +} +``` + +A non-null is a kind of type marker, a wrapping type which points to another +type. Non-null types enforce that their values are never null and can ensure +an error is raised if this ever occurs during a request. It is useful for +fields which you can make a strong guarantee on non-nullability, for example +usually the id field of a database row will never be null. + +#### Example + +```js +var RowType = new GraphQLObjectType({ + name: 'Row', + fields: () => ({ + id: { type: new GraphQLNonNull(String) }, + }), +}); +``` + +## Predicates + +### isInputType + +```js +function isInputType(type: ?GraphQLType): boolean +``` + +These types may be used as input types for arguments and directives. + +### isOutputType + +```js +function isOutputType(type: ?GraphQLType): boolean +``` + +These types may be used as output types as the result of fields + +### isLeafType + +```js +function isLeafType(type: ?GraphQLType): boolean +``` + +These types may describe types which may be leaf values + +### isCompositeType + +```js +function isCompositeType(type: ?GraphQLType): boolean +``` + +These types may describe the parent context of a selection set + +### isAbstractType + +```js +function isAbstractType(type: ?GraphQLType): boolean +``` + +These types may describe a combination of object types + +## Un-modifiers + +### getNullableType + +```js +function getNullableType(type: ?GraphQLType): ?GraphQLNullableType +``` + +If a given type is non-nullable, this strips the non-nullability and +returns the underlying type. + +### getNamedType + +```js +function getNamedType(type: ?GraphQLType): ?GraphQLNamedType +``` + +If a given type is non-nullable or a list, this repeated strips the +non-nullability and list wrappers and returns the underlying type. + +## Scalars + +### GraphQLInt + +```js +var GraphQLInt: GraphQLScalarType; +``` + +A `GraphQLScalarType` that represents an int. + +### GraphQLFloat + +```js +var GraphQLFloat: GraphQLScalarType; +``` + +A `GraphQLScalarType` that represents a float. + +### GraphQLString + +```js +var GraphQLString: GraphQLScalarType; +``` + +A `GraphQLScalarType` that represents a string. + +### GraphQLBoolean + +```js +var GraphQLBoolean: GraphQLScalarType; +``` + +A `GraphQLScalarType` that represents a boolean. + +### GraphQLID + +```js +var GraphQLID: GraphQLScalarType; +``` + +A `GraphQLScalarType` that represents an ID. diff --git a/docs/APIReference-Utilities.md b/docs/APIReference-Utilities.md new file mode 100644 index 00000000..a9455aad --- /dev/null +++ b/docs/APIReference-Utilities.md @@ -0,0 +1,266 @@ +--- +title: graphql/utilities +layout: ../_core/GraphQLJSLayout +category: API Reference +permalink: /graphql-js/utilities/ +sublinks: astFromValue,buildASTSchema,buildClientSchema,buildSchema,introspectionQuery,isValidJSValue,isValidLiteralValue,printIntrospectionSchema,printSchema,typeFromAST,TypeInfo +next: /graphql-js/validation/ +--- + +The `graphql/utilities` module contains common useful computations to use with +the GraphQL language and type objects. You can import either from the `graphql/utilities` module, or from the root `graphql` module. For example: + +```js +import { introspectionQuery } from 'graphql'; // ES6 +var { introspectionQuery } = require('graphql'); // CommonJS +``` + +## Overview + +_Introspection_ + + + +_Schema Language_ + + + +_Visitors_ + + + +_Value Validation_ + + + +## Introspection + +### getIntrospectionQuery + +```js +interface IntrospectionOptions { + // Whether to include descriptions in the introspection result. + // Default: true + descriptions?: boolean; + + // Whether to include `specifiedByUrl` in the introspection result. + // Default: false + specifiedByUrl?: boolean; + + // Whether to include `isRepeatable` flag on directives. + // Default: false + directiveIsRepeatable?: boolean; + + // Whether to include `description` field on schema. + // Default: false + schemaDescription?: boolean; +} + +function getIntrospectionQuery( + options: IntrospectionOptions +): string; +``` + +Build a GraphQL query that queries a server's introspection system for enough +information to reproduce that server's type system. + +### buildClientSchema + +```js +function buildClientSchema( + introspection: IntrospectionQuery +): GraphQLSchema +``` + +Build a GraphQLSchema for use by client tools. + +Given the result of a client running the introspection query, creates and +returns a GraphQLSchema instance which can be then used with all GraphQL.js +tools, but cannot be used to execute a query, as introspection does not +represent the "resolver", "parse" or "serialize" functions or any other +server-internal mechanisms. + +## Schema Representation + +### buildSchema + +```js +function buildSchema(source: string | Source): GraphQLSchema { +``` + +Creates a GraphQLSchema object from GraphQL schema language. The schema will use default resolvers. For more detail on the GraphQL schema language, see the [schema language docs](/learn/schema/) or this [schema language cheat sheet](https://wehavefaces.net/graphql-shorthand-notation-cheatsheet-17cd715861b6#.9oztv0a7n). + +### printSchema + +```js +function printSchema(schema: GraphQLSchema): string { +``` + +Prints the provided schema in the Schema Language format. + +### printIntrospectionSchema + +```js +function printIntrospectionSchema(schema: GraphQLSchema): string { +``` + +Prints the built-in introspection schema in the Schema Language format. + +### buildASTSchema + +```js +function buildASTSchema( + ast: SchemaDocument, + queryTypeName: string, + mutationTypeName: ?string +): GraphQLSchema +``` + +This takes the ast of a schema document produced by `parse` in +`graphql/language` and constructs a GraphQLSchema instance which can be +then used with all GraphQL.js tools, but cannot be used to execute a query, as +introspection does not represent the "resolver", "parse" or "serialize" +functions or any other server-internal mechanisms. + +### typeFromAST + +```js +function typeFromAST( + schema: GraphQLSchema, + inputTypeAST: Type +): ?GraphQLType +``` + +Given the name of a Type as it appears in a GraphQL AST and a Schema, return the +corresponding GraphQLType from that schema. + +### astFromValue + +```js +function astFromValue( + value: any, + type?: ?GraphQLType +): ?Value +``` + +Produces a GraphQL Input Value AST given a JavaScript value. + +Optionally, a GraphQL type may be provided, which will be used to +disambiguate between value primitives. + +## Visitors + +### TypeInfo + +```js +class TypeInfo { + constructor(schema: GraphQLSchema) + getType(): ?GraphQLOutputType { + getParentType(): ?GraphQLCompositeType { + getInputType(): ?GraphQLInputType { + getFieldDef(): ?GraphQLFieldDefinition { + getDirective(): ?GraphQLDirective { + getArgument(): ?GraphQLArgument { +} +``` + +TypeInfo is a utility class which, given a GraphQL schema, can keep track +of the current field and type definitions at any point in a GraphQL document +AST during a recursive descent by calling `enter(node)` and `leave(node)`. + +## Value Validation + +### isValidJSValue + +```js +function isValidJSValue(value: any, type: GraphQLInputType): string[] +``` + +Given a JavaScript value and a GraphQL type, determine if the value will be +accepted for that type. This is primarily useful for validating the +runtime values of query variables. + +### isValidLiteralValue + +```js +function isValidLiteralValue( + type: GraphQLInputType, + valueAST: Value +): string[] +``` + +Utility for validators which determines if a value literal AST is valid given +an input type. + +Note that this only validates literal values, variables are assumed to +provide values of the correct type. diff --git a/docs/APIReference-Validation.md b/docs/APIReference-Validation.md new file mode 100644 index 00000000..e9c28ebb --- /dev/null +++ b/docs/APIReference-Validation.md @@ -0,0 +1,68 @@ +--- +title: graphql/validation +layout: ../_core/GraphQLJSLayout +category: API Reference +permalink: /graphql-js/validation/ +sublinks: specifiedRules,validate +--- + +The `graphql/validation` module fulfills the Validation phase of fulfilling a +GraphQL result. You can import either from the `graphql/validation` module, or from the root `graphql` module. For example: + +```js +import { validate } from 'graphql/validation'; // ES6 +var { validate } = require('graphql/validation'); // CommonJS +``` + +## Overview + + + +## Validation + +### validate + +```js +function validate( + schema: GraphQLSchema, + ast: Document, + rules?: Array +): Array +``` + +Implements the "Validation" section of the spec. + +Validation runs synchronously, returning an array of encountered errors, or +an empty array if no errors were encountered and the document is valid. + +A list of specific validation rules may be provided. If not provided, the +default list of rules defined by the GraphQL specification will be used. + +Each validation rules is a function which returns a visitor +(see the language/visitor API). Visitor methods are expected to return +GraphQLErrors, or Arrays of GraphQLErrors when invalid. + +Visitors can also supply `visitSpreadFragments: true` which will alter the +behavior of the visitor to skip over top level defined fragments, and instead +visit those fragments at every point a spread is encountered. + +### specifiedRules + +```js +var specifiedRules: Array<(context: ValidationContext): any> +``` + +This set includes all validation rules defined by the GraphQL spec diff --git a/docs/Guides-ConstructingTypes.md b/docs/Guides-ConstructingTypes.md new file mode 100644 index 00000000..e8737c33 --- /dev/null +++ b/docs/Guides-ConstructingTypes.md @@ -0,0 +1,125 @@ +--- +title: Constructing Types +layout: ../_core/GraphQLJSLayout +category: Advanced Guides +permalink: /graphql-js/constructing-types/ +next: /graphql-js/express-graphql/ +--- + +For many apps, you can define a fixed schema when the application starts, and define it using GraphQL schema language. In some cases, it's useful to construct a schema programmatically. You can do this using the `GraphQLSchema` constructor. + +When you are using the `GraphQLSchema` constructor to create a schema, instead of defining `Query` and `Mutation` types solely using schema language, you create them as separate object types. + +For example, let's say we are building a simple API that lets you fetch user data for a few hardcoded users based on an id. Using `buildSchema` we could write a server with: + +```js +var express = require('express'); +var { graphqlHTTP } = require('express-graphql'); +var { buildSchema } = require('graphql'); + +var schema = buildSchema(` + type User { + id: String + name: String + } + + type Query { + user(id: String): User + } +`); + +// Maps id to User object +var fakeDatabase = { + a: { + id: 'a', + name: 'alice', + }, + b: { + id: 'b', + name: 'bob', + }, +}; + +var root = { + user: function ({ id }) { + return fakeDatabase[id]; + }, +}; + +var app = express(); +app.use( + '/graphql', + graphqlHTTP({ + schema: schema, + rootValue: root, + graphiql: true, + }), +); +app.listen(4000, () => { + console.log('Running a GraphQL API server at localhost:4000/graphql'); +}); +``` + +We can implement this same API without using GraphQL schema language: + +```js +var express = require('express'); +var { graphqlHTTP } = require('express-graphql'); +var graphql = require('graphql'); + +// Maps id to User object +var fakeDatabase = { + a: { + id: 'a', + name: 'alice', + }, + b: { + id: 'b', + name: 'bob', + }, +}; + +// Define the User type +var userType = new graphql.GraphQLObjectType({ + name: 'User', + fields: { + id: { type: graphql.GraphQLString }, + name: { type: graphql.GraphQLString }, + }, +}); + +// Define the Query type +var queryType = new graphql.GraphQLObjectType({ + name: 'Query', + fields: { + user: { + type: userType, + // `args` describes the arguments that the `user` query accepts + args: { + id: { type: graphql.GraphQLString }, + }, + resolve: function (_, { id }) { + return fakeDatabase[id]; + }, + }, + }, +}); + +var schema = new graphql.GraphQLSchema({ query: queryType }); + +var app = express(); +app.use( + '/graphql', + graphqlHTTP({ + schema: schema, + graphiql: true, + }), +); +app.listen(4000, () => { + console.log('Running a GraphQL API server at localhost:4000/graphql'); +}); +``` + +When we use this method of creating the API, the root level resolvers are implemented on the `Query` and `Mutation` types rather than on a `root` object. + +This is particularly useful if you want to create a GraphQL schema automatically from something else, like a database schema. You might have a common format for something like creating and updating database records. This is also useful for implementing features like union types which don't map cleanly to ES6 classes and schema language. diff --git a/docs/Tutorial-Authentication.md b/docs/Tutorial-Authentication.md new file mode 100644 index 00000000..28376bc1 --- /dev/null +++ b/docs/Tutorial-Authentication.md @@ -0,0 +1,57 @@ +--- +title: Authentication and Express Middleware +sidebarTitle: Authentication & Middleware +layout: ../_core/GraphQLJSLayout +category: GraphQL.js Tutorial +permalink: /graphql-js/authentication-and-express-middleware/ +next: /graphql-js/constructing-types/ +--- + +It's simple to use any Express middleware in conjunction with `express-graphql`. In particular, this is a great pattern for handling authentication. + +To use middleware with a GraphQL resolver, just use the middleware like you would with a normal Express app. The `request` object is then available as the second argument in any resolver. + +For example, let's say we wanted our server to log the IP address of every request, and we also want to write an API that returns the IP address of the caller. We can do the former with middleware, and the latter by accessing the `request` object in a resolver. Here's server code that implements this: + +```js +var express = require('express'); +var { graphqlHTTP } = require('express-graphql'); +var { buildSchema } = require('graphql'); + +var schema = buildSchema(` + type Query { + ip: String + } +`); + +function loggingMiddleware(req, res, next) { + console.log('ip:', req.ip); + next(); +} + +var root = { + ip: function (args, request) { + return request.ip; + }, +}; + +var app = express(); +app.use(loggingMiddleware); +app.use( + '/graphql', + graphqlHTTP({ + schema: schema, + rootValue: root, + graphiql: true, + }), +); +app.listen(4000, () => { + console.log('Running a GraphQL API server at localhost:4000/graphql'); +}); +``` + +In a REST API, authentication is often handled with a header, that contains an auth token which proves what user is making this request. Express middleware processes these headers and puts authentication data on the Express `request` object. Some middleware modules that handle authentication like this are [Passport](http://passportjs.org/), [express-jwt](https://github.com/auth0/express-jwt), and [express-session](https://github.com/expressjs/session). Each of these modules works with `express-graphql`. + +If you aren't familiar with any of these authentication mechanisms, we recommend using `express-jwt` because it's simple without sacrificing any future flexibility. + +If you've read through the docs linearly to get to this point, congratulations! You now know everything you need to build a practical GraphQL API server. diff --git a/docs/Tutorial-BasicTypes.md b/docs/Tutorial-BasicTypes.md new file mode 100644 index 00000000..2367b7d3 --- /dev/null +++ b/docs/Tutorial-BasicTypes.md @@ -0,0 +1,62 @@ +--- +title: Basic Types +layout: ../_core/GraphQLJSLayout +category: GraphQL.js Tutorial +permalink: /graphql-js/basic-types/ +next: /graphql-js/passing-arguments/ +--- + +In most situations, all you need to do is to specify the types for your API using the GraphQL schema language, taken as an argument to the `buildSchema` function. + +The GraphQL schema language supports the scalar types of `String`, `Int`, `Float`, `Boolean`, and `ID`, so you can use these directly in the schema you pass to `buildSchema`. + +By default, every type is nullable - it's legitimate to return `null` as any of the scalar types. Use an exclamation point to indicate a type cannot be nullable, so `String!` is a non-nullable string. + +To use a list type, surround the type in square brackets, so `[Int]` is a list of integers. + +Each of these types maps straightforwardly to JavaScript, so you can just return plain old JavaScript objects in APIs that return these types. Here's an example that shows how to use some of these basic types: + +```js +var express = require('express'); +var { graphqlHTTP } = require('express-graphql'); +var { buildSchema } = require('graphql'); + +// Construct a schema, using GraphQL schema language +var schema = buildSchema(` + type Query { + quoteOfTheDay: String + random: Float! + rollThreeDice: [Int] + } +`); + +// The root provides a resolver function for each API endpoint +var root = { + quoteOfTheDay: () => { + return Math.random() < 0.5 ? 'Take it easy' : 'Salvation lies within'; + }, + random: () => { + return Math.random(); + }, + rollThreeDice: () => { + return [1, 2, 3].map((_) => 1 + Math.floor(Math.random() * 6)); + }, +}; + +var app = express(); +app.use( + '/graphql', + graphqlHTTP({ + schema: schema, + rootValue: root, + graphiql: true, + }), +); +app.listen(4000, () => { + console.log('Running a GraphQL API server at localhost:4000/graphql'); +}); +``` + +If you run this code with `node server.js` and browse to http://localhost:4000/graphql you can try out these APIs. + +These examples show you how to call APIs that return different types. To send different types of data into an API, you will also need to learn about [passing arguments to a GraphQL API](/graphql-js/passing-arguments/). diff --git a/docs/Tutorial-ExpressGraphQL.md b/docs/Tutorial-ExpressGraphQL.md new file mode 100644 index 00000000..69b49c0a --- /dev/null +++ b/docs/Tutorial-ExpressGraphQL.md @@ -0,0 +1,63 @@ +--- +title: Running an Express GraphQL Server +sidebarTitle: Running Express + GraphQL +layout: ../_core/GraphQLJSLayout +category: GraphQL.js Tutorial +permalink: /graphql-js/running-an-express-graphql-server/ +next: /graphql-js/graphql-clients/ +--- + +The simplest way to run a GraphQL API server is to use [Express](https://expressjs.com), a popular web application framework for Node.js. You will need to install two additional dependencies: + +```bash +npm install express express-graphql graphql --save +``` + +Let's modify our “hello world” example so that it's an API server rather than a script that runs a single query. We can use the 'express' module to run a webserver, and instead of executing a query directly with the `graphql` function, we can use the `express-graphql` library to mount a GraphQL API server on the “/graphql” HTTP endpoint: + +```js +var express = require('express'); +var { graphqlHTTP } = require('express-graphql'); +var { buildSchema } = require('graphql'); + +// Construct a schema, using GraphQL schema language +var schema = buildSchema(` + type Query { + hello: String + } +`); + +// The root provides a resolver function for each API endpoint +var root = { + hello: () => { + return 'Hello world!'; + }, +}; + +var app = express(); +app.use( + '/graphql', + graphqlHTTP({ + schema: schema, + rootValue: root, + graphiql: true, + }), +); +app.listen(4000, () => { + console.log('Running a GraphQL API server at localhost:4000/graphql'); +}); +``` + +You can run this GraphQL server with: + +```bash +node server.js +``` + +Since we configured `graphqlHTTP` with `graphiql: true`, you can use the GraphiQL tool to manually issue GraphQL queries. If you navigate in a web browser to `http://localhost:4000/graphql`, you should see an interface that lets you enter queries. It should look like: + +![hello world graphql example](/img/hello.png) + +This screen shot shows the GraphQL query `{ hello }` being issued and giving a result of `{ data: { hello: 'Hello world!' } }`. GraphiQL is a great tool for debugging and inspecting a server, so we recommend running it whenever your application is in development mode. + +At this point you have learned how to run a GraphQL server and how to use GraphiQL interface to issue queries. The next step is to learn how to [issue GraphQL queries from client code](/graphql-js/graphql-clients/). diff --git a/docs/Tutorial-GettingStarted.md b/docs/Tutorial-GettingStarted.md new file mode 100644 index 00000000..19c4cfb1 --- /dev/null +++ b/docs/Tutorial-GettingStarted.md @@ -0,0 +1,66 @@ +--- +title: Getting Started With GraphQL.js +sidebarTitle: Getting Started +layout: ../_core/GraphQLJSLayout +category: GraphQL.js Tutorial +permalink: /graphql-js/ +next: /graphql-js/running-an-express-graphql-server/ +--- + +## Prerequisites + +Before getting started, you should have Node v6 installed, although the examples should mostly work in previous versions of Node as well. For this guide, we won't use any language features that require transpilation, but we will use some ES6 features like [Promises](http://www.html5rocks.com/en/tutorials/es6/promises/), [classes](http://javascriptplayground.com/blog/2014/07/introduction-to-es6-classes-tutorial/), and [fat arrow functions](https://strongloop.com/strongblog/an-introduction-to-javascript-es6-arrow-functions/), so if you aren't familiar with them you might want to read up on them first. + +To create a new project and install GraphQL.js in your current directory: + +```bash +npm init +npm install graphql --save +``` + +## Writing Code + +To handle GraphQL queries, we need a schema that defines the `Query` type, and we need an API root with a function called a “resolver” for each API endpoint. For an API that just returns “Hello world!”, we can put this code in a file named `server.js`: + +```js +var { graphql, buildSchema } = require('graphql'); + +// Construct a schema, using GraphQL schema language +var schema = buildSchema(` + type Query { + hello: String + } +`); + +// The root provides a resolver function for each API endpoint +var root = { + hello: () => { + return 'Hello world!'; + }, +}; + +// Run the GraphQL query '{ hello }' and print out the response +graphql(schema, '{ hello }', root).then((response) => { + console.log(response); +}); +``` + +If you run this with: + +```bash +node server.js +``` + +You should see the GraphQL response printed out: + +```js +{ + data: { + hello: 'Hello world!'; + } +} +``` + +Congratulations - you just executed a GraphQL query! + +For practical applications, you'll probably want to run GraphQL queries from an API server, rather than executing GraphQL with a command line tool. To use GraphQL for an API server over HTTP, check out [Running an Express GraphQL Server](/graphql-js/running-an-express-graphql-server/). diff --git a/docs/Tutorial-GraphQLClients.md b/docs/Tutorial-GraphQLClients.md new file mode 100644 index 00000000..578a0d8f --- /dev/null +++ b/docs/Tutorial-GraphQLClients.md @@ -0,0 +1,87 @@ +--- +title: GraphQL Clients +layout: ../_core/GraphQLJSLayout +category: GraphQL.js Tutorial +permalink: /graphql-js/graphql-clients/ +next: /graphql-js/basic-types/ +--- + +Since a GraphQL API has more underlying structure than a REST API, there are more powerful clients like [Relay](https://facebook.github.io/relay/) which can automatically handle batching, caching, and other features. But you don't need a complex client to call a GraphQL server. With `express-graphql`, you can just send an HTTP POST request to the endpoint you mounted your GraphQL server on, passing the GraphQL query as the `query` field in a JSON payload. + +For example, let's say we mounted a GraphQL server on http://localhost:4000/graphql as in the example code for [running an Express GraphQL server](/graphql-js/running-an-express-graphql-server/), and we want to send the GraphQL query `{ hello }`. We can do this from the command line with `curl`. If you paste this into a terminal: + +```bash +curl -X POST \ +-H "Content-Type: application/json" \ +-d '{"query": "{ hello }"}' \ +http://localhost:4000/graphql +``` + +You should see the output returned as JSON: + +``` +{"data":{"hello":"Hello world!"}} +``` + +If you prefer to use a graphical user interface to send a test query, you can use clients such as [GraphiQL](https://github.com/graphql/graphiql) and [Insomnia](https://github.com/getinsomnia/insomnia). + +It's also simple to send GraphQL from the browser. Open up http://localhost:4000, open a developer console, and paste in: + +```js +fetch('/graphql', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + Accept: 'application/json', + }, + body: JSON.stringify({ query: '{ hello }' }), +}) + .then((r) => r.json()) + .then((data) => console.log('data returned:', data)); +``` + +You should see the data returned, logged in the console: + +``` +data returned: Object { hello: "Hello world!" } +``` + +In this example, the query was just a hardcoded string. As your application becomes more complex, and you add GraphQL endpoints that take arguments as described in [Passing Arguments](/graphql-js/passing-arguments/), you will want to construct GraphQL queries using variables in client code. You can do this by including a keyword prefixed with a dollar sign in the query, and passing an extra `variables` field on the payload. + +For example, let's say you're running the example server from [Passing Arguments](/graphql-js/passing-arguments/) that has a schema of + +```graphql +type Query { + rollDice(numDice: Int!, numSides: Int): [Int] +} +``` + +You could access this from JavaScript with the code: + +```js +var dice = 3; +var sides = 6; +var query = `query RollDice($dice: Int!, $sides: Int) { + rollDice(numDice: $dice, numSides: $sides) +}`; + +fetch('/graphql', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + Accept: 'application/json', + }, + body: JSON.stringify({ + query, + variables: { dice, sides }, + }), +}) + .then((r) => r.json()) + .then((data) => console.log('data returned:', data)); +``` + +Using this syntax for variables is a good idea because it automatically prevents bugs due to escaping, and it makes it easier to monitor your server. + +In general, it will take a bit more time to set up a GraphQL client like Relay, but it's worth it to get more features as your application grows. You might want to start out just using HTTP requests as the underlying transport layer, and switching to a more complex client as your application gets more complex. + +At this point you can write a client and server in GraphQL for an API that receives a single string. To do more, you will want to [learn how to use the other basic data types](/graphql-js/basic-types/). diff --git a/docs/Tutorial-Mutations.md b/docs/Tutorial-Mutations.md new file mode 100644 index 00000000..4b19fc0e --- /dev/null +++ b/docs/Tutorial-Mutations.md @@ -0,0 +1,193 @@ +--- +title: Mutations and Input Types +layout: ../_core/GraphQLJSLayout +category: GraphQL.js Tutorial +permalink: /graphql-js/mutations-and-input-types/ +next: /graphql-js/authentication-and-express-middleware/ +--- + +If you have an API endpoint that alters data, like inserting data into a database or altering data already in a database, you should make this endpoint a `Mutation` rather than a `Query`. This is as simple as making the API endpoint part of the top-level `Mutation` type instead of the top-level `Query` type. + +Let's say we have a “message of the day” server, where anyone can update the message of the day, and anyone can read the current one. The GraphQL schema for this is simply: + +```graphql +type Mutation { + setMessage(message: String): String +} + +type Query { + getMessage: String +} +``` + +It's often convenient to have a mutation that maps to a database create or update operation, like `setMessage`, return the same thing that the server stored. That way, if you modify the data on the server, the client can learn about those modifications. + +Both mutations and queries can be handled by root resolvers, so the root that implements this schema can simply be: + +```js +var fakeDatabase = {}; +var root = { + setMessage: function ({ message }) { + fakeDatabase.message = message; + return message; + }, + getMessage: function () { + return fakeDatabase.message; + }, +}; +``` + +You don't need anything more than this to implement mutations. But in many cases, you will find a number of different mutations that all accept the same input parameters. A common example is that creating an object in a database and updating an object in a database often take the same parameters. To make your schema simpler, you can use “input types” for this, by using the `input` keyword instead of the `type` keyword. + +For example, instead of a single message of the day, let's say we have many messages, indexed in a database by the `id` field, and each message has both a `content` string and an `author` string. We want a mutation API both for creating a new message and for updating an old message. We could use the schema: + +```graphql +input MessageInput { + content: String + author: String +} + +type Message { + id: ID! + content: String + author: String +} + +type Query { + getMessage(id: ID!): Message +} + +type Mutation { + createMessage(input: MessageInput): Message + updateMessage(id: ID!, input: MessageInput): Message +} +``` + +Here, the mutations return a `Message` type, so that the client can get more information about the newly-modified `Message` in the same request as the request that mutates it. + +Input types can't have fields that are other objects, only basic scalar types, list types, and other input types. + +Naming input types with `Input` on the end is a useful convention, because you will often want both an input type and an output type that are slightly different for a single conceptual object. + +Here's some runnable code that implements this schema, keeping the data in memory: + +```js +var express = require('express'); +var { graphqlHTTP } = require('express-graphql'); +var { buildSchema } = require('graphql'); + +// Construct a schema, using GraphQL schema language +var schema = buildSchema(` + input MessageInput { + content: String + author: String + } + + type Message { + id: ID! + content: String + author: String + } + + type Query { + getMessage(id: ID!): Message + } + + type Mutation { + createMessage(input: MessageInput): Message + updateMessage(id: ID!, input: MessageInput): Message + } +`); + +// If Message had any complex fields, we'd put them on this object. +class Message { + constructor(id, { content, author }) { + this.id = id; + this.content = content; + this.author = author; + } +} + +// Maps username to content +var fakeDatabase = {}; + +var root = { + getMessage: function ({ id }) { + if (!fakeDatabase[id]) { + throw new Error('no message exists with id ' + id); + } + return new Message(id, fakeDatabase[id]); + }, + createMessage: function ({ input }) { + // Create a random id for our "database". + var id = require('crypto').randomBytes(10).toString('hex'); + + fakeDatabase[id] = input; + return new Message(id, input); + }, + updateMessage: function ({ id, input }) { + if (!fakeDatabase[id]) { + throw new Error('no message exists with id ' + id); + } + // This replaces all old data, but some apps might want partial update. + fakeDatabase[id] = input; + return new Message(id, input); + }, +}; + +var app = express(); +app.use( + '/graphql', + graphqlHTTP({ + schema: schema, + rootValue: root, + graphiql: true, + }), +); +app.listen(4000, () => { + console.log('Running a GraphQL API server at localhost:4000/graphql'); +}); +``` + +To call a mutation, you must use the keyword `mutation` before your GraphQL query. To pass an input type, provide the data written as if it's a JSON object. For example, with the server defined above, you can create a new message and return the `id` of the new message with this operation: + +```graphql +mutation { + createMessage(input: { author: "andy", content: "hope is a good thing" }) { + id + } +} +``` + +You can use variables to simplify mutation client logic just like you can with queries. For example, some JavaScript code that calls the server to execute this mutation is: + +```js +var author = 'andy'; +var content = 'hope is a good thing'; +var query = `mutation CreateMessage($input: MessageInput) { + createMessage(input: $input) { + id + } +}`; + +fetch('/graphql', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + Accept: 'application/json', + }, + body: JSON.stringify({ + query, + variables: { + input: { + author, + content, + }, + }, + }), +}) + .then((r) => r.json()) + .then((data) => console.log('data returned:', data)); +``` + +One particular type of mutation is operations that change users, like signing up a new user. While you can implement this using GraphQL mutations, you can reuse many existing libraries if you learn about [GraphQL with authentication and Express middleware](/graphql-js/authentication-and-express-middleware/). diff --git a/docs/Tutorial-ObjectTypes.md b/docs/Tutorial-ObjectTypes.md new file mode 100644 index 00000000..246aa67a --- /dev/null +++ b/docs/Tutorial-ObjectTypes.md @@ -0,0 +1,148 @@ +--- +title: Object Types +layout: ../_core/GraphQLJSLayout +category: GraphQL.js Tutorial +permalink: /graphql-js/object-types/ +next: /graphql-js/mutations-and-input-types/ +--- + +In many cases, you don't want to return a number or a string from an API. You want to return an object that has its own complex behavior. GraphQL is a perfect fit for this. + +In GraphQL schema language, the way you define a new object type is the same way we have been defining the `Query` type in our examples. Each object can have fields that return a particular type, and methods that take arguments. For example, in the [Passing Arguments](/graphql-js/passing-arguments/) documentation, we had a method to roll some random dice: + +```graphql +type Query { + rollDice(numDice: Int!, numSides: Int): [Int] +} +``` + +If we wanted to have more and more methods based on a random die over time, we could implement this with a `RandomDie` object type instead. + +```graphql +type RandomDie { + roll(numRolls: Int!): [Int] +} + +type Query { + getDie(numSides: Int): RandomDie +} +``` + +Instead of a root-level resolver for the `RandomDie` type, we can instead use an ES6 class, where the resolvers are instance methods. This code shows how the `RandomDie` schema above can be implemented: + +```js +class RandomDie { + constructor(numSides) { + this.numSides = numSides; + } + + rollOnce() { + return 1 + Math.floor(Math.random() * this.numSides); + } + + roll({ numRolls }) { + var output = []; + for (var i = 0; i < numRolls; i++) { + output.push(this.rollOnce()); + } + return output; + } +} + +var root = { + getDie: function ({ numSides }) { + return new RandomDie(numSides || 6); + }, +}; +``` + +For fields that don't use any arguments, you can use either properties on the object or instance methods. So for the example code above, both `numSides` and `rollOnce` can actually be used to implement GraphQL fields, so that code also implements the schema of: + +```graphql +type RandomDie { + numSides: Int! + rollOnce: Int! + roll(numRolls: Int!): [Int] +} + +type Query { + getDie(numSides: Int): RandomDie +} +``` + +Putting this all together, here is some sample code that runs a server with this GraphQL API: + +```js +var express = require('express'); +var { graphqlHTTP } = require('express-graphql'); +var { buildSchema } = require('graphql'); + +// Construct a schema, using GraphQL schema language +var schema = buildSchema(` + type RandomDie { + numSides: Int! + rollOnce: Int! + roll(numRolls: Int!): [Int] + } + + type Query { + getDie(numSides: Int): RandomDie + } +`); + +// This class implements the RandomDie GraphQL type +class RandomDie { + constructor(numSides) { + this.numSides = numSides; + } + + rollOnce() { + return 1 + Math.floor(Math.random() * this.numSides); + } + + roll({ numRolls }) { + var output = []; + for (var i = 0; i < numRolls; i++) { + output.push(this.rollOnce()); + } + return output; + } +} + +// The root provides the top-level API endpoints +var root = { + getDie: function ({ numSides }) { + return new RandomDie(numSides || 6); + }, +}; + +var app = express(); +app.use( + '/graphql', + graphqlHTTP({ + schema: schema, + rootValue: root, + graphiql: true, + }), +); +app.listen(4000, () => { + console.log('Running a GraphQL API server at localhost:4000/graphql'); +}); +``` + +When you issue a GraphQL query against an API that returns object types, you can call multiple methods on the object at once by nesting the GraphQL field names. For example, if you wanted to call both `rollOnce` to roll a die once, and `roll` to roll a die three times, you could do it with this query: + +```graphql +{ + getDie(numSides: 6) { + rollOnce + roll(numRolls: 3) + } +} +``` + +If you run this code with `node server.js` and browse to http://localhost:4000/graphql you can try out these APIs with GraphiQL. + +This way of defining object types often provides advantages over a traditional REST API. Instead of doing one API request to get basic information about an object, and then multiple subsequent API requests to find out more information about that object, you can get all of that information in one API request. That saves bandwidth, makes your app run faster, and simplifies your client-side logic. + +So far, every API we've looked at is designed for returning data. In order to modify stored data or handle complex input, it helps to [learn about mutations and input types](/graphql-js/mutations-and-input-types/). diff --git a/docs/Tutorial-PassingArguments.md b/docs/Tutorial-PassingArguments.md new file mode 100644 index 00000000..df8fda9e --- /dev/null +++ b/docs/Tutorial-PassingArguments.md @@ -0,0 +1,134 @@ +--- +title: Passing Arguments +layout: ../_core/GraphQLJSLayout +category: GraphQL.js Tutorial +permalink: /graphql-js/passing-arguments/ +next: /graphql-js/object-types/ +--- + +Just like a REST API, it's common to pass arguments to an endpoint in a GraphQL API. By defining the arguments in the schema language, type checking happens automatically. Each argument must be named and have a type. For example, in the [Basic Types documentation](/graphql-js/basic-types/) we had an endpoint called `rollThreeDice`: + +```graphql +type Query { + rollThreeDice: [Int] +} +``` + +Instead of hard-coding “three”, we might want a more general function that rolls `numDice` dice, each of which have `numSides` sides. We can add arguments to the GraphQL schema language like this: + +```graphql +type Query { + rollDice(numDice: Int!, numSides: Int): [Int] +} +``` + +The exclamation point in `Int!` indicates that `numDice` can't be null, which means we can skip a bit of validation logic to make our server code simpler. We can let `numSides` be null and assume that by default a die has 6 sides. + +So far, our resolver functions took no arguments. When a resolver takes arguments, they are passed as one “args” object, as the first argument to the function. So rollDice could be implemented as: + +```js +var root = { + rollDice: function (args) { + var output = []; + for (var i = 0; i < args.numDice; i++) { + output.push(1 + Math.floor(Math.random() * (args.numSides || 6))); + } + return output; + }, +}; +``` + +It's convenient to use [ES6 destructuring assignment](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) for these parameters, since you know what format they will be. So we can also write `rollDice` as + +```js +var root = { + rollDice: function ({ numDice, numSides }) { + var output = []; + for (var i = 0; i < numDice; i++) { + output.push(1 + Math.floor(Math.random() * (numSides || 6))); + } + return output; + }, +}; +``` + +If you're familiar with destructuring, this is a bit nicer because the line of code where `rollDice` is defined tells you about what the arguments are. + +The entire code for a server that hosts this `rollDice` API is: + +```js +var express = require('express'); +var { graphqlHTTP } = require('express-graphql'); +var { buildSchema } = require('graphql'); + +// Construct a schema, using GraphQL schema language +var schema = buildSchema(` + type Query { + rollDice(numDice: Int!, numSides: Int): [Int] + } +`); + +// The root provides a resolver function for each API endpoint +var root = { + rollDice: function ({ numDice, numSides }) { + var output = []; + for (var i = 0; i < numDice; i++) { + output.push(1 + Math.floor(Math.random() * (numSides || 6))); + } + return output; + }, +}; + +var app = express(); +app.use( + '/graphql', + graphqlHTTP({ + schema: schema, + rootValue: root, + graphiql: true, + }), +); +app.listen(4000, () => { + console.log('Running a GraphQL API server at localhost:4000/graphql'); +}); +``` + +When you call this API, you have to pass each argument by name. So for the server above, you could issue this GraphQL query to roll three six-sided dice: + +```graphql +{ + rollDice(numDice: 3, numSides: 6) +} +``` + +If you run this code with `node server.js` and browse to http://localhost:4000/graphql you can try out this API. + +When you're passing arguments in code, it's generally better to avoid constructing the whole query string yourself. Instead, you can use `$` syntax to define variables in your query, and pass the variables as a separate map. + +For example, some JavaScript code that calls our server above is: + +```js +var dice = 3; +var sides = 6; +var query = `query RollDice($dice: Int!, $sides: Int) { + rollDice(numDice: $dice, numSides: $sides) +}`; + +fetch('/graphql', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + Accept: 'application/json', + }, + body: JSON.stringify({ + query, + variables: { dice, sides }, + }), +}) + .then((r) => r.json()) + .then((data) => console.log('data returned:', data)); +``` + +Using `$dice` and `$sides` as variables in GraphQL means we don't have to worry about escaping on the client side. + +With basic types and argument passing, you can implement anything you can implement in a REST API. But GraphQL supports even more powerful queries. You can replace multiple API calls with a single API call if you learn how to [define your own object types](/graphql-js/object-types/). diff --git a/integrationTests/README.md b/integrationTests/README.md new file mode 100644 index 00000000..70644910 --- /dev/null +++ b/integrationTests/README.md @@ -0,0 +1 @@ +# TBD diff --git a/integrationTests/integration-test.js b/integrationTests/integration-test.js new file mode 100644 index 00000000..91d1575b --- /dev/null +++ b/integrationTests/integration-test.js @@ -0,0 +1,49 @@ +'use strict'; + +const os = require('os'); +const fs = require('fs'); +const path = require('path'); +const childProcess = require('child_process'); + +const { describe, it } = require('mocha'); + +function exec(command, options = {}) { + const output = childProcess.execSync(command, { + encoding: 'utf-8', + ...options, + }); + return output && output.trimEnd(); +} + +describe('Integration Tests', () => { + const tmpDir = path.join(os.tmpdir(), 'graphql-js-integrationTmp'); + fs.rmSync(tmpDir, { recursive: true, force: true }); + fs.mkdirSync(tmpDir); + + const distDir = path.resolve('./npmDist'); + const archiveName = exec(`npm --quiet pack ${distDir}`, { cwd: tmpDir }); + fs.renameSync( + path.join(tmpDir, archiveName), + path.join(tmpDir, 'graphql.tgz'), + ); + + function testOnNodeProject(projectName) { + const projectPath = path.join(__dirname, projectName); + + const packageJSONPath = path.join(projectPath, 'package.json'); + const packageJSON = JSON.parse(fs.readFileSync(packageJSONPath, 'utf-8')); + + it(packageJSON.description, () => { + exec(`cp -R ${projectPath} ${tmpDir}`); + + const cwd = path.join(tmpDir, projectName); + // TODO: figure out a way to run it with --ignore-scripts + exec('npm --quiet install', { cwd, stdio: 'inherit' }); + exec('npm --quiet test', { cwd, stdio: 'inherit' }); + }).timeout(60000); + } + + testOnNodeProject('ts'); + testOnNodeProject('node'); + testOnNodeProject('webpack'); +}); diff --git a/integrationTests/node/index.js b/integrationTests/node/index.js new file mode 100644 index 00000000..4815fe52 --- /dev/null +++ b/integrationTests/node/index.js @@ -0,0 +1,27 @@ +'use strict'; + +const assert = require('assert'); +const { readFileSync } = require('fs'); + +const { version, graphqlSync } = require('graphql'); +const { buildSchema } = require('graphql/utilities'); + +assert.deepStrictEqual( + version, + JSON.parse(readFileSync('./node_modules/graphql/package.json')).version, +); + +const schema = buildSchema('type Query { hello: String }'); + +const result = graphqlSync({ + schema, + source: '{ hello }', + rootValue: { hello: 'world' }, +}); + +assert.deepStrictEqual(result, { + data: { + __proto__: null, + hello: 'world', + }, +}); diff --git a/integrationTests/node/package.json b/integrationTests/node/package.json new file mode 100644 index 00000000..87f399e7 --- /dev/null +++ b/integrationTests/node/package.json @@ -0,0 +1,14 @@ +{ + "private": true, + "description": "graphql-js should work on all supported node versions", + "scripts": { + "test": "node test.js" + }, + "dependencies": { + "graphql": "file:../graphql.tgz", + "node-12": "npm:node@12.x.x", + "node-14": "npm:node@14.x.x", + "node-16": "npm:node@16.x.x", + "node-17": "npm:node@17.x.x" + } +} diff --git a/integrationTests/node/test.js b/integrationTests/node/test.js new file mode 100644 index 00000000..94cc957b --- /dev/null +++ b/integrationTests/node/test.js @@ -0,0 +1,17 @@ +'use strict'; + +const path = require('path'); +const childProcess = require('child_process'); + +const { dependencies } = require('./package.json'); + +const nodeVersions = Object.keys(dependencies) + .filter((pkg) => pkg.startsWith('node-')) + .sort((a, b) => b.localeCompare(a)); + +for (const version of nodeVersions) { + console.log(`Testing on ${version} ...`); + + const nodePath = path.join(__dirname, 'node_modules', version, 'bin/node'); + childProcess.execSync(nodePath + ' index.js', { stdio: 'inherit' }); +} diff --git a/integrationTests/ts/TypedQueryDocumentNode-test.ts b/integrationTests/ts/TypedQueryDocumentNode-test.ts new file mode 100644 index 00000000..89044efb --- /dev/null +++ b/integrationTests/ts/TypedQueryDocumentNode-test.ts @@ -0,0 +1,72 @@ +import type { ExecutionResult } from 'graphql/execution'; +import type { TypedQueryDocumentNode } from 'graphql/utilities'; + +import { parse } from 'graphql/language'; +import { execute } from 'graphql/execution'; +import { buildSchema } from 'graphql/utilities'; + +const schema = buildSchema(` + type Query { + test: String + } +`); + +// Tests for TS specific TypedQueryDocumentNode type +const queryDocument = parse('{ test }'); + +type ResponseData = { test: string }; +const typedQueryDocument = queryDocument as TypedQueryDocumentNode< + ResponseData, + {} +>; + +// Supports conversion to DocumentNode +execute({ schema, document: typedQueryDocument }); + +function wrappedExecute(document: TypedQueryDocumentNode) { + return execute({ schema, document }) as ExecutionResult; +} + +const response = wrappedExecute(typedQueryDocument); +const responseData: ResponseData | undefined | null = response.data; + +declare function runQueryA( + q: TypedQueryDocumentNode<{ output: string }, { input: string | null }>, +): void; + +// valid +declare const optionalInputRequiredOutput: TypedQueryDocumentNode< + { output: string }, + { input: string | null } +>; +runQueryA(optionalInputRequiredOutput); + +declare function runQueryB( + q: TypedQueryDocumentNode<{ output: string | null }, { input: string }>, +): void; + +// still valid: We still accept {output: string} as a valid result. +// We're now passing in {input: string} which is still assignable to {input: string | null} +runQueryB(optionalInputRequiredOutput); + +// valid: we now accept {output: null} as a valid Result +declare const optionalInputOptionalOutput: TypedQueryDocumentNode< + { output: string | null }, + { input: string | null } +>; +runQueryB(optionalInputOptionalOutput); + +// valid: we now only pass {input: string} to the query +declare const requiredInputRequiredOutput: TypedQueryDocumentNode< + { output: string }, + { input: string } +>; +runQueryB(requiredInputRequiredOutput); + +// valid: we now accept {output: null} as a valid Result AND +// we now only pass {input: string} to the query +declare const requiredInputOptionalOutput: TypedQueryDocumentNode< + { output: null }, + { input: string } +>; +runQueryB(requiredInputOptionalOutput); diff --git a/integrationTests/ts/basic-test.ts b/integrationTests/ts/basic-test.ts new file mode 100644 index 00000000..a28bd840 --- /dev/null +++ b/integrationTests/ts/basic-test.ts @@ -0,0 +1,34 @@ +import type { ExecutionResult } from 'graphql/execution'; + +import { graphqlSync } from 'graphql'; +import { GraphQLString, GraphQLSchema, GraphQLObjectType } from 'graphql/type'; + +const queryType: GraphQLObjectType = new GraphQLObjectType({ + name: 'Query', + fields: () => ({ + sayHi: { + type: GraphQLString, + args: { + who: { + type: GraphQLString, + defaultValue: 'World', + }, + }, + resolve(_root, args: { who: string }) { + return 'Hello ' + args.who; + }, + }, + }), +}); + +const schema: GraphQLSchema = new GraphQLSchema({ query: queryType }); + +const result: ExecutionResult = graphqlSync({ + schema, + source: ` + query helloWho($who: String){ + test(who: $who) + } + `, + variableValues: { who: 'Dolly' }, +}); diff --git a/integrationTests/ts/extensions-test.ts b/integrationTests/ts/extensions-test.ts new file mode 100644 index 00000000..689d9435 --- /dev/null +++ b/integrationTests/ts/extensions-test.ts @@ -0,0 +1,62 @@ +import { GraphQLError } from 'graphql/error'; +import { GraphQLString, GraphQLObjectType } from 'graphql/type'; + +interface SomeExtension { + meaningOfLife: 42; +} + +declare module 'graphql' { + interface GraphQLObjectTypeExtensions<_TSource, _TContext> { + someObjectExtension?: SomeExtension; + } + + interface GraphQLFieldExtensions<_TSource, _TContext, _TArgs> { + someFieldExtension?: SomeExtension; + } + + interface GraphQLArgumentExtensions { + someArgumentExtension?: SomeExtension; + } +} + +const queryType: GraphQLObjectType = new GraphQLObjectType({ + name: 'Query', + fields: () => ({ + sayHi: { + type: GraphQLString, + args: { + who: { + type: GraphQLString, + extensions: { + someArgumentExtension: { meaningOfLife: 42 }, + }, + }, + }, + resolve: (_root, args) => 'Hello ' + (args.who || 'World'), + extensions: { + someFieldExtension: { meaningOfLife: 42 }, + }, + }, + }), + extensions: { + someObjectExtension: { meaningOfLife: 42 }, + }, +}); + +function checkExtensionTypes(_test: SomeExtension | null | undefined) {} + +checkExtensionTypes(queryType.extensions.someObjectExtension); + +const sayHiField = queryType.getFields().sayHi; +checkExtensionTypes(sayHiField.extensions.someFieldExtension); + +checkExtensionTypes(sayHiField.args[0].extensions.someArgumentExtension); + +declare module 'graphql' { + export interface GraphQLErrorExtensions { + someErrorExtension?: SomeExtension; + } +} + +const error = new GraphQLError('foo'); +checkExtensionTypes(error.extensions.someErrorExtension); diff --git a/integrationTests/ts/internalImports-test.ts b/integrationTests/ts/internalImports-test.ts new file mode 100644 index 00000000..62d9628d --- /dev/null +++ b/integrationTests/ts/internalImports-test.ts @@ -0,0 +1,8 @@ +import type { NameNode } from 'graphql/language'; + +// Parser class is internal API so so any changes to it are never considered breaking changes. +// We just want to test that we are able to import it. +import { Parser } from 'graphql/language/parser'; + +const parser = new Parser('foo'); +const ast: NameNode = parser.parseName(); diff --git a/integrationTests/ts/package.json b/integrationTests/ts/package.json new file mode 100644 index 00000000..505c9c3f --- /dev/null +++ b/integrationTests/ts/package.json @@ -0,0 +1,15 @@ +{ + "private": true, + "description": "graphql-js should compile with all supported TS versions", + "scripts": { + "test": "node test.js" + }, + "dependencies": { + "graphql": "file:../graphql.tgz", + "typescript-4.1": "npm:typescript@4.1.x", + "typescript-4.2": "npm:typescript@4.2.x", + "typescript-4.3": "npm:typescript@4.3.x", + "typescript-4.4": "npm:typescript@4.4.x", + "typescript-4.5": "npm:typescript@4.5.x" + } +} diff --git a/integrationTests/ts/test.js b/integrationTests/ts/test.js new file mode 100644 index 00000000..b328fe16 --- /dev/null +++ b/integrationTests/ts/test.js @@ -0,0 +1,19 @@ +'use strict'; + +const path = require('path'); +const childProcess = require('child_process'); + +const { dependencies } = require('./package.json'); + +const tsVersions = Object.keys(dependencies) + .filter((pkg) => pkg.startsWith('typescript-')) + .sort((a, b) => b.localeCompare(a)); + +for (const version of tsVersions) { + console.log(`Testing on ${version} ...`); + childProcess.execSync(tscPath(version), { stdio: 'inherit' }); +} + +function tscPath(version) { + return path.join(__dirname, 'node_modules', version, 'bin/tsc'); +} diff --git a/integrationTests/ts/tsconfig.json b/integrationTests/ts/tsconfig.json new file mode 100644 index 00000000..403b4c21 --- /dev/null +++ b/integrationTests/ts/tsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es2019", "es2020.promise", "es2020.bigint", "es2020.string"], + "strict": true, + "noEmit": true, + "types": [] + } +} diff --git a/integrationTests/webpack/entry.js b/integrationTests/webpack/entry.js new file mode 100644 index 00000000..8f51030c --- /dev/null +++ b/integrationTests/webpack/entry.js @@ -0,0 +1,13 @@ +'use strict'; + +const { buildSchema, graphqlSync } = require('graphql'); + +const schema = buildSchema('type Query { hello: String }'); + +const result = graphqlSync({ + schema, + source: '{ hello }', + rootValue: { hello: 'world' }, +}); + +module.exports = { result }; diff --git a/integrationTests/webpack/package.json b/integrationTests/webpack/package.json new file mode 100644 index 00000000..aec7a21a --- /dev/null +++ b/integrationTests/webpack/package.json @@ -0,0 +1,12 @@ +{ + "private": true, + "description": "graphql-js should be compatible with Webpack", + "scripts": { + "test": "webpack && node test.js" + }, + "dependencies": { + "graphql": "file:../graphql.tgz", + "webpack": "5.x.x", + "webpack-cli": "4.x.x" + } +} diff --git a/integrationTests/webpack/test.js b/integrationTests/webpack/test.js new file mode 100644 index 00000000..40c22233 --- /dev/null +++ b/integrationTests/webpack/test.js @@ -0,0 +1,14 @@ +'use strict'; + +const assert = require('assert'); + +// eslint-disable-next-line node/no-missing-require +const { result } = require('./dist/main.js'); + +assert.deepStrictEqual(result, { + data: { + __proto__: null, + hello: 'world', + }, +}); +console.log('Test script: Got correct result from Webpack bundle!'); diff --git a/integrationTests/webpack/webpack.config.json b/integrationTests/webpack/webpack.config.json new file mode 100644 index 00000000..830b2bd5 --- /dev/null +++ b/integrationTests/webpack/webpack.config.json @@ -0,0 +1,7 @@ +{ + "mode": "production", + "entry": "./entry.js", + "output": { + "libraryTarget": "commonjs2" + } +} diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000..46934fc8 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,11393 @@ +{ + "name": "graphql", + "version": "16.2.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "graphql", + "version": "16.2.0", + "license": "MIT", + "devDependencies": { + "@babel/core": "7.16.5", + "@babel/plugin-syntax-typescript": "7.16.5", + "@babel/plugin-transform-typescript": "7.16.1", + "@babel/preset-env": "7.16.5", + "@babel/register": "7.16.5", + "@types/chai": "4.3.0", + "@types/mocha": "9.0.0", + "@types/node": "17.0.5", + "@typescript-eslint/eslint-plugin": "5.8.0", + "@typescript-eslint/parser": "5.8.0", + "c8": "7.10.0", + "chai": "4.3.4", + "cspell": "5.13.4", + "eslint": "8.5.0", + "eslint-plugin-import": "2.25.3", + "eslint-plugin-internal-rules": "file:./resources/eslint-internal-rules", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-simple-import-sort": "7.0.0", + "eslint-plugin-tsdoc": "0.2.14", + "mocha": "9.1.3", + "prettier": "2.5.1", + "typescript": "4.5.4" + }, + "engines": { + "node": "^12.22.0 || ^14.16.0 || >=16.0.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.0.tgz", + "integrity": "sha512-IF4EOMEV+bfYwOmNxGzSnjR2EmQod7f1UXOpZM3l4i4o4QNwzjtJAu/HxdjHq0aYBvdqMuQEY1eg0nqW9ZPORA==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.16.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.16.4", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.16.4.tgz", + "integrity": "sha512-1o/jo7D+kC9ZjHX5v+EHrdjl3PhxMrLSOTGsOdHJ+KL8HCaEK6ehrVL2RS6oHDZp+L7xLirLrPmQtEng769J/Q==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.16.5.tgz", + "integrity": "sha512-wUcenlLzuWMZ9Zt8S0KmFwGlH6QKRh3vsm/dhDA3CHkiTA45YuG1XkHRcNRl73EFPXDp/d5kVOU0/y7x2w6OaQ==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.16.0", + "@babel/generator": "^7.16.5", + "@babel/helper-compilation-targets": "^7.16.3", + "@babel/helper-module-transforms": "^7.16.5", + "@babel/helpers": "^7.16.5", + "@babel/parser": "^7.16.5", + "@babel/template": "^7.16.0", + "@babel/traverse": "^7.16.5", + "@babel/types": "^7.16.0", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.1.2", + "semver": "^6.3.0", + "source-map": "^0.5.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/generator": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.16.5.tgz", + "integrity": "sha512-kIvCdjZqcdKqoDbVVdt5R99icaRtrtYhYK/xux5qiWCBmfdvEYMFZ68QCrpE5cbFM1JsuArUNs1ZkuKtTtUcZA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.16.0", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-annotate-as-pure": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.16.0.tgz", + "integrity": "sha512-ItmYF9vR4zA8cByDocY05o0LGUkp1zhbTQOH1NFyl5xXEqlTJQCEJjieriw+aFpxo16swMxUnUiKS7a/r4vtHg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.16.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-builder-binary-assignment-operator-visitor": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.16.5.tgz", + "integrity": "sha512-3JEA9G5dmmnIWdzaT9d0NmFRgYnWUThLsDaL7982H0XqqWr56lRrsmwheXFMjR+TMl7QMBb6mzy9kvgr1lRLUA==", + "dev": true, + "dependencies": { + "@babel/helper-explode-assignable-expression": "^7.16.0", + "@babel/types": "^7.16.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.16.3", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.3.tgz", + "integrity": "sha512-vKsoSQAyBmxS35JUOOt+07cLc6Nk/2ljLIHwmq2/NM6hdioUaqEXq/S+nXvbvXbZkNDlWOymPanJGOc4CBjSJA==", + "dev": true, + "dependencies": { + "@babel/compat-data": "^7.16.0", + "@babel/helper-validator-option": "^7.14.5", + "browserslist": "^4.17.5", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-create-class-features-plugin": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.16.5.tgz", + "integrity": "sha512-NEohnYA7mkB8L5JhU7BLwcBdU3j83IziR9aseMueWGeAjblbul3zzb8UvJ3a1zuBiqCMObzCJHFqKIQE6hTVmg==", + "dev": true, + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.16.0", + "@babel/helper-environment-visitor": "^7.16.5", + "@babel/helper-function-name": "^7.16.0", + "@babel/helper-member-expression-to-functions": "^7.16.5", + "@babel/helper-optimise-call-expression": "^7.16.0", + "@babel/helper-replace-supers": "^7.16.5", + "@babel/helper-split-export-declaration": "^7.16.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-create-regexp-features-plugin": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.16.0.tgz", + "integrity": "sha512-3DyG0zAFAZKcOp7aVr33ddwkxJ0Z0Jr5V99y3I690eYLpukJsJvAbzTy1ewoCqsML8SbIrjH14Jc/nSQ4TvNPA==", + "dev": true, + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.16.0", + "regexpu-core": "^4.7.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-define-polyfill-provider": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.0.tgz", + "integrity": "sha512-7hfT8lUljl/tM3h+izTX/pO3W3frz2ok6Pk+gzys8iJqDfZrZy2pXjRTZAvG2YmfHun1X4q8/UZRLatMfqc5Tg==", + "dev": true, + "dependencies": { + "@babel/helper-compilation-targets": "^7.13.0", + "@babel/helper-module-imports": "^7.12.13", + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/traverse": "^7.13.0", + "debug": "^4.1.1", + "lodash.debounce": "^4.0.8", + "resolve": "^1.14.2", + "semver": "^6.1.2" + }, + "peerDependencies": { + "@babel/core": "^7.4.0-0" + } + }, + "node_modules/@babel/helper-environment-visitor": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.5.tgz", + "integrity": "sha512-ODQyc5AnxmZWm/R2W7fzhamOk1ey8gSguo5SGvF0zcB3uUzRpTRmM/jmLSm9bDMyPlvbyJ+PwPEK0BWIoZ9wjg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.16.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-explode-assignable-expression": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.16.0.tgz", + "integrity": "sha512-Hk2SLxC9ZbcOhLpg/yMznzJ11W++lg5GMbxt1ev6TXUiJB0N42KPC+7w8a+eWGuqDnUYuwStJoZHM7RgmIOaGQ==", + "dev": true, + "dependencies": { + "@babel/types": "^7.16.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-function-name": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.0.tgz", + "integrity": "sha512-BZh4mEk1xi2h4HFjWUXRQX5AEx4rvaZxHgax9gcjdLWdkjsY7MKt5p0otjsg5noXw+pB+clMCjw+aEVYADMjog==", + "dev": true, + "dependencies": { + "@babel/helper-get-function-arity": "^7.16.0", + "@babel/template": "^7.16.0", + "@babel/types": "^7.16.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-get-function-arity": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.0.tgz", + "integrity": "sha512-ASCquNcywC1NkYh/z7Cgp3w31YW8aojjYIlNg4VeJiHkqyP4AzIvr4qx7pYDb4/s8YcsZWqqOSxgkvjUz1kpDQ==", + "dev": true, + "dependencies": { + "@babel/types": "^7.16.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-hoist-variables": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.0.tgz", + "integrity": "sha512-1AZlpazjUR0EQZQv3sgRNfM9mEVWPK3M6vlalczA+EECcPz3XPh6VplbErL5UoMpChhSck5wAJHthlj1bYpcmg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.16.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-member-expression-to-functions": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.16.5.tgz", + "integrity": "sha512-7fecSXq7ZrLE+TWshbGT+HyCLkxloWNhTbU2QM1NTI/tDqyf0oZiMcEfYtDuUDCo528EOlt39G1rftea4bRZIw==", + "dev": true, + "dependencies": { + "@babel/types": "^7.16.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.0.tgz", + "integrity": "sha512-kkH7sWzKPq0xt3H1n+ghb4xEMP8k0U7XV3kkB+ZGy69kDk2ySFW1qPi06sjKzFY3t1j6XbJSqr4mF9L7CYVyhg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.16.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.16.5.tgz", + "integrity": "sha512-CkvMxgV4ZyyioElFwcuWnDCcNIeyqTkCm9BxXZi73RR1ozqlpboqsbGUNvRTflgZtFbbJ1v5Emvm+lkjMYY/LQ==", + "dev": true, + "dependencies": { + "@babel/helper-environment-visitor": "^7.16.5", + "@babel/helper-module-imports": "^7.16.0", + "@babel/helper-simple-access": "^7.16.0", + "@babel/helper-split-export-declaration": "^7.16.0", + "@babel/helper-validator-identifier": "^7.15.7", + "@babel/template": "^7.16.0", + "@babel/traverse": "^7.16.5", + "@babel/types": "^7.16.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-optimise-call-expression": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.0.tgz", + "integrity": "sha512-SuI467Gi2V8fkofm2JPnZzB/SUuXoJA5zXe/xzyPP2M04686RzFKFHPK6HDVN6JvWBIEW8tt9hPR7fXdn2Lgpw==", + "dev": true, + "dependencies": { + "@babel/types": "^7.16.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.5.tgz", + "integrity": "sha512-59KHWHXxVA9K4HNF4sbHCf+eJeFe0Te/ZFGqBT4OjXhrwvA04sGfaEGsVTdsjoszq0YTP49RC9UKe5g8uN2RwQ==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-remap-async-to-generator": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.16.5.tgz", + "integrity": "sha512-X+aAJldyxrOmN9v3FKp+Hu1NO69VWgYgDGq6YDykwRPzxs5f2N+X988CBXS7EQahDU+Vpet5QYMqLk+nsp+Qxw==", + "dev": true, + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.16.0", + "@babel/helper-wrap-function": "^7.16.5", + "@babel/types": "^7.16.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-replace-supers": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.16.5.tgz", + "integrity": "sha512-ao3seGVa/FZCMCCNDuBcqnBFSbdr8N2EW35mzojx3TwfIbdPmNK+JV6+2d5bR0Z71W5ocLnQp9en/cTF7pBJiQ==", + "dev": true, + "dependencies": { + "@babel/helper-environment-visitor": "^7.16.5", + "@babel/helper-member-expression-to-functions": "^7.16.5", + "@babel/helper-optimise-call-expression": "^7.16.0", + "@babel/traverse": "^7.16.5", + "@babel/types": "^7.16.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-simple-access": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.16.0.tgz", + "integrity": "sha512-o1rjBT/gppAqKsYfUdfHq5Rk03lMQrkPHG1OWzHWpLgVXRH4HnMM9Et9CVdIqwkCQlobnGHEJMsgWP/jE1zUiw==", + "dev": true, + "dependencies": { + "@babel/types": "^7.16.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-skip-transparent-expression-wrappers": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.16.0.tgz", + "integrity": "sha512-+il1gTy0oHwUsBQZyJvukbB4vPMdcYBrFHa0Uc4AizLxbq6BOYC51Rv4tWocX9BLBDLZ4kc6qUFpQ6HRgL+3zw==", + "dev": true, + "dependencies": { + "@babel/types": "^7.16.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-split-export-declaration": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.0.tgz", + "integrity": "sha512-0YMMRpuDFNGTHNRiiqJX19GjNXA4H0E8jZ2ibccfSxaCogbm3am5WN/2nQNj0YnQwGWM1J06GOcQ2qnh3+0paw==", + "dev": true, + "dependencies": { + "@babel/types": "^7.16.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.15.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz", + "integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz", + "integrity": "sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-wrap-function": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.16.5.tgz", + "integrity": "sha512-2J2pmLBqUqVdJw78U0KPNdeE2qeuIyKoG4mKV7wAq3mc4jJG282UgjZw4ZYDnqiWQuS3Y3IYdF/AQ6CpyBV3VA==", + "dev": true, + "dependencies": { + "@babel/helper-function-name": "^7.16.0", + "@babel/template": "^7.16.0", + "@babel/traverse": "^7.16.5", + "@babel/types": "^7.16.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.16.5.tgz", + "integrity": "sha512-TLgi6Lh71vvMZGEkFuIxzaPsyeYCHQ5jJOOX1f0xXn0uciFuE8cEk0wyBquMcCxBXZ5BJhE2aUB7pnWTD150Tw==", + "dev": true, + "dependencies": { + "@babel/template": "^7.16.0", + "@babel/traverse": "^7.16.5", + "@babel/types": "^7.16.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.0.tgz", + "integrity": "sha512-t8MH41kUQylBtu2+4IQA3atqevA2lRgqA2wyVB/YiWmsDSuylZZuXOUy9ric30hfzauEFfdsuk/eXTRrGrfd0g==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.15.7", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.16.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.6.tgz", + "integrity": "sha512-Gr86ujcNuPDnNOY8mi383Hvi8IYrJVJYuf3XcuBM/Dgd+bINn/7tHqsj+tKkoreMbmGsFLsltI/JJd8fOFWGDQ==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { + "version": "7.16.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.16.2.tgz", + "integrity": "sha512-h37CvpLSf8gb2lIJ2CgC3t+EjFbi0t8qS7LCS1xcJIlEXE4czlofwaW7W1HA8zpgOCzI9C1nmoqNR1zWkk0pQg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.16.0.tgz", + "integrity": "sha512-4tcFwwicpWTrpl9qjf7UsoosaArgImF85AxqCRZlgc3IQDvkUHjJpruXAL58Wmj+T6fypWTC/BakfEkwIL/pwA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5", + "@babel/helper-skip-transparent-expression-wrappers": "^7.16.0", + "@babel/plugin-proposal-optional-chaining": "^7.16.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.13.0" + } + }, + "node_modules/@babel/plugin-proposal-async-generator-functions": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.16.5.tgz", + "integrity": "sha512-C/FX+3HNLV6sz7AqbTQqEo1L9/kfrKjxcVtgyBCmvIgOjvuBVUWooDoi7trsLxOzCEo5FccjRvKHkfDsJFZlfA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.16.5", + "@babel/helper-remap-async-to-generator": "^7.16.5", + "@babel/plugin-syntax-async-generators": "^7.8.4" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-class-properties": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.16.5.tgz", + "integrity": "sha512-pJD3HjgRv83s5dv1sTnDbZOaTjghKEz8KUn1Kbh2eAIRhGuyQ1XSeI4xVXU3UlIEVA3DAyIdxqT1eRn7Wcn55A==", + "dev": true, + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.16.5", + "@babel/helper-plugin-utils": "^7.16.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-class-static-block": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.16.5.tgz", + "integrity": "sha512-EEFzuLZcm/rNJ8Q5krK+FRKdVkd6FjfzT9tuSZql9sQn64K0hHA2KLJ0DqVot9/iV6+SsuadC5yI39zWnm+nmQ==", + "dev": true, + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.16.5", + "@babel/helper-plugin-utils": "^7.16.5", + "@babel/plugin-syntax-class-static-block": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.12.0" + } + }, + "node_modules/@babel/plugin-proposal-dynamic-import": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.16.5.tgz", + "integrity": "sha512-P05/SJZTTvHz79LNYTF8ff5xXge0kk5sIIWAypcWgX4BTRUgyHc8wRxJ/Hk+mU0KXldgOOslKaeqnhthcDJCJQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.16.5", + "@babel/plugin-syntax-dynamic-import": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-export-namespace-from": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.16.5.tgz", + "integrity": "sha512-i+sltzEShH1vsVydvNaTRsgvq2vZsfyrd7K7vPLUU/KgS0D5yZMe6uipM0+izminnkKrEfdUnz7CxMRb6oHZWw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.16.5", + "@babel/plugin-syntax-export-namespace-from": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-json-strings": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.16.5.tgz", + "integrity": "sha512-QQJueTFa0y9E4qHANqIvMsuxM/qcLQmKttBACtPCQzGUEizsXDACGonlPiSwynHfOa3vNw0FPMVvQzbuXwh4SQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.16.5", + "@babel/plugin-syntax-json-strings": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-logical-assignment-operators": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.16.5.tgz", + "integrity": "sha512-xqibl7ISO2vjuQM+MzR3rkd0zfNWltk7n9QhaD8ghMmMceVguYrNDt7MikRyj4J4v3QehpnrU8RYLnC7z/gZLA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.16.5", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-nullish-coalescing-operator": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.16.5.tgz", + "integrity": "sha512-YwMsTp/oOviSBhrjwi0vzCUycseCYwoXnLiXIL3YNjHSMBHicGTz7GjVU/IGgz4DtOEXBdCNG72pvCX22ehfqg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.16.5", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-numeric-separator": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.16.5.tgz", + "integrity": "sha512-DvB9l/TcsCRvsIV9v4jxR/jVP45cslTVC0PMVHvaJhhNuhn2Y1SOhCSFlPK777qLB5wb8rVDaNoqMTyOqtY5Iw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.16.5", + "@babel/plugin-syntax-numeric-separator": "^7.10.4" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-object-rest-spread": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.16.5.tgz", + "integrity": "sha512-UEd6KpChoyPhCoE840KRHOlGhEZFutdPDMGj+0I56yuTTOaT51GzmnEl/0uT41fB/vD2nT+Pci2KjezyE3HmUw==", + "dev": true, + "dependencies": { + "@babel/compat-data": "^7.16.4", + "@babel/helper-compilation-targets": "^7.16.3", + "@babel/helper-plugin-utils": "^7.16.5", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-transform-parameters": "^7.16.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-optional-catch-binding": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.16.5.tgz", + "integrity": "sha512-ihCMxY1Iljmx4bWy/PIMJGXN4NS4oUj1MKynwO07kiKms23pNvIn1DMB92DNB2R0EA882sw0VXIelYGdtF7xEQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.16.5", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-optional-chaining": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.16.5.tgz", + "integrity": "sha512-kzdHgnaXRonttiTfKYnSVafbWngPPr2qKw9BWYBESl91W54e+9R5pP70LtWxV56g0f05f/SQrwHYkfvbwcdQ/A==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.16.5", + "@babel/helper-skip-transparent-expression-wrappers": "^7.16.0", + "@babel/plugin-syntax-optional-chaining": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-private-methods": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.16.5.tgz", + "integrity": "sha512-+yFMO4BGT3sgzXo+lrq7orX5mAZt57DwUK6seqII6AcJnJOIhBJ8pzKH47/ql/d426uQ7YhN8DpUFirQzqYSUA==", + "dev": true, + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.16.5", + "@babel/helper-plugin-utils": "^7.16.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-private-property-in-object": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.16.5.tgz", + "integrity": "sha512-+YGh5Wbw0NH3y/E5YMu6ci5qTDmAEVNoZ3I54aB6nVEOZ5BQ7QJlwKq5pYVucQilMByGn/bvX0af+uNaPRCabA==", + "dev": true, + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.16.0", + "@babel/helper-create-class-features-plugin": "^7.16.5", + "@babel/helper-plugin-utils": "^7.16.5", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-unicode-property-regex": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.16.5.tgz", + "integrity": "sha512-s5sKtlKQyFSatt781HQwv1hoM5BQ9qRH30r+dK56OLDsHmV74mzwJNX7R1yMuE7VZKG5O6q/gmOGSAO6ikTudg==", + "dev": true, + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.16.0", + "@babel/helper-plugin-utils": "^7.16.5" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", + "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-class-static-block": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", + "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-dynamic-import": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", + "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-export-namespace-from": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz", + "integrity": "sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-private-property-in-object": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", + "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", + "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-typescript": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.16.5.tgz", + "integrity": "sha512-/d4//lZ1Vqb4mZ5xTep3dDK888j7BGM/iKqBmndBaoYAFPlPKrGU608VVBz5JeyAb6YQDjRu1UKqj86UhwWVgw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.16.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-arrow-functions": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.16.5.tgz", + "integrity": "sha512-8bTHiiZyMOyfZFULjsCnYOWG059FVMes0iljEHSfARhNgFfpsqE92OrCffv3veSw9rwMkYcFe9bj0ZoXU2IGtQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.16.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-async-to-generator": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.16.5.tgz", + "integrity": "sha512-TMXgfioJnkXU+XRoj7P2ED7rUm5jbnDWwlCuFVTpQboMfbSya5WrmubNBAMlk7KXvywpo8rd8WuYZkis1o2H8w==", + "dev": true, + "dependencies": { + "@babel/helper-module-imports": "^7.16.0", + "@babel/helper-plugin-utils": "^7.16.5", + "@babel/helper-remap-async-to-generator": "^7.16.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-block-scoped-functions": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.16.5.tgz", + "integrity": "sha512-BxmIyKLjUGksJ99+hJyL/HIxLIGnLKtw772zYDER7UuycDZ+Xvzs98ZQw6NGgM2ss4/hlFAaGiZmMNKvValEjw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.16.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-block-scoping": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.16.5.tgz", + "integrity": "sha512-JxjSPNZSiOtmxjX7PBRBeRJTUKTyJ607YUYeT0QJCNdsedOe+/rXITjP08eG8xUpsLfPirgzdCFN+h0w6RI+pQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.16.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-classes": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.16.5.tgz", + "integrity": "sha512-DzJ1vYf/7TaCYy57J3SJ9rV+JEuvmlnvvyvYKFbk5u46oQbBvuB9/0w+YsVsxkOv8zVWKpDmUoj4T5ILHoXevA==", + "dev": true, + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.16.0", + "@babel/helper-environment-visitor": "^7.16.5", + "@babel/helper-function-name": "^7.16.0", + "@babel/helper-optimise-call-expression": "^7.16.0", + "@babel/helper-plugin-utils": "^7.16.5", + "@babel/helper-replace-supers": "^7.16.5", + "@babel/helper-split-export-declaration": "^7.16.0", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-computed-properties": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.16.5.tgz", + "integrity": "sha512-n1+O7xtU5lSLraRzX88CNcpl7vtGdPakKzww74bVwpAIRgz9JVLJJpOLb0uYqcOaXVM0TL6X0RVeIJGD2CnCkg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.16.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-destructuring": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.16.5.tgz", + "integrity": "sha512-GuRVAsjq+c9YPK6NeTkRLWyQskDC099XkBSVO+6QzbnOnH2d/4mBVXYStaPrZD3dFRfg00I6BFJ9Atsjfs8mlg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.16.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-dotall-regex": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.16.5.tgz", + "integrity": "sha512-iQiEMt8Q4/5aRGHpGVK2Zc7a6mx7qEAO7qehgSug3SDImnuMzgmm/wtJALXaz25zUj1PmnNHtShjFgk4PDx4nw==", + "dev": true, + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.16.0", + "@babel/helper-plugin-utils": "^7.16.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-duplicate-keys": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.16.5.tgz", + "integrity": "sha512-81tijpDg2a6I1Yhj4aWY1l3O1J4Cg/Pd7LfvuaH2VVInAkXtzibz9+zSPdUM1WvuUi128ksstAP0hM5w48vQgg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.16.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-exponentiation-operator": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.16.5.tgz", + "integrity": "sha512-12rba2HwemQPa7BLIKCzm1pT2/RuQHtSFHdNl41cFiC6oi4tcrp7gjB07pxQvFpcADojQywSjblQth6gJyE6CA==", + "dev": true, + "dependencies": { + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.16.5", + "@babel/helper-plugin-utils": "^7.16.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-for-of": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.16.5.tgz", + "integrity": "sha512-+DpCAJFPAvViR17PIMi9x2AE34dll5wNlXO43wagAX2YcRGgEVHCNFC4azG85b4YyyFarvkc/iD5NPrz4Oneqw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.16.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-function-name": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.16.5.tgz", + "integrity": "sha512-Fuec/KPSpVLbGo6z1RPw4EE1X+z9gZk1uQmnYy7v4xr4TO9p41v1AoUuXEtyqAI7H+xNJYSICzRqZBhDEkd3kQ==", + "dev": true, + "dependencies": { + "@babel/helper-function-name": "^7.16.0", + "@babel/helper-plugin-utils": "^7.16.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-literals": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.16.5.tgz", + "integrity": "sha512-B1j9C/IfvshnPcklsc93AVLTrNVa69iSqztylZH6qnmiAsDDOmmjEYqOm3Ts2lGSgTSywnBNiqC949VdD0/gfw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.16.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-member-expression-literals": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.16.5.tgz", + "integrity": "sha512-d57i3vPHWgIde/9Y8W/xSFUndhvhZN5Wu2TjRrN1MVz5KzdUihKnfDVlfP1U7mS5DNj/WHHhaE4/tTi4hIyHwQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.16.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-amd": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.16.5.tgz", + "integrity": "sha512-oHI15S/hdJuSCfnwIz+4lm6wu/wBn7oJ8+QrkzPPwSFGXk8kgdI/AIKcbR/XnD1nQVMg/i6eNaXpszbGuwYDRQ==", + "dev": true, + "dependencies": { + "@babel/helper-module-transforms": "^7.16.5", + "@babel/helper-plugin-utils": "^7.16.5", + "babel-plugin-dynamic-import-node": "^2.3.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.16.5.tgz", + "integrity": "sha512-ABhUkxvoQyqhCWyb8xXtfwqNMJD7tx+irIRnUh6lmyFud7Jln1WzONXKlax1fg/ey178EXbs4bSGNd6PngO+SQ==", + "dev": true, + "dependencies": { + "@babel/helper-module-transforms": "^7.16.5", + "@babel/helper-plugin-utils": "^7.16.5", + "@babel/helper-simple-access": "^7.16.0", + "babel-plugin-dynamic-import-node": "^2.3.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-systemjs": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.16.5.tgz", + "integrity": "sha512-53gmLdScNN28XpjEVIm7LbWnD/b/TpbwKbLk6KV4KqC9WyU6rq1jnNmVG6UgAdQZVVGZVoik3DqHNxk4/EvrjA==", + "dev": true, + "dependencies": { + "@babel/helper-hoist-variables": "^7.16.0", + "@babel/helper-module-transforms": "^7.16.5", + "@babel/helper-plugin-utils": "^7.16.5", + "@babel/helper-validator-identifier": "^7.15.7", + "babel-plugin-dynamic-import-node": "^2.3.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-umd": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.16.5.tgz", + "integrity": "sha512-qTFnpxHMoenNHkS3VoWRdwrcJ3FhX567GvDA3hRZKF0Dj8Fmg0UzySZp3AP2mShl/bzcywb/UWAMQIjA1bhXvw==", + "dev": true, + "dependencies": { + "@babel/helper-module-transforms": "^7.16.5", + "@babel/helper-plugin-utils": "^7.16.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-named-capturing-groups-regex": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.16.5.tgz", + "integrity": "sha512-/wqGDgvFUeKELW6ex6QB7dLVRkd5ehjw34tpXu1nhKC0sFfmaLabIswnpf8JgDyV2NeDmZiwoOb0rAmxciNfjA==", + "dev": true, + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.16.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-transform-new-target": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.16.5.tgz", + "integrity": "sha512-ZaIrnXF08ZC8jnKR4/5g7YakGVL6go6V9ql6Jl3ecO8PQaQqFE74CuM384kezju7Z9nGCCA20BqZaR1tJ/WvHg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.16.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-object-super": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.16.5.tgz", + "integrity": "sha512-tded+yZEXuxt9Jdtkc1RraW1zMF/GalVxaVVxh41IYwirdRgyAxxxCKZ9XB7LxZqmsjfjALxupNE1MIz9KH+Zg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.16.5", + "@babel/helper-replace-supers": "^7.16.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-parameters": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.16.5.tgz", + "integrity": "sha512-B3O6AL5oPop1jAVg8CV+haeUte9oFuY85zu0jwnRNZZi3tVAbJriu5tag/oaO2kGaQM/7q7aGPBlTI5/sr9enA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.16.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-property-literals": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.16.5.tgz", + "integrity": "sha512-+IRcVW71VdF9pEH/2R/Apab4a19LVvdVsr/gEeotH00vSDVlKD+XgfSIw+cgGWsjDB/ziqGv/pGoQZBIiQVXHg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.16.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-regenerator": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.16.5.tgz", + "integrity": "sha512-2z+it2eVWU8TtQQRauvGUqZwLy4+7rTfo6wO4npr+fvvN1SW30ZF3O/ZRCNmTuu4F5MIP8OJhXAhRV5QMJOuYg==", + "dev": true, + "dependencies": { + "regenerator-transform": "^0.14.2" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-reserved-words": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.16.5.tgz", + "integrity": "sha512-aIB16u8lNcf7drkhXJRoggOxSTUAuihTSTfAcpynowGJOZiGf+Yvi7RuTwFzVYSYPmWyARsPqUGoZWWWxLiknw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.16.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-shorthand-properties": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.16.5.tgz", + "integrity": "sha512-ZbuWVcY+MAXJuuW7qDoCwoxDUNClfZxoo7/4swVbOW1s/qYLOMHlm9YRWMsxMFuLs44eXsv4op1vAaBaBaDMVg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.16.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-spread": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.16.5.tgz", + "integrity": "sha512-5d6l/cnG7Lw4tGHEoga4xSkYp1euP7LAtrah1h1PgJ3JY7yNsjybsxQAnVK4JbtReZ/8z6ASVmd3QhYYKLaKZw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.16.5", + "@babel/helper-skip-transparent-expression-wrappers": "^7.16.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-sticky-regex": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.16.5.tgz", + "integrity": "sha512-usYsuO1ID2LXxzuUxifgWtJemP7wL2uZtyrTVM4PKqsmJycdS4U4mGovL5xXkfUheds10Dd2PjoQLXw6zCsCbg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.16.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-template-literals": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.16.5.tgz", + "integrity": "sha512-gnyKy9RyFhkovex4BjKWL3BVYzUDG6zC0gba7VMLbQoDuqMfJ1SDXs8k/XK41Mmt1Hyp4qNAvGFb9hKzdCqBRQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.16.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-typeof-symbol": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.16.5.tgz", + "integrity": "sha512-ldxCkW180qbrvyCVDzAUZqB0TAeF8W/vGJoRcaf75awm6By+PxfJKvuqVAnq8N9wz5Xa6mSpM19OfVKKVmGHSQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.16.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-typescript": { + "version": "7.16.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.16.1.tgz", + "integrity": "sha512-NO4XoryBng06jjw/qWEU2LhcLJr1tWkhpMam/H4eas/CDKMX/b2/Ylb6EI256Y7+FVPCawwSM1rrJNOpDiz+Lg==", + "dev": true, + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.16.0", + "@babel/helper-plugin-utils": "^7.14.5", + "@babel/plugin-syntax-typescript": "^7.16.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-escapes": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.16.5.tgz", + "integrity": "sha512-shiCBHTIIChGLdyojsKQjoAyB8MBwat25lKM7MJjbe1hE0bgIppD+LX9afr41lLHOhqceqeWl4FkLp+Bgn9o1Q==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.16.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-regex": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.16.5.tgz", + "integrity": "sha512-GTJ4IW012tiPEMMubd7sD07iU9O/LOo8Q/oU4xNhcaq0Xn8+6TcUQaHtC8YxySo1T+ErQ8RaWogIEeFhKGNPzw==", + "dev": true, + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.16.0", + "@babel/helper-plugin-utils": "^7.16.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/preset-env": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.16.5.tgz", + "integrity": "sha512-MiJJW5pwsktG61NDxpZ4oJ1CKxM1ncam9bzRtx9g40/WkLRkxFP6mhpkYV0/DxcciqoiHicx291+eUQrXb/SfQ==", + "dev": true, + "dependencies": { + "@babel/compat-data": "^7.16.4", + "@babel/helper-compilation-targets": "^7.16.3", + "@babel/helper-plugin-utils": "^7.16.5", + "@babel/helper-validator-option": "^7.14.5", + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.16.2", + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.16.0", + "@babel/plugin-proposal-async-generator-functions": "^7.16.5", + "@babel/plugin-proposal-class-properties": "^7.16.5", + "@babel/plugin-proposal-class-static-block": "^7.16.5", + "@babel/plugin-proposal-dynamic-import": "^7.16.5", + "@babel/plugin-proposal-export-namespace-from": "^7.16.5", + "@babel/plugin-proposal-json-strings": "^7.16.5", + "@babel/plugin-proposal-logical-assignment-operators": "^7.16.5", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.5", + "@babel/plugin-proposal-numeric-separator": "^7.16.5", + "@babel/plugin-proposal-object-rest-spread": "^7.16.5", + "@babel/plugin-proposal-optional-catch-binding": "^7.16.5", + "@babel/plugin-proposal-optional-chaining": "^7.16.5", + "@babel/plugin-proposal-private-methods": "^7.16.5", + "@babel/plugin-proposal-private-property-in-object": "^7.16.5", + "@babel/plugin-proposal-unicode-property-regex": "^7.16.5", + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-class-properties": "^7.12.13", + "@babel/plugin-syntax-class-static-block": "^7.14.5", + "@babel/plugin-syntax-dynamic-import": "^7.8.3", + "@babel/plugin-syntax-export-namespace-from": "^7.8.3", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.10.4", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5", + "@babel/plugin-syntax-top-level-await": "^7.14.5", + "@babel/plugin-transform-arrow-functions": "^7.16.5", + "@babel/plugin-transform-async-to-generator": "^7.16.5", + "@babel/plugin-transform-block-scoped-functions": "^7.16.5", + "@babel/plugin-transform-block-scoping": "^7.16.5", + "@babel/plugin-transform-classes": "^7.16.5", + "@babel/plugin-transform-computed-properties": "^7.16.5", + "@babel/plugin-transform-destructuring": "^7.16.5", + "@babel/plugin-transform-dotall-regex": "^7.16.5", + "@babel/plugin-transform-duplicate-keys": "^7.16.5", + "@babel/plugin-transform-exponentiation-operator": "^7.16.5", + "@babel/plugin-transform-for-of": "^7.16.5", + "@babel/plugin-transform-function-name": "^7.16.5", + "@babel/plugin-transform-literals": "^7.16.5", + "@babel/plugin-transform-member-expression-literals": "^7.16.5", + "@babel/plugin-transform-modules-amd": "^7.16.5", + "@babel/plugin-transform-modules-commonjs": "^7.16.5", + "@babel/plugin-transform-modules-systemjs": "^7.16.5", + "@babel/plugin-transform-modules-umd": "^7.16.5", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.16.5", + "@babel/plugin-transform-new-target": "^7.16.5", + "@babel/plugin-transform-object-super": "^7.16.5", + "@babel/plugin-transform-parameters": "^7.16.5", + "@babel/plugin-transform-property-literals": "^7.16.5", + "@babel/plugin-transform-regenerator": "^7.16.5", + "@babel/plugin-transform-reserved-words": "^7.16.5", + "@babel/plugin-transform-shorthand-properties": "^7.16.5", + "@babel/plugin-transform-spread": "^7.16.5", + "@babel/plugin-transform-sticky-regex": "^7.16.5", + "@babel/plugin-transform-template-literals": "^7.16.5", + "@babel/plugin-transform-typeof-symbol": "^7.16.5", + "@babel/plugin-transform-unicode-escapes": "^7.16.5", + "@babel/plugin-transform-unicode-regex": "^7.16.5", + "@babel/preset-modules": "^0.1.5", + "@babel/types": "^7.16.0", + "babel-plugin-polyfill-corejs2": "^0.3.0", + "babel-plugin-polyfill-corejs3": "^0.4.0", + "babel-plugin-polyfill-regenerator": "^0.3.0", + "core-js-compat": "^3.19.1", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/preset-modules": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.5.tgz", + "integrity": "sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-proposal-unicode-property-regex": "^7.4.4", + "@babel/plugin-transform-dotall-regex": "^7.4.4", + "@babel/types": "^7.4.4", + "esutils": "^2.0.2" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/register": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/register/-/register-7.16.5.tgz", + "integrity": "sha512-NpluD+cToBiZiDsG3y9rtIcqDyivsahpaM9csfyfiq1qQWduSmihUZ+ruIqqSDGjZKZMJfgAElo9x2YWlOQuRw==", + "dev": true, + "dependencies": { + "clone-deep": "^4.0.1", + "find-cache-dir": "^2.0.0", + "make-dir": "^2.1.0", + "pirates": "^4.0.0", + "source-map-support": "^0.5.16" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/runtime": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.16.5.tgz", + "integrity": "sha512-TXWihFIS3Pyv5hzR7j6ihmeLkZfrXGxAr5UfSl8CHf+6q/wpiYDkUau0czckpYG8QmnCIuPpdLtuA9VmuGGyMA==", + "dev": true, + "dependencies": { + "regenerator-runtime": "^0.13.4" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/template": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.0.tgz", + "integrity": "sha512-MnZdpFD/ZdYhXwiunMqqgyZyucaYsbL0IrjoGjaVhGilz+x8YB++kRfygSOIj1yOtWKPlx7NBp+9I1RQSgsd5A==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.16.0", + "@babel/parser": "^7.16.0", + "@babel/types": "^7.16.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.5.tgz", + "integrity": "sha512-FOCODAzqUMROikDYLYxl4nmwiLlu85rNqBML/A5hKRVXG2LV8d0iMqgPzdYTcIpjZEBB7D6UDU9vxRZiriASdQ==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.16.0", + "@babel/generator": "^7.16.5", + "@babel/helper-environment-visitor": "^7.16.5", + "@babel/helper-function-name": "^7.16.0", + "@babel/helper-hoist-variables": "^7.16.0", + "@babel/helper-split-export-declaration": "^7.16.0", + "@babel/parser": "^7.16.5", + "@babel/types": "^7.16.0", + "debug": "^4.1.0", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.16.0.tgz", + "integrity": "sha512-PJgg/k3SdLsGb3hhisFvtLOw5ts113klrpLuIPtCJIU+BB24fqq6lf8RWqKJEjzqXR9AEH1rIb5XTqwBHB+kQg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.15.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true + }, + "node_modules/@cspell/cspell-bundled-dicts": { + "version": "5.13.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-5.13.4.tgz", + "integrity": "sha512-D88zFAcEbUJiM03cY1U4Fb1c9BcECi6RvSwwJG/Ayc4lLO9uZgFyKlzQwjSEgTzuCME9A0Nn2hXrD+aWol85Mg==", + "dev": true, + "dependencies": { + "@cspell/dict-ada": "^1.1.2", + "@cspell/dict-aws": "^1.0.14", + "@cspell/dict-bash": "^1.0.17", + "@cspell/dict-companies": "^2.0.2", + "@cspell/dict-cpp": "^1.1.40", + "@cspell/dict-cryptocurrencies": "^1.0.10", + "@cspell/dict-csharp": "^2.0.1", + "@cspell/dict-css": "^1.0.12", + "@cspell/dict-django": "^1.0.26", + "@cspell/dict-dotnet": "^1.0.32", + "@cspell/dict-elixir": "^1.0.26", + "@cspell/dict-en_us": "^2.1.4", + "@cspell/dict-en-gb": "^1.1.33", + "@cspell/dict-filetypes": "^2.0.1", + "@cspell/dict-fonts": "^1.0.14", + "@cspell/dict-fullstack": "^2.0.4", + "@cspell/dict-golang": "^1.1.24", + "@cspell/dict-haskell": "^1.0.13", + "@cspell/dict-html": "^1.1.9", + "@cspell/dict-html-symbol-entities": "^1.0.23", + "@cspell/dict-java": "^1.0.23", + "@cspell/dict-latex": "^1.0.25", + "@cspell/dict-lorem-ipsum": "^1.0.22", + "@cspell/dict-lua": "^1.0.16", + "@cspell/dict-node": "^1.0.12", + "@cspell/dict-npm": "^1.0.16", + "@cspell/dict-php": "^1.0.25", + "@cspell/dict-powershell": "^1.0.19", + "@cspell/dict-public-licenses": "^1.0.4", + "@cspell/dict-python": "^2.0.5", + "@cspell/dict-ruby": "^1.0.15", + "@cspell/dict-rust": "^1.0.23", + "@cspell/dict-scala": "^1.0.21", + "@cspell/dict-software-terms": "^2.0.11", + "@cspell/dict-swift": "^1.0.1", + "@cspell/dict-typescript": "^1.0.19", + "@cspell/dict-vue": "^2.0.1" + }, + "engines": { + "node": ">=12.13.0" + } + }, + "node_modules/@cspell/cspell-types": { + "version": "5.13.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-5.13.4.tgz", + "integrity": "sha512-OH3aqFfmRNOSO0K0h5JNm84I5RLDgngp1Qa9YeEm9oj1U/qjrm2bOwOGGh9XU/ZjLl56JMbtbnfSpHpT7tLc+A==", + "dev": true, + "engines": { + "node": ">=12.13.0" + } + }, + "node_modules/@cspell/dict-ada": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-ada/-/dict-ada-1.1.2.tgz", + "integrity": "sha512-UDrcYcKIVyXDz5mInJabRNQpJoehjBFvja5W+GQyu9pGcx3BS3cAU8mWENstGR0Qc/iFTxB010qwF8F3cHA/aA==", + "dev": true + }, + "node_modules/@cspell/dict-aws": { + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/@cspell/dict-aws/-/dict-aws-1.0.14.tgz", + "integrity": "sha512-K21CfB4ZpKYwwDQiPfic2zJA/uxkbsd4IQGejEvDAhE3z8wBs6g6BwwqdVO767M9NgZqc021yAVpr79N5pWe3w==", + "dev": true + }, + "node_modules/@cspell/dict-bash": { + "version": "1.0.17", + "resolved": "https://registry.npmjs.org/@cspell/dict-bash/-/dict-bash-1.0.17.tgz", + "integrity": "sha512-BlX+pnDlLmIf776C9d71QjXl4NOIz+yloeixx1ZZjrwvKPLF+ffE/Ez13eV+D9R2Ps1rW10UvW8u3Hbmwme+Fw==", + "dev": true + }, + "node_modules/@cspell/dict-companies": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-2.0.2.tgz", + "integrity": "sha512-LPKwBMAWRz+p1R8q+TV6E1sGOOTvxJOaJeXNN++CZQ7i6JMn5Rf+BSxagwkeK6z3o9vIC5ZE4AcQ5BMkvyjqGw==", + "dev": true + }, + "node_modules/@cspell/dict-cpp": { + "version": "1.1.40", + "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-1.1.40.tgz", + "integrity": "sha512-sscfB3woNDNj60/yGXAdwNtIRWZ89y35xnIaJVDMk5TPMMpaDvuk0a34iOPIq0g4V+Y8e3RyAg71SH6ADwSjGw==", + "dev": true + }, + "node_modules/@cspell/dict-cryptocurrencies": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/@cspell/dict-cryptocurrencies/-/dict-cryptocurrencies-1.0.10.tgz", + "integrity": "sha512-47ABvDJOkaST/rXipNMfNvneHUzASvmL6K/CbOFpYKfsd0x23Jc9k1yaOC7JAm82XSC/8a7+3Yu+Fk2jVJNnsA==", + "dev": true + }, + "node_modules/@cspell/dict-csharp": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-csharp/-/dict-csharp-2.0.1.tgz", + "integrity": "sha512-ZzAr+WRP2FUtXHZtfhe8f3j9vPjH+5i44Hcr5JqbWxmqciGoTbWBPQXwu9y+J4mbdC69HSWRrVGkNJ8rQk8pSw==", + "dev": true + }, + "node_modules/@cspell/dict-css": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/@cspell/dict-css/-/dict-css-1.0.12.tgz", + "integrity": "sha512-K6yuxej7n454O7dwKG6lHacHrAOMZ0PhMEbmV6qH2JH0U4TtWXfBASYugHvXZCDDx1UObpiJP+3tQJiBqfGpHA==", + "dev": true + }, + "node_modules/@cspell/dict-django": { + "version": "1.0.26", + "resolved": "https://registry.npmjs.org/@cspell/dict-django/-/dict-django-1.0.26.tgz", + "integrity": "sha512-mn9bd7Et1L2zuibc08GVHTiD2Go3/hdjyX5KLukXDklBkq06r+tb0OtKtf1zKodtFDTIaYekGADhNhA6AnKLkg==", + "dev": true + }, + "node_modules/@cspell/dict-dotnet": { + "version": "1.0.32", + "resolved": "https://registry.npmjs.org/@cspell/dict-dotnet/-/dict-dotnet-1.0.32.tgz", + "integrity": "sha512-9H9vXrgJB4KF8xsyTToXO53cXD33iyfrpT4mhCds+YLUw3P3x3E9myszgJzshnrxYBvQZ+QMII57Qr6SjZVk4Q==", + "dev": true + }, + "node_modules/@cspell/dict-elixir": { + "version": "1.0.26", + "resolved": "https://registry.npmjs.org/@cspell/dict-elixir/-/dict-elixir-1.0.26.tgz", + "integrity": "sha512-hz1yETUiRJM7yjN3mITSnxcmZaEyaBbyJhpZPpg+cKUil+xhHeZ2wwfbRc83QHGmlqEuDWbdCFqKSpCDJYpYhg==", + "dev": true + }, + "node_modules/@cspell/dict-en_us": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-2.1.4.tgz", + "integrity": "sha512-W4b+aIvZ637FqtTmrTe/T9i9748cuTQf82eWUgV9O296WzZj7rCxm+rzOrmRTAcCmU+9+6Cdsr0unETFQfuxww==", + "dev": true + }, + "node_modules/@cspell/dict-en-gb": { + "version": "1.1.33", + "resolved": "https://registry.npmjs.org/@cspell/dict-en-gb/-/dict-en-gb-1.1.33.tgz", + "integrity": "sha512-tKSSUf9BJEV+GJQAYGw5e+ouhEe2ZXE620S7BLKe3ZmpnjlNG9JqlnaBhkIMxKnNFkLY2BP/EARzw31AZnOv4g==", + "dev": true + }, + "node_modules/@cspell/dict-filetypes": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-2.0.1.tgz", + "integrity": "sha512-bQ7K3U/3hKO2lpQjObf0veNP/n50qk5CVezSwApMBckf/sAVvDTR1RGAvYdr+vdQnkdQrk6wYmhbshXi0sLDVg==", + "dev": true + }, + "node_modules/@cspell/dict-fonts": { + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/@cspell/dict-fonts/-/dict-fonts-1.0.14.tgz", + "integrity": "sha512-VhIX+FVYAnqQrOuoFEtya6+H72J82cIicz9QddgknsTqZQ3dvgp6lmVnsQXPM3EnzA8n1peTGpLDwHzT7ociLA==", + "dev": true + }, + "node_modules/@cspell/dict-fullstack": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-fullstack/-/dict-fullstack-2.0.4.tgz", + "integrity": "sha512-+JtYO58QAXnetRN+MGVzI8YbkbFTLpYfl/Cw/tmNqy7U1IDVC4sTXQ2pZvbbeKQWFHBqYvBs0YASV+mTouXYBw==", + "dev": true + }, + "node_modules/@cspell/dict-golang": { + "version": "1.1.24", + "resolved": "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-1.1.24.tgz", + "integrity": "sha512-qq3Cjnx2U1jpeWAGJL1GL0ylEhUMqyaR36Xij6Y6Aq4bViCRp+HRRqk0x5/IHHbOrti45h3yy7ii1itRFo+Xkg==", + "dev": true + }, + "node_modules/@cspell/dict-haskell": { + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/@cspell/dict-haskell/-/dict-haskell-1.0.13.tgz", + "integrity": "sha512-kvl8T84cnYRPpND/P3D86P6WRSqebsbk0FnMfy27zo15L5MLAb3d3MOiT1kW3vEWfQgzUD7uddX/vUiuroQ8TA==", + "dev": true + }, + "node_modules/@cspell/dict-html": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/@cspell/dict-html/-/dict-html-1.1.9.tgz", + "integrity": "sha512-vvnYia0tyIS5Fdoz+gEQm77MGZZE66kOJjuNpIYyRHCXFAhWdYz3SmkRm6YKJSWSvuO+WBJYTKDvkOxSh3Fx/w==", + "dev": true + }, + "node_modules/@cspell/dict-html-symbol-entities": { + "version": "1.0.23", + "resolved": "https://registry.npmjs.org/@cspell/dict-html-symbol-entities/-/dict-html-symbol-entities-1.0.23.tgz", + "integrity": "sha512-PV0UBgcBFbBLf/m1wfkVMM8w96kvfHoiCGLWO6BR3Q9v70IXoE4ae0+T+f0CkxcEkacMqEQk/I7vuE9MzrjaNw==", + "dev": true + }, + "node_modules/@cspell/dict-java": { + "version": "1.0.23", + "resolved": "https://registry.npmjs.org/@cspell/dict-java/-/dict-java-1.0.23.tgz", + "integrity": "sha512-LcOg9srYLDoNGd8n3kbfDBlZD+LOC9IVcnFCdua1b/luCHNVmlgBx7e677qPu7olpMYOD5TQIVW2OmM1+/6MFA==", + "dev": true + }, + "node_modules/@cspell/dict-latex": { + "version": "1.0.25", + "resolved": "https://registry.npmjs.org/@cspell/dict-latex/-/dict-latex-1.0.25.tgz", + "integrity": "sha512-cEgg91Migqcp1SdVV7dUeMxbPDhxdNo6Fgq2eygAXQjIOFK520FFvh/qxyBvW90qdZbIRoU2AJpchyHfGuwZFA==", + "dev": true + }, + "node_modules/@cspell/dict-lorem-ipsum": { + "version": "1.0.22", + "resolved": "https://registry.npmjs.org/@cspell/dict-lorem-ipsum/-/dict-lorem-ipsum-1.0.22.tgz", + "integrity": "sha512-yqzspR+2ADeAGUxLTfZ4pXvPl7FmkENMRcGDECmddkOiuEwBCWMZdMP5fng9B0Q6j91hQ8w9CLvJKBz10TqNYg==", + "dev": true + }, + "node_modules/@cspell/dict-lua": { + "version": "1.0.16", + "resolved": "https://registry.npmjs.org/@cspell/dict-lua/-/dict-lua-1.0.16.tgz", + "integrity": "sha512-YiHDt8kmHJ8nSBy0tHzaxiuitYp+oJ66ffCYuFWTNB3//Y0SI4OGHU3omLsQVeXIfCeVrO4DrVvRDoCls9B5zQ==", + "dev": true + }, + "node_modules/@cspell/dict-node": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/@cspell/dict-node/-/dict-node-1.0.12.tgz", + "integrity": "sha512-RPNn/7CSkflAWk0sbSoOkg0ORrgBARUjOW3QjB11KwV1gSu8f5W/ij/S50uIXtlrfoBLqd4OyE04jyON+g/Xfg==", + "dev": true + }, + "node_modules/@cspell/dict-npm": { + "version": "1.0.16", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-1.0.16.tgz", + "integrity": "sha512-RwkuZGcYBxL3Yux3cSG/IOWGlQ1e9HLCpHeyMtTVGYKAIkFAVUnGrz20l16/Q7zUG7IEktBz5O42kAozrEnqMQ==", + "dev": true + }, + "node_modules/@cspell/dict-php": { + "version": "1.0.25", + "resolved": "https://registry.npmjs.org/@cspell/dict-php/-/dict-php-1.0.25.tgz", + "integrity": "sha512-RoBIP5MRdByyPaXcznZMfOY1JdCMYPPLua5E9gkq0TJO7bX5mC9hyAKfYBSWVQunZydd82HZixjb5MPkDFU1uw==", + "dev": true + }, + "node_modules/@cspell/dict-powershell": { + "version": "1.0.19", + "resolved": "https://registry.npmjs.org/@cspell/dict-powershell/-/dict-powershell-1.0.19.tgz", + "integrity": "sha512-zF/raM/lkhXeHf4I43OtK0gP9rBeEJFArscTVwLWOCIvNk21MJcNoTYoaGw+c056+Q+hJL0psGLO7QN+mxYH1A==", + "dev": true + }, + "node_modules/@cspell/dict-public-licenses": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-public-licenses/-/dict-public-licenses-1.0.4.tgz", + "integrity": "sha512-h4xULfVEDUeWyvp1OO19pcGDqWcBEQ7WGMp3QBHyYpjsamlzsyYYjCRSY2ZvpM7wruDmywSRFmRHJ/+uNFT7nA==", + "dev": true + }, + "node_modules/@cspell/dict-python": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-2.0.5.tgz", + "integrity": "sha512-WkyGYtNmUsOHsWixck7AxNvveDgVPqw0H51hzIY+/5u3c94wZUweIj0vfFOGIfOBq8e1ZxpjumKBxVDGXTmQkw==", + "dev": true + }, + "node_modules/@cspell/dict-ruby": { + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/@cspell/dict-ruby/-/dict-ruby-1.0.15.tgz", + "integrity": "sha512-I76hJA///lc1pgmDTGUFHN/O8KLIZIU/8TgIYIGI6Ix/YzSEvWNdQYbANn6JbCynS0X+7IbZ2Ft+QqvmGtIWuA==", + "dev": true + }, + "node_modules/@cspell/dict-rust": { + "version": "1.0.23", + "resolved": "https://registry.npmjs.org/@cspell/dict-rust/-/dict-rust-1.0.23.tgz", + "integrity": "sha512-lR4boDzs79YD6+30mmiSGAMMdwh7HTBAPUFSB0obR3Kidibfc3GZ+MHWZXay5dxZ4nBKM06vyjtanF9VJ8q1Iw==", + "dev": true + }, + "node_modules/@cspell/dict-scala": { + "version": "1.0.21", + "resolved": "https://registry.npmjs.org/@cspell/dict-scala/-/dict-scala-1.0.21.tgz", + "integrity": "sha512-5V/R7PRbbminTpPS3ywgdAalI9BHzcEjEj9ug4kWYvBIGwSnS7T6QCFCiu+e9LvEGUqQC+NHgLY4zs1NaBj2vA==", + "dev": true + }, + "node_modules/@cspell/dict-software-terms": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-2.0.11.tgz", + "integrity": "sha512-ix5k4m9Y5ZcozgE8QdEhiMIksreGozBETsCo5tGKAs4xDDkS4G07lOMFbek6m5poJ5qk5My0A/iz1j9f3L3aOg==", + "dev": true + }, + "node_modules/@cspell/dict-swift": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-swift/-/dict-swift-1.0.1.tgz", + "integrity": "sha512-M4onLt10Ptld8Q1BwBit8BBYVZ0d2ZEiBTW1AXekIVPQkPKkwa/RkGlR0GESWNTC2Zbmt/qge7trksVdaYVWFQ==", + "dev": true + }, + "node_modules/@cspell/dict-typescript": { + "version": "1.0.19", + "resolved": "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-1.0.19.tgz", + "integrity": "sha512-qmJApzoVskDeJnLZzZMaafEDGbEg5Elt4c3Mpg49SWzIHm1N4VXCp5CcFfHsOinJ30dGrs3ARAJGJZIw56kK6A==", + "dev": true + }, + "node_modules/@cspell/dict-vue": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-vue/-/dict-vue-2.0.1.tgz", + "integrity": "sha512-n9So2C2Zw+uSDRzb2h9wq3PjZBqoHx+vBvu6a34H2qpumNjZ6HaEronrzX5tXJJXzOtocIQYrLxdd128TAU3+g==", + "dev": true + }, + "node_modules/@eslint/eslintrc": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.0.5.tgz", + "integrity": "sha512-BLxsnmK3KyPunz5wmCCpqy0YelEoxxGmH73Is+Z74oOTMtExcjkr3dDR6quwrjh1YspA8DH9gnX1o069KiS9AQ==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.2.0", + "globals": "^13.9.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.0.tgz", + "integrity": "sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/eslintrc/node_modules/ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.2.tgz", + "integrity": "sha512-UXOuFCGcwciWckOpmfKDq/GyhlTf9pN/BzG//x8p8zTOFEcGuA68ANXheFS0AGvy3qgZqLBUkMs7hqzqCKOVwA==", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@microsoft/tsdoc": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.13.2.tgz", + "integrity": "sha512-WrHvO8PDL8wd8T2+zBGKrMwVL5IyzR3ryWUsl0PXgEV0QHup4mTLi0QcATefGI6Gx9Anu7vthPyyyLpY0EpiQg==", + "dev": true + }, + "node_modules/@microsoft/tsdoc-config": { + "version": "0.15.2", + "resolved": "https://registry.npmjs.org/@microsoft/tsdoc-config/-/tsdoc-config-0.15.2.tgz", + "integrity": "sha512-mK19b2wJHSdNf8znXSMYVShAHktVr/ib0Ck2FA3lsVBSEhSI/TfXT7DJQkAYgcztTuwazGcg58ZjYdk0hTCVrA==", + "dev": true, + "dependencies": { + "@microsoft/tsdoc": "0.13.2", + "ajv": "~6.12.6", + "jju": "~1.4.0", + "resolve": "~1.19.0" + } + }, + "node_modules/@microsoft/tsdoc-config/node_modules/resolve": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", + "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", + "dev": true, + "dependencies": { + "is-core-module": "^2.1.0", + "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@types/chai": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.0.tgz", + "integrity": "sha512-/ceqdqeRraGolFTcfoXNiqjyQhZzbINDngeoAq9GoHa8PPK1yNzTaxWjA6BFWp5Ua9JpXEMSS4s5i9tS0hOJtw==", + "dev": true + }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", + "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==", + "dev": true + }, + "node_modules/@types/json-schema": { + "version": "7.0.9", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", + "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", + "dev": true + }, + "node_modules/@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "dev": true + }, + "node_modules/@types/mocha": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.0.0.tgz", + "integrity": "sha512-scN0hAWyLVAvLR9AyW7HoFF5sJZglyBsbPuHO4fv7JRvfmPBMfp1ozWqOf/e4wwPNxezBZXRfWzMb6iFLgEVRA==", + "dev": true + }, + "node_modules/@types/node": { + "version": "17.0.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.5.tgz", + "integrity": "sha512-w3mrvNXLeDYV1GKTZorGJQivK6XLCoGwpnyJFbJVK/aTBQUxOCaa/GlFAAN3OTDFcb7h5tiFG+YXCO2By+riZw==", + "dev": true + }, + "node_modules/@types/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", + "dev": true + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.8.0.tgz", + "integrity": "sha512-spu1UW7QuBn0nJ6+psnfCc3iVoQAifjKORgBngKOmC8U/1tbe2YJMzYQqDGYB4JCss7L8+RM2kKLb1B1Aw9BNA==", + "dev": true, + "dependencies": { + "@typescript-eslint/experimental-utils": "5.8.0", + "@typescript-eslint/scope-manager": "5.8.0", + "debug": "^4.3.2", + "functional-red-black-tree": "^1.0.1", + "ignore": "^5.1.8", + "regexpp": "^3.2.0", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^5.0.0", + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/experimental-utils": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.8.0.tgz", + "integrity": "sha512-KN5FvNH71bhZ8fKtL+lhW7bjm7cxs1nt+hrDZWIqb6ViCffQcWyLunGrgvISgkRojIDcXIsH+xlFfI4RCDA0xA==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.9", + "@typescript-eslint/scope-manager": "5.8.0", + "@typescript-eslint/types": "5.8.0", + "@typescript-eslint/typescript-estree": "5.8.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.8.0.tgz", + "integrity": "sha512-Gleacp/ZhRtJRYs5/T8KQR3pAQjQI89Dn/k+OzyCKOsLiZH2/Vh60cFBTnFsHNI6WAD+lNUo/xGZ4NeA5u0Ipw==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "5.8.0", + "@typescript-eslint/types": "5.8.0", + "@typescript-eslint/typescript-estree": "5.8.0", + "debug": "^4.3.2" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.8.0.tgz", + "integrity": "sha512-x82CYJsLOjPCDuFFEbS6e7K1QEWj7u5Wk1alw8A+gnJiYwNnDJk0ib6PCegbaPMjrfBvFKa7SxE3EOnnIQz2Gg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.8.0", + "@typescript-eslint/visitor-keys": "5.8.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/types": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.8.0.tgz", + "integrity": "sha512-LdCYOqeqZWqCMOmwFnum6YfW9F3nKuxJiR84CdIRN5nfHJ7gyvGpXWqL/AaW0k3Po0+wm93ARAsOdzlZDPCcXg==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.8.0.tgz", + "integrity": "sha512-srfeZ3URdEcUsSLbkOFqS7WoxOqn8JNil2NSLO9O+I2/Uyc85+UlfpEvQHIpj5dVts7KKOZnftoJD/Fdv0L7nQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.8.0", + "@typescript-eslint/visitor-keys": "5.8.0", + "debug": "^4.3.2", + "globby": "^11.0.4", + "is-glob": "^4.0.3", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.8.0.tgz", + "integrity": "sha512-+HDIGOEMnqbxdAHegxvnOqESUH6RWFRR2b8qxP1W9CZnnYh4Usz6MBL+2KMAgPk/P0o9c1HqnYtwzVH6GTIqug==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.8.0", + "eslint-visitor-keys": "^3.0.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@ungap/promise-all-settled": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", + "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", + "dev": true + }, + "node_modules/acorn": { + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.6.0.tgz", + "integrity": "sha512-U1riIR+lBSNi3IbxtaHOIKdH8sLFv3NYfNv8sg7ZsNhcfl4HF2++BfqqrNAxoCLQW1iiylOj76ecnaUxz+z9yw==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/array-includes": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.4.tgz", + "integrity": "sha512-ZTNSQkmWumEbiHO2GF4GmWxYVTiQyJy2XOTa15sdQSrvKn7l+180egQMqlrMOUMCyLMD7pmyQe4mMDUT6Behrw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.1", + "get-intrinsic": "^1.1.1", + "is-string": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-timsort": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-timsort/-/array-timsort-1.0.3.tgz", + "integrity": "sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ==", + "dev": true + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/array.prototype.flat": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.5.tgz", + "integrity": "sha512-KaYU+S+ndVqyUnignHftkwc58o3uVU1jzczILJ1tN2YaIZpFIKBiP/x/j97E5MVPsaCloPbqWLB/8qCTVvT2qg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/babel-plugin-dynamic-import-node": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", + "integrity": "sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==", + "dev": true, + "dependencies": { + "object.assign": "^4.1.0" + } + }, + "node_modules/babel-plugin-polyfill-corejs2": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.0.tgz", + "integrity": "sha512-wMDoBJ6uG4u4PNFh72Ty6t3EgfA91puCuAwKIazbQlci+ENb/UU9A3xG5lutjUIiXCIn1CY5L15r9LimiJyrSA==", + "dev": true, + "dependencies": { + "@babel/compat-data": "^7.13.11", + "@babel/helper-define-polyfill-provider": "^0.3.0", + "semver": "^6.1.1" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/babel-plugin-polyfill-corejs3": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.4.0.tgz", + "integrity": "sha512-YxFreYwUfglYKdLUGvIF2nJEsGwj+RhWSX/ije3D2vQPOXuyMLMtg/cCGMDpOA7Nd+MwlNdnGODbd2EwUZPlsw==", + "dev": true, + "dependencies": { + "@babel/helper-define-polyfill-provider": "^0.3.0", + "core-js-compat": "^3.18.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/babel-plugin-polyfill-regenerator": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.3.0.tgz", + "integrity": "sha512-dhAPTDLGoMW5/84wkgwiLRwMnio2i1fUe53EuvtKMv0pn2p3S8OCoV1xAzfJPl0KOX7IB89s2ib85vbYiea3jg==", + "dev": true, + "dependencies": { + "@babel/helper-define-polyfill-provider": "^0.3.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "node_modules/browserslist": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.19.1.tgz", + "integrity": "sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A==", + "dev": true, + "dependencies": { + "caniuse-lite": "^1.0.30001286", + "electron-to-chromium": "^1.4.17", + "escalade": "^3.1.1", + "node-releases": "^2.0.1", + "picocolors": "^1.0.0" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "node_modules/c8": { + "version": "7.10.0", + "resolved": "https://registry.npmjs.org/c8/-/c8-7.10.0.tgz", + "integrity": "sha512-OAwfC5+emvA6R7pkYFVBTOtI5ruf9DahffGmIqUc9l6wEh0h7iAFP6dt/V9Ioqlr2zW5avX9U9/w1I4alTRHkA==", + "dev": true, + "dependencies": { + "@bcoe/v8-coverage": "^0.2.3", + "@istanbuljs/schema": "^0.1.2", + "find-up": "^5.0.0", + "foreground-child": "^2.0.0", + "istanbul-lib-coverage": "^3.0.1", + "istanbul-lib-report": "^3.0.0", + "istanbul-reports": "^3.0.2", + "rimraf": "^3.0.0", + "test-exclude": "^6.0.0", + "v8-to-istanbul": "^8.0.0", + "yargs": "^16.2.0", + "yargs-parser": "^20.2.7" + }, + "bin": { + "c8": "bin/c8.js" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.1.tgz", + "integrity": "sha512-tVI4q5jjFV5CavAU8DXfza/TJcZutVKo/5Foskmsqcm0MsL91moHvwiGNnqaa2o6PF/7yT5ikDRcVcl8Rj6LCA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001292", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001292.tgz", + "integrity": "sha512-jnT4Tq0Q4ma+6nncYQVe7d73kmDmE9C3OGTx3MvW7lBM/eY1S1DZTMBON7dqV481RhNiS5OxD7k9JQvmDOTirw==", + "dev": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + } + }, + "node_modules/chai": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.4.tgz", + "integrity": "sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA==", + "dev": true, + "dependencies": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^3.0.1", + "get-func-name": "^2.0.0", + "pathval": "^1.1.1", + "type-detect": "^4.0.5" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/chokidar": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", + "integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==", + "dev": true, + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/chokidar/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/clear-module": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/clear-module/-/clear-module-4.1.2.tgz", + "integrity": "sha512-LWAxzHqdHsAZlPlEyJ2Poz6AIs384mPeqLVCru2p0BrP9G/kVGuhNyZYClLO6cXlnuJjzC8xtsJIuMjKqLXoAw==", + "dev": true, + "dependencies": { + "parent-module": "^2.0.0", + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/clone-deep": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", + "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", + "dev": true, + "dependencies": { + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.2", + "shallow-clone": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "node_modules/commander": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", + "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", + "dev": true, + "engines": { + "node": ">= 12" + } + }, + "node_modules/comment-json": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.1.1.tgz", + "integrity": "sha512-v8gmtPvxhBlhdRBLwdHSjGy9BgA23t9H1FctdQKyUrErPjSrJcdDMqBq9B4Irtm7w3TNYLQJNH6ARKnpyag1sA==", + "dev": true, + "dependencies": { + "array-timsort": "^1.0.3", + "core-util-is": "^1.0.2", + "esprima": "^4.0.1", + "has-own-prop": "^2.0.0", + "repeat-string": "^1.6.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "node_modules/configstore": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz", + "integrity": "sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA==", + "dev": true, + "dependencies": { + "dot-prop": "^5.2.0", + "graceful-fs": "^4.1.2", + "make-dir": "^3.0.0", + "unique-string": "^2.0.0", + "write-file-atomic": "^3.0.0", + "xdg-basedir": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/configstore/node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/convert-source-map": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", + "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.1" + } + }, + "node_modules/core-js-compat": { + "version": "3.20.1", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.20.1.tgz", + "integrity": "sha512-AVhKZNpqMV3Jz8hU0YEXXE06qoxtQGsAqU0u1neUngz5IusDJRX/ZJ6t3i7mS7QxNyEONbCo14GprkBrxPlTZA==", + "dev": true, + "dependencies": { + "browserslist": "^4.19.1", + "semver": "7.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, + "node_modules/core-js-compat/node_modules/semver": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", + "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true + }, + "node_modules/cosmiconfig": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.1.tgz", + "integrity": "sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ==", + "dev": true, + "dependencies": { + "@types/parse-json": "^4.0.0", + "import-fresh": "^3.2.1", + "parse-json": "^5.0.0", + "path-type": "^4.0.0", + "yaml": "^1.10.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/crypto-random-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", + "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/cspell": { + "version": "5.13.4", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-5.13.4.tgz", + "integrity": "sha512-T/AMylb/CY0af8Oc1/Nv79Mqe852ga4AOAY0m8eYG8A5zahDpL2EC6PN5yK8KFn0UPMWMB8B2atZf6/U5RWdaQ==", + "dev": true, + "dependencies": { + "chalk": "^4.1.2", + "commander": "^8.3.0", + "comment-json": "^4.1.1", + "cspell-gitignore": "^5.13.4", + "cspell-glob": "^5.13.4", + "cspell-lib": "^5.13.4", + "fast-json-stable-stringify": "^2.1.0", + "file-entry-cache": "^6.0.1", + "fs-extra": "^10.0.0", + "get-stdin": "^8.0.0", + "glob": "^7.2.0", + "imurmurhash": "^0.1.4", + "semver": "^7.3.5", + "strip-ansi": "^6.0.1", + "vscode-uri": "^3.0.2" + }, + "bin": { + "cspell": "bin.js" + }, + "engines": { + "node": ">=12.13.0" + }, + "funding": { + "url": "https://github.com/streetsidesoftware/cspell?sponsor=1" + } + }, + "node_modules/cspell-gitignore": { + "version": "5.13.4", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-5.13.4.tgz", + "integrity": "sha512-Md2V+EyILAavxO6CJ/Y/l8/p2nBFA0p1sMrjCEBtBuF3BL7A/A2LGaK4Tb+trVONFAKQ5cZo84WbyvSYWUqvpw==", + "dev": true, + "dependencies": { + "cspell-glob": "^5.13.4", + "find-up": "^5.0.0" + }, + "bin": { + "cspell-gitignore": "bin.js" + }, + "engines": { + "node": ">=12.13.0" + } + }, + "node_modules/cspell-glob": { + "version": "5.13.4", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-5.13.4.tgz", + "integrity": "sha512-uKkibBe41Tr609mNBOairsyuNhPo+kqMVw2JeobfgN71GESQLjU7hr6VpKaUKGZyJpaicP606LB0gZBM38IOvw==", + "dev": true, + "dependencies": { + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=12.13.0" + } + }, + "node_modules/cspell-io": { + "version": "5.13.4", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-5.13.4.tgz", + "integrity": "sha512-THe0R5CAv2h5yvrF3dtvigY73mnfFlfTJFWoSgGsafKq5nmR8jgKpbjQgK93zL0JC//BgdK0extfrSLsW2D4mw==", + "dev": true, + "engines": { + "node": ">=12.13.0" + } + }, + "node_modules/cspell-lib": { + "version": "5.13.4", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-5.13.4.tgz", + "integrity": "sha512-kKGqAMXKdj8l3sgjoJuuQKTuwLz/33c3YFM/d3lYzcP3mo7C4v/M04Dm4mlTdWA0l4WYlzuSqxDmj32SsHMbNA==", + "dev": true, + "dependencies": { + "@cspell/cspell-bundled-dicts": "^5.13.4", + "@cspell/cspell-types": "^5.13.4", + "clear-module": "^4.1.2", + "comment-json": "^4.1.1", + "configstore": "^5.0.1", + "cosmiconfig": "^7.0.1", + "cspell-glob": "^5.13.4", + "cspell-io": "^5.13.4", + "cspell-trie-lib": "^5.13.4", + "find-up": "^5.0.0", + "fs-extra": "^10.0.0", + "gensequence": "^3.1.1", + "import-fresh": "^3.3.0", + "resolve-from": "^5.0.0", + "resolve-global": "^1.0.0", + "vscode-uri": "^3.0.2" + }, + "engines": { + "node": ">=12.13.0" + } + }, + "node_modules/cspell-trie-lib": { + "version": "5.13.4", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-5.13.4.tgz", + "integrity": "sha512-e5fKOOioJlJJ+DcLVIkuy+7FI/YmUojhfzdUjTvLDn5EJFL3/oiP5AvDXGV3bMqYzlbRQKD6FpC61KVIkNMbEw==", + "dev": true, + "dependencies": { + "fs-extra": "^10.0.0", + "gensequence": "^3.1.1" + }, + "engines": { + "node": ">=12.13.0" + } + }, + "node_modules/cspell/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/cspell/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/cspell/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/cspell/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/cspell/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/cspell/node_modules/semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/cspell/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/deep-eql": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", + "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "dev": true, + "dependencies": { + "type-detect": "^4.0.0" + }, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "node_modules/define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "dependencies": { + "object-keys": "^1.0.12" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/diff": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", + "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/dot-prop": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", + "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", + "dev": true, + "dependencies": { + "is-obj": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.4.28", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.28.tgz", + "integrity": "sha512-Gzbf0wUtKfyPaqf0Plz+Ctinf9eQIzxEqBHwSvbGfeOm9GMNdLxyu1dNiCUfM+x6r4BE0xUJNh3Nmg9gfAtTmg==", + "dev": true + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "dependencies": { + "ansi-colors": "^4.1.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/es-abstract": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.1.tgz", + "integrity": "sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "get-intrinsic": "^1.1.1", + "get-symbol-description": "^1.0.0", + "has": "^1.0.3", + "has-symbols": "^1.0.2", + "internal-slot": "^1.0.3", + "is-callable": "^1.2.4", + "is-negative-zero": "^2.0.1", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.1", + "is-string": "^1.0.7", + "is-weakref": "^1.0.1", + "object-inspect": "^1.11.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.2", + "string.prototype.trimend": "^1.0.4", + "string.prototype.trimstart": "^1.0.4", + "unbox-primitive": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/eslint": { + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.5.0.tgz", + "integrity": "sha512-tVGSkgNbOfiHyVte8bCM8OmX+xG9PzVG/B4UCF60zx7j61WIVY/AqJECDgpLD4DbbESD0e174gOg3ZlrX15GDg==", + "dev": true, + "dependencies": { + "@eslint/eslintrc": "^1.0.5", + "@humanwhocodes/config-array": "^0.9.2", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.1.0", + "eslint-utils": "^3.0.0", + "eslint-visitor-keys": "^3.1.0", + "espree": "^9.2.0", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^6.0.1", + "globals": "^13.6.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.2.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.1", + "strip-json-comments": "^3.1.0", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-import-resolver-node": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz", + "integrity": "sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw==", + "dev": true, + "dependencies": { + "debug": "^3.2.7", + "resolve": "^1.20.0" + } + }, + "node_modules/eslint-import-resolver-node/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-module-utils": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.1.tgz", + "integrity": "sha512-fjoetBXQZq2tSTWZ9yWVl2KuFrTZZH3V+9iD1V1RfpDgxzJR+mPd/KZmMiA8gbPqdBzpNiEHOuT7IYEWxrH0zQ==", + "dev": true, + "dependencies": { + "debug": "^3.2.7", + "find-up": "^2.1.0", + "pkg-dir": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-module-utils/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-module-utils/node_modules/find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "dependencies": { + "locate-path": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-module-utils/node_modules/locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "dependencies": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-module-utils/node_modules/p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "dependencies": { + "p-try": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-module-utils/node_modules/p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "dependencies": { + "p-limit": "^1.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-module-utils/node_modules/path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-plugin-es": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-3.0.1.tgz", + "integrity": "sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ==", + "dev": true, + "dependencies": { + "eslint-utils": "^2.0.0", + "regexpp": "^3.0.0" + }, + "engines": { + "node": ">=8.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=4.19.1" + } + }, + "node_modules/eslint-plugin-es/node_modules/eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^1.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } + }, + "node_modules/eslint-plugin-es/node_modules/eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-plugin-import": { + "version": "2.25.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.25.3.tgz", + "integrity": "sha512-RzAVbby+72IB3iOEL8clzPLzL3wpDrlwjsTBAQXgyp5SeTqqY+0bFubwuo+y/HLhNZcXV4XqTBO4LGsfyHIDXg==", + "dev": true, + "dependencies": { + "array-includes": "^3.1.4", + "array.prototype.flat": "^1.2.5", + "debug": "^2.6.9", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.6", + "eslint-module-utils": "^2.7.1", + "has": "^1.0.3", + "is-core-module": "^2.8.0", + "is-glob": "^4.0.3", + "minimatch": "^3.0.4", + "object.values": "^1.1.5", + "resolve": "^1.20.0", + "tsconfig-paths": "^3.11.0" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" + } + }, + "node_modules/eslint-plugin-import/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/eslint-plugin-import/node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-plugin-import/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "node_modules/eslint-plugin-internal-rules": { + "resolved": "resources/eslint-internal-rules", + "link": true + }, + "node_modules/eslint-plugin-node": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz", + "integrity": "sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g==", + "dev": true, + "dependencies": { + "eslint-plugin-es": "^3.0.0", + "eslint-utils": "^2.0.0", + "ignore": "^5.1.1", + "minimatch": "^3.0.4", + "resolve": "^1.10.1", + "semver": "^6.1.0" + }, + "engines": { + "node": ">=8.10.0" + }, + "peerDependencies": { + "eslint": ">=5.16.0" + } + }, + "node_modules/eslint-plugin-node/node_modules/eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^1.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } + }, + "node_modules/eslint-plugin-node/node_modules/eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-plugin-simple-import-sort": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-7.0.0.tgz", + "integrity": "sha512-U3vEDB5zhYPNfxT5TYR7u01dboFZp+HNpnGhkDB2g/2E4wZ/g1Q9Ton8UwCLfRV9yAKyYqDh62oHOamvkFxsvw==", + "dev": true, + "peerDependencies": { + "eslint": ">=5.0.0" + } + }, + "node_modules/eslint-plugin-tsdoc": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/eslint-plugin-tsdoc/-/eslint-plugin-tsdoc-0.2.14.tgz", + "integrity": "sha512-fJ3fnZRsdIoBZgzkQjv8vAj6NeeOoFkTfgosj6mKsFjX70QV256sA/wq+y/R2+OL4L8E79VVaVWrPeZnKNe8Ng==", + "dev": true, + "dependencies": { + "@microsoft/tsdoc": "0.13.2", + "@microsoft/tsdoc-config": "0.15.2" + } + }, + "node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^2.0.0" + }, + "engines": { + "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=5" + } + }, + "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz", + "integrity": "sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/eslint/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/eslint/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/eslint/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/eslint/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/eslint/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/eslint-scope": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.0.tgz", + "integrity": "sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/eslint/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/eslint/node_modules/globals": { + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.0.tgz", + "integrity": "sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/eslint/node_modules/semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/espree": { + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.2.0.tgz", + "integrity": "sha512-oP3utRkynpZWF/F2x/HZJ+AGtnIclaR7z1pYPxy7NYM2fSO6LgK/Rkny8anRSPK/VwEA1eqm2squui0T7ZMOBg==", + "dev": true, + "dependencies": { + "acorn": "^8.6.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^3.1.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esquery": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "dev": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esquery/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-glob": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.7.tgz", + "integrity": "sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "node_modules/fastq": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-cache-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", + "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", + "dev": true, + "dependencies": { + "commondir": "^1.0.1", + "make-dir": "^2.0.0", + "pkg-dir": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/find-cache-dir/node_modules/find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "dependencies": { + "locate-path": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/find-cache-dir/node_modules/locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "dependencies": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/find-cache-dir/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/find-cache-dir/node_modules/p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "dependencies": { + "p-limit": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/find-cache-dir/node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/find-cache-dir/node_modules/path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/find-cache-dir/node_modules/pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "dev": true, + "dependencies": { + "find-up": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true, + "bin": { + "flat": "cli.js" + } + }, + "node_modules/flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, + "dependencies": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.4.tgz", + "integrity": "sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw==", + "dev": true + }, + "node_modules/foreground-child": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/fs-extra": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz", + "integrity": "sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "node_modules/functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "node_modules/gensequence": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/gensequence/-/gensequence-3.1.1.tgz", + "integrity": "sha512-ys3h0hiteRwmY6BsvSttPmkhC0vEQHPJduANBRtH/dlDPZ0UBIb/dXy80IcckXyuQ6LKg+PloRqvGER9IS7F7g==", + "dev": true, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", + "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-stdin": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz", + "integrity": "sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-symbol-description": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", + "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/global-dirs": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz", + "integrity": "sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU=", + "dev": true, + "dependencies": { + "ini": "^1.3.4" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/globby": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz", + "integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.1.1", + "ignore": "^5.1.4", + "merge2": "^1.3.0", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz", + "integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==", + "dev": true + }, + "node_modules/growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "dev": true, + "engines": { + "node": ">=4.x" + } + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-bigints": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz", + "integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/has-own-prop": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-own-prop/-/has-own-prop-2.0.0.tgz", + "integrity": "sha512-Pq0h+hvsVm6dDEa8x82GnLSYHOzNDt7f0ddFa3FqcQlgzEiptPqL+XrOJNavjOzSYiYWIrgeVYYgGlLmnxwilQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/has-symbols": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", + "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", + "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true, + "bin": { + "he": "bin/he" + } + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "node_modules/ignore": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-fresh/node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/import-fresh/node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + }, + "node_modules/internal-slot": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", + "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.0", + "has": "^1.0.3", + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "node_modules/is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dev": true, + "dependencies": { + "has-bigints": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-callable": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz", + "integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-core-module": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.0.tgz", + "integrity": "sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-negative-zero": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", + "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-number-object": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.6.tgz", + "integrity": "sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz", + "integrity": "sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", + "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "dev": true, + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^3.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report/node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/istanbul-lib-report/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-reports": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.2.tgz", + "integrity": "sha512-0gHxuT1NNC0aEIL1zbJ+MTgPbbHhU77eJPuU35WKA7TgXiSNlCAx4PENoMrH0Or6M2H80TaZcWKhM0IK6V8gRw==", + "dev": true, + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jju": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz", + "integrity": "sha1-o6vicYryQaKykE+EpiWXDzia4yo=", + "dev": true + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true, + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "node_modules/json5": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", + "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", + "dev": true, + "dependencies": { + "minimist": "^1.2.5" + }, + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash.debounce": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", + "dev": true + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-symbols/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/log-symbols/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/log-symbols/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/log-symbols/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/log-symbols/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/log-symbols/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "dependencies": { + "pify": "^4.0.1", + "semver": "^5.6.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", + "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "dev": true, + "dependencies": { + "braces": "^3.0.1", + "picomatch": "^2.2.3" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "node_modules/mocha": { + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.1.3.tgz", + "integrity": "sha512-Xcpl9FqXOAYqI3j79pEtHBBnQgVXIhpULjGQa7DVb0Po+VzmSIK9kanAiWLHoRR/dbZ2qpdPshuXr8l1VaHCzw==", + "dev": true, + "dependencies": { + "@ungap/promise-all-settled": "1.1.2", + "ansi-colors": "4.1.1", + "browser-stdout": "1.3.1", + "chokidar": "3.5.2", + "debug": "4.3.2", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.1.7", + "growl": "1.10.5", + "he": "1.2.0", + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", + "minimatch": "3.0.4", + "ms": "2.1.3", + "nanoid": "3.1.25", + "serialize-javascript": "6.0.0", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "which": "2.0.2", + "workerpool": "6.1.5", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mochajs" + } + }, + "node_modules/mocha/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mocha/node_modules/glob": { + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/mocha/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/mocha/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/mocha/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/mocha/node_modules/yargs-parser": { + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/nanoid": { + "version": "3.1.25", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.25.tgz", + "integrity": "sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q==", + "dev": true, + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "node_modules/node-releases": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.1.tgz", + "integrity": "sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==", + "dev": true + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", + "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.values": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.5.tgz", + "integrity": "sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/parent-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-2.0.0.tgz", + "integrity": "sha512-uo0Z9JJeWzv8BG+tRcapBKNJ0dro9cLyczGzulS6EfeyAdeC9sbojtW6XwvYxJkEne9En+J2XEl4zyglVeIwFg==", + "dev": true, + "dependencies": { + "callsites": "^3.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, + "node_modules/picomatch": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/pirates": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.4.tgz", + "integrity": "sha512-ZIrVPH+A52Dw84R0L3/VS9Op04PuQ2SEoJL6bkshmiTic/HldyW9Tf7oH5mhJZBK7NmDx27vSMrYEXPXclpDKw==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "dev": true, + "dependencies": { + "find-up": "^2.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/pkg-dir/node_modules/find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "dependencies": { + "locate-path": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/pkg-dir/node_modules/locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "dependencies": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/pkg-dir/node_modules/p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "dependencies": { + "p-try": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/pkg-dir/node_modules/p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "dependencies": { + "p-limit": "^1.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/pkg-dir/node_modules/path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.5.1.tgz", + "integrity": "sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==", + "dev": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/regenerate": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", + "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", + "dev": true + }, + "node_modules/regenerate-unicode-properties": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-9.0.0.tgz", + "integrity": "sha512-3E12UeNSPfjrgwjkR81m5J7Aw/T55Tu7nUyZVQYCKEOs+2dkxEY+DpPtZzO4YruuiPb7NkYLVcyJC4+zCbk5pA==", + "dev": true, + "dependencies": { + "regenerate": "^1.4.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/regenerator-runtime": { + "version": "0.13.9", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", + "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==", + "dev": true + }, + "node_modules/regenerator-transform": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.5.tgz", + "integrity": "sha512-eOf6vka5IO151Jfsw2NO9WpGX58W6wWmefK3I1zEGr0lOD0u8rwPaNqQL1aRxUaxLeKO3ArNh3VYg1KbaD+FFw==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.8.4" + } + }, + "node_modules/regexpp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } + }, + "node_modules/regexpu-core": { + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.8.0.tgz", + "integrity": "sha512-1F6bYsoYiz6is+oz70NWur2Vlh9KWtswuRuzJOfeYUrfPX2o8n74AnUVaOGDbUqVGO9fNHu48/pjJO4sNVwsOg==", + "dev": true, + "dependencies": { + "regenerate": "^1.4.2", + "regenerate-unicode-properties": "^9.0.0", + "regjsgen": "^0.5.2", + "regjsparser": "^0.7.0", + "unicode-match-property-ecmascript": "^2.0.0", + "unicode-match-property-value-ecmascript": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/regjsgen": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.2.tgz", + "integrity": "sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A==", + "dev": true + }, + "node_modules/regjsparser": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.7.0.tgz", + "integrity": "sha512-A4pcaORqmNMDVwUjWoTzuhwMGpP+NykpfqAsEgI1FSH/EzC7lrN5TMd+kN8YCovX+jMpu8eaqXgXPCa0g8FQNQ==", + "dev": true, + "dependencies": { + "jsesc": "~0.5.0" + }, + "bin": { + "regjsparser": "bin/parser" + } + }, + "node_modules/regjsparser/node_modules/jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "dev": true, + "bin": { + "jsesc": "bin/jsesc" + } + }, + "node_modules/repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", + "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", + "dev": true, + "dependencies": { + "is-core-module": "^2.2.0", + "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-global": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-global/-/resolve-global-1.0.0.tgz", + "integrity": "sha512-zFa12V4OLtT5XUX/Q4VLvTfBf+Ok0SPc1FNGM/z9ctUdiU618qwKpWnd0CHs3+RqROfyEg/DhuHbMWYqcgljEw==", + "dev": true, + "dependencies": { + "global-dirs": "^0.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/serialize-javascript": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "dev": true, + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/shallow-clone": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", + "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.6.tgz", + "integrity": "sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ==", + "dev": true + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/source-map-support/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz", + "integrity": "sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz", + "integrity": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/tsconfig-paths": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz", + "integrity": "sha512-e5adrnOYT6zqVnWqZu7i/BQ3BnhzvGbjEjejFXO20lKIKpwTaupkCPgEfv4GZK1IBciJUEhYs3J3p75FdaTFVg==", + "dev": true, + "dependencies": { + "@types/json5": "^0.0.29", + "json5": "^1.0.1", + "minimist": "^1.2.0", + "strip-bom": "^3.0.0" + } + }, + "node_modules/tsconfig-paths/node_modules/json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, + "node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "node_modules/tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + } + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, + "dependencies": { + "is-typedarray": "^1.0.0" + } + }, + "node_modules/typescript": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.4.tgz", + "integrity": "sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/unbox-primitive": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz", + "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1", + "has-bigints": "^1.0.1", + "has-symbols": "^1.0.2", + "which-boxed-primitive": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/unicode-canonical-property-names-ecmascript": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", + "integrity": "sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-match-property-ecmascript": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz", + "integrity": "sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==", + "dev": true, + "dependencies": { + "unicode-canonical-property-names-ecmascript": "^2.0.0", + "unicode-property-aliases-ecmascript": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-match-property-value-ecmascript": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.0.0.tgz", + "integrity": "sha512-7Yhkc0Ye+t4PNYzOGKedDhXbYIBe1XEQYQxOPyhcXNMJ0WCABqqj6ckydd6pWRZTHV4GuCPKdBAUiMc60tsKVw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-property-aliases-ecmascript": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.0.0.tgz", + "integrity": "sha512-5Zfuy9q/DFr4tfO7ZPeVXb1aPoeQSdeFMLpYuFebehDAhbuevLs5yxSZmIFN1tP5F9Wl4IpJrYojg85/zgyZHQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/unique-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", + "integrity": "sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==", + "dev": true, + "dependencies": { + "crypto-random-string": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "dev": true, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/v8-compile-cache": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", + "dev": true + }, + "node_modules/v8-to-istanbul": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-8.1.0.tgz", + "integrity": "sha512-/PRhfd8aTNp9Ggr62HPzXg2XasNFGy5PBt0Rp04du7/8GNNSgxFL6WBTkgMKSL9bFjH+8kKEG3f37FmxiTqUUA==", + "dev": true, + "dependencies": { + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^1.6.0", + "source-map": "^0.7.3" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/v8-to-istanbul/node_modules/source-map": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/vscode-uri": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.3.tgz", + "integrity": "sha512-EcswR2S8bpR7fD0YPeS7r2xXExrScVMxg4MedACaWHEtx9ftCF/qHG1xGkolzTPcEmjTavCQgbVzHUIdTMzFGA==", + "dev": true + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, + "dependencies": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/workerpool": { + "version": "6.1.5", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.5.tgz", + "integrity": "sha512-XdKkCK0Zqc6w3iTxLckiuJ81tiD/o5rBE/m+nXpRCB+/Sq4DqkfXZ/x0jW02DG1tGsfUGXbTJyZDP+eu67haSw==", + "dev": true + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "node_modules/write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "dev": true, + "dependencies": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, + "node_modules/xdg-basedir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz", + "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/yaml": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", + "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "dev": true, + "dependencies": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "resources/eslint-internal-rules": { + "name": "eslint-plugin-graphql-internal", + "version": "0.0.0", + "dev": true, + "engines": { + "node": ">= 14.0.0" + } + } + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.0.tgz", + "integrity": "sha512-IF4EOMEV+bfYwOmNxGzSnjR2EmQod7f1UXOpZM3l4i4o4QNwzjtJAu/HxdjHq0aYBvdqMuQEY1eg0nqW9ZPORA==", + "dev": true, + "requires": { + "@babel/highlight": "^7.16.0" + } + }, + "@babel/compat-data": { + "version": "7.16.4", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.16.4.tgz", + "integrity": "sha512-1o/jo7D+kC9ZjHX5v+EHrdjl3PhxMrLSOTGsOdHJ+KL8HCaEK6ehrVL2RS6oHDZp+L7xLirLrPmQtEng769J/Q==", + "dev": true + }, + "@babel/core": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.16.5.tgz", + "integrity": "sha512-wUcenlLzuWMZ9Zt8S0KmFwGlH6QKRh3vsm/dhDA3CHkiTA45YuG1XkHRcNRl73EFPXDp/d5kVOU0/y7x2w6OaQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.16.0", + "@babel/generator": "^7.16.5", + "@babel/helper-compilation-targets": "^7.16.3", + "@babel/helper-module-transforms": "^7.16.5", + "@babel/helpers": "^7.16.5", + "@babel/parser": "^7.16.5", + "@babel/template": "^7.16.0", + "@babel/traverse": "^7.16.5", + "@babel/types": "^7.16.0", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.1.2", + "semver": "^6.3.0", + "source-map": "^0.5.0" + } + }, + "@babel/generator": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.16.5.tgz", + "integrity": "sha512-kIvCdjZqcdKqoDbVVdt5R99icaRtrtYhYK/xux5qiWCBmfdvEYMFZ68QCrpE5cbFM1JsuArUNs1ZkuKtTtUcZA==", + "dev": true, + "requires": { + "@babel/types": "^7.16.0", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "@babel/helper-annotate-as-pure": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.16.0.tgz", + "integrity": "sha512-ItmYF9vR4zA8cByDocY05o0LGUkp1zhbTQOH1NFyl5xXEqlTJQCEJjieriw+aFpxo16swMxUnUiKS7a/r4vtHg==", + "dev": true, + "requires": { + "@babel/types": "^7.16.0" + } + }, + "@babel/helper-builder-binary-assignment-operator-visitor": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.16.5.tgz", + "integrity": "sha512-3JEA9G5dmmnIWdzaT9d0NmFRgYnWUThLsDaL7982H0XqqWr56lRrsmwheXFMjR+TMl7QMBb6mzy9kvgr1lRLUA==", + "dev": true, + "requires": { + "@babel/helper-explode-assignable-expression": "^7.16.0", + "@babel/types": "^7.16.0" + } + }, + "@babel/helper-compilation-targets": { + "version": "7.16.3", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.3.tgz", + "integrity": "sha512-vKsoSQAyBmxS35JUOOt+07cLc6Nk/2ljLIHwmq2/NM6hdioUaqEXq/S+nXvbvXbZkNDlWOymPanJGOc4CBjSJA==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.16.0", + "@babel/helper-validator-option": "^7.14.5", + "browserslist": "^4.17.5", + "semver": "^6.3.0" + } + }, + "@babel/helper-create-class-features-plugin": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.16.5.tgz", + "integrity": "sha512-NEohnYA7mkB8L5JhU7BLwcBdU3j83IziR9aseMueWGeAjblbul3zzb8UvJ3a1zuBiqCMObzCJHFqKIQE6hTVmg==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.16.0", + "@babel/helper-environment-visitor": "^7.16.5", + "@babel/helper-function-name": "^7.16.0", + "@babel/helper-member-expression-to-functions": "^7.16.5", + "@babel/helper-optimise-call-expression": "^7.16.0", + "@babel/helper-replace-supers": "^7.16.5", + "@babel/helper-split-export-declaration": "^7.16.0" + } + }, + "@babel/helper-create-regexp-features-plugin": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.16.0.tgz", + "integrity": "sha512-3DyG0zAFAZKcOp7aVr33ddwkxJ0Z0Jr5V99y3I690eYLpukJsJvAbzTy1ewoCqsML8SbIrjH14Jc/nSQ4TvNPA==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.16.0", + "regexpu-core": "^4.7.1" + } + }, + "@babel/helper-define-polyfill-provider": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.0.tgz", + "integrity": "sha512-7hfT8lUljl/tM3h+izTX/pO3W3frz2ok6Pk+gzys8iJqDfZrZy2pXjRTZAvG2YmfHun1X4q8/UZRLatMfqc5Tg==", + "dev": true, + "requires": { + "@babel/helper-compilation-targets": "^7.13.0", + "@babel/helper-module-imports": "^7.12.13", + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/traverse": "^7.13.0", + "debug": "^4.1.1", + "lodash.debounce": "^4.0.8", + "resolve": "^1.14.2", + "semver": "^6.1.2" + } + }, + "@babel/helper-environment-visitor": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.5.tgz", + "integrity": "sha512-ODQyc5AnxmZWm/R2W7fzhamOk1ey8gSguo5SGvF0zcB3uUzRpTRmM/jmLSm9bDMyPlvbyJ+PwPEK0BWIoZ9wjg==", + "dev": true, + "requires": { + "@babel/types": "^7.16.0" + } + }, + "@babel/helper-explode-assignable-expression": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.16.0.tgz", + "integrity": "sha512-Hk2SLxC9ZbcOhLpg/yMznzJ11W++lg5GMbxt1ev6TXUiJB0N42KPC+7w8a+eWGuqDnUYuwStJoZHM7RgmIOaGQ==", + "dev": true, + "requires": { + "@babel/types": "^7.16.0" + } + }, + "@babel/helper-function-name": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.0.tgz", + "integrity": "sha512-BZh4mEk1xi2h4HFjWUXRQX5AEx4rvaZxHgax9gcjdLWdkjsY7MKt5p0otjsg5noXw+pB+clMCjw+aEVYADMjog==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.16.0", + "@babel/template": "^7.16.0", + "@babel/types": "^7.16.0" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.0.tgz", + "integrity": "sha512-ASCquNcywC1NkYh/z7Cgp3w31YW8aojjYIlNg4VeJiHkqyP4AzIvr4qx7pYDb4/s8YcsZWqqOSxgkvjUz1kpDQ==", + "dev": true, + "requires": { + "@babel/types": "^7.16.0" + } + }, + "@babel/helper-hoist-variables": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.0.tgz", + "integrity": "sha512-1AZlpazjUR0EQZQv3sgRNfM9mEVWPK3M6vlalczA+EECcPz3XPh6VplbErL5UoMpChhSck5wAJHthlj1bYpcmg==", + "dev": true, + "requires": { + "@babel/types": "^7.16.0" + } + }, + "@babel/helper-member-expression-to-functions": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.16.5.tgz", + "integrity": "sha512-7fecSXq7ZrLE+TWshbGT+HyCLkxloWNhTbU2QM1NTI/tDqyf0oZiMcEfYtDuUDCo528EOlt39G1rftea4bRZIw==", + "dev": true, + "requires": { + "@babel/types": "^7.16.0" + } + }, + "@babel/helper-module-imports": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.0.tgz", + "integrity": "sha512-kkH7sWzKPq0xt3H1n+ghb4xEMP8k0U7XV3kkB+ZGy69kDk2ySFW1qPi06sjKzFY3t1j6XbJSqr4mF9L7CYVyhg==", + "dev": true, + "requires": { + "@babel/types": "^7.16.0" + } + }, + "@babel/helper-module-transforms": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.16.5.tgz", + "integrity": "sha512-CkvMxgV4ZyyioElFwcuWnDCcNIeyqTkCm9BxXZi73RR1ozqlpboqsbGUNvRTflgZtFbbJ1v5Emvm+lkjMYY/LQ==", + "dev": true, + "requires": { + "@babel/helper-environment-visitor": "^7.16.5", + "@babel/helper-module-imports": "^7.16.0", + "@babel/helper-simple-access": "^7.16.0", + "@babel/helper-split-export-declaration": "^7.16.0", + "@babel/helper-validator-identifier": "^7.15.7", + "@babel/template": "^7.16.0", + "@babel/traverse": "^7.16.5", + "@babel/types": "^7.16.0" + } + }, + "@babel/helper-optimise-call-expression": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.0.tgz", + "integrity": "sha512-SuI467Gi2V8fkofm2JPnZzB/SUuXoJA5zXe/xzyPP2M04686RzFKFHPK6HDVN6JvWBIEW8tt9hPR7fXdn2Lgpw==", + "dev": true, + "requires": { + "@babel/types": "^7.16.0" + } + }, + "@babel/helper-plugin-utils": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.5.tgz", + "integrity": "sha512-59KHWHXxVA9K4HNF4sbHCf+eJeFe0Te/ZFGqBT4OjXhrwvA04sGfaEGsVTdsjoszq0YTP49RC9UKe5g8uN2RwQ==", + "dev": true + }, + "@babel/helper-remap-async-to-generator": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.16.5.tgz", + "integrity": "sha512-X+aAJldyxrOmN9v3FKp+Hu1NO69VWgYgDGq6YDykwRPzxs5f2N+X988CBXS7EQahDU+Vpet5QYMqLk+nsp+Qxw==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.16.0", + "@babel/helper-wrap-function": "^7.16.5", + "@babel/types": "^7.16.0" + } + }, + "@babel/helper-replace-supers": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.16.5.tgz", + "integrity": "sha512-ao3seGVa/FZCMCCNDuBcqnBFSbdr8N2EW35mzojx3TwfIbdPmNK+JV6+2d5bR0Z71W5ocLnQp9en/cTF7pBJiQ==", + "dev": true, + "requires": { + "@babel/helper-environment-visitor": "^7.16.5", + "@babel/helper-member-expression-to-functions": "^7.16.5", + "@babel/helper-optimise-call-expression": "^7.16.0", + "@babel/traverse": "^7.16.5", + "@babel/types": "^7.16.0" + } + }, + "@babel/helper-simple-access": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.16.0.tgz", + "integrity": "sha512-o1rjBT/gppAqKsYfUdfHq5Rk03lMQrkPHG1OWzHWpLgVXRH4HnMM9Et9CVdIqwkCQlobnGHEJMsgWP/jE1zUiw==", + "dev": true, + "requires": { + "@babel/types": "^7.16.0" + } + }, + "@babel/helper-skip-transparent-expression-wrappers": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.16.0.tgz", + "integrity": "sha512-+il1gTy0oHwUsBQZyJvukbB4vPMdcYBrFHa0Uc4AizLxbq6BOYC51Rv4tWocX9BLBDLZ4kc6qUFpQ6HRgL+3zw==", + "dev": true, + "requires": { + "@babel/types": "^7.16.0" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.0.tgz", + "integrity": "sha512-0YMMRpuDFNGTHNRiiqJX19GjNXA4H0E8jZ2ibccfSxaCogbm3am5WN/2nQNj0YnQwGWM1J06GOcQ2qnh3+0paw==", + "dev": true, + "requires": { + "@babel/types": "^7.16.0" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.15.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz", + "integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==", + "dev": true + }, + "@babel/helper-validator-option": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz", + "integrity": "sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow==", + "dev": true + }, + "@babel/helper-wrap-function": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.16.5.tgz", + "integrity": "sha512-2J2pmLBqUqVdJw78U0KPNdeE2qeuIyKoG4mKV7wAq3mc4jJG282UgjZw4ZYDnqiWQuS3Y3IYdF/AQ6CpyBV3VA==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.16.0", + "@babel/template": "^7.16.0", + "@babel/traverse": "^7.16.5", + "@babel/types": "^7.16.0" + } + }, + "@babel/helpers": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.16.5.tgz", + "integrity": "sha512-TLgi6Lh71vvMZGEkFuIxzaPsyeYCHQ5jJOOX1f0xXn0uciFuE8cEk0wyBquMcCxBXZ5BJhE2aUB7pnWTD150Tw==", + "dev": true, + "requires": { + "@babel/template": "^7.16.0", + "@babel/traverse": "^7.16.5", + "@babel/types": "^7.16.0" + } + }, + "@babel/highlight": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.0.tgz", + "integrity": "sha512-t8MH41kUQylBtu2+4IQA3atqevA2lRgqA2wyVB/YiWmsDSuylZZuXOUy9ric30hfzauEFfdsuk/eXTRrGrfd0g==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.15.7", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.16.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.6.tgz", + "integrity": "sha512-Gr86ujcNuPDnNOY8mi383Hvi8IYrJVJYuf3XcuBM/Dgd+bINn/7tHqsj+tKkoreMbmGsFLsltI/JJd8fOFWGDQ==", + "dev": true + }, + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { + "version": "7.16.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.16.2.tgz", + "integrity": "sha512-h37CvpLSf8gb2lIJ2CgC3t+EjFbi0t8qS7LCS1xcJIlEXE4czlofwaW7W1HA8zpgOCzI9C1nmoqNR1zWkk0pQg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.16.0.tgz", + "integrity": "sha512-4tcFwwicpWTrpl9qjf7UsoosaArgImF85AxqCRZlgc3IQDvkUHjJpruXAL58Wmj+T6fypWTC/BakfEkwIL/pwA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5", + "@babel/helper-skip-transparent-expression-wrappers": "^7.16.0", + "@babel/plugin-proposal-optional-chaining": "^7.16.0" + } + }, + "@babel/plugin-proposal-async-generator-functions": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.16.5.tgz", + "integrity": "sha512-C/FX+3HNLV6sz7AqbTQqEo1L9/kfrKjxcVtgyBCmvIgOjvuBVUWooDoi7trsLxOzCEo5FccjRvKHkfDsJFZlfA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.16.5", + "@babel/helper-remap-async-to-generator": "^7.16.5", + "@babel/plugin-syntax-async-generators": "^7.8.4" + } + }, + "@babel/plugin-proposal-class-properties": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.16.5.tgz", + "integrity": "sha512-pJD3HjgRv83s5dv1sTnDbZOaTjghKEz8KUn1Kbh2eAIRhGuyQ1XSeI4xVXU3UlIEVA3DAyIdxqT1eRn7Wcn55A==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.16.5", + "@babel/helper-plugin-utils": "^7.16.5" + } + }, + "@babel/plugin-proposal-class-static-block": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.16.5.tgz", + "integrity": "sha512-EEFzuLZcm/rNJ8Q5krK+FRKdVkd6FjfzT9tuSZql9sQn64K0hHA2KLJ0DqVot9/iV6+SsuadC5yI39zWnm+nmQ==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.16.5", + "@babel/helper-plugin-utils": "^7.16.5", + "@babel/plugin-syntax-class-static-block": "^7.14.5" + } + }, + "@babel/plugin-proposal-dynamic-import": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.16.5.tgz", + "integrity": "sha512-P05/SJZTTvHz79LNYTF8ff5xXge0kk5sIIWAypcWgX4BTRUgyHc8wRxJ/Hk+mU0KXldgOOslKaeqnhthcDJCJQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.16.5", + "@babel/plugin-syntax-dynamic-import": "^7.8.3" + } + }, + "@babel/plugin-proposal-export-namespace-from": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.16.5.tgz", + "integrity": "sha512-i+sltzEShH1vsVydvNaTRsgvq2vZsfyrd7K7vPLUU/KgS0D5yZMe6uipM0+izminnkKrEfdUnz7CxMRb6oHZWw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.16.5", + "@babel/plugin-syntax-export-namespace-from": "^7.8.3" + } + }, + "@babel/plugin-proposal-json-strings": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.16.5.tgz", + "integrity": "sha512-QQJueTFa0y9E4qHANqIvMsuxM/qcLQmKttBACtPCQzGUEizsXDACGonlPiSwynHfOa3vNw0FPMVvQzbuXwh4SQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.16.5", + "@babel/plugin-syntax-json-strings": "^7.8.3" + } + }, + "@babel/plugin-proposal-logical-assignment-operators": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.16.5.tgz", + "integrity": "sha512-xqibl7ISO2vjuQM+MzR3rkd0zfNWltk7n9QhaD8ghMmMceVguYrNDt7MikRyj4J4v3QehpnrU8RYLnC7z/gZLA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.16.5", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" + } + }, + "@babel/plugin-proposal-nullish-coalescing-operator": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.16.5.tgz", + "integrity": "sha512-YwMsTp/oOviSBhrjwi0vzCUycseCYwoXnLiXIL3YNjHSMBHicGTz7GjVU/IGgz4DtOEXBdCNG72pvCX22ehfqg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.16.5", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" + } + }, + "@babel/plugin-proposal-numeric-separator": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.16.5.tgz", + "integrity": "sha512-DvB9l/TcsCRvsIV9v4jxR/jVP45cslTVC0PMVHvaJhhNuhn2Y1SOhCSFlPK777qLB5wb8rVDaNoqMTyOqtY5Iw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.16.5", + "@babel/plugin-syntax-numeric-separator": "^7.10.4" + } + }, + "@babel/plugin-proposal-object-rest-spread": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.16.5.tgz", + "integrity": "sha512-UEd6KpChoyPhCoE840KRHOlGhEZFutdPDMGj+0I56yuTTOaT51GzmnEl/0uT41fB/vD2nT+Pci2KjezyE3HmUw==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.16.4", + "@babel/helper-compilation-targets": "^7.16.3", + "@babel/helper-plugin-utils": "^7.16.5", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-transform-parameters": "^7.16.5" + } + }, + "@babel/plugin-proposal-optional-catch-binding": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.16.5.tgz", + "integrity": "sha512-ihCMxY1Iljmx4bWy/PIMJGXN4NS4oUj1MKynwO07kiKms23pNvIn1DMB92DNB2R0EA882sw0VXIelYGdtF7xEQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.16.5", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" + } + }, + "@babel/plugin-proposal-optional-chaining": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.16.5.tgz", + "integrity": "sha512-kzdHgnaXRonttiTfKYnSVafbWngPPr2qKw9BWYBESl91W54e+9R5pP70LtWxV56g0f05f/SQrwHYkfvbwcdQ/A==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.16.5", + "@babel/helper-skip-transparent-expression-wrappers": "^7.16.0", + "@babel/plugin-syntax-optional-chaining": "^7.8.3" + } + }, + "@babel/plugin-proposal-private-methods": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.16.5.tgz", + "integrity": "sha512-+yFMO4BGT3sgzXo+lrq7orX5mAZt57DwUK6seqII6AcJnJOIhBJ8pzKH47/ql/d426uQ7YhN8DpUFirQzqYSUA==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.16.5", + "@babel/helper-plugin-utils": "^7.16.5" + } + }, + "@babel/plugin-proposal-private-property-in-object": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.16.5.tgz", + "integrity": "sha512-+YGh5Wbw0NH3y/E5YMu6ci5qTDmAEVNoZ3I54aB6nVEOZ5BQ7QJlwKq5pYVucQilMByGn/bvX0af+uNaPRCabA==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.16.0", + "@babel/helper-create-class-features-plugin": "^7.16.5", + "@babel/helper-plugin-utils": "^7.16.5", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5" + } + }, + "@babel/plugin-proposal-unicode-property-regex": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.16.5.tgz", + "integrity": "sha512-s5sKtlKQyFSatt781HQwv1hoM5BQ9qRH30r+dK56OLDsHmV74mzwJNX7R1yMuE7VZKG5O6q/gmOGSAO6ikTudg==", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.16.0", + "@babel/helper-plugin-utils": "^7.16.5" + } + }, + "@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", + "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.12.13" + } + }, + "@babel/plugin-syntax-class-static-block": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", + "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/plugin-syntax-dynamic-import": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", + "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-export-namespace-from": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz", + "integrity": "sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.3" + } + }, + "@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-private-property-in-object": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", + "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", + "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/plugin-syntax-typescript": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.16.5.tgz", + "integrity": "sha512-/d4//lZ1Vqb4mZ5xTep3dDK888j7BGM/iKqBmndBaoYAFPlPKrGU608VVBz5JeyAb6YQDjRu1UKqj86UhwWVgw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.16.5" + } + }, + "@babel/plugin-transform-arrow-functions": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.16.5.tgz", + "integrity": "sha512-8bTHiiZyMOyfZFULjsCnYOWG059FVMes0iljEHSfARhNgFfpsqE92OrCffv3veSw9rwMkYcFe9bj0ZoXU2IGtQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.16.5" + } + }, + "@babel/plugin-transform-async-to-generator": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.16.5.tgz", + "integrity": "sha512-TMXgfioJnkXU+XRoj7P2ED7rUm5jbnDWwlCuFVTpQboMfbSya5WrmubNBAMlk7KXvywpo8rd8WuYZkis1o2H8w==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.16.0", + "@babel/helper-plugin-utils": "^7.16.5", + "@babel/helper-remap-async-to-generator": "^7.16.5" + } + }, + "@babel/plugin-transform-block-scoped-functions": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.16.5.tgz", + "integrity": "sha512-BxmIyKLjUGksJ99+hJyL/HIxLIGnLKtw772zYDER7UuycDZ+Xvzs98ZQw6NGgM2ss4/hlFAaGiZmMNKvValEjw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.16.5" + } + }, + "@babel/plugin-transform-block-scoping": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.16.5.tgz", + "integrity": "sha512-JxjSPNZSiOtmxjX7PBRBeRJTUKTyJ607YUYeT0QJCNdsedOe+/rXITjP08eG8xUpsLfPirgzdCFN+h0w6RI+pQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.16.5" + } + }, + "@babel/plugin-transform-classes": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.16.5.tgz", + "integrity": "sha512-DzJ1vYf/7TaCYy57J3SJ9rV+JEuvmlnvvyvYKFbk5u46oQbBvuB9/0w+YsVsxkOv8zVWKpDmUoj4T5ILHoXevA==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.16.0", + "@babel/helper-environment-visitor": "^7.16.5", + "@babel/helper-function-name": "^7.16.0", + "@babel/helper-optimise-call-expression": "^7.16.0", + "@babel/helper-plugin-utils": "^7.16.5", + "@babel/helper-replace-supers": "^7.16.5", + "@babel/helper-split-export-declaration": "^7.16.0", + "globals": "^11.1.0" + } + }, + "@babel/plugin-transform-computed-properties": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.16.5.tgz", + "integrity": "sha512-n1+O7xtU5lSLraRzX88CNcpl7vtGdPakKzww74bVwpAIRgz9JVLJJpOLb0uYqcOaXVM0TL6X0RVeIJGD2CnCkg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.16.5" + } + }, + "@babel/plugin-transform-destructuring": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.16.5.tgz", + "integrity": "sha512-GuRVAsjq+c9YPK6NeTkRLWyQskDC099XkBSVO+6QzbnOnH2d/4mBVXYStaPrZD3dFRfg00I6BFJ9Atsjfs8mlg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.16.5" + } + }, + "@babel/plugin-transform-dotall-regex": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.16.5.tgz", + "integrity": "sha512-iQiEMt8Q4/5aRGHpGVK2Zc7a6mx7qEAO7qehgSug3SDImnuMzgmm/wtJALXaz25zUj1PmnNHtShjFgk4PDx4nw==", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.16.0", + "@babel/helper-plugin-utils": "^7.16.5" + } + }, + "@babel/plugin-transform-duplicate-keys": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.16.5.tgz", + "integrity": "sha512-81tijpDg2a6I1Yhj4aWY1l3O1J4Cg/Pd7LfvuaH2VVInAkXtzibz9+zSPdUM1WvuUi128ksstAP0hM5w48vQgg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.16.5" + } + }, + "@babel/plugin-transform-exponentiation-operator": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.16.5.tgz", + "integrity": "sha512-12rba2HwemQPa7BLIKCzm1pT2/RuQHtSFHdNl41cFiC6oi4tcrp7gjB07pxQvFpcADojQywSjblQth6gJyE6CA==", + "dev": true, + "requires": { + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.16.5", + "@babel/helper-plugin-utils": "^7.16.5" + } + }, + "@babel/plugin-transform-for-of": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.16.5.tgz", + "integrity": "sha512-+DpCAJFPAvViR17PIMi9x2AE34dll5wNlXO43wagAX2YcRGgEVHCNFC4azG85b4YyyFarvkc/iD5NPrz4Oneqw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.16.5" + } + }, + "@babel/plugin-transform-function-name": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.16.5.tgz", + "integrity": "sha512-Fuec/KPSpVLbGo6z1RPw4EE1X+z9gZk1uQmnYy7v4xr4TO9p41v1AoUuXEtyqAI7H+xNJYSICzRqZBhDEkd3kQ==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.16.0", + "@babel/helper-plugin-utils": "^7.16.5" + } + }, + "@babel/plugin-transform-literals": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.16.5.tgz", + "integrity": "sha512-B1j9C/IfvshnPcklsc93AVLTrNVa69iSqztylZH6qnmiAsDDOmmjEYqOm3Ts2lGSgTSywnBNiqC949VdD0/gfw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.16.5" + } + }, + "@babel/plugin-transform-member-expression-literals": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.16.5.tgz", + "integrity": "sha512-d57i3vPHWgIde/9Y8W/xSFUndhvhZN5Wu2TjRrN1MVz5KzdUihKnfDVlfP1U7mS5DNj/WHHhaE4/tTi4hIyHwQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.16.5" + } + }, + "@babel/plugin-transform-modules-amd": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.16.5.tgz", + "integrity": "sha512-oHI15S/hdJuSCfnwIz+4lm6wu/wBn7oJ8+QrkzPPwSFGXk8kgdI/AIKcbR/XnD1nQVMg/i6eNaXpszbGuwYDRQ==", + "dev": true, + "requires": { + "@babel/helper-module-transforms": "^7.16.5", + "@babel/helper-plugin-utils": "^7.16.5", + "babel-plugin-dynamic-import-node": "^2.3.3" + } + }, + "@babel/plugin-transform-modules-commonjs": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.16.5.tgz", + "integrity": "sha512-ABhUkxvoQyqhCWyb8xXtfwqNMJD7tx+irIRnUh6lmyFud7Jln1WzONXKlax1fg/ey178EXbs4bSGNd6PngO+SQ==", + "dev": true, + "requires": { + "@babel/helper-module-transforms": "^7.16.5", + "@babel/helper-plugin-utils": "^7.16.5", + "@babel/helper-simple-access": "^7.16.0", + "babel-plugin-dynamic-import-node": "^2.3.3" + } + }, + "@babel/plugin-transform-modules-systemjs": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.16.5.tgz", + "integrity": "sha512-53gmLdScNN28XpjEVIm7LbWnD/b/TpbwKbLk6KV4KqC9WyU6rq1jnNmVG6UgAdQZVVGZVoik3DqHNxk4/EvrjA==", + "dev": true, + "requires": { + "@babel/helper-hoist-variables": "^7.16.0", + "@babel/helper-module-transforms": "^7.16.5", + "@babel/helper-plugin-utils": "^7.16.5", + "@babel/helper-validator-identifier": "^7.15.7", + "babel-plugin-dynamic-import-node": "^2.3.3" + } + }, + "@babel/plugin-transform-modules-umd": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.16.5.tgz", + "integrity": "sha512-qTFnpxHMoenNHkS3VoWRdwrcJ3FhX567GvDA3hRZKF0Dj8Fmg0UzySZp3AP2mShl/bzcywb/UWAMQIjA1bhXvw==", + "dev": true, + "requires": { + "@babel/helper-module-transforms": "^7.16.5", + "@babel/helper-plugin-utils": "^7.16.5" + } + }, + "@babel/plugin-transform-named-capturing-groups-regex": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.16.5.tgz", + "integrity": "sha512-/wqGDgvFUeKELW6ex6QB7dLVRkd5ehjw34tpXu1nhKC0sFfmaLabIswnpf8JgDyV2NeDmZiwoOb0rAmxciNfjA==", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.16.0" + } + }, + "@babel/plugin-transform-new-target": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.16.5.tgz", + "integrity": "sha512-ZaIrnXF08ZC8jnKR4/5g7YakGVL6go6V9ql6Jl3ecO8PQaQqFE74CuM384kezju7Z9nGCCA20BqZaR1tJ/WvHg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.16.5" + } + }, + "@babel/plugin-transform-object-super": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.16.5.tgz", + "integrity": "sha512-tded+yZEXuxt9Jdtkc1RraW1zMF/GalVxaVVxh41IYwirdRgyAxxxCKZ9XB7LxZqmsjfjALxupNE1MIz9KH+Zg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.16.5", + "@babel/helper-replace-supers": "^7.16.5" + } + }, + "@babel/plugin-transform-parameters": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.16.5.tgz", + "integrity": "sha512-B3O6AL5oPop1jAVg8CV+haeUte9oFuY85zu0jwnRNZZi3tVAbJriu5tag/oaO2kGaQM/7q7aGPBlTI5/sr9enA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.16.5" + } + }, + "@babel/plugin-transform-property-literals": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.16.5.tgz", + "integrity": "sha512-+IRcVW71VdF9pEH/2R/Apab4a19LVvdVsr/gEeotH00vSDVlKD+XgfSIw+cgGWsjDB/ziqGv/pGoQZBIiQVXHg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.16.5" + } + }, + "@babel/plugin-transform-regenerator": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.16.5.tgz", + "integrity": "sha512-2z+it2eVWU8TtQQRauvGUqZwLy4+7rTfo6wO4npr+fvvN1SW30ZF3O/ZRCNmTuu4F5MIP8OJhXAhRV5QMJOuYg==", + "dev": true, + "requires": { + "regenerator-transform": "^0.14.2" + } + }, + "@babel/plugin-transform-reserved-words": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.16.5.tgz", + "integrity": "sha512-aIB16u8lNcf7drkhXJRoggOxSTUAuihTSTfAcpynowGJOZiGf+Yvi7RuTwFzVYSYPmWyARsPqUGoZWWWxLiknw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.16.5" + } + }, + "@babel/plugin-transform-shorthand-properties": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.16.5.tgz", + "integrity": "sha512-ZbuWVcY+MAXJuuW7qDoCwoxDUNClfZxoo7/4swVbOW1s/qYLOMHlm9YRWMsxMFuLs44eXsv4op1vAaBaBaDMVg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.16.5" + } + }, + "@babel/plugin-transform-spread": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.16.5.tgz", + "integrity": "sha512-5d6l/cnG7Lw4tGHEoga4xSkYp1euP7LAtrah1h1PgJ3JY7yNsjybsxQAnVK4JbtReZ/8z6ASVmd3QhYYKLaKZw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.16.5", + "@babel/helper-skip-transparent-expression-wrappers": "^7.16.0" + } + }, + "@babel/plugin-transform-sticky-regex": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.16.5.tgz", + "integrity": "sha512-usYsuO1ID2LXxzuUxifgWtJemP7wL2uZtyrTVM4PKqsmJycdS4U4mGovL5xXkfUheds10Dd2PjoQLXw6zCsCbg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.16.5" + } + }, + "@babel/plugin-transform-template-literals": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.16.5.tgz", + "integrity": "sha512-gnyKy9RyFhkovex4BjKWL3BVYzUDG6zC0gba7VMLbQoDuqMfJ1SDXs8k/XK41Mmt1Hyp4qNAvGFb9hKzdCqBRQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.16.5" + } + }, + "@babel/plugin-transform-typeof-symbol": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.16.5.tgz", + "integrity": "sha512-ldxCkW180qbrvyCVDzAUZqB0TAeF8W/vGJoRcaf75awm6By+PxfJKvuqVAnq8N9wz5Xa6mSpM19OfVKKVmGHSQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.16.5" + } + }, + "@babel/plugin-transform-typescript": { + "version": "7.16.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.16.1.tgz", + "integrity": "sha512-NO4XoryBng06jjw/qWEU2LhcLJr1tWkhpMam/H4eas/CDKMX/b2/Ylb6EI256Y7+FVPCawwSM1rrJNOpDiz+Lg==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.16.0", + "@babel/helper-plugin-utils": "^7.14.5", + "@babel/plugin-syntax-typescript": "^7.16.0" + } + }, + "@babel/plugin-transform-unicode-escapes": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.16.5.tgz", + "integrity": "sha512-shiCBHTIIChGLdyojsKQjoAyB8MBwat25lKM7MJjbe1hE0bgIppD+LX9afr41lLHOhqceqeWl4FkLp+Bgn9o1Q==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.16.5" + } + }, + "@babel/plugin-transform-unicode-regex": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.16.5.tgz", + "integrity": "sha512-GTJ4IW012tiPEMMubd7sD07iU9O/LOo8Q/oU4xNhcaq0Xn8+6TcUQaHtC8YxySo1T+ErQ8RaWogIEeFhKGNPzw==", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.16.0", + "@babel/helper-plugin-utils": "^7.16.5" + } + }, + "@babel/preset-env": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.16.5.tgz", + "integrity": "sha512-MiJJW5pwsktG61NDxpZ4oJ1CKxM1ncam9bzRtx9g40/WkLRkxFP6mhpkYV0/DxcciqoiHicx291+eUQrXb/SfQ==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.16.4", + "@babel/helper-compilation-targets": "^7.16.3", + "@babel/helper-plugin-utils": "^7.16.5", + "@babel/helper-validator-option": "^7.14.5", + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.16.2", + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.16.0", + "@babel/plugin-proposal-async-generator-functions": "^7.16.5", + "@babel/plugin-proposal-class-properties": "^7.16.5", + "@babel/plugin-proposal-class-static-block": "^7.16.5", + "@babel/plugin-proposal-dynamic-import": "^7.16.5", + "@babel/plugin-proposal-export-namespace-from": "^7.16.5", + "@babel/plugin-proposal-json-strings": "^7.16.5", + "@babel/plugin-proposal-logical-assignment-operators": "^7.16.5", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.5", + "@babel/plugin-proposal-numeric-separator": "^7.16.5", + "@babel/plugin-proposal-object-rest-spread": "^7.16.5", + "@babel/plugin-proposal-optional-catch-binding": "^7.16.5", + "@babel/plugin-proposal-optional-chaining": "^7.16.5", + "@babel/plugin-proposal-private-methods": "^7.16.5", + "@babel/plugin-proposal-private-property-in-object": "^7.16.5", + "@babel/plugin-proposal-unicode-property-regex": "^7.16.5", + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-class-properties": "^7.12.13", + "@babel/plugin-syntax-class-static-block": "^7.14.5", + "@babel/plugin-syntax-dynamic-import": "^7.8.3", + "@babel/plugin-syntax-export-namespace-from": "^7.8.3", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.10.4", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5", + "@babel/plugin-syntax-top-level-await": "^7.14.5", + "@babel/plugin-transform-arrow-functions": "^7.16.5", + "@babel/plugin-transform-async-to-generator": "^7.16.5", + "@babel/plugin-transform-block-scoped-functions": "^7.16.5", + "@babel/plugin-transform-block-scoping": "^7.16.5", + "@babel/plugin-transform-classes": "^7.16.5", + "@babel/plugin-transform-computed-properties": "^7.16.5", + "@babel/plugin-transform-destructuring": "^7.16.5", + "@babel/plugin-transform-dotall-regex": "^7.16.5", + "@babel/plugin-transform-duplicate-keys": "^7.16.5", + "@babel/plugin-transform-exponentiation-operator": "^7.16.5", + "@babel/plugin-transform-for-of": "^7.16.5", + "@babel/plugin-transform-function-name": "^7.16.5", + "@babel/plugin-transform-literals": "^7.16.5", + "@babel/plugin-transform-member-expression-literals": "^7.16.5", + "@babel/plugin-transform-modules-amd": "^7.16.5", + "@babel/plugin-transform-modules-commonjs": "^7.16.5", + "@babel/plugin-transform-modules-systemjs": "^7.16.5", + "@babel/plugin-transform-modules-umd": "^7.16.5", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.16.5", + "@babel/plugin-transform-new-target": "^7.16.5", + "@babel/plugin-transform-object-super": "^7.16.5", + "@babel/plugin-transform-parameters": "^7.16.5", + "@babel/plugin-transform-property-literals": "^7.16.5", + "@babel/plugin-transform-regenerator": "^7.16.5", + "@babel/plugin-transform-reserved-words": "^7.16.5", + "@babel/plugin-transform-shorthand-properties": "^7.16.5", + "@babel/plugin-transform-spread": "^7.16.5", + "@babel/plugin-transform-sticky-regex": "^7.16.5", + "@babel/plugin-transform-template-literals": "^7.16.5", + "@babel/plugin-transform-typeof-symbol": "^7.16.5", + "@babel/plugin-transform-unicode-escapes": "^7.16.5", + "@babel/plugin-transform-unicode-regex": "^7.16.5", + "@babel/preset-modules": "^0.1.5", + "@babel/types": "^7.16.0", + "babel-plugin-polyfill-corejs2": "^0.3.0", + "babel-plugin-polyfill-corejs3": "^0.4.0", + "babel-plugin-polyfill-regenerator": "^0.3.0", + "core-js-compat": "^3.19.1", + "semver": "^6.3.0" + } + }, + "@babel/preset-modules": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.5.tgz", + "integrity": "sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-proposal-unicode-property-regex": "^7.4.4", + "@babel/plugin-transform-dotall-regex": "^7.4.4", + "@babel/types": "^7.4.4", + "esutils": "^2.0.2" + } + }, + "@babel/register": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/register/-/register-7.16.5.tgz", + "integrity": "sha512-NpluD+cToBiZiDsG3y9rtIcqDyivsahpaM9csfyfiq1qQWduSmihUZ+ruIqqSDGjZKZMJfgAElo9x2YWlOQuRw==", + "dev": true, + "requires": { + "clone-deep": "^4.0.1", + "find-cache-dir": "^2.0.0", + "make-dir": "^2.1.0", + "pirates": "^4.0.0", + "source-map-support": "^0.5.16" + } + }, + "@babel/runtime": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.16.5.tgz", + "integrity": "sha512-TXWihFIS3Pyv5hzR7j6ihmeLkZfrXGxAr5UfSl8CHf+6q/wpiYDkUau0czckpYG8QmnCIuPpdLtuA9VmuGGyMA==", + "dev": true, + "requires": { + "regenerator-runtime": "^0.13.4" + } + }, + "@babel/template": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.0.tgz", + "integrity": "sha512-MnZdpFD/ZdYhXwiunMqqgyZyucaYsbL0IrjoGjaVhGilz+x8YB++kRfygSOIj1yOtWKPlx7NBp+9I1RQSgsd5A==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.16.0", + "@babel/parser": "^7.16.0", + "@babel/types": "^7.16.0" + } + }, + "@babel/traverse": { + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.5.tgz", + "integrity": "sha512-FOCODAzqUMROikDYLYxl4nmwiLlu85rNqBML/A5hKRVXG2LV8d0iMqgPzdYTcIpjZEBB7D6UDU9vxRZiriASdQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.16.0", + "@babel/generator": "^7.16.5", + "@babel/helper-environment-visitor": "^7.16.5", + "@babel/helper-function-name": "^7.16.0", + "@babel/helper-hoist-variables": "^7.16.0", + "@babel/helper-split-export-declaration": "^7.16.0", + "@babel/parser": "^7.16.5", + "@babel/types": "^7.16.0", + "debug": "^4.1.0", + "globals": "^11.1.0" + } + }, + "@babel/types": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.16.0.tgz", + "integrity": "sha512-PJgg/k3SdLsGb3hhisFvtLOw5ts113klrpLuIPtCJIU+BB24fqq6lf8RWqKJEjzqXR9AEH1rIb5XTqwBHB+kQg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.15.7", + "to-fast-properties": "^2.0.0" + } + }, + "@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true + }, + "@cspell/cspell-bundled-dicts": { + "version": "5.13.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-5.13.4.tgz", + "integrity": "sha512-D88zFAcEbUJiM03cY1U4Fb1c9BcECi6RvSwwJG/Ayc4lLO9uZgFyKlzQwjSEgTzuCME9A0Nn2hXrD+aWol85Mg==", + "dev": true, + "requires": { + "@cspell/dict-ada": "^1.1.2", + "@cspell/dict-aws": "^1.0.14", + "@cspell/dict-bash": "^1.0.17", + "@cspell/dict-companies": "^2.0.2", + "@cspell/dict-cpp": "^1.1.40", + "@cspell/dict-cryptocurrencies": "^1.0.10", + "@cspell/dict-csharp": "^2.0.1", + "@cspell/dict-css": "^1.0.12", + "@cspell/dict-django": "^1.0.26", + "@cspell/dict-dotnet": "^1.0.32", + "@cspell/dict-elixir": "^1.0.26", + "@cspell/dict-en_us": "^2.1.4", + "@cspell/dict-en-gb": "^1.1.33", + "@cspell/dict-filetypes": "^2.0.1", + "@cspell/dict-fonts": "^1.0.14", + "@cspell/dict-fullstack": "^2.0.4", + "@cspell/dict-golang": "^1.1.24", + "@cspell/dict-haskell": "^1.0.13", + "@cspell/dict-html": "^1.1.9", + "@cspell/dict-html-symbol-entities": "^1.0.23", + "@cspell/dict-java": "^1.0.23", + "@cspell/dict-latex": "^1.0.25", + "@cspell/dict-lorem-ipsum": "^1.0.22", + "@cspell/dict-lua": "^1.0.16", + "@cspell/dict-node": "^1.0.12", + "@cspell/dict-npm": "^1.0.16", + "@cspell/dict-php": "^1.0.25", + "@cspell/dict-powershell": "^1.0.19", + "@cspell/dict-public-licenses": "^1.0.4", + "@cspell/dict-python": "^2.0.5", + "@cspell/dict-ruby": "^1.0.15", + "@cspell/dict-rust": "^1.0.23", + "@cspell/dict-scala": "^1.0.21", + "@cspell/dict-software-terms": "^2.0.11", + "@cspell/dict-swift": "^1.0.1", + "@cspell/dict-typescript": "^1.0.19", + "@cspell/dict-vue": "^2.0.1" + } + }, + "@cspell/cspell-types": { + "version": "5.13.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-5.13.4.tgz", + "integrity": "sha512-OH3aqFfmRNOSO0K0h5JNm84I5RLDgngp1Qa9YeEm9oj1U/qjrm2bOwOGGh9XU/ZjLl56JMbtbnfSpHpT7tLc+A==", + "dev": true + }, + "@cspell/dict-ada": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-ada/-/dict-ada-1.1.2.tgz", + "integrity": "sha512-UDrcYcKIVyXDz5mInJabRNQpJoehjBFvja5W+GQyu9pGcx3BS3cAU8mWENstGR0Qc/iFTxB010qwF8F3cHA/aA==", + "dev": true + }, + "@cspell/dict-aws": { + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/@cspell/dict-aws/-/dict-aws-1.0.14.tgz", + "integrity": "sha512-K21CfB4ZpKYwwDQiPfic2zJA/uxkbsd4IQGejEvDAhE3z8wBs6g6BwwqdVO767M9NgZqc021yAVpr79N5pWe3w==", + "dev": true + }, + "@cspell/dict-bash": { + "version": "1.0.17", + "resolved": "https://registry.npmjs.org/@cspell/dict-bash/-/dict-bash-1.0.17.tgz", + "integrity": "sha512-BlX+pnDlLmIf776C9d71QjXl4NOIz+yloeixx1ZZjrwvKPLF+ffE/Ez13eV+D9R2Ps1rW10UvW8u3Hbmwme+Fw==", + "dev": true + }, + "@cspell/dict-companies": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-2.0.2.tgz", + "integrity": "sha512-LPKwBMAWRz+p1R8q+TV6E1sGOOTvxJOaJeXNN++CZQ7i6JMn5Rf+BSxagwkeK6z3o9vIC5ZE4AcQ5BMkvyjqGw==", + "dev": true + }, + "@cspell/dict-cpp": { + "version": "1.1.40", + "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-1.1.40.tgz", + "integrity": "sha512-sscfB3woNDNj60/yGXAdwNtIRWZ89y35xnIaJVDMk5TPMMpaDvuk0a34iOPIq0g4V+Y8e3RyAg71SH6ADwSjGw==", + "dev": true + }, + "@cspell/dict-cryptocurrencies": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/@cspell/dict-cryptocurrencies/-/dict-cryptocurrencies-1.0.10.tgz", + "integrity": "sha512-47ABvDJOkaST/rXipNMfNvneHUzASvmL6K/CbOFpYKfsd0x23Jc9k1yaOC7JAm82XSC/8a7+3Yu+Fk2jVJNnsA==", + "dev": true + }, + "@cspell/dict-csharp": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-csharp/-/dict-csharp-2.0.1.tgz", + "integrity": "sha512-ZzAr+WRP2FUtXHZtfhe8f3j9vPjH+5i44Hcr5JqbWxmqciGoTbWBPQXwu9y+J4mbdC69HSWRrVGkNJ8rQk8pSw==", + "dev": true + }, + "@cspell/dict-css": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/@cspell/dict-css/-/dict-css-1.0.12.tgz", + "integrity": "sha512-K6yuxej7n454O7dwKG6lHacHrAOMZ0PhMEbmV6qH2JH0U4TtWXfBASYugHvXZCDDx1UObpiJP+3tQJiBqfGpHA==", + "dev": true + }, + "@cspell/dict-django": { + "version": "1.0.26", + "resolved": "https://registry.npmjs.org/@cspell/dict-django/-/dict-django-1.0.26.tgz", + "integrity": "sha512-mn9bd7Et1L2zuibc08GVHTiD2Go3/hdjyX5KLukXDklBkq06r+tb0OtKtf1zKodtFDTIaYekGADhNhA6AnKLkg==", + "dev": true + }, + "@cspell/dict-dotnet": { + "version": "1.0.32", + "resolved": "https://registry.npmjs.org/@cspell/dict-dotnet/-/dict-dotnet-1.0.32.tgz", + "integrity": "sha512-9H9vXrgJB4KF8xsyTToXO53cXD33iyfrpT4mhCds+YLUw3P3x3E9myszgJzshnrxYBvQZ+QMII57Qr6SjZVk4Q==", + "dev": true + }, + "@cspell/dict-elixir": { + "version": "1.0.26", + "resolved": "https://registry.npmjs.org/@cspell/dict-elixir/-/dict-elixir-1.0.26.tgz", + "integrity": "sha512-hz1yETUiRJM7yjN3mITSnxcmZaEyaBbyJhpZPpg+cKUil+xhHeZ2wwfbRc83QHGmlqEuDWbdCFqKSpCDJYpYhg==", + "dev": true + }, + "@cspell/dict-en_us": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-2.1.4.tgz", + "integrity": "sha512-W4b+aIvZ637FqtTmrTe/T9i9748cuTQf82eWUgV9O296WzZj7rCxm+rzOrmRTAcCmU+9+6Cdsr0unETFQfuxww==", + "dev": true + }, + "@cspell/dict-en-gb": { + "version": "1.1.33", + "resolved": "https://registry.npmjs.org/@cspell/dict-en-gb/-/dict-en-gb-1.1.33.tgz", + "integrity": "sha512-tKSSUf9BJEV+GJQAYGw5e+ouhEe2ZXE620S7BLKe3ZmpnjlNG9JqlnaBhkIMxKnNFkLY2BP/EARzw31AZnOv4g==", + "dev": true + }, + "@cspell/dict-filetypes": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-2.0.1.tgz", + "integrity": "sha512-bQ7K3U/3hKO2lpQjObf0veNP/n50qk5CVezSwApMBckf/sAVvDTR1RGAvYdr+vdQnkdQrk6wYmhbshXi0sLDVg==", + "dev": true + }, + "@cspell/dict-fonts": { + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/@cspell/dict-fonts/-/dict-fonts-1.0.14.tgz", + "integrity": "sha512-VhIX+FVYAnqQrOuoFEtya6+H72J82cIicz9QddgknsTqZQ3dvgp6lmVnsQXPM3EnzA8n1peTGpLDwHzT7ociLA==", + "dev": true + }, + "@cspell/dict-fullstack": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-fullstack/-/dict-fullstack-2.0.4.tgz", + "integrity": "sha512-+JtYO58QAXnetRN+MGVzI8YbkbFTLpYfl/Cw/tmNqy7U1IDVC4sTXQ2pZvbbeKQWFHBqYvBs0YASV+mTouXYBw==", + "dev": true + }, + "@cspell/dict-golang": { + "version": "1.1.24", + "resolved": "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-1.1.24.tgz", + "integrity": "sha512-qq3Cjnx2U1jpeWAGJL1GL0ylEhUMqyaR36Xij6Y6Aq4bViCRp+HRRqk0x5/IHHbOrti45h3yy7ii1itRFo+Xkg==", + "dev": true + }, + "@cspell/dict-haskell": { + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/@cspell/dict-haskell/-/dict-haskell-1.0.13.tgz", + "integrity": "sha512-kvl8T84cnYRPpND/P3D86P6WRSqebsbk0FnMfy27zo15L5MLAb3d3MOiT1kW3vEWfQgzUD7uddX/vUiuroQ8TA==", + "dev": true + }, + "@cspell/dict-html": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/@cspell/dict-html/-/dict-html-1.1.9.tgz", + "integrity": "sha512-vvnYia0tyIS5Fdoz+gEQm77MGZZE66kOJjuNpIYyRHCXFAhWdYz3SmkRm6YKJSWSvuO+WBJYTKDvkOxSh3Fx/w==", + "dev": true + }, + "@cspell/dict-html-symbol-entities": { + "version": "1.0.23", + "resolved": "https://registry.npmjs.org/@cspell/dict-html-symbol-entities/-/dict-html-symbol-entities-1.0.23.tgz", + "integrity": "sha512-PV0UBgcBFbBLf/m1wfkVMM8w96kvfHoiCGLWO6BR3Q9v70IXoE4ae0+T+f0CkxcEkacMqEQk/I7vuE9MzrjaNw==", + "dev": true + }, + "@cspell/dict-java": { + "version": "1.0.23", + "resolved": "https://registry.npmjs.org/@cspell/dict-java/-/dict-java-1.0.23.tgz", + "integrity": "sha512-LcOg9srYLDoNGd8n3kbfDBlZD+LOC9IVcnFCdua1b/luCHNVmlgBx7e677qPu7olpMYOD5TQIVW2OmM1+/6MFA==", + "dev": true + }, + "@cspell/dict-latex": { + "version": "1.0.25", + "resolved": "https://registry.npmjs.org/@cspell/dict-latex/-/dict-latex-1.0.25.tgz", + "integrity": "sha512-cEgg91Migqcp1SdVV7dUeMxbPDhxdNo6Fgq2eygAXQjIOFK520FFvh/qxyBvW90qdZbIRoU2AJpchyHfGuwZFA==", + "dev": true + }, + "@cspell/dict-lorem-ipsum": { + "version": "1.0.22", + "resolved": "https://registry.npmjs.org/@cspell/dict-lorem-ipsum/-/dict-lorem-ipsum-1.0.22.tgz", + "integrity": "sha512-yqzspR+2ADeAGUxLTfZ4pXvPl7FmkENMRcGDECmddkOiuEwBCWMZdMP5fng9B0Q6j91hQ8w9CLvJKBz10TqNYg==", + "dev": true + }, + "@cspell/dict-lua": { + "version": "1.0.16", + "resolved": "https://registry.npmjs.org/@cspell/dict-lua/-/dict-lua-1.0.16.tgz", + "integrity": "sha512-YiHDt8kmHJ8nSBy0tHzaxiuitYp+oJ66ffCYuFWTNB3//Y0SI4OGHU3omLsQVeXIfCeVrO4DrVvRDoCls9B5zQ==", + "dev": true + }, + "@cspell/dict-node": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/@cspell/dict-node/-/dict-node-1.0.12.tgz", + "integrity": "sha512-RPNn/7CSkflAWk0sbSoOkg0ORrgBARUjOW3QjB11KwV1gSu8f5W/ij/S50uIXtlrfoBLqd4OyE04jyON+g/Xfg==", + "dev": true + }, + "@cspell/dict-npm": { + "version": "1.0.16", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-1.0.16.tgz", + "integrity": "sha512-RwkuZGcYBxL3Yux3cSG/IOWGlQ1e9HLCpHeyMtTVGYKAIkFAVUnGrz20l16/Q7zUG7IEktBz5O42kAozrEnqMQ==", + "dev": true + }, + "@cspell/dict-php": { + "version": "1.0.25", + "resolved": "https://registry.npmjs.org/@cspell/dict-php/-/dict-php-1.0.25.tgz", + "integrity": "sha512-RoBIP5MRdByyPaXcznZMfOY1JdCMYPPLua5E9gkq0TJO7bX5mC9hyAKfYBSWVQunZydd82HZixjb5MPkDFU1uw==", + "dev": true + }, + "@cspell/dict-powershell": { + "version": "1.0.19", + "resolved": "https://registry.npmjs.org/@cspell/dict-powershell/-/dict-powershell-1.0.19.tgz", + "integrity": "sha512-zF/raM/lkhXeHf4I43OtK0gP9rBeEJFArscTVwLWOCIvNk21MJcNoTYoaGw+c056+Q+hJL0psGLO7QN+mxYH1A==", + "dev": true + }, + "@cspell/dict-public-licenses": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-public-licenses/-/dict-public-licenses-1.0.4.tgz", + "integrity": "sha512-h4xULfVEDUeWyvp1OO19pcGDqWcBEQ7WGMp3QBHyYpjsamlzsyYYjCRSY2ZvpM7wruDmywSRFmRHJ/+uNFT7nA==", + "dev": true + }, + "@cspell/dict-python": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-2.0.5.tgz", + "integrity": "sha512-WkyGYtNmUsOHsWixck7AxNvveDgVPqw0H51hzIY+/5u3c94wZUweIj0vfFOGIfOBq8e1ZxpjumKBxVDGXTmQkw==", + "dev": true + }, + "@cspell/dict-ruby": { + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/@cspell/dict-ruby/-/dict-ruby-1.0.15.tgz", + "integrity": "sha512-I76hJA///lc1pgmDTGUFHN/O8KLIZIU/8TgIYIGI6Ix/YzSEvWNdQYbANn6JbCynS0X+7IbZ2Ft+QqvmGtIWuA==", + "dev": true + }, + "@cspell/dict-rust": { + "version": "1.0.23", + "resolved": "https://registry.npmjs.org/@cspell/dict-rust/-/dict-rust-1.0.23.tgz", + "integrity": "sha512-lR4boDzs79YD6+30mmiSGAMMdwh7HTBAPUFSB0obR3Kidibfc3GZ+MHWZXay5dxZ4nBKM06vyjtanF9VJ8q1Iw==", + "dev": true + }, + "@cspell/dict-scala": { + "version": "1.0.21", + "resolved": "https://registry.npmjs.org/@cspell/dict-scala/-/dict-scala-1.0.21.tgz", + "integrity": "sha512-5V/R7PRbbminTpPS3ywgdAalI9BHzcEjEj9ug4kWYvBIGwSnS7T6QCFCiu+e9LvEGUqQC+NHgLY4zs1NaBj2vA==", + "dev": true + }, + "@cspell/dict-software-terms": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-2.0.11.tgz", + "integrity": "sha512-ix5k4m9Y5ZcozgE8QdEhiMIksreGozBETsCo5tGKAs4xDDkS4G07lOMFbek6m5poJ5qk5My0A/iz1j9f3L3aOg==", + "dev": true + }, + "@cspell/dict-swift": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-swift/-/dict-swift-1.0.1.tgz", + "integrity": "sha512-M4onLt10Ptld8Q1BwBit8BBYVZ0d2ZEiBTW1AXekIVPQkPKkwa/RkGlR0GESWNTC2Zbmt/qge7trksVdaYVWFQ==", + "dev": true + }, + "@cspell/dict-typescript": { + "version": "1.0.19", + "resolved": "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-1.0.19.tgz", + "integrity": "sha512-qmJApzoVskDeJnLZzZMaafEDGbEg5Elt4c3Mpg49SWzIHm1N4VXCp5CcFfHsOinJ30dGrs3ARAJGJZIw56kK6A==", + "dev": true + }, + "@cspell/dict-vue": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-vue/-/dict-vue-2.0.1.tgz", + "integrity": "sha512-n9So2C2Zw+uSDRzb2h9wq3PjZBqoHx+vBvu6a34H2qpumNjZ6HaEronrzX5tXJJXzOtocIQYrLxdd128TAU3+g==", + "dev": true + }, + "@eslint/eslintrc": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.0.5.tgz", + "integrity": "sha512-BLxsnmK3KyPunz5wmCCpqy0YelEoxxGmH73Is+Z74oOTMtExcjkr3dDR6quwrjh1YspA8DH9gnX1o069KiS9AQ==", + "dev": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.2.0", + "globals": "^13.9.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "globals": { + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.0.tgz", + "integrity": "sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg==", + "dev": true, + "requires": { + "type-fest": "^0.20.2" + } + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + } + } + }, + "@humanwhocodes/config-array": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.2.tgz", + "integrity": "sha512-UXOuFCGcwciWckOpmfKDq/GyhlTf9pN/BzG//x8p8zTOFEcGuA68ANXheFS0AGvy3qgZqLBUkMs7hqzqCKOVwA==", + "dev": true, + "requires": { + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + } + }, + "@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true + }, + "@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true + }, + "@microsoft/tsdoc": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.13.2.tgz", + "integrity": "sha512-WrHvO8PDL8wd8T2+zBGKrMwVL5IyzR3ryWUsl0PXgEV0QHup4mTLi0QcATefGI6Gx9Anu7vthPyyyLpY0EpiQg==", + "dev": true + }, + "@microsoft/tsdoc-config": { + "version": "0.15.2", + "resolved": "https://registry.npmjs.org/@microsoft/tsdoc-config/-/tsdoc-config-0.15.2.tgz", + "integrity": "sha512-mK19b2wJHSdNf8znXSMYVShAHktVr/ib0Ck2FA3lsVBSEhSI/TfXT7DJQkAYgcztTuwazGcg58ZjYdk0hTCVrA==", + "dev": true, + "requires": { + "@microsoft/tsdoc": "0.13.2", + "ajv": "~6.12.6", + "jju": "~1.4.0", + "resolve": "~1.19.0" + }, + "dependencies": { + "resolve": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", + "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", + "dev": true, + "requires": { + "is-core-module": "^2.1.0", + "path-parse": "^1.0.6" + } + } + } + }, + "@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + } + }, + "@types/chai": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.0.tgz", + "integrity": "sha512-/ceqdqeRraGolFTcfoXNiqjyQhZzbINDngeoAq9GoHa8PPK1yNzTaxWjA6BFWp5Ua9JpXEMSS4s5i9tS0hOJtw==", + "dev": true + }, + "@types/istanbul-lib-coverage": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", + "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==", + "dev": true + }, + "@types/json-schema": { + "version": "7.0.9", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", + "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", + "dev": true + }, + "@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "dev": true + }, + "@types/mocha": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.0.0.tgz", + "integrity": "sha512-scN0hAWyLVAvLR9AyW7HoFF5sJZglyBsbPuHO4fv7JRvfmPBMfp1ozWqOf/e4wwPNxezBZXRfWzMb6iFLgEVRA==", + "dev": true + }, + "@types/node": { + "version": "17.0.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.5.tgz", + "integrity": "sha512-w3mrvNXLeDYV1GKTZorGJQivK6XLCoGwpnyJFbJVK/aTBQUxOCaa/GlFAAN3OTDFcb7h5tiFG+YXCO2By+riZw==", + "dev": true + }, + "@types/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", + "dev": true + }, + "@typescript-eslint/eslint-plugin": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.8.0.tgz", + "integrity": "sha512-spu1UW7QuBn0nJ6+psnfCc3iVoQAifjKORgBngKOmC8U/1tbe2YJMzYQqDGYB4JCss7L8+RM2kKLb1B1Aw9BNA==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "5.8.0", + "@typescript-eslint/scope-manager": "5.8.0", + "debug": "^4.3.2", + "functional-red-black-tree": "^1.0.1", + "ignore": "^5.1.8", + "regexpp": "^3.2.0", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + }, + "dependencies": { + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + } + } + }, + "@typescript-eslint/experimental-utils": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.8.0.tgz", + "integrity": "sha512-KN5FvNH71bhZ8fKtL+lhW7bjm7cxs1nt+hrDZWIqb6ViCffQcWyLunGrgvISgkRojIDcXIsH+xlFfI4RCDA0xA==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.9", + "@typescript-eslint/scope-manager": "5.8.0", + "@typescript-eslint/types": "5.8.0", + "@typescript-eslint/typescript-estree": "5.8.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" + } + }, + "@typescript-eslint/parser": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.8.0.tgz", + "integrity": "sha512-Gleacp/ZhRtJRYs5/T8KQR3pAQjQI89Dn/k+OzyCKOsLiZH2/Vh60cFBTnFsHNI6WAD+lNUo/xGZ4NeA5u0Ipw==", + "dev": true, + "requires": { + "@typescript-eslint/scope-manager": "5.8.0", + "@typescript-eslint/types": "5.8.0", + "@typescript-eslint/typescript-estree": "5.8.0", + "debug": "^4.3.2" + } + }, + "@typescript-eslint/scope-manager": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.8.0.tgz", + "integrity": "sha512-x82CYJsLOjPCDuFFEbS6e7K1QEWj7u5Wk1alw8A+gnJiYwNnDJk0ib6PCegbaPMjrfBvFKa7SxE3EOnnIQz2Gg==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.8.0", + "@typescript-eslint/visitor-keys": "5.8.0" + } + }, + "@typescript-eslint/types": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.8.0.tgz", + "integrity": "sha512-LdCYOqeqZWqCMOmwFnum6YfW9F3nKuxJiR84CdIRN5nfHJ7gyvGpXWqL/AaW0k3Po0+wm93ARAsOdzlZDPCcXg==", + "dev": true + }, + "@typescript-eslint/typescript-estree": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.8.0.tgz", + "integrity": "sha512-srfeZ3URdEcUsSLbkOFqS7WoxOqn8JNil2NSLO9O+I2/Uyc85+UlfpEvQHIpj5dVts7KKOZnftoJD/Fdv0L7nQ==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.8.0", + "@typescript-eslint/visitor-keys": "5.8.0", + "debug": "^4.3.2", + "globby": "^11.0.4", + "is-glob": "^4.0.3", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + }, + "dependencies": { + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + } + } + }, + "@typescript-eslint/visitor-keys": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.8.0.tgz", + "integrity": "sha512-+HDIGOEMnqbxdAHegxvnOqESUH6RWFRR2b8qxP1W9CZnnYh4Usz6MBL+2KMAgPk/P0o9c1HqnYtwzVH6GTIqug==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.8.0", + "eslint-visitor-keys": "^3.0.0" + } + }, + "@ungap/promise-all-settled": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", + "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", + "dev": true + }, + "acorn": { + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.6.0.tgz", + "integrity": "sha512-U1riIR+lBSNi3IbxtaHOIKdH8sLFv3NYfNv8sg7ZsNhcfl4HF2++BfqqrNAxoCLQW1iiylOj76ecnaUxz+z9yw==", + "dev": true + }, + "acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "requires": {} + }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + }, + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "array-includes": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.4.tgz", + "integrity": "sha512-ZTNSQkmWumEbiHO2GF4GmWxYVTiQyJy2XOTa15sdQSrvKn7l+180egQMqlrMOUMCyLMD7pmyQe4mMDUT6Behrw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.1", + "get-intrinsic": "^1.1.1", + "is-string": "^1.0.7" + } + }, + "array-timsort": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-timsort/-/array-timsort-1.0.3.tgz", + "integrity": "sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ==", + "dev": true + }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, + "array.prototype.flat": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.5.tgz", + "integrity": "sha512-KaYU+S+ndVqyUnignHftkwc58o3uVU1jzczILJ1tN2YaIZpFIKBiP/x/j97E5MVPsaCloPbqWLB/8qCTVvT2qg==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.0" + } + }, + "assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true + }, + "babel-plugin-dynamic-import-node": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", + "integrity": "sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==", + "dev": true, + "requires": { + "object.assign": "^4.1.0" + } + }, + "babel-plugin-polyfill-corejs2": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.0.tgz", + "integrity": "sha512-wMDoBJ6uG4u4PNFh72Ty6t3EgfA91puCuAwKIazbQlci+ENb/UU9A3xG5lutjUIiXCIn1CY5L15r9LimiJyrSA==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.13.11", + "@babel/helper-define-polyfill-provider": "^0.3.0", + "semver": "^6.1.1" + } + }, + "babel-plugin-polyfill-corejs3": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.4.0.tgz", + "integrity": "sha512-YxFreYwUfglYKdLUGvIF2nJEsGwj+RhWSX/ije3D2vQPOXuyMLMtg/cCGMDpOA7Nd+MwlNdnGODbd2EwUZPlsw==", + "dev": true, + "requires": { + "@babel/helper-define-polyfill-provider": "^0.3.0", + "core-js-compat": "^3.18.0" + } + }, + "babel-plugin-polyfill-regenerator": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.3.0.tgz", + "integrity": "sha512-dhAPTDLGoMW5/84wkgwiLRwMnio2i1fUe53EuvtKMv0pn2p3S8OCoV1xAzfJPl0KOX7IB89s2ib85vbYiea3jg==", + "dev": true, + "requires": { + "@babel/helper-define-polyfill-provider": "^0.3.0" + } + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "browserslist": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.19.1.tgz", + "integrity": "sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A==", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30001286", + "electron-to-chromium": "^1.4.17", + "escalade": "^3.1.1", + "node-releases": "^2.0.1", + "picocolors": "^1.0.0" + } + }, + "buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "c8": { + "version": "7.10.0", + "resolved": "https://registry.npmjs.org/c8/-/c8-7.10.0.tgz", + "integrity": "sha512-OAwfC5+emvA6R7pkYFVBTOtI5ruf9DahffGmIqUc9l6wEh0h7iAFP6dt/V9Ioqlr2zW5avX9U9/w1I4alTRHkA==", + "dev": true, + "requires": { + "@bcoe/v8-coverage": "^0.2.3", + "@istanbuljs/schema": "^0.1.2", + "find-up": "^5.0.0", + "foreground-child": "^2.0.0", + "istanbul-lib-coverage": "^3.0.1", + "istanbul-lib-report": "^3.0.0", + "istanbul-reports": "^3.0.2", + "rimraf": "^3.0.0", + "test-exclude": "^6.0.0", + "v8-to-istanbul": "^8.0.0", + "yargs": "^16.2.0", + "yargs-parser": "^20.2.7" + } + }, + "call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + } + }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, + "camelcase": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.1.tgz", + "integrity": "sha512-tVI4q5jjFV5CavAU8DXfza/TJcZutVKo/5Foskmsqcm0MsL91moHvwiGNnqaa2o6PF/7yT5ikDRcVcl8Rj6LCA==", + "dev": true + }, + "caniuse-lite": { + "version": "1.0.30001292", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001292.tgz", + "integrity": "sha512-jnT4Tq0Q4ma+6nncYQVe7d73kmDmE9C3OGTx3MvW7lBM/eY1S1DZTMBON7dqV481RhNiS5OxD7k9JQvmDOTirw==", + "dev": true + }, + "chai": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.4.tgz", + "integrity": "sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA==", + "dev": true, + "requires": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^3.0.1", + "get-func-name": "^2.0.0", + "pathval": "^1.1.1", + "type-detect": "^4.0.5" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", + "dev": true + }, + "chokidar": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", + "integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==", + "dev": true, + "requires": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "fsevents": "~2.3.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "dependencies": { + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + } + } + }, + "clear-module": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/clear-module/-/clear-module-4.1.2.tgz", + "integrity": "sha512-LWAxzHqdHsAZlPlEyJ2Poz6AIs384mPeqLVCru2p0BrP9G/kVGuhNyZYClLO6cXlnuJjzC8xtsJIuMjKqLXoAw==", + "dev": true, + "requires": { + "parent-module": "^2.0.0", + "resolve-from": "^5.0.0" + } + }, + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "clone-deep": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", + "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.2", + "shallow-clone": "^3.0.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "commander": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", + "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", + "dev": true + }, + "comment-json": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.1.1.tgz", + "integrity": "sha512-v8gmtPvxhBlhdRBLwdHSjGy9BgA23t9H1FctdQKyUrErPjSrJcdDMqBq9B4Irtm7w3TNYLQJNH6ARKnpyag1sA==", + "dev": true, + "requires": { + "array-timsort": "^1.0.3", + "core-util-is": "^1.0.2", + "esprima": "^4.0.1", + "has-own-prop": "^2.0.0", + "repeat-string": "^1.6.1" + } + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "configstore": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz", + "integrity": "sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA==", + "dev": true, + "requires": { + "dot-prop": "^5.2.0", + "graceful-fs": "^4.1.2", + "make-dir": "^3.0.0", + "unique-string": "^2.0.0", + "write-file-atomic": "^3.0.0", + "xdg-basedir": "^4.0.0" + }, + "dependencies": { + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + } + } + } + }, + "convert-source-map": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", + "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + } + }, + "core-js-compat": { + "version": "3.20.1", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.20.1.tgz", + "integrity": "sha512-AVhKZNpqMV3Jz8hU0YEXXE06qoxtQGsAqU0u1neUngz5IusDJRX/ZJ6t3i7mS7QxNyEONbCo14GprkBrxPlTZA==", + "dev": true, + "requires": { + "browserslist": "^4.19.1", + "semver": "7.0.0" + }, + "dependencies": { + "semver": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", + "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", + "dev": true + } + } + }, + "core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true + }, + "cosmiconfig": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.1.tgz", + "integrity": "sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ==", + "dev": true, + "requires": { + "@types/parse-json": "^4.0.0", + "import-fresh": "^3.2.1", + "parse-json": "^5.0.0", + "path-type": "^4.0.0", + "yaml": "^1.10.0" + } + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "crypto-random-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", + "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==", + "dev": true + }, + "cspell": { + "version": "5.13.4", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-5.13.4.tgz", + "integrity": "sha512-T/AMylb/CY0af8Oc1/Nv79Mqe852ga4AOAY0m8eYG8A5zahDpL2EC6PN5yK8KFn0UPMWMB8B2atZf6/U5RWdaQ==", + "dev": true, + "requires": { + "chalk": "^4.1.2", + "commander": "^8.3.0", + "comment-json": "^4.1.1", + "cspell-gitignore": "^5.13.4", + "cspell-glob": "^5.13.4", + "cspell-lib": "^5.13.4", + "fast-json-stable-stringify": "^2.1.0", + "file-entry-cache": "^6.0.1", + "fs-extra": "^10.0.0", + "get-stdin": "^8.0.0", + "glob": "^7.2.0", + "imurmurhash": "^0.1.4", + "semver": "^7.3.5", + "strip-ansi": "^6.0.1", + "vscode-uri": "^3.0.2" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "cspell-gitignore": { + "version": "5.13.4", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-5.13.4.tgz", + "integrity": "sha512-Md2V+EyILAavxO6CJ/Y/l8/p2nBFA0p1sMrjCEBtBuF3BL7A/A2LGaK4Tb+trVONFAKQ5cZo84WbyvSYWUqvpw==", + "dev": true, + "requires": { + "cspell-glob": "^5.13.4", + "find-up": "^5.0.0" + } + }, + "cspell-glob": { + "version": "5.13.4", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-5.13.4.tgz", + "integrity": "sha512-uKkibBe41Tr609mNBOairsyuNhPo+kqMVw2JeobfgN71GESQLjU7hr6VpKaUKGZyJpaicP606LB0gZBM38IOvw==", + "dev": true, + "requires": { + "micromatch": "^4.0.4" + } + }, + "cspell-io": { + "version": "5.13.4", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-5.13.4.tgz", + "integrity": "sha512-THe0R5CAv2h5yvrF3dtvigY73mnfFlfTJFWoSgGsafKq5nmR8jgKpbjQgK93zL0JC//BgdK0extfrSLsW2D4mw==", + "dev": true + }, + "cspell-lib": { + "version": "5.13.4", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-5.13.4.tgz", + "integrity": "sha512-kKGqAMXKdj8l3sgjoJuuQKTuwLz/33c3YFM/d3lYzcP3mo7C4v/M04Dm4mlTdWA0l4WYlzuSqxDmj32SsHMbNA==", + "dev": true, + "requires": { + "@cspell/cspell-bundled-dicts": "^5.13.4", + "@cspell/cspell-types": "^5.13.4", + "clear-module": "^4.1.2", + "comment-json": "^4.1.1", + "configstore": "^5.0.1", + "cosmiconfig": "^7.0.1", + "cspell-glob": "^5.13.4", + "cspell-io": "^5.13.4", + "cspell-trie-lib": "^5.13.4", + "find-up": "^5.0.0", + "fs-extra": "^10.0.0", + "gensequence": "^3.1.1", + "import-fresh": "^3.3.0", + "resolve-from": "^5.0.0", + "resolve-global": "^1.0.0", + "vscode-uri": "^3.0.2" + } + }, + "cspell-trie-lib": { + "version": "5.13.4", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-5.13.4.tgz", + "integrity": "sha512-e5fKOOioJlJJ+DcLVIkuy+7FI/YmUojhfzdUjTvLDn5EJFL3/oiP5AvDXGV3bMqYzlbRQKD6FpC61KVIkNMbEw==", + "dev": true, + "requires": { + "fs-extra": "^10.0.0", + "gensequence": "^3.1.1" + } + }, + "debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true + }, + "deep-eql": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", + "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "dev": true, + "requires": { + "type-detect": "^4.0.0" + } + }, + "deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, + "diff": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", + "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "dev": true + }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "requires": { + "path-type": "^4.0.0" + } + }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "dot-prop": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", + "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", + "dev": true, + "requires": { + "is-obj": "^2.0.0" + } + }, + "electron-to-chromium": { + "version": "1.4.28", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.28.tgz", + "integrity": "sha512-Gzbf0wUtKfyPaqf0Plz+Ctinf9eQIzxEqBHwSvbGfeOm9GMNdLxyu1dNiCUfM+x6r4BE0xUJNh3Nmg9gfAtTmg==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "requires": { + "ansi-colors": "^4.1.1" + } + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es-abstract": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.1.tgz", + "integrity": "sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "get-intrinsic": "^1.1.1", + "get-symbol-description": "^1.0.0", + "has": "^1.0.3", + "has-symbols": "^1.0.2", + "internal-slot": "^1.0.3", + "is-callable": "^1.2.4", + "is-negative-zero": "^2.0.1", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.1", + "is-string": "^1.0.7", + "is-weakref": "^1.0.1", + "object-inspect": "^1.11.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.2", + "string.prototype.trimend": "^1.0.4", + "string.prototype.trimstart": "^1.0.4", + "unbox-primitive": "^1.0.1" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "eslint": { + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.5.0.tgz", + "integrity": "sha512-tVGSkgNbOfiHyVte8bCM8OmX+xG9PzVG/B4UCF60zx7j61WIVY/AqJECDgpLD4DbbESD0e174gOg3ZlrX15GDg==", + "dev": true, + "requires": { + "@eslint/eslintrc": "^1.0.5", + "@humanwhocodes/config-array": "^0.9.2", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.1.0", + "eslint-utils": "^3.0.0", + "eslint-visitor-keys": "^3.1.0", + "espree": "^9.2.0", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^6.0.1", + "globals": "^13.6.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.2.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.1", + "strip-json-comments": "^3.1.0", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, + "eslint-scope": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.0.tgz", + "integrity": "sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + } + }, + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + }, + "globals": { + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.0.tgz", + "integrity": "sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg==", + "dev": true, + "requires": { + "type-fest": "^0.20.2" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "eslint-import-resolver-node": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz", + "integrity": "sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw==", + "dev": true, + "requires": { + "debug": "^3.2.7", + "resolve": "^1.20.0" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + } + } + }, + "eslint-module-utils": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.1.tgz", + "integrity": "sha512-fjoetBXQZq2tSTWZ9yWVl2KuFrTZZH3V+9iD1V1RfpDgxzJR+mPd/KZmMiA8gbPqdBzpNiEHOuT7IYEWxrH0zQ==", + "dev": true, + "requires": { + "debug": "^3.2.7", + "find-up": "^2.1.0", + "pkg-dir": "^2.0.0" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + } + } + }, + "eslint-plugin-es": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-3.0.1.tgz", + "integrity": "sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ==", + "dev": true, + "requires": { + "eslint-utils": "^2.0.0", + "regexpp": "^3.0.0" + }, + "dependencies": { + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } + } + }, + "eslint-plugin-import": { + "version": "2.25.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.25.3.tgz", + "integrity": "sha512-RzAVbby+72IB3iOEL8clzPLzL3wpDrlwjsTBAQXgyp5SeTqqY+0bFubwuo+y/HLhNZcXV4XqTBO4LGsfyHIDXg==", + "dev": true, + "requires": { + "array-includes": "^3.1.4", + "array.prototype.flat": "^1.2.5", + "debug": "^2.6.9", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.6", + "eslint-module-utils": "^2.7.1", + "has": "^1.0.3", + "is-core-module": "^2.8.0", + "is-glob": "^4.0.3", + "minimatch": "^3.0.4", + "object.values": "^1.1.5", + "resolve": "^1.20.0", + "tsconfig-paths": "^3.11.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "eslint-plugin-internal-rules": { + "version": "file:resources/eslint-internal-rules" + }, + "eslint-plugin-node": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz", + "integrity": "sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g==", + "dev": true, + "requires": { + "eslint-plugin-es": "^3.0.0", + "eslint-utils": "^2.0.0", + "ignore": "^5.1.1", + "minimatch": "^3.0.4", + "resolve": "^1.10.1", + "semver": "^6.1.0" + }, + "dependencies": { + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } + } + }, + "eslint-plugin-simple-import-sort": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-7.0.0.tgz", + "integrity": "sha512-U3vEDB5zhYPNfxT5TYR7u01dboFZp+HNpnGhkDB2g/2E4wZ/g1Q9Ton8UwCLfRV9yAKyYqDh62oHOamvkFxsvw==", + "dev": true, + "requires": {} + }, + "eslint-plugin-tsdoc": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/eslint-plugin-tsdoc/-/eslint-plugin-tsdoc-0.2.14.tgz", + "integrity": "sha512-fJ3fnZRsdIoBZgzkQjv8vAj6NeeOoFkTfgosj6mKsFjX70QV256sA/wq+y/R2+OL4L8E79VVaVWrPeZnKNe8Ng==", + "dev": true, + "requires": { + "@microsoft/tsdoc": "0.13.2", + "@microsoft/tsdoc-config": "0.15.2" + } + }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^2.0.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true + } + } + }, + "eslint-visitor-keys": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz", + "integrity": "sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA==", + "dev": true + }, + "espree": { + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.2.0.tgz", + "integrity": "sha512-oP3utRkynpZWF/F2x/HZJ+AGtnIclaR7z1pYPxy7NYM2fSO6LgK/Rkny8anRSPK/VwEA1eqm2squui0T7ZMOBg==", + "dev": true, + "requires": { + "acorn": "^8.6.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^3.1.0" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esquery": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + } + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + } + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-glob": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.7.tgz", + "integrity": "sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "dependencies": { + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + } + } + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "fastq": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, + "file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "requires": { + "flat-cache": "^3.0.4" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "find-cache-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", + "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^2.0.0", + "pkg-dir": "^3.0.0" + }, + "dependencies": { + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "dev": true, + "requires": { + "find-up": "^3.0.0" + } + } + } + }, + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, + "flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true + }, + "flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, + "requires": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + } + }, + "flatted": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.4.tgz", + "integrity": "sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw==", + "dev": true + }, + "foreground-child": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" + } + }, + "fs-extra": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz", + "integrity": "sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "optional": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "gensequence": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/gensequence/-/gensequence-3.1.1.tgz", + "integrity": "sha512-ys3h0hiteRwmY6BsvSttPmkhC0vEQHPJduANBRtH/dlDPZ0UBIb/dXy80IcckXyuQ6LKg+PloRqvGER9IS7F7g==", + "dev": true + }, + "gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "dev": true + }, + "get-intrinsic": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", + "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + } + }, + "get-stdin": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz", + "integrity": "sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==", + "dev": true + }, + "get-symbol-description": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", + "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + } + }, + "glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "requires": { + "is-glob": "^4.0.3" + } + }, + "global-dirs": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz", + "integrity": "sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU=", + "dev": true, + "requires": { + "ini": "^1.3.4" + } + }, + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + }, + "globby": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz", + "integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==", + "dev": true, + "requires": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.1.1", + "ignore": "^5.1.4", + "merge2": "^1.3.0", + "slash": "^3.0.0" + } + }, + "graceful-fs": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz", + "integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==", + "dev": true + }, + "growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "dev": true + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-bigints": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz", + "integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "has-own-prop": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-own-prop/-/has-own-prop-2.0.0.tgz", + "integrity": "sha512-Pq0h+hvsVm6dDEa8x82GnLSYHOzNDt7f0ddFa3FqcQlgzEiptPqL+XrOJNavjOzSYiYWIrgeVYYgGlLmnxwilQ==", + "dev": true + }, + "has-symbols": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", + "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", + "dev": true + }, + "has-tostringtag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", + "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "dev": true, + "requires": { + "has-symbols": "^1.0.2" + } + }, + "he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true + }, + "html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "ignore": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "dev": true + }, + "import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "dependencies": { + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + } + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + }, + "internal-slot": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", + "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", + "dev": true, + "requires": { + "get-intrinsic": "^1.1.0", + "has": "^1.0.3", + "side-channel": "^1.0.4" + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dev": true, + "requires": { + "has-bigints": "^1.0.1" + } + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + } + }, + "is-callable": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz", + "integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==", + "dev": true + }, + "is-core-module": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.0.tgz", + "integrity": "sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, + "is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dev": true, + "requires": { + "has-tostringtag": "^1.0.0" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-negative-zero": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", + "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", + "dev": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-number-object": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.6.tgz", + "integrity": "sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g==", + "dev": true, + "requires": { + "has-tostringtag": "^1.0.0" + } + }, + "is-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", + "dev": true + }, + "is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + } + }, + "is-shared-array-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz", + "integrity": "sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA==", + "dev": true + }, + "is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dev": true, + "requires": { + "has-tostringtag": "^1.0.0" + } + }, + "is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dev": true, + "requires": { + "has-symbols": "^1.0.2" + } + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true + }, + "is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.2" + } + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "istanbul-lib-coverage": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", + "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", + "dev": true + }, + "istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "dev": true, + "requires": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^3.0.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "istanbul-reports": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.2.tgz", + "integrity": "sha512-0gHxuT1NNC0aEIL1zbJ+MTgPbbHhU77eJPuU35WKA7TgXiSNlCAx4PENoMrH0Or6M2H80TaZcWKhM0IK6V8gRw==", + "dev": true, + "requires": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + } + }, + "jju": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz", + "integrity": "sha1-o6vicYryQaKykE+EpiWXDzia4yo=", + "dev": true + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "requires": { + "argparse": "^2.0.1" + } + }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, + "json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "json5": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", + "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6", + "universalify": "^2.0.0" + } + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true + }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true + }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "requires": { + "p-locate": "^5.0.0" + } + }, + "lodash.debounce": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", + "dev": true + }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "requires": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "requires": { + "pify": "^4.0.1", + "semver": "^5.6.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true + }, + "micromatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", + "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.2.3" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "mocha": { + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.1.3.tgz", + "integrity": "sha512-Xcpl9FqXOAYqI3j79pEtHBBnQgVXIhpULjGQa7DVb0Po+VzmSIK9kanAiWLHoRR/dbZ2qpdPshuXr8l1VaHCzw==", + "dev": true, + "requires": { + "@ungap/promise-all-settled": "1.1.2", + "ansi-colors": "4.1.1", + "browser-stdout": "1.3.1", + "chokidar": "3.5.2", + "debug": "4.3.2", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.1.7", + "growl": "1.10.5", + "he": "1.2.0", + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", + "minimatch": "3.0.4", + "ms": "2.1.3", + "nanoid": "3.1.25", + "serialize-javascript": "6.0.0", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "which": "2.0.2", + "workerpool": "6.1.5", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" + }, + "dependencies": { + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, + "glob": { + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "yargs-parser": { + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", + "dev": true + } + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "nanoid": { + "version": "3.1.25", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.25.tgz", + "integrity": "sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q==", + "dev": true + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "node-releases": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.1.tgz", + "integrity": "sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==", + "dev": true + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "object-inspect": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", + "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==", + "dev": true + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, + "object.assign": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + } + }, + "object.values": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.5.tgz", + "integrity": "sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + } + }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "requires": { + "p-limit": "^3.0.2" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "parent-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-2.0.0.tgz", + "integrity": "sha512-uo0Z9JJeWzv8BG+tRcapBKNJ0dro9cLyczGzulS6EfeyAdeC9sbojtW6XwvYxJkEne9En+J2XEl4zyglVeIwFg==", + "dev": true, + "requires": { + "callsites": "^3.1.0" + } + }, + "parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + }, + "pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "dev": true + }, + "picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, + "picomatch": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", + "dev": true + }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + }, + "pirates": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.4.tgz", + "integrity": "sha512-ZIrVPH+A52Dw84R0L3/VS9Op04PuQ2SEoJL6bkshmiTic/HldyW9Tf7oH5mhJZBK7NmDx27vSMrYEXPXclpDKw==", + "dev": true + }, + "pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "dev": true, + "requires": { + "find-up": "^2.1.0" + }, + "dependencies": { + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + } + } + }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true + }, + "prettier": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.5.1.tgz", + "integrity": "sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==", + "dev": true + }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "requires": { + "picomatch": "^2.2.1" + } + }, + "regenerate": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", + "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", + "dev": true + }, + "regenerate-unicode-properties": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-9.0.0.tgz", + "integrity": "sha512-3E12UeNSPfjrgwjkR81m5J7Aw/T55Tu7nUyZVQYCKEOs+2dkxEY+DpPtZzO4YruuiPb7NkYLVcyJC4+zCbk5pA==", + "dev": true, + "requires": { + "regenerate": "^1.4.2" + } + }, + "regenerator-runtime": { + "version": "0.13.9", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", + "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==", + "dev": true + }, + "regenerator-transform": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.5.tgz", + "integrity": "sha512-eOf6vka5IO151Jfsw2NO9WpGX58W6wWmefK3I1zEGr0lOD0u8rwPaNqQL1aRxUaxLeKO3ArNh3VYg1KbaD+FFw==", + "dev": true, + "requires": { + "@babel/runtime": "^7.8.4" + } + }, + "regexpp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true + }, + "regexpu-core": { + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.8.0.tgz", + "integrity": "sha512-1F6bYsoYiz6is+oz70NWur2Vlh9KWtswuRuzJOfeYUrfPX2o8n74AnUVaOGDbUqVGO9fNHu48/pjJO4sNVwsOg==", + "dev": true, + "requires": { + "regenerate": "^1.4.2", + "regenerate-unicode-properties": "^9.0.0", + "regjsgen": "^0.5.2", + "regjsparser": "^0.7.0", + "unicode-match-property-ecmascript": "^2.0.0", + "unicode-match-property-value-ecmascript": "^2.0.0" + } + }, + "regjsgen": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.2.tgz", + "integrity": "sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A==", + "dev": true + }, + "regjsparser": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.7.0.tgz", + "integrity": "sha512-A4pcaORqmNMDVwUjWoTzuhwMGpP+NykpfqAsEgI1FSH/EzC7lrN5TMd+kN8YCovX+jMpu8eaqXgXPCa0g8FQNQ==", + "dev": true, + "requires": { + "jsesc": "~0.5.0" + }, + "dependencies": { + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "dev": true + } + } + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "resolve": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", + "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", + "dev": true, + "requires": { + "is-core-module": "^2.2.0", + "path-parse": "^1.0.6" + } + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + }, + "resolve-global": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-global/-/resolve-global-1.0.0.tgz", + "integrity": "sha512-zFa12V4OLtT5XUX/Q4VLvTfBf+Ok0SPc1FNGM/z9ctUdiU618qwKpWnd0CHs3+RqROfyEg/DhuHbMWYqcgljEw==", + "dev": true, + "requires": { + "global-dirs": "^0.1.1" + } + }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "requires": { + "queue-microtask": "^1.2.2" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "serialize-javascript": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + }, + "shallow-clone": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", + "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", + "dev": true, + "requires": { + "kind-of": "^6.0.2" + } + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + } + }, + "signal-exit": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.6.tgz", + "integrity": "sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ==", + "dev": true + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "string.prototype.trimend": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz", + "integrity": "sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + } + }, + "string.prototype.trimstart": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz", + "integrity": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "requires": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "tsconfig-paths": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz", + "integrity": "sha512-e5adrnOYT6zqVnWqZu7i/BQ3BnhzvGbjEjejFXO20lKIKpwTaupkCPgEfv4GZK1IBciJUEhYs3J3p75FdaTFVg==", + "dev": true, + "requires": { + "@types/json5": "^0.0.29", + "json5": "^1.0.1", + "minimist": "^1.2.0", + "strip-bom": "^3.0.0" + }, + "dependencies": { + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + } + } + }, + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + }, + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true + }, + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true + }, + "typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, + "requires": { + "is-typedarray": "^1.0.0" + } + }, + "typescript": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.4.tgz", + "integrity": "sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==", + "dev": true + }, + "unbox-primitive": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz", + "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "has-bigints": "^1.0.1", + "has-symbols": "^1.0.2", + "which-boxed-primitive": "^1.0.2" + } + }, + "unicode-canonical-property-names-ecmascript": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", + "integrity": "sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ==", + "dev": true + }, + "unicode-match-property-ecmascript": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz", + "integrity": "sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==", + "dev": true, + "requires": { + "unicode-canonical-property-names-ecmascript": "^2.0.0", + "unicode-property-aliases-ecmascript": "^2.0.0" + } + }, + "unicode-match-property-value-ecmascript": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.0.0.tgz", + "integrity": "sha512-7Yhkc0Ye+t4PNYzOGKedDhXbYIBe1XEQYQxOPyhcXNMJ0WCABqqj6ckydd6pWRZTHV4GuCPKdBAUiMc60tsKVw==", + "dev": true + }, + "unicode-property-aliases-ecmascript": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.0.0.tgz", + "integrity": "sha512-5Zfuy9q/DFr4tfO7ZPeVXb1aPoeQSdeFMLpYuFebehDAhbuevLs5yxSZmIFN1tP5F9Wl4IpJrYojg85/zgyZHQ==", + "dev": true + }, + "unique-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", + "integrity": "sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==", + "dev": true, + "requires": { + "crypto-random-string": "^2.0.0" + } + }, + "universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "dev": true + }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "v8-compile-cache": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", + "dev": true + }, + "v8-to-istanbul": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-8.1.0.tgz", + "integrity": "sha512-/PRhfd8aTNp9Ggr62HPzXg2XasNFGy5PBt0Rp04du7/8GNNSgxFL6WBTkgMKSL9bFjH+8kKEG3f37FmxiTqUUA==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^1.6.0", + "source-map": "^0.7.3" + }, + "dependencies": { + "source-map": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", + "dev": true + } + } + }, + "vscode-uri": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.3.tgz", + "integrity": "sha512-EcswR2S8bpR7fD0YPeS7r2xXExrScVMxg4MedACaWHEtx9ftCF/qHG1xGkolzTPcEmjTavCQgbVzHUIdTMzFGA==", + "dev": true + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, + "requires": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + } + }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true + }, + "workerpool": { + "version": "6.1.5", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.5.tgz", + "integrity": "sha512-XdKkCK0Zqc6w3iTxLckiuJ81tiD/o5rBE/m+nXpRCB+/Sq4DqkfXZ/x0jW02DG1tGsfUGXbTJyZDP+eu67haSw==", + "dev": true + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + } + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, + "xdg-basedir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz", + "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==", + "dev": true + }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "yaml": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", + "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", + "dev": true + }, + "yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + } + }, + "yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true + }, + "yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "dev": true, + "requires": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + } + }, + "yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 00000000..6a870cc8 --- /dev/null +++ b/package.json @@ -0,0 +1,79 @@ +{ + "name": "graphql", + "version": "16.2.0", + "description": "A Query Language and Runtime which can target any service.", + "license": "MIT", + "private": true, + "main": "index", + "module": "index.mjs", + "typesVersions": { + ">=4.1.0": { + "*": [ + "*" + ] + } + }, + "sideEffects": false, + "homepage": "https://github.com/graphql/graphql-js", + "bugs": { + "url": "https://github.com/graphql/graphql-js/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/graphql/graphql-js.git" + }, + "keywords": [ + "graphql", + "graphql-js" + ], + "engines": { + "node": "^12.22.0 || ^14.16.0 || >=16.0.0" + }, + "scripts": { + "preversion": ". ./resources/checkgit.sh && npm ci --ignore-scripts", + "version": "node resources/gen-version.js && npm test && git add src/version.ts", + "fuzzonly": "mocha --full-trace src/**/__tests__/**/*-fuzz.ts", + "changelog": "node resources/gen-changelog.js", + "benchmark": "node benchmark/benchmark.js", + "test": "npm run lint && npm run check && npm run testonly && npm run prettier:check && npm run check:spelling && npm run check:integrations", + "lint": "eslint --cache --max-warnings 0 .", + "check": "tsc --pretty", + "testonly": "mocha --full-trace src/**/__tests__/**/*-test.ts", + "testonly:cover": "c8 npm run testonly", + "prettier": "prettier --write --list-different .", + "prettier:check": "prettier --check .", + "check:spelling": "cspell --cache --no-progress '**/*'", + "check:integrations": "npm run build:npm && npm run build:deno && mocha --full-trace integrationTests/*-test.js", + "build:npm": "node resources/build-npm.js", + "build:deno": "node resources/build-deno.js", + "gitpublish:npm": "bash ./resources/gitpublish.sh npm npmDist", + "gitpublish:deno": "bash ./resources/gitpublish.sh deno denoDist" + }, + "devDependencies": { + "@babel/core": "7.16.5", + "@babel/plugin-syntax-typescript": "7.16.5", + "@babel/plugin-transform-typescript": "7.16.1", + "@babel/preset-env": "7.16.5", + "@babel/register": "7.16.5", + "@types/chai": "4.3.0", + "@types/mocha": "9.0.0", + "@types/node": "17.0.5", + "@typescript-eslint/eslint-plugin": "5.8.0", + "@typescript-eslint/parser": "5.8.0", + "c8": "7.10.0", + "chai": "4.3.4", + "cspell": "5.13.4", + "eslint": "8.5.0", + "eslint-plugin-import": "2.25.3", + "eslint-plugin-internal-rules": "file:./resources/eslint-internal-rules", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-simple-import-sort": "7.0.0", + "eslint-plugin-tsdoc": "0.2.14", + "mocha": "9.1.3", + "prettier": "2.5.1", + "typescript": "4.5.4" + }, + "publishConfig": { + "tag": "latest" + } +} diff --git a/resources/add-extension-to-import-paths.js b/resources/add-extension-to-import-paths.js new file mode 100644 index 00000000..3ec22d9d --- /dev/null +++ b/resources/add-extension-to-import-paths.js @@ -0,0 +1,39 @@ +'use strict'; + +/** + * Adds extension to all paths imported inside MJS files + * + * Transforms: + * + * import { foo } from './bar'; + * export { foo } from './bar'; + * + * to: + * + * import { foo } from './bar.mjs'; + * export { foo } from './bar.mjs'; + * + */ +module.exports = function addExtensionToImportPaths(context, { extension }) { + const { types } = context; + + return { + visitor: { + ImportDeclaration: replaceImportPath, + ExportNamedDeclaration: replaceImportPath, + }, + }; + + function replaceImportPath(path) { + // bail if the declaration doesn't have a source, e.g. "export { foo };" + if (!path.node.source) { + return; + } + + const source = path.node.source.value; + if (source.startsWith('./') || source.startsWith('../')) { + const newSourceNode = types.stringLiteral(source + '.' + extension); + path.get('source').replaceWith(newSourceNode); + } + } +}; diff --git a/resources/build-deno.js b/resources/build-deno.js new file mode 100644 index 00000000..f0479a85 --- /dev/null +++ b/resources/build-deno.js @@ -0,0 +1,35 @@ +'use strict'; + +const fs = require('fs'); +const path = require('path'); + +const babel = require('@babel/core'); + +const { + writeGeneratedFile, + readdirRecursive, + showDirStats, +} = require('./utils.js'); + +if (require.main === module) { + fs.rmSync('./denoDist', { recursive: true, force: true }); + fs.mkdirSync('./denoDist'); + + const srcFiles = readdirRecursive('./src', { ignoreDir: /^__.*__$/ }); + for (const filepath of srcFiles) { + const srcPath = path.join('./src', filepath); + const destPath = path.join('./denoDist', filepath); + + fs.mkdirSync(path.dirname(destPath), { recursive: true }); + if (filepath.endsWith('.ts')) { + const options = { babelrc: false, configFile: './.babelrc-deno.json' }; + const output = babel.transformFileSync(srcPath, options).code + '\n'; + writeGeneratedFile(destPath, output); + } + } + + fs.copyFileSync('./LICENSE', './denoDist/LICENSE'); + fs.copyFileSync('./README.md', './denoDist/README.md'); + + showDirStats('./denoDist'); +} diff --git a/resources/build-npm.js b/resources/build-npm.js new file mode 100644 index 00000000..7ff0cf07 --- /dev/null +++ b/resources/build-npm.js @@ -0,0 +1,139 @@ +'use strict'; + +const fs = require('fs'); +const path = require('path'); +const assert = require('assert'); + +const ts = require('typescript'); +const babel = require('@babel/core'); + +const { + writeGeneratedFile, + readdirRecursive, + showDirStats, +} = require('./utils.js'); + +if (require.main === module) { + fs.rmSync('./npmDist', { recursive: true, force: true }); + fs.mkdirSync('./npmDist'); + + const packageJSON = buildPackageJSON(); + + const srcFiles = readdirRecursive('./src', { ignoreDir: /^__.*__$/ }); + for (const filepath of srcFiles) { + const srcPath = path.join('./src', filepath); + const destPath = path.join('./npmDist', filepath); + + fs.mkdirSync(path.dirname(destPath), { recursive: true }); + if (filepath.endsWith('.ts')) { + const cjs = babelBuild(srcPath, { envName: 'cjs' }); + writeGeneratedFile(destPath.replace(/\.ts$/, '.js'), cjs); + + const mjs = babelBuild(srcPath, { envName: 'mjs' }); + writeGeneratedFile(destPath.replace(/\.ts$/, '.mjs'), mjs); + } + } + + // Based on https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#getting-the-dts-from-a-javascript-file + const tsConfig = JSON.parse( + fs.readFileSync(require.resolve('../tsconfig.json'), 'utf-8'), + ); + assert( + tsConfig.compilerOptions, + '"tsconfig.json" should have `compilerOptions`', + ); + const tsOptions = { + ...tsConfig.compilerOptions, + noEmit: false, + declaration: true, + declarationDir: './npmDist', + emitDeclarationOnly: true, + }; + + const tsHost = ts.createCompilerHost(tsOptions); + tsHost.writeFile = (filepath, body) => { + writeGeneratedFile(filepath, body); + }; + + const tsProgram = ts.createProgram(['src/index.ts'], tsOptions, tsHost); + const tsResult = tsProgram.emit(); + assert( + !tsResult.emitSkipped, + 'Fail to generate `*.d.ts` files, please run `npm run check`', + ); + + assert(packageJSON.types === undefined, 'Unexpected "types" in package.json'); + const supportedTSVersions = Object.keys(packageJSON.typesVersions); + assert( + supportedTSVersions.length === 1, + 'Property "typesVersions" should have exactly one key.', + ); + // TODO: revisit once TS implements https://github.com/microsoft/TypeScript/issues/32166 + const notSupportedTSVersionFile = 'NotSupportedTSVersion.d.ts'; + fs.writeFileSync( + path.join('./npmDist', notSupportedTSVersionFile), + // Provoke syntax error to show this message + `"Package 'graphql' support only TS versions that are ${supportedTSVersions[0]}".`, + ); + packageJSON.typesVersions = { + ...packageJSON.typesVersions, + '*': { '*': [notSupportedTSVersionFile] }, + }; + + fs.copyFileSync('./LICENSE', './npmDist/LICENSE'); + fs.copyFileSync('./README.md', './npmDist/README.md'); + + // Should be done as the last step so only valid packages can be published + writeGeneratedFile('./npmDist/package.json', JSON.stringify(packageJSON)); + + showDirStats('./npmDist'); +} + +function babelBuild(srcPath, options) { + const { code } = babel.transformFileSync(srcPath, { + babelrc: false, + configFile: './.babelrc-npm.json', + ...options, + }); + return code + '\n'; +} + +function buildPackageJSON() { + const packageJSON = JSON.parse( + fs.readFileSync(require.resolve('../package.json'), 'utf-8'), + ); + + delete packageJSON.private; + delete packageJSON.scripts; + delete packageJSON.devDependencies; + + // TODO: move to integration tests + const publishTag = packageJSON.publishConfig?.tag; + assert(publishTag != null, 'Should have packageJSON.publishConfig defined!'); + + const { version } = packageJSON; + const versionMatch = /^\d+\.\d+\.\d+-?(?.*)?$/.exec(version); + if (!versionMatch) { + throw new Error('Version does not match semver spec: ' + version); + } + + const { preReleaseTag } = versionMatch.groups; + + if (preReleaseTag != null) { + const splittedTag = preReleaseTag.split('.'); + // Note: `experimental-*` take precedence over `alpha`, `beta` or `rc`. + const versionTag = splittedTag[2] ?? splittedTag[0]; + assert( + ['alpha', 'beta', 'rc'].includes(versionTag) || + versionTag.startsWith('experimental-'), + `"${versionTag}" tag is not supported.`, + ); + assert.equal( + versionTag, + publishTag, + 'Publish tag and version tag should match!', + ); + } + + return packageJSON; +} diff --git a/resources/checkgit.sh b/resources/checkgit.sh new file mode 100644 index 00000000..49449ecd --- /dev/null +++ b/resources/checkgit.sh @@ -0,0 +1,38 @@ +# Exit immediately if any subcommand terminated +trap "exit 1" ERR + +# +# This script determines if current git state is the up to date main. If so +# it exits normally. If not it prompts for an explicit continue. This script +# intends to protect from versioning for NPM without first pushing changes +# and including any changes on main. +# + +# Check that local copy has no modifications +GIT_MODIFIED_FILES=$(git ls-files -dm 2> /dev/null); +GIT_STAGED_FILES=$(git diff --cached --name-only 2> /dev/null); +if [ "$GIT_MODIFIED_FILES" != "" -o "$GIT_STAGED_FILES" != "" ]; then + read -p "Git has local modifications. Continue? (y|N) " yn; + if [ "$yn" != "y" ]; then exit 1; fi; +fi; + +# First fetch to ensure git is up to date. Fail-fast if this fails. +git fetch; +if [[ $? -ne 0 ]]; then exit 1; fi; + +# Extract useful information. +GIT_BRANCH=$(git branch -v 2> /dev/null | sed '/^[^*]/d'); +GIT_BRANCH_NAME=$(echo "$GIT_BRANCH" | sed 's/* \([A-Za-z0-9_\-]*\).*/\1/'); +GIT_BRANCH_SYNC=$(echo "$GIT_BRANCH" | sed 's/* [^[]*.\([^]]*\).*/\1/'); + +# Check if main is checked out +if [ "$GIT_BRANCH_NAME" != "main" ]; then + read -p "Git not on main but $GIT_BRANCH_NAME. Continue? (y|N) " yn; + if [ "$yn" != "y" ]; then exit 1; fi; +fi; + +# Check if branch is synced with remote +if [ "$GIT_BRANCH_SYNC" != "" ]; then + read -p "Git not up to date but $GIT_BRANCH_SYNC. Continue? (y|N) " yn; + if [ "$yn" != "y" ]; then exit 1; fi; +fi; diff --git a/resources/diff-npm-package.js b/resources/diff-npm-package.js new file mode 100644 index 00000000..c0d8d8c9 --- /dev/null +++ b/resources/diff-npm-package.js @@ -0,0 +1,104 @@ +'use strict'; + +const os = require('os'); +const fs = require('fs'); +const path = require('path'); +const cp = require('child_process'); + +const LOCAL = 'local'; +const localRepoDir = path.join(__dirname, '..'); +const tmpDir = path.join(os.tmpdir(), 'graphql-js-npm-diff'); +fs.rmSync(tmpDir, { recursive: true, force: true }); +fs.mkdirSync(tmpDir); + +const args = process.argv.slice(2); +let [fromRevision, toRevision] = args; +if (args.length < 2) { + fromRevision = fromRevision ?? 'HEAD'; + toRevision = toRevision ?? LOCAL; + console.warn( + `Assuming you meant: diff-npm-package ${fromRevision} ${toRevision}`, + ); +} + +console.log(`📦 Building NPM package for ${fromRevision}...`); +const fromPackage = prepareNPMPackage(fromRevision); + +console.log(`📦 Building NPM package for ${toRevision}...`); +const toPackage = prepareNPMPackage(toRevision); + +console.log('➖➕ Generating diff...'); +const diff = exec(`npm diff --diff=${fromPackage} --diff=${toPackage}`); + +if (diff === '') { + console.log('No changes found!'); +} else { + const reportPath = path.join(localRepoDir, 'npm-dist-diff.html'); + fs.writeFileSync(reportPath, generateReport(diff), 'utf-8'); + console.log('Report saved to: ', reportPath); +} + +function generateReport(diffString) { + return ` + + + + + + + + + + + +
+ + + `; +} +function prepareNPMPackage(revision) { + if (revision === LOCAL) { + exec('npm --quiet run build:npm', { cwd: localRepoDir }); + return path.join(localRepoDir, 'npmDist'); + } + + // Returns the complete git hash for a given git revision reference. + const hash = exec(`git rev-parse "${revision}"`); + + const repoDir = path.join(tmpDir, hash); + fs.rmSync(repoDir, { recursive: true, force: true }); + fs.mkdirSync(repoDir); + exec(`git archive "${hash}" | tar -xC "${repoDir}"`); + exec('npm --quiet ci --ignore-scripts', { cwd: repoDir }); + exec('npm --quiet run build:npm', { cwd: repoDir }); + return path.join(repoDir, 'npmDist'); +} + +function exec(command, options = {}) { + const result = cp.execSync(command, { + encoding: 'utf-8', + stdio: ['inherit', 'pipe', 'inherit'], + ...options, + }); + return result?.trimEnd(); +} diff --git a/resources/eslint-internal-rules/README.md b/resources/eslint-internal-rules/README.md new file mode 100644 index 00000000..cec9e87c --- /dev/null +++ b/resources/eslint-internal-rules/README.md @@ -0,0 +1,6 @@ +# Custom ESLint Rules + +This is a dummy npm package that allows us to treat it as an `eslint-plugin-graphql-internal`. +It's not actually published, nor are the rules here useful for users of graphql. + +**If you modify this rule, you must re-run `npm install` for it to take effect.** diff --git a/resources/eslint-internal-rules/index.js b/resources/eslint-internal-rules/index.js new file mode 100644 index 00000000..4acc530f --- /dev/null +++ b/resources/eslint-internal-rules/index.js @@ -0,0 +1,13 @@ +'use strict'; + +const onlyASCII = require('./only-ascii.js'); +const noDirImport = require('./no-dir-import.js'); +const requireToStringTag = require('./require-to-string-tag.js'); + +module.exports = { + rules: { + 'only-ascii': onlyASCII, + 'no-dir-import': noDirImport, + 'require-to-string-tag': requireToStringTag, + }, +}; diff --git a/resources/eslint-internal-rules/no-dir-import.js b/resources/eslint-internal-rules/no-dir-import.js new file mode 100644 index 00000000..53220398 --- /dev/null +++ b/resources/eslint-internal-rules/no-dir-import.js @@ -0,0 +1,36 @@ +'use strict'; + +const fs = require('fs'); +const path = require('path'); + +module.exports = function noDirImportRule(context) { + return { + ImportDeclaration: checkImportPath, + ExportNamedDeclaration: checkImportPath, + }; + + function checkImportPath(node) { + const { source } = node; + + // bail if the declaration doesn't have a source, e.g. "export { foo };" + if (!source) { + return; + } + + const importPath = source.value; + if (importPath.startsWith('./') || importPath.startsWith('../')) { + const baseDir = path.dirname(context.getFilename()); + const resolvedPath = path.resolve(baseDir, importPath); + + if ( + fs.existsSync(resolvedPath) && + fs.statSync(resolvedPath).isDirectory() + ) { + context.report({ + node: source, + message: 'It is not allowed to import from directory', + }); + } + } + } +}; diff --git a/resources/eslint-internal-rules/only-ascii.js b/resources/eslint-internal-rules/only-ascii.js new file mode 100644 index 00000000..f5ddbe1b --- /dev/null +++ b/resources/eslint-internal-rules/only-ascii.js @@ -0,0 +1,39 @@ +'use strict'; + +module.exports = { + meta: { + schema: [ + { + type: 'object', + properties: { + allowEmoji: { + type: 'boolean', + }, + }, + additionalProperties: false, + }, + ], + }, + create: onlyASCII, +}; + +function onlyASCII(context) { + const regExp = + context.options[0]?.allowEmoji === true + ? /[^\p{ASCII}\p{Emoji}]+/gu + : /\P{ASCII}+/gu; + + return { + Program() { + const sourceCode = context.getSourceCode(); + const text = sourceCode.getText(); + + for (const match of text.matchAll(regExp)) { + context.report({ + loc: sourceCode.getLocFromIndex(match.index), + message: `Non-ASCII character "${match[0]}" found.`, + }); + } + }, + }; +} diff --git a/resources/eslint-internal-rules/package.json b/resources/eslint-internal-rules/package.json new file mode 100644 index 00000000..5912b145 --- /dev/null +++ b/resources/eslint-internal-rules/package.json @@ -0,0 +1,8 @@ +{ + "name": "eslint-plugin-graphql-internal", + "version": "0.0.0", + "private": true, + "engines": { + "node": ">= 14.0.0" + } +} diff --git a/resources/eslint-internal-rules/require-to-string-tag.js b/resources/eslint-internal-rules/require-to-string-tag.js new file mode 100644 index 00000000..517fd07e --- /dev/null +++ b/resources/eslint-internal-rules/require-to-string-tag.js @@ -0,0 +1,37 @@ +'use strict'; + +module.exports = function requireToStringTag(context) { + const sourceCode = context.getSourceCode(); + + return { + 'ExportNamedDeclaration > ClassDeclaration': (classNode) => { + const properties = classNode.body.body; + if (properties.some(isToStringTagProperty)) { + return; + } + + const jsDoc = context.getJSDocComment(classNode)?.value; + // FIXME: use proper TSDoc parser instead of includes once we fix TSDoc comments + if (jsDoc?.includes('@internal') === true) { + return; + } + + context.report({ + node: classNode, + message: + 'All classes in public API required to have [Symbol.toStringTag] method', + }); + }, + }; + + function isToStringTagProperty(propertyNode) { + if ( + propertyNode.type !== 'MethodDefinition' || + propertyNode.kind !== 'get' + ) { + return false; + } + const keyText = sourceCode.getText(propertyNode.key); + return keyText === 'Symbol.toStringTag'; + } +}; diff --git a/resources/gen-changelog.js b/resources/gen-changelog.js new file mode 100644 index 00000000..02bb6340 --- /dev/null +++ b/resources/gen-changelog.js @@ -0,0 +1,323 @@ +'use strict'; + +const util = require('util'); +const https = require('https'); + +const packageJSON = require('../package.json'); + +const { exec } = require('./utils.js'); + +const graphqlRequest = util.promisify(graphqlRequestImpl); +const labelsConfig = { + 'PR: breaking change 💥': { + section: 'Breaking Change 💥', + }, + 'PR: deprecation ⚠': { + section: 'Deprecation ⚠', + }, + 'PR: feature 🚀': { + section: 'New Feature 🚀', + }, + 'PR: bug fix 🐞': { + section: 'Bug Fix 🐞', + }, + 'PR: docs 📝': { + section: 'Docs 📝', + fold: true, + }, + 'PR: polish 💅': { + section: 'Polish 💅', + fold: true, + }, + 'PR: internal 🏠': { + section: 'Internal 🏠', + fold: true, + }, + 'PR: dependency 📦': { + section: 'Dependency 📦', + fold: true, + }, +}; +const { GH_TOKEN } = process.env; + +if (!GH_TOKEN) { + console.error('Must provide GH_TOKEN as environment variable!'); + process.exit(1); +} + +if (!packageJSON.repository || typeof packageJSON.repository.url !== 'string') { + console.error('package.json is missing repository.url string!'); + process.exit(1); +} + +const repoURLMatch = + /https:\/\/github.com\/(?[^/]+)\/(?[^/]+).git/.exec( + packageJSON.repository.url, + ); +if (repoURLMatch == null) { + console.error('Cannot extract organization and repo name from repo URL!'); + process.exit(1); +} +const { githubOrg, githubRepo } = repoURLMatch.groups; + +getChangeLog() + .then((changelog) => process.stdout.write(changelog)) + .catch((error) => { + console.error(error); + process.exit(1); + }); + +function getChangeLog() { + const { version } = packageJSON; + + let tag = null; + let commitsList = exec(`git rev-list --reverse v${version}..`); + if (commitsList === '') { + const parentPackageJSON = exec('git cat-file blob HEAD~1:package.json'); + const parentVersion = JSON.parse(parentPackageJSON).version; + commitsList = exec(`git rev-list --reverse v${parentVersion}..HEAD~1`); + tag = `v${version}`; + } + + const date = exec('git log -1 --format=%cd --date=short'); + return getCommitsInfo(commitsList.split('\n')) + .then((commitsInfo) => getPRsInfo(commitsInfoToPRs(commitsInfo))) + .then((prsInfo) => genChangeLog(tag, date, prsInfo)); +} + +function genChangeLog(tag, date, allPRs) { + const byLabel = {}; + const committersByLogin = {}; + + for (const pr of allPRs) { + const labels = pr.labels.nodes + .map((label) => label.name) + .filter((label) => label.startsWith('PR: ')); + + if (labels.length === 0) { + throw new Error(`PR is missing label. See ${pr.url}`); + } + if (labels.length > 1) { + throw new Error( + `PR has conflicting labels: ${labels.join('\n')}\nSee ${pr.url}`, + ); + } + + const label = labels[0]; + if (!labelsConfig[label]) { + throw new Error(`Unknown label: ${label}. See ${pr.url}`); + } + byLabel[label] = byLabel[label] || []; + byLabel[label].push(pr); + committersByLogin[pr.author.login] = pr.author; + } + + let changelog = `## ${tag || 'Unreleased'} (${date})\n`; + for (const [label, config] of Object.entries(labelsConfig)) { + const prs = byLabel[label]; + if (prs) { + const shouldFold = config.fold && prs.length > 1; + + changelog += `\n#### ${config.section}\n`; + if (shouldFold) { + changelog += '
\n'; + changelog += ` ${prs.length} PRs were merged \n\n`; + } + + for (const pr of prs) { + const { number, url, author } = pr; + changelog += `* [#${number}](${url}) ${pr.title} ([@${author.login}](${author.url}))\n`; + } + + if (shouldFold) { + changelog += '
\n'; + } + } + } + + const committers = Object.values(committersByLogin).sort((a, b) => + (a.name || a.login).localeCompare(b.name || b.login), + ); + changelog += `\n#### Committers: ${committers.length}\n`; + for (const committer of committers) { + changelog += `* ${committer.name}([@${committer.login}](${committer.url}))\n`; + } + + return changelog; +} + +function graphqlRequestImpl(query, variables, cb) { + const resultCB = typeof variables === 'function' ? variables : cb; + + const req = https.request('https://api.github.com/graphql', { + method: 'POST', + headers: { + Authorization: 'bearer ' + GH_TOKEN, + 'Content-Type': 'application/json', + 'User-Agent': 'gen-changelog', + }, + }); + + req.on('response', (res) => { + let responseBody = ''; + + res.setEncoding('utf8'); + res.on('data', (d) => (responseBody += d)); + res.on('error', (error) => resultCB(error)); + + res.on('end', () => { + if (res.statusCode !== 200) { + return resultCB( + new Error( + `GitHub responded with ${res.statusCode}: ${res.statusMessage}\n` + + responseBody, + ), + ); + } + + let json; + try { + json = JSON.parse(responseBody); + } catch (error) { + return resultCB(error); + } + + if (json.errors) { + return resultCB( + new Error('Errors: ' + JSON.stringify(json.errors, null, 2)), + ); + } + + resultCB(undefined, json.data); + }); + }); + + req.on('error', (error) => resultCB(error)); + req.write(JSON.stringify({ query, variables })); + req.end(); +} + +async function batchCommitInfo(commits) { + let commitsSubQuery = ''; + for (const oid of commits) { + commitsSubQuery += ` + commit_${oid}: object(oid: "${oid}") { + ... on Commit { + oid + message + associatedPullRequests(first: 10) { + nodes { + number + repository { + nameWithOwner + } + } + } + } + } + `; + } + + const response = await graphqlRequest(` + { + repository(owner: "${githubOrg}", name: "${githubRepo}") { + ${commitsSubQuery} + } + } + `); + + const commitsInfo = []; + for (const oid of commits) { + commitsInfo.push(response.repository['commit_' + oid]); + } + return commitsInfo; +} + +async function batchPRInfo(prs) { + let prsSubQuery = ''; + for (const number of prs) { + prsSubQuery += ` + pr_${number}: pullRequest(number: ${number}) { + number + title + url + author { + login + url + ... on User { + name + } + } + labels(first: 10) { + nodes { + name + } + } + } + `; + } + + const response = await graphqlRequest(` + { + repository(owner: "${githubOrg}", name: "${githubRepo}") { + ${prsSubQuery} + } + } + `); + + const prsInfo = []; + for (const number of prs) { + prsInfo.push(response.repository['pr_' + number]); + } + return prsInfo; +} + +function commitsInfoToPRs(commits) { + const prs = {}; + for (const commit of commits) { + const associatedPRs = commit.associatedPullRequests.nodes.filter( + (pr) => pr.repository.nameWithOwner === `${githubOrg}/${githubRepo}`, + ); + if (associatedPRs.length === 0) { + const match = / \(#(?[0-9]+)\)$/m.exec(commit.message); + if (match) { + prs[parseInt(match.groups.prNumber, 10)] = true; + continue; + } + throw new Error( + `Commit ${commit.oid} has no associated PR: ${commit.message}`, + ); + } + if (associatedPRs.length > 1) { + throw new Error( + `Commit ${commit.oid} is associated with multiple PRs: ${commit.message}`, + ); + } + + prs[associatedPRs[0].number] = true; + } + + return Object.keys(prs); +} + +async function getPRsInfo(commits) { + // Split pr into batches of 50 to prevent timeouts + const prInfoPromises = []; + for (let i = 0; i < commits.length; i += 50) { + const batch = commits.slice(i, i + 50); + prInfoPromises.push(batchPRInfo(batch)); + } + + return (await Promise.all(prInfoPromises)).flat(); +} + +async function getCommitsInfo(commits) { + // Split commits into batches of 50 to prevent timeouts + const commitInfoPromises = []; + for (let i = 0; i < commits.length; i += 50) { + const batch = commits.slice(i, i + 50); + commitInfoPromises.push(batchCommitInfo(batch)); + } + + return (await Promise.all(commitInfoPromises)).flat(); +} diff --git a/resources/gen-version.js b/resources/gen-version.js new file mode 100644 index 00000000..b73621bc --- /dev/null +++ b/resources/gen-version.js @@ -0,0 +1,38 @@ +'use strict'; + +const { version } = require('../package.json'); + +const { writeGeneratedFile } = require('./utils.js'); + +const versionMatch = /^(\d+)\.(\d+)\.(\d+)-?(.*)?$/.exec(version); +if (!versionMatch) { + throw new Error('Version does not match semver spec: ' + version); +} + +const [, major, minor, patch, preReleaseTag] = versionMatch; + +const body = ` +// Note: This file is autogenerated using "resources/gen-version.js" script and +// automatically updated by "npm version" command. + +/** + * A string containing the version of the GraphQL.js library + */ +export const version = '${version}' as string; + +/** + * An object containing the components of the GraphQL.js version string + */ +export const versionInfo = Object.freeze({ + major: ${major} as number, + minor: ${minor} as number, + patch: ${patch} as number, + preReleaseTag: ${ + preReleaseTag ? `'${preReleaseTag}'` : 'null' + } as string | null, +}); +`; + +if (require.main === module) { + writeGeneratedFile('./src/version.ts', body); +} diff --git a/resources/inline-invariant.js b/resources/inline-invariant.js new file mode 100644 index 00000000..d3f5a1b6 --- /dev/null +++ b/resources/inline-invariant.js @@ -0,0 +1,48 @@ +'use strict'; + +/** + * Eliminates function call to `invariant` if the condition is met. + * + * Transforms: + * + * invariant(, ...) + * + * to: + * + * () || invariant(false ...) + */ +module.exports = function inlineInvariant(context) { + const invariantTemplate = context.template(` + (%%cond%%) || invariant(false, %%args%%) + `); + const assertTemplate = context.template(` + (%%cond%%) || devAssert(false, %%args%%) + `); + + return { + visitor: { + CallExpression(path) { + const node = path.node; + const parent = path.parent; + + if ( + parent.type !== 'ExpressionStatement' || + node.callee.type !== 'Identifier' || + node.arguments.length === 0 + ) { + return; + } + + const calleeName = node.callee.name; + if (calleeName === 'invariant') { + const [cond, args] = node.arguments; + + path.replaceWith(invariantTemplate({ cond, args })); + } else if (calleeName === 'devAssert') { + const [cond, args] = node.arguments; + path.replaceWith(assertTemplate({ cond, args })); + } + }, + }, + }; +}; diff --git a/resources/ts-register.js b/resources/ts-register.js new file mode 100644 index 00000000..649eb5fd --- /dev/null +++ b/resources/ts-register.js @@ -0,0 +1,3 @@ +'use strict'; + +require('@babel/register')({ extensions: ['.ts'] }); diff --git a/resources/utils.js b/resources/utils.js new file mode 100644 index 00000000..37cd83e8 --- /dev/null +++ b/resources/utils.js @@ -0,0 +1,99 @@ +'use strict'; + +const fs = require('fs'); +const path = require('path'); +const childProcess = require('child_process'); + +const prettier = require('prettier'); + +function exec(command, options) { + const output = childProcess.execSync(command, { + maxBuffer: 10 * 1024 * 1024, // 10MB + encoding: 'utf-8', + ...options, + }); + return output && output.trimEnd(); +} + +function readdirRecursive(dirPath, opts = {}) { + const { ignoreDir } = opts; + const result = []; + for (const dirent of fs.readdirSync(dirPath, { withFileTypes: true })) { + const name = dirent.name; + if (!dirent.isDirectory()) { + result.push(dirent.name); + continue; + } + + if (ignoreDir && ignoreDir.test(name)) { + continue; + } + const list = readdirRecursive(path.join(dirPath, name), opts).map((f) => + path.join(name, f), + ); + result.push(...list); + } + return result; +} + +function showDirStats(dirPath) { + const fileTypes = {}; + let totalSize = 0; + + for (const filepath of readdirRecursive(dirPath)) { + const name = filepath.split(path.sep).pop(); + const [base, ...splitExt] = name.split('.'); + const ext = splitExt.join('.'); + + const filetype = ext ? '*.' + ext : base; + fileTypes[filetype] = fileTypes[filetype] || { filepaths: [], size: 0 }; + + const { size } = fs.lstatSync(path.join(dirPath, filepath)); + totalSize += size; + fileTypes[filetype].size += size; + fileTypes[filetype].filepaths.push(filepath); + } + + let stats = []; + for (const [filetype, typeStats] of Object.entries(fileTypes)) { + const numFiles = typeStats.filepaths.length; + + if (numFiles > 1) { + stats.push([filetype + ' x' + numFiles, typeStats.size]); + } else { + stats.push([typeStats.filepaths[0], typeStats.size]); + } + } + stats.sort((a, b) => b[1] - a[1]); + stats = stats.map(([type, size]) => [type, (size / 1024).toFixed(2) + ' KB']); + + const typeMaxLength = Math.max(...stats.map((x) => x[0].length)); + const sizeMaxLength = Math.max(...stats.map((x) => x[1].length)); + for (const [type, size] of stats) { + console.log( + type.padStart(typeMaxLength) + ' | ' + size.padStart(sizeMaxLength), + ); + } + + console.log('-'.repeat(typeMaxLength + 3 + sizeMaxLength)); + const totalMB = (totalSize / 1024 / 1024).toFixed(2) + ' MB'; + console.log( + 'Total'.padStart(typeMaxLength) + ' | ' + totalMB.padStart(sizeMaxLength), + ); +} + +const prettierConfig = JSON.parse( + fs.readFileSync(require.resolve('../.prettierrc'), 'utf-8'), +); + +function writeGeneratedFile(filepath, body) { + const formatted = prettier.format(body, { filepath, ...prettierConfig }); + fs.writeFileSync(filepath, formatted); +} + +module.exports = { + exec, + readdirRecursive, + showDirStats, + writeGeneratedFile, +}; diff --git a/src/README.md b/src/README.md new file mode 100644 index 00000000..7a67bcb5 --- /dev/null +++ b/src/README.md @@ -0,0 +1,23 @@ +## GraphQL JS + +The primary `graphql` module includes everything you need to define a GraphQL +schema and fulfill GraphQL requests. + +```js +import { ... } from 'graphql'; // ES6 +var GraphQL = require('graphql'); // CommonJS +``` + +Each sub directory within is a sub-module of graphql-js: + +- [`graphql/language`](language/README.md): Parse and operate on the GraphQL + language. +- [`graphql/type`](type/README.md): Define GraphQL types and schema. +- [`graphql/validation`](validation/README.md): The Validation phase of + fulfilling a GraphQL result. +- [`graphql/execution`](execution/README.md): The Execution phase of fulfilling + a GraphQL request. +- [`graphql/error`](error/README.md): Creating and formatting GraphQL errors. +- [`graphql/utilities`](utilities/README.md): Common useful computations upon + the GraphQL language and type objects. +- [`graphql/subscription`](subscription/README.md): Subscribe to data updates. diff --git a/src/__testUtils__/__tests__/dedent-test.ts b/src/__testUtils__/__tests__/dedent-test.ts new file mode 100644 index 00000000..dfaf28e9 --- /dev/null +++ b/src/__testUtils__/__tests__/dedent-test.ts @@ -0,0 +1,131 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { dedent, dedentString } from '../dedent'; + +describe('dedentString', () => { + it('removes indentation in typical usage', () => { + const output = dedentString(` + type Query { + me: User + } + + type User { + id: ID + name: String + } + `); + expect(output).to.equal( + [ + 'type Query {', + ' me: User', + '}', + '', + 'type User {', + ' id: ID', + ' name: String', + '}', + ].join('\n'), + ); + }); + + it('removes only the first level of indentation', () => { + const output = dedentString(` + first + second + third + fourth + `); + expect(output).to.equal( + ['first', ' second', ' third', ' fourth'].join('\n'), + ); + }); + + it('does not escape special characters', () => { + const output = dedentString(` + type Root { + field(arg: String = "wi\th de\fault"): String + } + `); + expect(output).to.equal( + [ + 'type Root {', + ' field(arg: String = "wi\th de\fault"): String', + '}', + ].join('\n'), + ); + }); + + it('also removes indentation using tabs', () => { + const output = dedentString(` + \t\t type Query { + \t\t me: User + \t\t } + `); + expect(output).to.equal(['type Query {', ' me: User', '}'].join('\n')); + }); + + it('removes leading and trailing newlines', () => { + const output = dedentString(` + + + type Query { + me: User + } + + + `); + expect(output).to.equal(['type Query {', ' me: User', '}'].join('\n')); + }); + + it('removes all trailing spaces and tabs', () => { + const output = dedentString(` + type Query { + me: User + } + \t\t \t `); + expect(output).to.equal(['type Query {', ' me: User', '}'].join('\n')); + }); + + it('works on text without leading newline', () => { + const output = dedentString(` type Query { + me: User + } + `); + expect(output).to.equal(['type Query {', ' me: User', '}'].join('\n')); + }); +}); + +describe('dedent', () => { + it('removes indentation in typical usage', () => { + const output = dedent` + type Query { + me: User + } + `; + expect(output).to.equal(['type Query {', ' me: User', '}'].join('\n')); + }); + + it('supports expression interpolation', () => { + const name = 'John'; + const surname = 'Doe'; + const output = dedent` + { + "me": { + "name": "${name}", + "surname": "${surname}" + } + } + `; + expect(output).to.equal( + [ + '{', + ' "me": {', + ' "name": "John",', + ' "surname": "Doe"', + ' }', + '}', + ].join('\n'), + ); + }); +}); diff --git a/src/__testUtils__/__tests__/genFuzzStrings-test.ts b/src/__testUtils__/__tests__/genFuzzStrings-test.ts new file mode 100644 index 00000000..516ed00f --- /dev/null +++ b/src/__testUtils__/__tests__/genFuzzStrings-test.ts @@ -0,0 +1,83 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { genFuzzStrings } from '../genFuzzStrings'; + +function expectFuzzStrings(options: { + allowedChars: ReadonlyArray; + maxLength: number; +}) { + return expect([...genFuzzStrings(options)]); +} + +describe('genFuzzStrings', () => { + it('always provide empty string', () => { + expectFuzzStrings({ allowedChars: [], maxLength: 0 }).to.deep.equal(['']); + expectFuzzStrings({ allowedChars: [], maxLength: 1 }).to.deep.equal(['']); + expectFuzzStrings({ allowedChars: ['a'], maxLength: 0 }).to.deep.equal([ + '', + ]); + }); + + it('generate strings with single character', () => { + expectFuzzStrings({ allowedChars: ['a'], maxLength: 1 }).to.deep.equal([ + '', + 'a', + ]); + + expectFuzzStrings({ + allowedChars: ['a', 'b', 'c'], + maxLength: 1, + }).to.deep.equal(['', 'a', 'b', 'c']); + }); + + it('generate strings with multiple character', () => { + expectFuzzStrings({ allowedChars: ['a'], maxLength: 2 }).to.deep.equal([ + '', + 'a', + 'aa', + ]); + + expectFuzzStrings({ + allowedChars: ['a', 'b', 'c'], + maxLength: 2, + }).to.deep.equal([ + '', + 'a', + 'b', + 'c', + 'aa', + 'ab', + 'ac', + 'ba', + 'bb', + 'bc', + 'ca', + 'cb', + 'cc', + ]); + }); + + it('generate strings longer than possible number of characters', () => { + expectFuzzStrings({ + allowedChars: ['a', 'b'], + maxLength: 3, + }).to.deep.equal([ + '', + 'a', + 'b', + 'aa', + 'ab', + 'ba', + 'bb', + 'aaa', + 'aab', + 'aba', + 'abb', + 'baa', + 'bab', + 'bba', + 'bbb', + ]); + }); +}); diff --git a/src/__testUtils__/__tests__/inspectStr-test.ts b/src/__testUtils__/__tests__/inspectStr-test.ts new file mode 100644 index 00000000..9c3eba3a --- /dev/null +++ b/src/__testUtils__/__tests__/inspectStr-test.ts @@ -0,0 +1,19 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { inspectStr } from '../inspectStr'; + +describe('inspectStr', () => { + it('handles null and undefined values', () => { + expect(inspectStr(null)).to.equal('null'); + expect(inspectStr(undefined)).to.equal('null'); + }); + + it('correctly print various strings', () => { + expect(inspectStr('')).to.equal('``'); + expect(inspectStr('a')).to.equal('`a`'); + expect(inspectStr('"')).to.equal('`"`'); + expect(inspectStr("'")).to.equal("`'`"); + expect(inspectStr('\\"')).to.equal('`\\"`'); + }); +}); diff --git a/src/__testUtils__/__tests__/resolveOnNextTick-test.ts b/src/__testUtils__/__tests__/resolveOnNextTick-test.ts new file mode 100644 index 00000000..0916b44a --- /dev/null +++ b/src/__testUtils__/__tests__/resolveOnNextTick-test.ts @@ -0,0 +1,21 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { resolveOnNextTick } from '../resolveOnNextTick'; + +describe('resolveOnNextTick', () => { + it('resolves promise on the next tick', async () => { + const output = []; + + const promise1 = resolveOnNextTick().then(() => { + output.push('second'); + }); + const promise2 = resolveOnNextTick().then(() => { + output.push('third'); + }); + output.push('first'); + + await Promise.all([promise1, promise2]); + expect(output).to.deep.equal(['first', 'second', 'third']); + }); +}); diff --git a/src/__testUtils__/dedent.ts b/src/__testUtils__/dedent.ts new file mode 100644 index 00000000..7fc6b463 --- /dev/null +++ b/src/__testUtils__/dedent.ts @@ -0,0 +1,41 @@ +export function dedentString(string: string): string { + const trimmedStr = string + .replace(/^\n*/m, '') // remove leading newline + .replace(/[ \t\n]*$/, ''); // remove trailing spaces and tabs + + // fixes indentation by removing leading spaces and tabs from each line + let indent = ''; + for (const char of trimmedStr) { + if (char !== ' ' && char !== '\t') { + break; + } + indent += char; + } + + return trimmedStr.replace(RegExp('^' + indent, 'mg'), ''); // remove indent +} + +/** + * An ES6 string tag that fixes indentation and also trims string. + * + * Example usage: + * ```ts + * const str = dedent` + * { + * test + * } + * `; + * str === "{\n test\n}"; + * ``` + */ +export function dedent( + strings: ReadonlyArray, + ...values: ReadonlyArray +): string { + let str = strings[0]; + + for (let i = 1; i < strings.length; ++i) { + str += values[i - 1] + strings[i]; // interpolation + } + return dedentString(str); +} diff --git a/src/__testUtils__/expectJSON.ts b/src/__testUtils__/expectJSON.ts new file mode 100644 index 00000000..64e2ba5d --- /dev/null +++ b/src/__testUtils__/expectJSON.ts @@ -0,0 +1,51 @@ +import { expect } from 'chai'; + +import { isObjectLike } from '../jsutils/isObjectLike'; +import { mapValue } from '../jsutils/mapValue'; + +/** + * Deeply transforms an arbitrary value to a JSON-safe value by calling toJSON + * on any nested value which defines it. + */ +function toJSONDeep(value: unknown): unknown { + if (!isObjectLike(value)) { + return value; + } + + if (typeof value.toJSON === 'function') { + return value.toJSON(); + } + + if (Array.isArray(value)) { + return value.map(toJSONDeep); + } + + return mapValue(value, toJSONDeep); +} + +export function expectJSON(actual: unknown) { + const actualJSON = toJSONDeep(actual); + + return { + toDeepEqual(expected: unknown) { + const expectedJSON = toJSONDeep(expected); + expect(actualJSON).to.deep.equal(expectedJSON); + }, + toDeepNestedProperty(path: string, expected: unknown) { + const expectedJSON = toJSONDeep(expected); + expect(actualJSON).to.deep.nested.property(path, expectedJSON); + }, + }; +} + +export function expectToThrowJSON(fn: () => unknown) { + function mapException(): unknown { + try { + return fn(); + } catch (error) { + throw toJSONDeep(error); + } + } + + return expect(mapException).to.throw(); +} diff --git a/src/__testUtils__/genFuzzStrings.ts b/src/__testUtils__/genFuzzStrings.ts new file mode 100644 index 00000000..f29e1bb8 --- /dev/null +++ b/src/__testUtils__/genFuzzStrings.ts @@ -0,0 +1,29 @@ +/** + * Generator that produces all possible combinations of allowed characters. + */ +export function* genFuzzStrings(options: { + allowedChars: ReadonlyArray; + maxLength: number; +}): Generator { + const { allowedChars, maxLength } = options; + const numAllowedChars = allowedChars.length; + + let numCombinations = 0; + for (let length = 1; length <= maxLength; ++length) { + numCombinations += numAllowedChars ** length; + } + + yield ''; // special case for empty string + for (let combination = 0; combination < numCombinations; ++combination) { + let permutation = ''; + + let leftOver = combination; + while (leftOver >= 0) { + const reminder = leftOver % numAllowedChars; + permutation = allowedChars[reminder] + permutation; + leftOver = (leftOver - reminder) / numAllowedChars - 1; + } + + yield permutation; + } +} diff --git a/src/__testUtils__/inspectStr.ts b/src/__testUtils__/inspectStr.ts new file mode 100644 index 00000000..721d6e67 --- /dev/null +++ b/src/__testUtils__/inspectStr.ts @@ -0,0 +1,14 @@ +import type { Maybe } from '../jsutils/Maybe'; + +/** + * Special inspect function to produce readable string literal for error messages in tests + */ +export function inspectStr(str: Maybe): string { + if (str == null) { + return 'null'; + } + return JSON.stringify(str) + .replace(/^"|"$/g, '`') + .replace(/\\"/g, '"') + .replace(/\\\\/g, '\\'); +} diff --git a/src/__testUtils__/kitchenSinkQuery.ts b/src/__testUtils__/kitchenSinkQuery.ts new file mode 100644 index 00000000..9ed9a7e9 --- /dev/null +++ b/src/__testUtils__/kitchenSinkQuery.ts @@ -0,0 +1,68 @@ +export const kitchenSinkQuery: string = String.raw` +query queryName($foo: ComplexType, $site: Site = MOBILE) @onQuery { + whoever123is: node(id: [123, 456]) { + id + ... on User @onInlineFragment { + field2 { + id + alias: field1(first: 10, after: $foo) @include(if: $foo) { + id + ...frag @onFragmentSpread + } + } + } + ... @skip(unless: $foo) { + id + } + ... { + id + } + } +} + +mutation likeStory @onMutation { + like(story: 123) @onField { + story { + id @onField + } + } +} + +subscription StoryLikeSubscription( + $input: StoryLikeSubscribeInput @onVariableDefinition +) + @onSubscription { + storyLikeSubscribe(input: $input) { + story { + likers { + count + } + likeSentence { + text + } + } + } +} + +fragment frag on Friend @onFragmentDefinition { + foo( + size: $size + bar: $b + obj: { + key: "value" + block: """ + block string uses \""" + """ + } + ) +} + +{ + unnamed(truthy: true, falsy: false, nullish: null) + query +} + +query { + __typename +} +`; diff --git a/src/__testUtils__/kitchenSinkSDL.ts b/src/__testUtils__/kitchenSinkSDL.ts new file mode 100644 index 00000000..cdf2f9af --- /dev/null +++ b/src/__testUtils__/kitchenSinkSDL.ts @@ -0,0 +1,158 @@ +export const kitchenSinkSDL = ` +"""This is a description of the schema as a whole.""" +schema { + query: QueryType + mutation: MutationType +} + +""" +This is a description +of the \`Foo\` type. +""" +type Foo implements Bar & Baz & Two { + "Description of the \`one\` field." + one: Type + """ + This is a description of the \`two\` field. + """ + two( + """ + This is a description of the \`argument\` argument. + """ + argument: InputType! + ): Type + """This is a description of the \`three\` field.""" + three(argument: InputType, other: String): Int + four(argument: String = "string"): String + five(argument: [String] = ["string", "string"]): String + six(argument: InputType = {key: "value"}): Type + seven(argument: Int = null): Type +} + +type AnnotatedObject @onObject(arg: "value") { + annotatedField(arg: Type = "default" @onArgumentDefinition): Type @onField +} + +type UndefinedType + +extend type Foo { + seven(argument: [String]): Type +} + +extend type Foo @onType + +interface Bar { + one: Type + four(argument: String = "string"): String +} + +interface AnnotatedInterface @onInterface { + annotatedField(arg: Type @onArgumentDefinition): Type @onField +} + +interface UndefinedInterface + +extend interface Bar implements Two { + two(argument: InputType!): Type +} + +extend interface Bar @onInterface + +interface Baz implements Bar & Two { + one: Type + two(argument: InputType!): Type + four(argument: String = "string"): String +} + +union Feed = + | Story + | Article + | Advert + +union AnnotatedUnion @onUnion = A | B + +union AnnotatedUnionTwo @onUnion = | A | B + +union UndefinedUnion + +extend union Feed = Photo | Video + +extend union Feed @onUnion + +scalar CustomScalar + +scalar AnnotatedScalar @onScalar + +extend scalar CustomScalar @onScalar + +enum Site { + """ + This is a description of the \`DESKTOP\` value + """ + DESKTOP + + """This is a description of the \`MOBILE\` value""" + MOBILE + + "This is a description of the \`WEB\` value" + WEB +} + +enum AnnotatedEnum @onEnum { + ANNOTATED_VALUE @onEnumValue + OTHER_VALUE +} + +enum UndefinedEnum + +extend enum Site { + VR +} + +extend enum Site @onEnum + +input InputType { + key: String! + answer: Int = 42 +} + +input AnnotatedInput @onInputObject { + annotatedField: Type @onInputFieldDefinition +} + +input UndefinedInput + +extend input InputType { + other: Float = 1.23e4 @onInputFieldDefinition +} + +extend input InputType @onInputObject + +""" +This is a description of the \`@skip\` directive +""" +directive @skip( + """This is a description of the \`if\` argument""" + if: Boolean! @onArgumentDefinition +) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT + +directive @include(if: Boolean!) + on FIELD + | FRAGMENT_SPREAD + | INLINE_FRAGMENT + +directive @include2(if: Boolean!) on + | FIELD + | FRAGMENT_SPREAD + | INLINE_FRAGMENT + +directive @myRepeatableDir(name: String!) repeatable on + | OBJECT + | INTERFACE + +extend schema @onSchema + +extend schema @onSchema { + subscription: SubscriptionType +} +`; diff --git a/src/__testUtils__/resolveOnNextTick.ts b/src/__testUtils__/resolveOnNextTick.ts new file mode 100644 index 00000000..6dd50b39 --- /dev/null +++ b/src/__testUtils__/resolveOnNextTick.ts @@ -0,0 +1,3 @@ +export function resolveOnNextTick(): Promise { + return Promise.resolve(undefined); +} diff --git a/src/__tests__/starWarsData.ts b/src/__tests__/starWarsData.ts new file mode 100644 index 00000000..60c4331b --- /dev/null +++ b/src/__tests__/starWarsData.ts @@ -0,0 +1,154 @@ +/** + * These are types which correspond to the schema. + * They represent the shape of the data visited during field resolution. + */ +export interface Character { + id: string; + name: string; + friends: ReadonlyArray; + appearsIn: ReadonlyArray; +} + +export interface Human { + type: 'Human'; + id: string; + name: string; + friends: ReadonlyArray; + appearsIn: ReadonlyArray; + homePlanet?: string; +} + +export interface Droid { + type: 'Droid'; + id: string; + name: string; + friends: ReadonlyArray; + appearsIn: ReadonlyArray; + primaryFunction: string; +} + +/** + * This defines a basic set of data for our Star Wars Schema. + * + * This data is hard coded for the sake of the demo, but you could imagine + * fetching this data from a backend service rather than from hardcoded + * JSON objects in a more complex demo. + */ + +const luke: Human = { + type: 'Human', + id: '1000', + name: 'Luke Skywalker', + friends: ['1002', '1003', '2000', '2001'], + appearsIn: [4, 5, 6], + homePlanet: 'Tatooine', +}; + +const vader: Human = { + type: 'Human', + id: '1001', + name: 'Darth Vader', + friends: ['1004'], + appearsIn: [4, 5, 6], + homePlanet: 'Tatooine', +}; + +const han: Human = { + type: 'Human', + id: '1002', + name: 'Han Solo', + friends: ['1000', '1003', '2001'], + appearsIn: [4, 5, 6], +}; + +const leia: Human = { + type: 'Human', + id: '1003', + name: 'Leia Organa', + friends: ['1000', '1002', '2000', '2001'], + appearsIn: [4, 5, 6], + homePlanet: 'Alderaan', +}; + +const tarkin: Human = { + type: 'Human', + id: '1004', + name: 'Wilhuff Tarkin', + friends: ['1001'], + appearsIn: [4], +}; + +const humanData: { [id: string]: Human } = { + [luke.id]: luke, + [vader.id]: vader, + [han.id]: han, + [leia.id]: leia, + [tarkin.id]: tarkin, +}; + +const threepio: Droid = { + type: 'Droid', + id: '2000', + name: 'C-3PO', + friends: ['1000', '1002', '1003', '2001'], + appearsIn: [4, 5, 6], + primaryFunction: 'Protocol', +}; + +const artoo: Droid = { + type: 'Droid', + id: '2001', + name: 'R2-D2', + friends: ['1000', '1002', '1003'], + appearsIn: [4, 5, 6], + primaryFunction: 'Astromech', +}; + +const droidData: { [id: string]: Droid } = { + [threepio.id]: threepio, + [artoo.id]: artoo, +}; + +/** + * Helper function to get a character by ID. + */ +function getCharacter(id: string): Promise { + // Returning a promise just to illustrate that GraphQL.js supports it. + return Promise.resolve(humanData[id] ?? droidData[id]); +} + +/** + * Allows us to query for a character's friends. + */ +export function getFriends( + character: Character, +): Array> { + // Notice that GraphQL accepts Arrays of Promises. + return character.friends.map((id) => getCharacter(id)); +} + +/** + * Allows us to fetch the undisputed hero of the Star Wars trilogy, R2-D2. + */ +export function getHero(episode: number): Character { + if (episode === 5) { + // Luke is the hero of Episode V. + return luke; + } + // Artoo is the hero otherwise. + return artoo; +} + +/** + * Allows us to query for the human with the given id. + */ +export function getHuman(id: string): Human | null { + return humanData[id]; +} + +/** + * Allows us to query for the droid with the given id. + */ +export function getDroid(id: string): Droid | null { + return droidData[id]; +} diff --git a/src/__tests__/starWarsIntrospection-test.ts b/src/__tests__/starWarsIntrospection-test.ts new file mode 100644 index 00000000..d637787c --- /dev/null +++ b/src/__tests__/starWarsIntrospection-test.ts @@ -0,0 +1,366 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { graphqlSync } from '../graphql'; + +import { StarWarsSchema } from './starWarsSchema'; + +function queryStarWars(source: string) { + const result = graphqlSync({ schema: StarWarsSchema, source }); + expect(Object.keys(result)).to.deep.equal(['data']); + return result.data; +} + +describe('Star Wars Introspection Tests', () => { + describe('Basic Introspection', () => { + it('Allows querying the schema for types', () => { + const data = queryStarWars(` + { + __schema { + types { + name + } + } + } + `); + + // Include all types used by StarWars schema, introspection types and + // standard directives. For example, `Boolean` is used in `@skip`, + // `@include` and also inside introspection types. + expect(data).to.deep.equal({ + __schema: { + types: [ + { name: 'Human' }, + { name: 'Character' }, + { name: 'String' }, + { name: 'Episode' }, + { name: 'Droid' }, + { name: 'Query' }, + { name: 'Boolean' }, + { name: '__Schema' }, + { name: '__Type' }, + { name: '__TypeKind' }, + { name: '__Field' }, + { name: '__InputValue' }, + { name: '__EnumValue' }, + { name: '__Directive' }, + { name: '__DirectiveLocation' }, + ], + }, + }); + }); + + it('Allows querying the schema for query type', () => { + const data = queryStarWars(` + { + __schema { + queryType { + name + } + } + } + `); + + expect(data).to.deep.equal({ + __schema: { + queryType: { + name: 'Query', + }, + }, + }); + }); + + it('Allows querying the schema for a specific type', () => { + const data = queryStarWars(` + { + __type(name: "Droid") { + name + } + } + `); + + expect(data).to.deep.equal({ + __type: { + name: 'Droid', + }, + }); + }); + + it('Allows querying the schema for an object kind', () => { + const data = queryStarWars(` + { + __type(name: "Droid") { + name + kind + } + } + `); + + expect(data).to.deep.equal({ + __type: { + name: 'Droid', + kind: 'OBJECT', + }, + }); + }); + + it('Allows querying the schema for an interface kind', () => { + const data = queryStarWars(` + { + __type(name: "Character") { + name + kind + } + } + `); + + expect(data).to.deep.equal({ + __type: { + name: 'Character', + kind: 'INTERFACE', + }, + }); + }); + + it('Allows querying the schema for object fields', () => { + const data = queryStarWars(` + { + __type(name: "Droid") { + name + fields { + name + type { + name + kind + } + } + } + } + `); + + expect(data).to.deep.equal({ + __type: { + name: 'Droid', + fields: [ + { + name: 'id', + type: { name: null, kind: 'NON_NULL' }, + }, + { + name: 'name', + type: { name: 'String', kind: 'SCALAR' }, + }, + { + name: 'friends', + type: { name: null, kind: 'LIST' }, + }, + { + name: 'appearsIn', + type: { name: null, kind: 'LIST' }, + }, + { + name: 'secretBackstory', + type: { name: 'String', kind: 'SCALAR' }, + }, + { + name: 'primaryFunction', + type: { name: 'String', kind: 'SCALAR' }, + }, + ], + }, + }); + }); + + it('Allows querying the schema for nested object fields', () => { + const data = queryStarWars(` + { + __type(name: "Droid") { + name + fields { + name + type { + name + kind + ofType { + name + kind + } + } + } + } + } + `); + + expect(data).to.deep.equal({ + __type: { + name: 'Droid', + fields: [ + { + name: 'id', + type: { + name: null, + kind: 'NON_NULL', + ofType: { + name: 'String', + kind: 'SCALAR', + }, + }, + }, + { + name: 'name', + type: { + name: 'String', + kind: 'SCALAR', + ofType: null, + }, + }, + { + name: 'friends', + type: { + name: null, + kind: 'LIST', + ofType: { + name: 'Character', + kind: 'INTERFACE', + }, + }, + }, + { + name: 'appearsIn', + type: { + name: null, + kind: 'LIST', + ofType: { + name: 'Episode', + kind: 'ENUM', + }, + }, + }, + { + name: 'secretBackstory', + type: { + name: 'String', + kind: 'SCALAR', + ofType: null, + }, + }, + { + name: 'primaryFunction', + type: { + name: 'String', + kind: 'SCALAR', + ofType: null, + }, + }, + ], + }, + }); + }); + + it('Allows querying the schema for field args', () => { + const data = queryStarWars(` + { + __schema { + queryType { + fields { + name + args { + name + description + type { + name + kind + ofType { + name + kind + } + } + defaultValue + } + } + } + } + } + `); + + expect(data).to.deep.equal({ + __schema: { + queryType: { + fields: [ + { + name: 'hero', + args: [ + { + defaultValue: null, + description: + 'If omitted, returns the hero of the whole saga. If provided, returns the hero of that particular episode.', + name: 'episode', + type: { + kind: 'ENUM', + name: 'Episode', + ofType: null, + }, + }, + ], + }, + { + name: 'human', + args: [ + { + name: 'id', + description: 'id of the human', + type: { + kind: 'NON_NULL', + name: null, + ofType: { + kind: 'SCALAR', + name: 'String', + }, + }, + defaultValue: null, + }, + ], + }, + { + name: 'droid', + args: [ + { + name: 'id', + description: 'id of the droid', + type: { + kind: 'NON_NULL', + name: null, + ofType: { + kind: 'SCALAR', + name: 'String', + }, + }, + defaultValue: null, + }, + ], + }, + ], + }, + }, + }); + }); + + it('Allows querying the schema for documentation', () => { + const data = queryStarWars(` + { + __type(name: "Droid") { + name + description + } + } + `); + + expect(data).to.deep.equal({ + __type: { + name: 'Droid', + description: 'A mechanical creature in the Star Wars universe.', + }, + }); + }); + }); +}); diff --git a/src/__tests__/starWarsQuery-test.ts b/src/__tests__/starWarsQuery-test.ts new file mode 100644 index 00000000..2662079d --- /dev/null +++ b/src/__tests__/starWarsQuery-test.ts @@ -0,0 +1,497 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { expectJSON } from '../__testUtils__/expectJSON'; + +import { graphql } from '../graphql'; + +import { StarWarsSchema as schema } from './starWarsSchema'; + +describe('Star Wars Query Tests', () => { + describe('Basic Queries', () => { + it('Correctly identifies R2-D2 as the hero of the Star Wars Saga', async () => { + const source = ` + query HeroNameQuery { + hero { + name + } + } + `; + + const result = await graphql({ schema, source }); + expect(result).to.deep.equal({ + data: { + hero: { + name: 'R2-D2', + }, + }, + }); + }); + + it('Allows us to query for the ID and friends of R2-D2', async () => { + const source = ` + query HeroNameAndFriendsQuery { + hero { + id + name + friends { + name + } + } + } + `; + + const result = await graphql({ schema, source }); + expect(result).to.deep.equal({ + data: { + hero: { + id: '2001', + name: 'R2-D2', + friends: [ + { + name: 'Luke Skywalker', + }, + { + name: 'Han Solo', + }, + { + name: 'Leia Organa', + }, + ], + }, + }, + }); + }); + }); + + describe('Nested Queries', () => { + it('Allows us to query for the friends of friends of R2-D2', async () => { + const source = ` + query NestedQuery { + hero { + name + friends { + name + appearsIn + friends { + name + } + } + } + } + `; + + const result = await graphql({ schema, source }); + expect(result).to.deep.equal({ + data: { + hero: { + name: 'R2-D2', + friends: [ + { + name: 'Luke Skywalker', + appearsIn: ['NEW_HOPE', 'EMPIRE', 'JEDI'], + friends: [ + { + name: 'Han Solo', + }, + { + name: 'Leia Organa', + }, + { + name: 'C-3PO', + }, + { + name: 'R2-D2', + }, + ], + }, + { + name: 'Han Solo', + appearsIn: ['NEW_HOPE', 'EMPIRE', 'JEDI'], + friends: [ + { + name: 'Luke Skywalker', + }, + { + name: 'Leia Organa', + }, + { + name: 'R2-D2', + }, + ], + }, + { + name: 'Leia Organa', + appearsIn: ['NEW_HOPE', 'EMPIRE', 'JEDI'], + friends: [ + { + name: 'Luke Skywalker', + }, + { + name: 'Han Solo', + }, + { + name: 'C-3PO', + }, + { + name: 'R2-D2', + }, + ], + }, + ], + }, + }, + }); + }); + }); + + describe('Using IDs and query parameters to refetch objects', () => { + it('Allows us to query characters directly, using their IDs', async () => { + const source = ` + query FetchLukeAndC3POQuery { + human(id: "1000") { + name + } + droid(id: "2000") { + name + } + } + `; + + const result = await graphql({ schema, source }); + expect(result).to.deep.equal({ + data: { + human: { + name: 'Luke Skywalker', + }, + droid: { + name: 'C-3PO', + }, + }, + }); + }); + + it('Allows us to create a generic query, then use it to fetch Luke Skywalker using his ID', async () => { + const source = ` + query FetchSomeIDQuery($someId: String!) { + human(id: $someId) { + name + } + } + `; + const variableValues = { someId: '1000' }; + + const result = await graphql({ schema, source, variableValues }); + expect(result).to.deep.equal({ + data: { + human: { + name: 'Luke Skywalker', + }, + }, + }); + }); + + it('Allows us to create a generic query, then use it to fetch Han Solo using his ID', async () => { + const source = ` + query FetchSomeIDQuery($someId: String!) { + human(id: $someId) { + name + } + } + `; + const variableValues = { someId: '1002' }; + + const result = await graphql({ schema, source, variableValues }); + expect(result).to.deep.equal({ + data: { + human: { + name: 'Han Solo', + }, + }, + }); + }); + + it('Allows us to create a generic query, then pass an invalid ID to get null back', async () => { + const source = ` + query humanQuery($id: String!) { + human(id: $id) { + name + } + } + `; + const variableValues = { id: 'not a valid id' }; + + const result = await graphql({ schema, source, variableValues }); + expect(result).to.deep.equal({ + data: { + human: null, + }, + }); + }); + }); + + describe('Using aliases to change the key in the response', () => { + it('Allows us to query for Luke, changing his key with an alias', async () => { + const source = ` + query FetchLukeAliased { + luke: human(id: "1000") { + name + } + } + `; + + const result = await graphql({ schema, source }); + expect(result).to.deep.equal({ + data: { + luke: { + name: 'Luke Skywalker', + }, + }, + }); + }); + + it('Allows us to query for both Luke and Leia, using two root fields and an alias', async () => { + const source = ` + query FetchLukeAndLeiaAliased { + luke: human(id: "1000") { + name + } + leia: human(id: "1003") { + name + } + } + `; + + const result = await graphql({ schema, source }); + expect(result).to.deep.equal({ + data: { + luke: { + name: 'Luke Skywalker', + }, + leia: { + name: 'Leia Organa', + }, + }, + }); + }); + }); + + describe('Uses fragments to express more complex queries', () => { + it('Allows us to query using duplicated content', async () => { + const source = ` + query DuplicateFields { + luke: human(id: "1000") { + name + homePlanet + } + leia: human(id: "1003") { + name + homePlanet + } + } + `; + + const result = await graphql({ schema, source }); + expect(result).to.deep.equal({ + data: { + luke: { + name: 'Luke Skywalker', + homePlanet: 'Tatooine', + }, + leia: { + name: 'Leia Organa', + homePlanet: 'Alderaan', + }, + }, + }); + }); + + it('Allows us to use a fragment to avoid duplicating content', async () => { + const source = ` + query UseFragment { + luke: human(id: "1000") { + ...HumanFragment + } + leia: human(id: "1003") { + ...HumanFragment + } + } + + fragment HumanFragment on Human { + name + homePlanet + } + `; + + const result = await graphql({ schema, source }); + expect(result).to.deep.equal({ + data: { + luke: { + name: 'Luke Skywalker', + homePlanet: 'Tatooine', + }, + leia: { + name: 'Leia Organa', + homePlanet: 'Alderaan', + }, + }, + }); + }); + }); + + describe('Using __typename to find the type of an object', () => { + it('Allows us to verify that R2-D2 is a droid', async () => { + const source = ` + query CheckTypeOfR2 { + hero { + __typename + name + } + } + `; + + const result = await graphql({ schema, source }); + expect(result).to.deep.equal({ + data: { + hero: { + __typename: 'Droid', + name: 'R2-D2', + }, + }, + }); + }); + + it('Allows us to verify that Luke is a human', async () => { + const source = ` + query CheckTypeOfLuke { + hero(episode: EMPIRE) { + __typename + name + } + } + `; + + const result = await graphql({ schema, source }); + expect(result).to.deep.equal({ + data: { + hero: { + __typename: 'Human', + name: 'Luke Skywalker', + }, + }, + }); + }); + }); + + describe('Reporting errors raised in resolvers', () => { + it('Correctly reports error on accessing secretBackstory', async () => { + const source = ` + query HeroNameQuery { + hero { + name + secretBackstory + } + } + `; + + const result = await graphql({ schema, source }); + expectJSON(result).toDeepEqual({ + data: { + hero: { + name: 'R2-D2', + secretBackstory: null, + }, + }, + errors: [ + { + message: 'secretBackstory is secret.', + locations: [{ line: 5, column: 13 }], + path: ['hero', 'secretBackstory'], + }, + ], + }); + }); + + it('Correctly reports error on accessing secretBackstory in a list', async () => { + const source = ` + query HeroNameQuery { + hero { + name + friends { + name + secretBackstory + } + } + } + `; + + const result = await graphql({ schema, source }); + expectJSON(result).toDeepEqual({ + data: { + hero: { + name: 'R2-D2', + friends: [ + { + name: 'Luke Skywalker', + secretBackstory: null, + }, + { + name: 'Han Solo', + secretBackstory: null, + }, + { + name: 'Leia Organa', + secretBackstory: null, + }, + ], + }, + }, + errors: [ + { + message: 'secretBackstory is secret.', + locations: [{ line: 7, column: 15 }], + path: ['hero', 'friends', 0, 'secretBackstory'], + }, + { + message: 'secretBackstory is secret.', + locations: [{ line: 7, column: 15 }], + path: ['hero', 'friends', 1, 'secretBackstory'], + }, + { + message: 'secretBackstory is secret.', + locations: [{ line: 7, column: 15 }], + path: ['hero', 'friends', 2, 'secretBackstory'], + }, + ], + }); + }); + + it('Correctly reports error on accessing through an alias', async () => { + const source = ` + query HeroNameQuery { + mainHero: hero { + name + story: secretBackstory + } + } + `; + + const result = await graphql({ schema, source }); + expectJSON(result).toDeepEqual({ + data: { + mainHero: { + name: 'R2-D2', + story: null, + }, + }, + errors: [ + { + message: 'secretBackstory is secret.', + locations: [{ line: 5, column: 13 }], + path: ['mainHero', 'story'], + }, + ], + }); + }); + }); +}); diff --git a/src/__tests__/starWarsSchema.ts b/src/__tests__/starWarsSchema.ts new file mode 100644 index 00000000..c646c8ae --- /dev/null +++ b/src/__tests__/starWarsSchema.ts @@ -0,0 +1,303 @@ +import { + GraphQLEnumType, + GraphQLInterfaceType, + GraphQLList, + GraphQLNonNull, + GraphQLObjectType, +} from '../type/definition'; +import { GraphQLString } from '../type/scalars'; +import { GraphQLSchema } from '../type/schema'; + +import { getDroid, getFriends, getHero, getHuman } from './starWarsData'; + +/** + * This is designed to be an end-to-end test, demonstrating + * the full GraphQL stack. + * + * We will create a GraphQL schema that describes the major + * characters in the original Star Wars trilogy. + * + * NOTE: This may contain spoilers for the original Star + * Wars trilogy. + */ + +/** + * Using our shorthand to describe type systems, the type system for our + * Star Wars example is: + * + * ```graphql + * enum Episode { NEW_HOPE, EMPIRE, JEDI } + * + * interface Character { + * id: String! + * name: String + * friends: [Character] + * appearsIn: [Episode] + * } + * + * type Human implements Character { + * id: String! + * name: String + * friends: [Character] + * appearsIn: [Episode] + * homePlanet: String + * } + * + * type Droid implements Character { + * id: String! + * name: String + * friends: [Character] + * appearsIn: [Episode] + * primaryFunction: String + * } + * + * type Query { + * hero(episode: Episode): Character + * human(id: String!): Human + * droid(id: String!): Droid + * } + * ``` + * + * We begin by setting up our schema. + */ + +/** + * The original trilogy consists of three movies. + * + * This implements the following type system shorthand: + * ```graphql + * enum Episode { NEW_HOPE, EMPIRE, JEDI } + * ``` + */ +const episodeEnum = new GraphQLEnumType({ + name: 'Episode', + description: 'One of the films in the Star Wars Trilogy', + values: { + NEW_HOPE: { + value: 4, + description: 'Released in 1977.', + }, + EMPIRE: { + value: 5, + description: 'Released in 1980.', + }, + JEDI: { + value: 6, + description: 'Released in 1983.', + }, + }, +}); + +/** + * Characters in the Star Wars trilogy are either humans or droids. + * + * This implements the following type system shorthand: + * ```graphql + * interface Character { + * id: String! + * name: String + * friends: [Character] + * appearsIn: [Episode] + * secretBackstory: String + * } + * ``` + */ +const characterInterface: GraphQLInterfaceType = new GraphQLInterfaceType({ + name: 'Character', + description: 'A character in the Star Wars Trilogy', + fields: () => ({ + id: { + type: new GraphQLNonNull(GraphQLString), + description: 'The id of the character.', + }, + name: { + type: GraphQLString, + description: 'The name of the character.', + }, + friends: { + type: new GraphQLList(characterInterface), + description: + 'The friends of the character, or an empty list if they have none.', + }, + appearsIn: { + type: new GraphQLList(episodeEnum), + description: 'Which movies they appear in.', + }, + secretBackstory: { + type: GraphQLString, + description: 'All secrets about their past.', + }, + }), + resolveType(character) { + switch (character.type) { + case 'Human': + return humanType.name; + case 'Droid': + return droidType.name; + } + }, +}); + +/** + * We define our human type, which implements the character interface. + * + * This implements the following type system shorthand: + * ```graphql + * type Human : Character { + * id: String! + * name: String + * friends: [Character] + * appearsIn: [Episode] + * secretBackstory: String + * } + * ``` + */ +const humanType = new GraphQLObjectType({ + name: 'Human', + description: 'A humanoid creature in the Star Wars universe.', + fields: () => ({ + id: { + type: new GraphQLNonNull(GraphQLString), + description: 'The id of the human.', + }, + name: { + type: GraphQLString, + description: 'The name of the human.', + }, + friends: { + type: new GraphQLList(characterInterface), + description: + 'The friends of the human, or an empty list if they have none.', + resolve: (human) => getFriends(human), + }, + appearsIn: { + type: new GraphQLList(episodeEnum), + description: 'Which movies they appear in.', + }, + homePlanet: { + type: GraphQLString, + description: 'The home planet of the human, or null if unknown.', + }, + secretBackstory: { + type: GraphQLString, + description: 'Where are they from and how they came to be who they are.', + resolve() { + throw new Error('secretBackstory is secret.'); + }, + }, + }), + interfaces: [characterInterface], +}); + +/** + * The other type of character in Star Wars is a droid. + * + * This implements the following type system shorthand: + * ```graphql + * type Droid : Character { + * id: String! + * name: String + * friends: [Character] + * appearsIn: [Episode] + * secretBackstory: String + * primaryFunction: String + * } + * ``` + */ +const droidType = new GraphQLObjectType({ + name: 'Droid', + description: 'A mechanical creature in the Star Wars universe.', + fields: () => ({ + id: { + type: new GraphQLNonNull(GraphQLString), + description: 'The id of the droid.', + }, + name: { + type: GraphQLString, + description: 'The name of the droid.', + }, + friends: { + type: new GraphQLList(characterInterface), + description: + 'The friends of the droid, or an empty list if they have none.', + resolve: (droid) => getFriends(droid), + }, + appearsIn: { + type: new GraphQLList(episodeEnum), + description: 'Which movies they appear in.', + }, + secretBackstory: { + type: GraphQLString, + description: 'Construction date and the name of the designer.', + resolve() { + throw new Error('secretBackstory is secret.'); + }, + }, + primaryFunction: { + type: GraphQLString, + description: 'The primary function of the droid.', + }, + }), + interfaces: [characterInterface], +}); + +/** + * This is the type that will be the root of our query, and the + * entry point into our schema. It gives us the ability to fetch + * objects by their IDs, as well as to fetch the undisputed hero + * of the Star Wars trilogy, R2-D2, directly. + * + * This implements the following type system shorthand: + * ```graphql + * type Query { + * hero(episode: Episode): Character + * human(id: String!): Human + * droid(id: String!): Droid + * } + * ``` + */ +const queryType = new GraphQLObjectType({ + name: 'Query', + fields: () => ({ + hero: { + type: characterInterface, + args: { + episode: { + description: + 'If omitted, returns the hero of the whole saga. If provided, returns the hero of that particular episode.', + type: episodeEnum, + }, + }, + resolve: (_source, { episode }) => getHero(episode), + }, + human: { + type: humanType, + args: { + id: { + description: 'id of the human', + type: new GraphQLNonNull(GraphQLString), + }, + }, + resolve: (_source, { id }) => getHuman(id), + }, + droid: { + type: droidType, + args: { + id: { + description: 'id of the droid', + type: new GraphQLNonNull(GraphQLString), + }, + }, + resolve: (_source, { id }) => getDroid(id), + }, + }), +}); + +/** + * Finally, we construct our schema (whose starting query type is the query + * type we defined above) and export it. + */ +export const StarWarsSchema: GraphQLSchema = new GraphQLSchema({ + query: queryType, + types: [humanType, droidType], +}); diff --git a/src/__tests__/starWarsValidation-test.ts b/src/__tests__/starWarsValidation-test.ts new file mode 100644 index 00000000..65e6c7f6 --- /dev/null +++ b/src/__tests__/starWarsValidation-test.ts @@ -0,0 +1,119 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { parse } from '../language/parser'; +import { Source } from '../language/source'; + +import { validate } from '../validation/validate'; + +import { StarWarsSchema } from './starWarsSchema'; + +/** + * Helper function to test a query and the expected response. + */ +function validationErrors(query: string) { + const source = new Source(query, 'StarWars.graphql'); + const ast = parse(source); + return validate(StarWarsSchema, ast); +} + +describe('Star Wars Validation Tests', () => { + describe('Basic Queries', () => { + it('Validates a complex but valid query', () => { + const query = ` + query NestedQueryWithFragment { + hero { + ...NameAndAppearances + friends { + ...NameAndAppearances + friends { + ...NameAndAppearances + } + } + } + } + + fragment NameAndAppearances on Character { + name + appearsIn + } + `; + return expect(validationErrors(query)).to.be.empty; + }); + + it('Notes that non-existent fields are invalid', () => { + const query = ` + query HeroSpaceshipQuery { + hero { + favoriteSpaceship + } + } + `; + return expect(validationErrors(query)).to.not.be.empty; + }); + + it('Requires fields on objects', () => { + const query = ` + query HeroNoFieldsQuery { + hero + } + `; + return expect(validationErrors(query)).to.not.be.empty; + }); + + it('Disallows fields on scalars', () => { + const query = ` + query HeroFieldsOnScalarQuery { + hero { + name { + firstCharacterOfName + } + } + } + `; + return expect(validationErrors(query)).to.not.be.empty; + }); + + it('Disallows object fields on interfaces', () => { + const query = ` + query DroidFieldOnCharacter { + hero { + name + primaryFunction + } + } + `; + return expect(validationErrors(query)).to.not.be.empty; + }); + + it('Allows object fields in fragments', () => { + const query = ` + query DroidFieldInFragment { + hero { + name + ...DroidFields + } + } + + fragment DroidFields on Droid { + primaryFunction + } + `; + return expect(validationErrors(query)).to.be.empty; + }); + + it('Allows object fields in inline fragments', () => { + const query = ` + query DroidFieldInFragment { + hero { + name + ... on Droid { + primaryFunction + } + } + } + `; + return expect(validationErrors(query)).to.be.empty; + }); + }); +}); diff --git a/src/__tests__/version-test.ts b/src/__tests__/version-test.ts new file mode 100644 index 00000000..3680512d --- /dev/null +++ b/src/__tests__/version-test.ts @@ -0,0 +1,54 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { version, versionInfo } from '../version'; + +describe('Version', () => { + it('versionInfo', () => { + expect(versionInfo).to.be.an('object'); + expect(versionInfo).to.have.all.keys( + 'major', + 'minor', + 'patch', + 'preReleaseTag', + ); + + const { major, minor, patch, preReleaseTag } = versionInfo; + expect(major).to.be.a('number').at.least(0); + expect(minor).to.be.a('number').at.least(0); + expect(patch).to.be.a('number').at.least(0); + + // Can't be verified on all versions + /* c8 ignore start */ + switch (preReleaseTag?.split('.').length) { + case undefined: + break; + case 2: + expect(preReleaseTag).to.match( + /^(alpha|beta|rc|experimental-[\w-]+)\.\d+/, + ); + break; + case 4: + expect(preReleaseTag).to.match( + /^(alpha|beta|rc)\.\d+.experimental-[\w-]+\.\d+/, + ); + break; + default: + expect.fail('Invalid pre-release tag: ' + preReleaseTag); + } + /* c8 ignore stop */ + }); + + it('version', () => { + expect(version).to.be.a('string'); + + const { major, minor, patch, preReleaseTag } = versionInfo; + expect(version).to.equal( + // Can't be verified on all versions + /* c8 ignore next 3 */ + preReleaseTag === null + ? `${major}.${minor}.${patch}` + : `${major}.${minor}.${patch}-${preReleaseTag}`, + ); + }); +}); diff --git a/src/error/GraphQLError.ts b/src/error/GraphQLError.ts new file mode 100644 index 00000000..6d6677fa --- /dev/null +++ b/src/error/GraphQLError.ts @@ -0,0 +1,255 @@ +import { isObjectLike } from '../jsutils/isObjectLike'; +import type { Maybe } from '../jsutils/Maybe'; + +import type { ASTNode, Location } from '../language/ast'; +import type { SourceLocation } from '../language/location'; +import { getLocation } from '../language/location'; +import { printLocation, printSourceLocation } from '../language/printLocation'; +import type { Source } from '../language/source'; + +/** + * Custom extensions + * + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + */ +export interface GraphQLErrorExtensions { + [attributeName: string]: unknown; +} + +/** + * A GraphQLError describes an Error found during the parse, validate, or + * execute phases of performing a GraphQL operation. In addition to a message + * and stack trace, it also includes information about the locations in a + * GraphQL document and/or execution result that correspond to the Error. + */ +export class GraphQLError extends Error { + /** + * An array of `{ line, column }` locations within the source GraphQL document + * which correspond to this error. + * + * Errors during validation often contain multiple locations, for example to + * point out two things with the same name. Errors during execution include a + * single location, the field which produced the error. + * + * Enumerable, and appears in the result of JSON.stringify(). + */ + readonly locations: ReadonlyArray | undefined; + + /** + * An array describing the JSON-path into the execution response which + * corresponds to this error. Only included for errors during execution. + * + * Enumerable, and appears in the result of JSON.stringify(). + */ + readonly path: ReadonlyArray | undefined; + + /** + * An array of GraphQL AST Nodes corresponding to this error. + */ + readonly nodes: ReadonlyArray | undefined; + + /** + * The source GraphQL document for the first location of this error. + * + * Note that if this Error represents more than one node, the source may not + * represent nodes after the first node. + */ + readonly source: Source | undefined; + + /** + * An array of character offsets within the source GraphQL document + * which correspond to this error. + */ + readonly positions: ReadonlyArray | undefined; + + /** + * The original error thrown from a field resolver during execution. + */ + readonly originalError: Error | undefined; + + /** + * Extension fields to add to the formatted error. + */ + readonly extensions: GraphQLErrorExtensions; + + constructor( + message: string, + nodes?: ReadonlyArray | ASTNode | null, + source?: Maybe, + positions?: Maybe>, + path?: Maybe>, + originalError?: Maybe, + extensions?: Maybe, + ) { + super(message); + + this.name = 'GraphQLError'; + this.path = path ?? undefined; + this.originalError = originalError ?? undefined; + + // Compute list of blame nodes. + this.nodes = undefinedIfEmpty( + Array.isArray(nodes) ? nodes : nodes ? [nodes] : undefined, + ); + + const nodeLocations = undefinedIfEmpty( + this.nodes + ?.map((node) => node.loc) + .filter((loc): loc is Location => loc != null), + ); + + // Compute locations in the source for the given nodes/positions. + this.source = source ?? nodeLocations?.[0]?.source; + + this.positions = positions ?? nodeLocations?.map((loc) => loc.start); + + this.locations = + positions && source + ? positions.map((pos) => getLocation(source, pos)) + : nodeLocations?.map((loc) => getLocation(loc.source, loc.start)); + + const originalExtensions = isObjectLike(originalError?.extensions) + ? originalError?.extensions + : undefined; + this.extensions = extensions ?? originalExtensions ?? Object.create(null); + + // Only properties prescribed by the spec should be enumerable. + // Keep the rest as non-enumerable. + Object.defineProperties(this, { + message: { + writable: true, + enumerable: true, + }, + name: { enumerable: false }, + nodes: { enumerable: false }, + source: { enumerable: false }, + positions: { enumerable: false }, + originalError: { enumerable: false }, + }); + + // Include (non-enumerable) stack trace. + /* c8 ignore start */ + // FIXME: https://github.com/graphql/graphql-js/issues/2317 + if (originalError?.stack) { + Object.defineProperty(this, 'stack', { + value: originalError.stack, + writable: true, + configurable: true, + }); + } else if (Error.captureStackTrace) { + Error.captureStackTrace(this, GraphQLError); + } else { + Object.defineProperty(this, 'stack', { + value: Error().stack, + writable: true, + configurable: true, + }); + } + /* c8 ignore stop */ + } + + get [Symbol.toStringTag](): string { + return 'GraphQLError'; + } + + toString(): string { + let output = this.message; + + if (this.nodes) { + for (const node of this.nodes) { + if (node.loc) { + output += '\n\n' + printLocation(node.loc); + } + } + } else if (this.source && this.locations) { + for (const location of this.locations) { + output += '\n\n' + printSourceLocation(this.source, location); + } + } + + return output; + } + + toJSON(): GraphQLFormattedError { + type WritableFormattedError = { + -readonly [P in keyof GraphQLFormattedError]: GraphQLFormattedError[P]; + }; + + const formattedError: WritableFormattedError = { + message: this.message, + }; + + if (this.locations != null) { + formattedError.locations = this.locations; + } + + if (this.path != null) { + formattedError.path = this.path; + } + + if (this.extensions != null && Object.keys(this.extensions).length > 0) { + formattedError.extensions = this.extensions; + } + + return formattedError; + } +} + +function undefinedIfEmpty( + array: Array | undefined, +): Array | undefined { + return array === undefined || array.length === 0 ? undefined : array; +} + +/** + * See: https://spec.graphql.org/draft/#sec-Errors + */ +export interface GraphQLFormattedError { + /** + * A short, human-readable summary of the problem that **SHOULD NOT** change + * from occurrence to occurrence of the problem, except for purposes of + * localization. + */ + readonly message: string; + /** + * If an error can be associated to a particular point in the requested + * GraphQL document, it should contain a list of locations. + */ + readonly locations?: ReadonlyArray; + /** + * If an error can be associated to a particular field in the GraphQL result, + * it _must_ contain an entry with the key `path` that details the path of + * the response field which experienced the error. This allows clients to + * identify whether a null result is intentional or caused by a runtime error. + */ + readonly path?: ReadonlyArray; + /** + * Reserved for implementors to extend the protocol however they see fit, + * and hence there are no additional restrictions on its contents. + */ + readonly extensions?: { [key: string]: unknown }; +} + +/** + * Prints a GraphQLError to a string, representing useful location information + * about the error's position in the source. + * + * @deprecated Please use `error.toString` instead. Will be removed in v17 + */ +export function printError(error: GraphQLError): string { + return error.toString(); +} + +/** + * Given a GraphQLError, format it according to the rules described by the + * Response Format, Errors section of the GraphQL Specification. + * + * @deprecated Please use `error.toString` instead. Will be removed in v17 + */ +export function formatError(error: GraphQLError): GraphQLFormattedError { + return error.toJSON(); +} diff --git a/src/error/README.md b/src/error/README.md new file mode 100644 index 00000000..750c3510 --- /dev/null +++ b/src/error/README.md @@ -0,0 +1,9 @@ +## GraphQL Errors + +The `graphql/error` module is responsible for creating and formatting +GraphQL errors. + +```js +import { ... } from 'graphql/error'; // ES6 +var GraphQLError = require('graphql/error'); // CommonJS +``` diff --git a/src/error/__tests__/GraphQLError-test.ts b/src/error/__tests__/GraphQLError-test.ts new file mode 100644 index 00000000..21e1ab1f --- /dev/null +++ b/src/error/__tests__/GraphQLError-test.ts @@ -0,0 +1,356 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { dedent } from '../../__testUtils__/dedent'; + +import { invariant } from '../../jsutils/invariant'; + +import { Kind } from '../../language/kinds'; +import { parse } from '../../language/parser'; +import { Source } from '../../language/source'; + +import { formatError, GraphQLError, printError } from '../GraphQLError'; + +const source = new Source(dedent` + { + field + } +`); +const ast = parse(source); +const operationNode = ast.definitions[0]; +invariant(operationNode.kind === Kind.OPERATION_DEFINITION); +const fieldNode = operationNode.selectionSet.selections[0]; +invariant(fieldNode); + +describe('GraphQLError', () => { + it('is a class and is a subclass of Error', () => { + expect(new GraphQLError('str')).to.be.instanceof(Error); + expect(new GraphQLError('str')).to.be.instanceof(GraphQLError); + }); + + it('has a name, message, extensions, and stack trace', () => { + const e = new GraphQLError('msg'); + + expect(e).to.deep.include({ + name: 'GraphQLError', + message: 'msg', + extensions: {}, + }); + expect(e.stack).to.be.a('string'); + }); + + it('enumerate only properties prescribed by the spec', () => { + const e = new GraphQLError( + 'msg' /* message */, + [fieldNode] /* nodes */, + source /* source */, + [1, 2, 3] /* positions */, + ['a', 'b', 'c'] /* path */, + new Error('test') /* originalError */, + { foo: 'bar' } /* extensions */, + ); + + expect(Object.keys(e)).to.deep.equal([ + 'message', + 'path', + 'locations', + 'extensions', + ]); + }); + + it('uses the stack of an original error', () => { + const original = new Error('original'); + const e = new GraphQLError( + 'msg', + undefined, + undefined, + undefined, + undefined, + original, + ); + + expect(e).to.include({ + name: 'GraphQLError', + message: 'msg', + stack: original.stack, + originalError: original, + }); + }); + + it('creates new stack if original error has no stack', () => { + const original = new Error('original'); + const e = new GraphQLError('msg', null, null, null, null, original); + + expect(e).to.include({ + name: 'GraphQLError', + message: 'msg', + originalError: original, + }); + expect(e.stack).to.be.a('string'); + }); + + it('converts nodes to positions and locations', () => { + const e = new GraphQLError('msg', [fieldNode]); + expect(e).to.deep.include({ + source, + nodes: [fieldNode], + positions: [4], + locations: [{ line: 2, column: 3 }], + }); + }); + + it('converts single node to positions and locations', () => { + const e = new GraphQLError('msg', fieldNode); // Non-array value. + expect(e).to.deep.include({ + source, + nodes: [fieldNode], + positions: [4], + locations: [{ line: 2, column: 3 }], + }); + }); + + it('converts node with loc.start === 0 to positions and locations', () => { + const e = new GraphQLError('msg', operationNode); + expect(e).to.deep.include({ + source, + nodes: [operationNode], + positions: [0], + locations: [{ line: 1, column: 1 }], + }); + }); + + it('converts node without location to undefined source, positions and locations', () => { + const fieldNodeNoLocation = { + ...fieldNode, + loc: undefined, + }; + + const e = new GraphQLError('msg', fieldNodeNoLocation); + expect(e).to.deep.include({ + nodes: [fieldNodeNoLocation], + source: undefined, + positions: undefined, + locations: undefined, + }); + }); + + it('converts source and positions to locations', () => { + const e = new GraphQLError('msg', null, source, [6]); + expect(e).to.deep.include({ + source, + nodes: undefined, + positions: [6], + locations: [{ line: 2, column: 5 }], + }); + }); + + it('defaults to original error extension only if extensions argument is not passed', () => { + class ErrorWithExtensions extends Error { + extensions: unknown; + + constructor(message: string) { + super(message); + this.extensions = { original: 'extensions' }; + } + } + + const original = new ErrorWithExtensions('original'); + const inheritedExtensions = new GraphQLError( + 'InheritedExtensions', + undefined, + undefined, + undefined, + undefined, + original, + undefined, + ); + + expect(inheritedExtensions).to.deep.include({ + message: 'InheritedExtensions', + originalError: original, + extensions: { original: 'extensions' }, + }); + + const ownExtensions = new GraphQLError( + 'OwnExtensions', + undefined, + undefined, + undefined, + undefined, + original, + { own: 'extensions' }, + ); + + expect(ownExtensions).to.deep.include({ + message: 'OwnExtensions', + originalError: original, + extensions: { own: 'extensions' }, + }); + + const ownEmptyExtensions = new GraphQLError( + 'OwnEmptyExtensions', + undefined, + undefined, + undefined, + undefined, + original, + {}, + ); + + expect(ownEmptyExtensions).to.deep.include({ + message: 'OwnEmptyExtensions', + originalError: original, + extensions: {}, + }); + }); + + it('serializes to include all standard fields', () => { + const eShort = new GraphQLError('msg'); + expect(JSON.stringify(eShort, null, 2)).to.equal(dedent` + { + "message": "msg" + } + `); + + const path = ['path', 2, 'field']; + const extensions = { foo: 'bar' }; + const eFull = new GraphQLError( + 'msg', + fieldNode, + undefined, + undefined, + path, + undefined, + extensions, + ); + + // We should try to keep order of fields stable + // Changing it wouldn't be breaking change but will fail some tests in other libraries. + expect(JSON.stringify(eFull, null, 2)).to.equal(dedent` + { + "message": "msg", + "locations": [ + { + "line": 2, + "column": 3 + } + ], + "path": [ + "path", + 2, + "field" + ], + "extensions": { + "foo": "bar" + } + } + `); + }); +}); + +describe('toString', () => { + it('Deprecated: prints an error using printError', () => { + const error = new GraphQLError('Error'); + expect(printError(error)).to.equal('Error'); + }); + + it('prints an error without location', () => { + const error = new GraphQLError('Error without location'); + expect(error.toString()).to.equal('Error without location'); + }); + + it('prints an error using node without location', () => { + const error = new GraphQLError( + 'Error attached to node without location', + parse('{ foo }', { noLocation: true }), + ); + expect(error.toString()).to.equal( + 'Error attached to node without location', + ); + }); + + it('prints an error with nodes from different sources', () => { + const docA = parse( + new Source( + dedent` + type Foo { + field: String + } + `, + 'SourceA', + ), + ); + const opA = docA.definitions[0]; + invariant(opA.kind === Kind.OBJECT_TYPE_DEFINITION && opA.fields); + const fieldA = opA.fields[0]; + + const docB = parse( + new Source( + dedent` + type Foo { + field: Int + } + `, + 'SourceB', + ), + ); + const opB = docB.definitions[0]; + invariant(opB.kind === Kind.OBJECT_TYPE_DEFINITION && opB.fields); + const fieldB = opB.fields[0]; + + const error = new GraphQLError('Example error with two nodes', [ + fieldA.type, + fieldB.type, + ]); + + expect(error.toString()).to.equal(dedent` + Example error with two nodes + + SourceA:2:10 + 1 | type Foo { + 2 | field: String + | ^ + 3 | } + + SourceB:2:10 + 1 | type Foo { + 2 | field: Int + | ^ + 3 | } + `); + }); +}); + +describe('toJSON', () => { + it('Deprecated: format an error using formatError', () => { + const error = new GraphQLError('Example Error'); + expect(formatError(error)).to.deep.equal({ + message: 'Example Error', + }); + }); + + it('includes path', () => { + const error = new GraphQLError('msg', null, null, null, [ + 'path', + 3, + 'to', + 'field', + ]); + + expect(error.toJSON()).to.deep.equal({ + message: 'msg', + path: ['path', 3, 'to', 'field'], + }); + }); + + it('includes extension fields', () => { + const error = new GraphQLError('msg', null, null, null, null, null, { + foo: 'bar', + }); + + expect(error.toJSON()).to.deep.equal({ + message: 'msg', + extensions: { foo: 'bar' }, + }); + }); +}); diff --git a/src/error/__tests__/locatedError-test.ts b/src/error/__tests__/locatedError-test.ts new file mode 100644 index 00000000..2e35723a --- /dev/null +++ b/src/error/__tests__/locatedError-test.ts @@ -0,0 +1,54 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { GraphQLError } from '../GraphQLError'; +import { locatedError } from '../locatedError'; + +describe('locatedError', () => { + it('passes GraphQLError through', () => { + const e = new GraphQLError('msg', null, null, null, [ + 'path', + 3, + 'to', + 'field', + ]); + + expect(locatedError(e, [], [])).to.deep.equal(e); + }); + + it('wraps non-errors', () => { + const testObject = Object.freeze({}); + const error = locatedError(testObject, [], []); + + expect(error).to.be.instanceOf(GraphQLError); + expect(error.originalError).to.include({ + name: 'NonErrorThrown', + thrownValue: testObject, + }); + }); + + it('passes GraphQLError-ish through', () => { + const e = new Error(); + // @ts-expect-error + e.locations = []; + // @ts-expect-error + e.path = []; + // @ts-expect-error + e.nodes = []; + // @ts-expect-error + e.source = null; + // @ts-expect-error + e.positions = []; + e.name = 'GraphQLError'; + + expect(locatedError(e, [], [])).to.deep.equal(e); + }); + + it('does not pass through elasticsearch-like errors', () => { + const e = new Error('I am from elasticsearch'); + // @ts-expect-error + e.path = '/something/feed/_search'; + + expect(locatedError(e, [], [])).to.not.deep.equal(e); + }); +}); diff --git a/src/error/index.ts b/src/error/index.ts new file mode 100644 index 00000000..41ad0d6f --- /dev/null +++ b/src/error/index.ts @@ -0,0 +1,9 @@ +export { GraphQLError, printError, formatError } from './GraphQLError'; +export type { + GraphQLFormattedError, + GraphQLErrorExtensions, +} from './GraphQLError'; + +export { syntaxError } from './syntaxError'; + +export { locatedError } from './locatedError'; diff --git a/src/error/locatedError.ts b/src/error/locatedError.ts new file mode 100644 index 00000000..2fec3204 --- /dev/null +++ b/src/error/locatedError.ts @@ -0,0 +1,37 @@ +import type { Maybe } from '../jsutils/Maybe'; +import { toError } from '../jsutils/toError'; + +import type { ASTNode } from '../language/ast'; + +import { GraphQLError } from './GraphQLError'; + +/** + * Given an arbitrary value, 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. + */ +export function locatedError( + rawOriginalError: unknown, + nodes: ASTNode | ReadonlyArray | undefined | null, + path?: Maybe>, +): GraphQLError { + const originalError = toError(rawOriginalError); + + // Note: this uses a brand-check to support GraphQL errors originating from other contexts. + if (isLocatedGraphQLError(originalError)) { + return originalError; + } + + return new GraphQLError( + originalError.message, + (originalError as GraphQLError).nodes ?? nodes, + (originalError as GraphQLError).source, + (originalError as GraphQLError).positions, + path, + originalError, + ); +} + +function isLocatedGraphQLError(error: any): error is GraphQLError { + return Array.isArray(error.path); +} diff --git a/src/error/syntaxError.ts b/src/error/syntaxError.ts new file mode 100644 index 00000000..21a2dc18 --- /dev/null +++ b/src/error/syntaxError.ts @@ -0,0 +1,17 @@ +import type { Source } from '../language/source'; + +import { GraphQLError } from './GraphQLError'; + +/** + * Produces a GraphQLError representing a syntax error, containing useful + * descriptive information about the syntax error's position in the source. + */ +export function syntaxError( + source: Source, + position: number, + description: string, +): GraphQLError { + return new GraphQLError(`Syntax Error: ${description}`, undefined, source, [ + position, + ]); +} diff --git a/src/execution/README.md b/src/execution/README.md new file mode 100644 index 00000000..6540f323 --- /dev/null +++ b/src/execution/README.md @@ -0,0 +1,9 @@ +## GraphQL Execution + +The `graphql/execution` module is responsible for the execution phase of +fulfilling a GraphQL request. + +```js +import { execute } from 'graphql/execution'; // ES6 +var GraphQLExecution = require('graphql/execution'); // CommonJS +``` diff --git a/src/execution/__tests__/abstract-test.ts b/src/execution/__tests__/abstract-test.ts new file mode 100644 index 00000000..5253d0d9 --- /dev/null +++ b/src/execution/__tests__/abstract-test.ts @@ -0,0 +1,643 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { expectJSON } from '../../__testUtils__/expectJSON'; + +import { parse } from '../../language/parser'; + +import { + assertInterfaceType, + GraphQLInterfaceType, + GraphQLList, + GraphQLObjectType, + GraphQLUnionType, +} from '../../type/definition'; +import { GraphQLBoolean, GraphQLString } from '../../type/scalars'; +import { GraphQLSchema } from '../../type/schema'; + +import { buildSchema } from '../../utilities/buildASTSchema'; + +import { execute, executeSync } from '../execute'; + +async function executeQuery(args: { + schema: GraphQLSchema; + query: string; + rootValue?: unknown; +}) { + const { schema, query, rootValue } = args; + const document = parse(query); + const result = executeSync({ + schema, + document, + rootValue, + contextValue: { async: false }, + }); + const asyncResult = await execute({ + schema, + document, + rootValue, + contextValue: { async: true }, + }); + + expectJSON(result).toDeepEqual(asyncResult); + return result; +} + +class Dog { + name: string; + woofs: boolean; + + constructor(name: string, woofs: boolean) { + this.name = name; + this.woofs = woofs; + } +} + +class Cat { + name: string; + meows: boolean; + + constructor(name: string, meows: boolean) { + this.name = name; + this.meows = meows; + } +} + +describe('Execute: Handles execution of abstract types', () => { + it('isTypeOf used to resolve runtime type for Interface', async () => { + const PetType = new GraphQLInterfaceType({ + name: 'Pet', + fields: { + name: { type: GraphQLString }, + }, + }); + + const DogType = new GraphQLObjectType({ + name: 'Dog', + interfaces: [PetType], + isTypeOf(obj, context) { + const isDog = obj instanceof Dog; + return context.async ? Promise.resolve(isDog) : isDog; + }, + fields: { + name: { type: GraphQLString }, + woofs: { type: GraphQLBoolean }, + }, + }); + + const CatType = new GraphQLObjectType({ + name: 'Cat', + interfaces: [PetType], + isTypeOf(obj, context) { + const isCat = obj instanceof Cat; + return context.async ? Promise.resolve(isCat) : isCat; + }, + fields: { + name: { type: GraphQLString }, + meows: { type: GraphQLBoolean }, + }, + }); + + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Query', + fields: { + pets: { + type: new GraphQLList(PetType), + resolve() { + return [new Dog('Odie', true), new Cat('Garfield', false)]; + }, + }, + }, + }), + types: [CatType, DogType], + }); + + const query = ` + { + pets { + name + ... on Dog { + woofs + } + ... on Cat { + meows + } + } + } + `; + + expect(await executeQuery({ schema, query })).to.deep.equal({ + data: { + pets: [ + { + name: 'Odie', + woofs: true, + }, + { + name: 'Garfield', + meows: false, + }, + ], + }, + }); + }); + + it('isTypeOf can throw', async () => { + const PetType = new GraphQLInterfaceType({ + name: 'Pet', + fields: { + name: { type: GraphQLString }, + }, + }); + + const DogType = new GraphQLObjectType({ + name: 'Dog', + interfaces: [PetType], + isTypeOf(_source, context) { + const error = new Error('We are testing this error'); + if (context.async) { + return Promise.reject(error); + } + throw error; + }, + fields: { + name: { type: GraphQLString }, + woofs: { type: GraphQLBoolean }, + }, + }); + + const CatType = new GraphQLObjectType({ + name: 'Cat', + interfaces: [PetType], + isTypeOf: undefined, + fields: { + name: { type: GraphQLString }, + meows: { type: GraphQLBoolean }, + }, + }); + + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Query', + fields: { + pets: { + type: new GraphQLList(PetType), + resolve() { + return [new Dog('Odie', true), new Cat('Garfield', false)]; + }, + }, + }, + }), + types: [DogType, CatType], + }); + + const query = ` + { + pets { + name + ... on Dog { + woofs + } + ... on Cat { + meows + } + } + } + `; + + expectJSON(await executeQuery({ schema, query })).toDeepEqual({ + data: { + pets: [null, null], + }, + errors: [ + { + message: 'We are testing this error', + locations: [{ line: 3, column: 9 }], + path: ['pets', 0], + }, + { + message: 'We are testing this error', + locations: [{ line: 3, column: 9 }], + path: ['pets', 1], + }, + ], + }); + }); + + it('isTypeOf can return false', async () => { + const PetType = new GraphQLInterfaceType({ + name: 'Pet', + fields: { + name: { type: GraphQLString }, + }, + }); + + const DogType = new GraphQLObjectType({ + name: 'Dog', + interfaces: [PetType], + isTypeOf(_source, context) { + return context.async ? Promise.resolve(false) : false; + }, + fields: { + name: { type: GraphQLString }, + woofs: { type: GraphQLBoolean }, + }, + }); + + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Query', + fields: { + pet: { + type: PetType, + resolve: () => ({}), + }, + }, + }), + types: [DogType], + }); + + const query = ` + { + pet { + name + } + } + `; + + expectJSON(await executeQuery({ schema, query })).toDeepEqual({ + data: { pet: null }, + errors: [ + { + message: + 'Abstract type "Pet" must resolve to an Object type at runtime for field "Query.pet". Either the "Pet" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.', + locations: [{ line: 3, column: 9 }], + path: ['pet'], + }, + ], + }); + }); + + it('isTypeOf used to resolve runtime type for Union', async () => { + const DogType = new GraphQLObjectType({ + name: 'Dog', + isTypeOf(obj, context) { + const isDog = obj instanceof Dog; + return context.async ? Promise.resolve(isDog) : isDog; + }, + fields: { + name: { type: GraphQLString }, + woofs: { type: GraphQLBoolean }, + }, + }); + + const CatType = new GraphQLObjectType({ + name: 'Cat', + isTypeOf(obj, context) { + const isCat = obj instanceof Cat; + return context.async ? Promise.resolve(isCat) : isCat; + }, + fields: { + name: { type: GraphQLString }, + meows: { type: GraphQLBoolean }, + }, + }); + + const PetType = new GraphQLUnionType({ + name: 'Pet', + types: [DogType, CatType], + }); + + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Query', + fields: { + pets: { + type: new GraphQLList(PetType), + resolve() { + return [new Dog('Odie', true), new Cat('Garfield', false)]; + }, + }, + }, + }), + }); + + const query = `{ + pets { + ... on Dog { + name + woofs + } + ... on Cat { + name + meows + } + } + }`; + + expect(await executeQuery({ schema, query })).to.deep.equal({ + data: { + pets: [ + { + name: 'Odie', + woofs: true, + }, + { + name: 'Garfield', + meows: false, + }, + ], + }, + }); + }); + + it('resolveType can throw', async () => { + const PetType = new GraphQLInterfaceType({ + name: 'Pet', + resolveType(_source, context) { + const error = new Error('We are testing this error'); + if (context.async) { + return Promise.reject(error); + } + throw error; + }, + fields: { + name: { type: GraphQLString }, + }, + }); + + const DogType = new GraphQLObjectType({ + name: 'Dog', + interfaces: [PetType], + fields: { + name: { type: GraphQLString }, + woofs: { type: GraphQLBoolean }, + }, + }); + + const CatType = new GraphQLObjectType({ + name: 'Cat', + interfaces: [PetType], + fields: { + name: { type: GraphQLString }, + meows: { type: GraphQLBoolean }, + }, + }); + + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Query', + fields: { + pets: { + type: new GraphQLList(PetType), + resolve() { + return [new Dog('Odie', true), new Cat('Garfield', false)]; + }, + }, + }, + }), + types: [CatType, DogType], + }); + + const query = ` + { + pets { + name + ... on Dog { + woofs + } + ... on Cat { + meows + } + } + } + `; + + expectJSON(await executeQuery({ schema, query })).toDeepEqual({ + data: { + pets: [null, null], + }, + errors: [ + { + message: 'We are testing this error', + locations: [{ line: 3, column: 9 }], + path: ['pets', 0], + }, + { + message: 'We are testing this error', + locations: [{ line: 3, column: 9 }], + path: ['pets', 1], + }, + ], + }); + }); + + it('resolve Union type using __typename on source object', async () => { + const schema = buildSchema(` + type Query { + pets: [Pet] + } + + union Pet = Cat | Dog + + type Cat { + name: String + meows: Boolean + } + + type Dog { + name: String + woofs: Boolean + } + `); + + const query = ` + { + pets { + name + ... on Dog { + woofs + } + ... on Cat { + meows + } + } + } + `; + + const rootValue = { + pets: [ + { + __typename: 'Dog', + name: 'Odie', + woofs: true, + }, + { + __typename: 'Cat', + name: 'Garfield', + meows: false, + }, + ], + }; + + expect(await executeQuery({ schema, query, rootValue })).to.deep.equal({ + data: { + pets: [ + { + name: 'Odie', + woofs: true, + }, + { + name: 'Garfield', + meows: false, + }, + ], + }, + }); + }); + + it('resolve Interface type using __typename on source object', async () => { + const schema = buildSchema(` + type Query { + pets: [Pet] + } + + interface Pet { + name: String + } + + type Cat implements Pet { + name: String + meows: Boolean + } + + type Dog implements Pet { + name: String + woofs: Boolean + } + `); + + const query = ` + { + pets { + name + ... on Dog { + woofs + } + ... on Cat { + meows + } + } + } + `; + + const rootValue = { + pets: [ + { + __typename: 'Dog', + name: 'Odie', + woofs: true, + }, + { + __typename: 'Cat', + name: 'Garfield', + meows: false, + }, + ], + }; + + expect(await executeQuery({ schema, query, rootValue })).to.deep.equal({ + data: { + pets: [ + { + name: 'Odie', + woofs: true, + }, + { + name: 'Garfield', + meows: false, + }, + ], + }, + }); + }); + + it('resolveType on Interface yields useful error', () => { + const schema = buildSchema(` + type Query { + pet: Pet + } + + interface Pet { + name: String + } + + type Cat implements Pet { + name: String + } + + type Dog implements Pet { + name: String + } + `); + + const document = parse(` + { + pet { + name + } + } + `); + + function expectError({ forTypeName }: { forTypeName: unknown }) { + const rootValue = { pet: { __typename: forTypeName } }; + const result = executeSync({ schema, document, rootValue }); + return { + toEqual(message: string) { + expectJSON(result).toDeepEqual({ + data: { pet: null }, + errors: [ + { + message, + locations: [{ line: 3, column: 9 }], + path: ['pet'], + }, + ], + }); + }, + }; + } + + expectError({ forTypeName: undefined }).toEqual( + 'Abstract type "Pet" must resolve to an Object type at runtime for field "Query.pet". Either the "Pet" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.', + ); + + expectError({ forTypeName: 'Human' }).toEqual( + 'Abstract type "Pet" was resolved to a type "Human" that does not exist inside the schema.', + ); + + expectError({ forTypeName: 'String' }).toEqual( + 'Abstract type "Pet" was resolved to a non-object type "String".', + ); + + expectError({ forTypeName: '__Schema' }).toEqual( + 'Runtime Object type "__Schema" is not a possible type for "Pet".', + ); + + // FIXME: workaround since we can't inject resolveType into SDL + // @ts-expect-error + assertInterfaceType(schema.getType('Pet')).resolveType = () => []; + expectError({ forTypeName: undefined }).toEqual( + 'Abstract type "Pet" must resolve to an Object type at runtime for field "Query.pet" with value { __typename: undefined }, received "[]".', + ); + + // FIXME: workaround since we can't inject resolveType into SDL + // @ts-expect-error + assertInterfaceType(schema.getType('Pet')).resolveType = () => + schema.getType('Cat'); + expectError({ forTypeName: undefined }).toEqual( + 'Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead.', + ); + }); +}); diff --git a/src/execution/__tests__/directives-test.ts b/src/execution/__tests__/directives-test.ts new file mode 100644 index 00000000..0c85f5ca --- /dev/null +++ b/src/execution/__tests__/directives-test.ts @@ -0,0 +1,307 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { parse } from '../../language/parser'; + +import { GraphQLObjectType } from '../../type/definition'; +import { GraphQLString } from '../../type/scalars'; +import { GraphQLSchema } from '../../type/schema'; + +import { executeSync } from '../execute'; + +const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'TestType', + fields: { + a: { type: GraphQLString }, + b: { type: GraphQLString }, + }, + }), +}); + +const rootValue = { + a() { + return 'a'; + }, + b() { + return 'b'; + }, +}; + +function executeTestQuery(query: string) { + const document = parse(query); + return executeSync({ schema, document, rootValue }); +} + +describe('Execute: handles directives', () => { + describe('works without directives', () => { + it('basic query works', () => { + const result = executeTestQuery('{ a, b }'); + + expect(result).to.deep.equal({ + data: { a: 'a', b: 'b' }, + }); + }); + }); + + describe('works on scalars', () => { + it('if true includes scalar', () => { + const result = executeTestQuery('{ a, b @include(if: true) }'); + + expect(result).to.deep.equal({ + data: { a: 'a', b: 'b' }, + }); + }); + + it('if false omits on scalar', () => { + const result = executeTestQuery('{ a, b @include(if: false) }'); + + expect(result).to.deep.equal({ + data: { a: 'a' }, + }); + }); + + it('unless false includes scalar', () => { + const result = executeTestQuery('{ a, b @skip(if: false) }'); + + expect(result).to.deep.equal({ + data: { a: 'a', b: 'b' }, + }); + }); + + it('unless true omits scalar', () => { + const result = executeTestQuery('{ a, b @skip(if: true) }'); + + expect(result).to.deep.equal({ + data: { a: 'a' }, + }); + }); + }); + + describe('works on fragment spreads', () => { + it('if false omits fragment spread', () => { + const result = executeTestQuery(` + query { + a + ...Frag @include(if: false) + } + fragment Frag on TestType { + b + } + `); + + expect(result).to.deep.equal({ + data: { a: 'a' }, + }); + }); + + it('if true includes fragment spread', () => { + const result = executeTestQuery(` + query { + a + ...Frag @include(if: true) + } + fragment Frag on TestType { + b + } + `); + + expect(result).to.deep.equal({ + data: { a: 'a', b: 'b' }, + }); + }); + + it('unless false includes fragment spread', () => { + const result = executeTestQuery(` + query { + a + ...Frag @skip(if: false) + } + fragment Frag on TestType { + b + } + `); + + expect(result).to.deep.equal({ + data: { a: 'a', b: 'b' }, + }); + }); + + it('unless true omits fragment spread', () => { + const result = executeTestQuery(` + query { + a + ...Frag @skip(if: true) + } + fragment Frag on TestType { + b + } + `); + + expect(result).to.deep.equal({ + data: { a: 'a' }, + }); + }); + }); + + describe('works on inline fragment', () => { + it('if false omits inline fragment', () => { + const result = executeTestQuery(` + query { + a + ... on TestType @include(if: false) { + b + } + } + `); + + expect(result).to.deep.equal({ + data: { a: 'a' }, + }); + }); + + it('if true includes inline fragment', () => { + const result = executeTestQuery(` + query { + a + ... on TestType @include(if: true) { + b + } + } + `); + + expect(result).to.deep.equal({ + data: { a: 'a', b: 'b' }, + }); + }); + it('unless false includes inline fragment', () => { + const result = executeTestQuery(` + query { + a + ... on TestType @skip(if: false) { + b + } + } + `); + + expect(result).to.deep.equal({ + data: { a: 'a', b: 'b' }, + }); + }); + it('unless true includes inline fragment', () => { + const result = executeTestQuery(` + query { + a + ... on TestType @skip(if: true) { + b + } + } + `); + + expect(result).to.deep.equal({ + data: { a: 'a' }, + }); + }); + }); + + describe('works on anonymous inline fragment', () => { + it('if false omits anonymous inline fragment', () => { + const result = executeTestQuery(` + query { + a + ... @include(if: false) { + b + } + } + `); + + expect(result).to.deep.equal({ + data: { a: 'a' }, + }); + }); + + it('if true includes anonymous inline fragment', () => { + const result = executeTestQuery(` + query { + a + ... @include(if: true) { + b + } + } + `); + + expect(result).to.deep.equal({ + data: { a: 'a', b: 'b' }, + }); + }); + it('unless false includes anonymous inline fragment', () => { + const result = executeTestQuery(` + query Q { + a + ... @skip(if: false) { + b + } + } + `); + + expect(result).to.deep.equal({ + data: { a: 'a', b: 'b' }, + }); + }); + it('unless true includes anonymous inline fragment', () => { + const result = executeTestQuery(` + query { + a + ... @skip(if: true) { + b + } + } + `); + + expect(result).to.deep.equal({ + data: { a: 'a' }, + }); + }); + }); + + describe('works with skip and include directives', () => { + it('include and no skip', () => { + const result = executeTestQuery(` + { + a + b @include(if: true) @skip(if: false) + } + `); + + expect(result).to.deep.equal({ + data: { a: 'a', b: 'b' }, + }); + }); + + it('include and skip', () => { + const result = executeTestQuery(` + { + a + b @include(if: true) @skip(if: true) + } + `); + + expect(result).to.deep.equal({ + data: { a: 'a' }, + }); + }); + + it('no include or skip', () => { + const result = executeTestQuery(` + { + a + b @include(if: false) @skip(if: false) + } + `); + + expect(result).to.deep.equal({ + data: { a: 'a' }, + }); + }); + }); +}); diff --git a/src/execution/__tests__/executor-test.ts b/src/execution/__tests__/executor-test.ts new file mode 100644 index 00000000..116334ad --- /dev/null +++ b/src/execution/__tests__/executor-test.ts @@ -0,0 +1,1272 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { expectJSON } from '../../__testUtils__/expectJSON'; + +import { inspect } from '../../jsutils/inspect'; +import { invariant } from '../../jsutils/invariant'; + +import { Kind } from '../../language/kinds'; +import { parse } from '../../language/parser'; + +import { + GraphQLInterfaceType, + GraphQLList, + GraphQLNonNull, + GraphQLObjectType, + GraphQLScalarType, + GraphQLUnionType, +} from '../../type/definition'; +import { GraphQLBoolean, GraphQLInt, GraphQLString } from '../../type/scalars'; +import { GraphQLSchema } from '../../type/schema'; + +import { execute, executeSync } from '../execute'; + +describe('Execute: Handles basic execution tasks', () => { + it('throws if no document is provided', () => { + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Type', + fields: { + a: { type: GraphQLString }, + }, + }), + }); + + // @ts-expect-error + expect(() => executeSync({ schema })).to.throw('Must provide document.'); + }); + + it('throws if no schema is provided', () => { + const document = parse('{ field }'); + + // @ts-expect-error + expect(() => executeSync({ document })).to.throw( + 'Expected undefined to be a GraphQL schema.', + ); + }); + + it('throws on invalid variables', () => { + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Type', + fields: { + fieldA: { + type: GraphQLString, + args: { argA: { type: GraphQLInt } }, + }, + }, + }), + }); + const document = parse(` + query ($a: Int) { + fieldA(argA: $a) + } + `); + const variableValues = '{ "a": 1 }'; + + // @ts-expect-error + expect(() => executeSync({ schema, document, variableValues })).to.throw( + 'Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.', + ); + }); + + it('executes arbitrary code', async () => { + const data = { + a: () => 'Apple', + b: () => 'Banana', + c: () => 'Cookie', + d: () => 'Donut', + e: () => 'Egg', + f: 'Fish', + // Called only by DataType::pic static resolver + pic: (size: number) => 'Pic of size: ' + size, + deep: () => deepData, + promise: promiseData, + }; + + const deepData = { + a: () => 'Already Been Done', + b: () => 'Boring', + c: () => ['Contrived', undefined, 'Confusing'], + deeper: () => [data, null, data], + }; + + function promiseData() { + return Promise.resolve(data); + } + + const DataType: GraphQLObjectType = new GraphQLObjectType({ + name: 'DataType', + fields: () => ({ + a: { type: GraphQLString }, + b: { type: GraphQLString }, + c: { type: GraphQLString }, + d: { type: GraphQLString }, + e: { type: GraphQLString }, + f: { type: GraphQLString }, + pic: { + args: { size: { type: GraphQLInt } }, + type: GraphQLString, + resolve: (obj, { size }) => obj.pic(size), + }, + deep: { type: DeepDataType }, + promise: { type: DataType }, + }), + }); + + const DeepDataType = new GraphQLObjectType({ + name: 'DeepDataType', + fields: { + a: { type: GraphQLString }, + b: { type: GraphQLString }, + c: { type: new GraphQLList(GraphQLString) }, + deeper: { type: new GraphQLList(DataType) }, + }, + }); + + const document = parse(` + query ($size: Int) { + a, + b, + x: c + ...c + f + ...on DataType { + pic(size: $size) + promise { + a + } + } + deep { + a + b + c + deeper { + a + b + } + } + } + + fragment c on DataType { + d + e + } + `); + + const result = await execute({ + schema: new GraphQLSchema({ query: DataType }), + document, + rootValue: data, + variableValues: { size: 100 }, + }); + + expect(result).to.deep.equal({ + data: { + a: 'Apple', + b: 'Banana', + x: 'Cookie', + d: 'Donut', + e: 'Egg', + f: 'Fish', + pic: 'Pic of size: 100', + promise: { a: 'Apple' }, + deep: { + a: 'Already Been Done', + b: 'Boring', + c: ['Contrived', null, 'Confusing'], + deeper: [ + { a: 'Apple', b: 'Banana' }, + null, + { a: 'Apple', b: 'Banana' }, + ], + }, + }, + }); + }); + + it('merges parallel fragments', () => { + const Type: GraphQLObjectType = new GraphQLObjectType({ + name: 'Type', + fields: () => ({ + a: { type: GraphQLString, resolve: () => 'Apple' }, + b: { type: GraphQLString, resolve: () => 'Banana' }, + c: { type: GraphQLString, resolve: () => 'Cherry' }, + deep: { type: Type, resolve: () => ({}) }, + }), + }); + const schema = new GraphQLSchema({ query: Type }); + + const document = parse(` + { a, ...FragOne, ...FragTwo } + + fragment FragOne on Type { + b + deep { b, deeper: deep { b } } + } + + fragment FragTwo on Type { + c + deep { c, deeper: deep { c } } + } + `); + + const result = executeSync({ schema, document }); + expect(result).to.deep.equal({ + data: { + a: 'Apple', + b: 'Banana', + c: 'Cherry', + deep: { + b: 'Banana', + c: 'Cherry', + deeper: { + b: 'Banana', + c: 'Cherry', + }, + }, + }, + }); + }); + + it('provides info about current execution state', () => { + let resolvedInfo; + const testType = new GraphQLObjectType({ + name: 'Test', + fields: { + test: { + type: GraphQLString, + resolve(_val, _args, _ctx, info) { + resolvedInfo = info; + }, + }, + }, + }); + const schema = new GraphQLSchema({ query: testType }); + + const document = parse('query ($var: String) { result: test }'); + const rootValue = { root: 'val' }; + const variableValues = { var: 'abc' }; + + executeSync({ schema, document, rootValue, variableValues }); + + expect(resolvedInfo).to.have.all.keys( + 'fieldName', + 'fieldNodes', + 'returnType', + 'parentType', + 'path', + 'schema', + 'fragments', + 'rootValue', + 'operation', + 'variableValues', + ); + + const operation = document.definitions[0]; + invariant(operation.kind === Kind.OPERATION_DEFINITION); + + expect(resolvedInfo).to.include({ + fieldName: 'test', + returnType: GraphQLString, + parentType: testType, + schema, + rootValue, + operation, + }); + + const field = operation.selectionSet.selections[0]; + expect(resolvedInfo).to.deep.include({ + fieldNodes: [field], + path: { prev: undefined, key: 'result', typename: 'Test' }, + variableValues: { var: 'abc' }, + }); + }); + + it('populates path correctly with complex types', () => { + let path; + const someObject = new GraphQLObjectType({ + name: 'SomeObject', + fields: { + test: { + type: GraphQLString, + resolve(_val, _args, _ctx, info) { + path = info.path; + }, + }, + }, + }); + const someUnion = new GraphQLUnionType({ + name: 'SomeUnion', + types: [someObject], + resolveType() { + return 'SomeObject'; + }, + }); + const testType = new GraphQLObjectType({ + name: 'SomeQuery', + fields: { + test: { + type: new GraphQLNonNull( + new GraphQLList(new GraphQLNonNull(someUnion)), + ), + }, + }, + }); + const schema = new GraphQLSchema({ query: testType }); + const rootValue = { test: [{}] }; + const document = parse(` + query { + l1: test { + ... on SomeObject { + l2: test + } + } + } + `); + + executeSync({ schema, document, rootValue }); + + expect(path).to.deep.equal({ + key: 'l2', + typename: 'SomeObject', + prev: { + key: 0, + typename: undefined, + prev: { + key: 'l1', + typename: 'SomeQuery', + prev: undefined, + }, + }, + }); + }); + + it('threads root value context correctly', () => { + let resolvedRootValue; + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Type', + fields: { + a: { + type: GraphQLString, + resolve(rootValueArg) { + resolvedRootValue = rootValueArg; + }, + }, + }, + }), + }); + + const document = parse('query Example { a }'); + const rootValue = { contextThing: 'thing' }; + + executeSync({ schema, document, rootValue }); + expect(resolvedRootValue).to.equal(rootValue); + }); + + it('correctly threads arguments', () => { + let resolvedArgs; + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Type', + fields: { + b: { + args: { + numArg: { type: GraphQLInt }, + stringArg: { type: GraphQLString }, + }, + type: GraphQLString, + resolve(_, args) { + resolvedArgs = args; + }, + }, + }, + }), + }); + + const document = parse(` + query Example { + b(numArg: 123, stringArg: "foo") + } + `); + + executeSync({ schema, document }); + expect(resolvedArgs).to.deep.equal({ numArg: 123, stringArg: 'foo' }); + }); + + it('nulls out error subtrees', async () => { + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Type', + fields: { + sync: { type: GraphQLString }, + syncError: { type: GraphQLString }, + syncRawError: { type: GraphQLString }, + syncReturnError: { type: GraphQLString }, + syncReturnErrorList: { type: new GraphQLList(GraphQLString) }, + async: { type: GraphQLString }, + asyncReject: { type: GraphQLString }, + asyncRejectWithExtensions: { type: GraphQLString }, + asyncRawReject: { type: GraphQLString }, + asyncEmptyReject: { type: GraphQLString }, + asyncError: { type: GraphQLString }, + asyncRawError: { type: GraphQLString }, + asyncReturnError: { type: GraphQLString }, + asyncReturnErrorWithExtensions: { type: GraphQLString }, + }, + }), + }); + + const document = parse(` + { + sync + syncError + syncRawError + syncReturnError + syncReturnErrorList + async + asyncReject + asyncRawReject + asyncEmptyReject + asyncError + asyncRawError + asyncReturnError + asyncReturnErrorWithExtensions + } + `); + + const rootValue = { + sync() { + return 'sync'; + }, + syncError() { + throw new Error('Error getting syncError'); + }, + syncRawError() { + // eslint-disable-next-line @typescript-eslint/no-throw-literal + throw 'Error getting syncRawError'; + }, + syncReturnError() { + return new Error('Error getting syncReturnError'); + }, + syncReturnErrorList() { + return [ + 'sync0', + new Error('Error getting syncReturnErrorList1'), + 'sync2', + new Error('Error getting syncReturnErrorList3'), + ]; + }, + async() { + return new Promise((resolve) => resolve('async')); + }, + asyncReject() { + return new Promise((_, reject) => + reject(new Error('Error getting asyncReject')), + ); + }, + asyncRawReject() { + // eslint-disable-next-line prefer-promise-reject-errors + return Promise.reject('Error getting asyncRawReject'); + }, + asyncEmptyReject() { + // eslint-disable-next-line prefer-promise-reject-errors + return Promise.reject(); + }, + asyncError() { + return new Promise(() => { + throw new Error('Error getting asyncError'); + }); + }, + asyncRawError() { + return new Promise(() => { + // eslint-disable-next-line @typescript-eslint/no-throw-literal + throw 'Error getting asyncRawError'; + }); + }, + asyncReturnError() { + return Promise.resolve(new Error('Error getting asyncReturnError')); + }, + asyncReturnErrorWithExtensions() { + const error = new Error('Error getting asyncReturnErrorWithExtensions'); + // @ts-expect-error + error.extensions = { foo: 'bar' }; + + return Promise.resolve(error); + }, + }; + + const result = await execute({ schema, document, rootValue }); + expectJSON(result).toDeepEqual({ + data: { + sync: 'sync', + syncError: null, + syncRawError: null, + syncReturnError: null, + syncReturnErrorList: ['sync0', null, 'sync2', null], + async: 'async', + asyncReject: null, + asyncRawReject: null, + asyncEmptyReject: null, + asyncError: null, + asyncRawError: null, + asyncReturnError: null, + asyncReturnErrorWithExtensions: null, + }, + errors: [ + { + message: 'Error getting syncError', + locations: [{ line: 4, column: 9 }], + path: ['syncError'], + }, + { + message: 'Unexpected error value: "Error getting syncRawError"', + locations: [{ line: 5, column: 9 }], + path: ['syncRawError'], + }, + { + message: 'Error getting syncReturnError', + locations: [{ line: 6, column: 9 }], + path: ['syncReturnError'], + }, + { + message: 'Error getting syncReturnErrorList1', + locations: [{ line: 7, column: 9 }], + path: ['syncReturnErrorList', 1], + }, + { + message: 'Error getting syncReturnErrorList3', + locations: [{ line: 7, column: 9 }], + path: ['syncReturnErrorList', 3], + }, + { + message: 'Error getting asyncReject', + locations: [{ line: 9, column: 9 }], + path: ['asyncReject'], + }, + { + message: 'Unexpected error value: "Error getting asyncRawReject"', + locations: [{ line: 10, column: 9 }], + path: ['asyncRawReject'], + }, + { + message: 'Unexpected error value: undefined', + locations: [{ line: 11, column: 9 }], + path: ['asyncEmptyReject'], + }, + { + message: 'Error getting asyncError', + locations: [{ line: 12, column: 9 }], + path: ['asyncError'], + }, + { + message: 'Unexpected error value: "Error getting asyncRawError"', + locations: [{ line: 13, column: 9 }], + path: ['asyncRawError'], + }, + { + message: 'Error getting asyncReturnError', + locations: [{ line: 14, column: 9 }], + path: ['asyncReturnError'], + }, + { + message: 'Error getting asyncReturnErrorWithExtensions', + locations: [{ line: 15, column: 9 }], + path: ['asyncReturnErrorWithExtensions'], + extensions: { foo: 'bar' }, + }, + ], + }); + }); + + it('nulls error subtree for promise rejection #1071', async () => { + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Query', + fields: { + foods: { + type: new GraphQLList( + new GraphQLObjectType({ + name: 'Food', + fields: { + name: { type: GraphQLString }, + }, + }), + ), + resolve() { + return Promise.reject(new Error('Oops')); + }, + }, + }, + }), + }); + + const document = parse(` + query { + foods { + name + } + } + `); + + const result = await execute({ schema, document }); + + expectJSON(result).toDeepEqual({ + data: { foods: null }, + errors: [ + { + locations: [{ column: 9, line: 3 }], + message: 'Oops', + path: ['foods'], + }, + ], + }); + }); + + it('Full response path is included for non-nullable fields', () => { + const A: GraphQLObjectType = new GraphQLObjectType({ + name: 'A', + fields: () => ({ + nullableA: { + type: A, + resolve: () => ({}), + }, + nonNullA: { + type: new GraphQLNonNull(A), + resolve: () => ({}), + }, + throws: { + type: new GraphQLNonNull(GraphQLString), + resolve: () => { + throw new Error('Catch me if you can'); + }, + }, + }), + }); + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'query', + fields: () => ({ + nullableA: { + type: A, + resolve: () => ({}), + }, + }), + }), + }); + + const document = parse(` + query { + nullableA { + aliasedA: nullableA { + nonNullA { + anotherA: nonNullA { + throws + } + } + } + } + } + `); + + const result = executeSync({ schema, document }); + expectJSON(result).toDeepEqual({ + data: { + nullableA: { + aliasedA: null, + }, + }, + errors: [ + { + message: 'Catch me if you can', + locations: [{ line: 7, column: 17 }], + path: ['nullableA', 'aliasedA', 'nonNullA', 'anotherA', 'throws'], + }, + ], + }); + }); + + it('uses the inline operation if no operation name is provided', () => { + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Type', + fields: { + a: { type: GraphQLString }, + }, + }), + }); + const document = parse('{ a }'); + const rootValue = { a: 'b' }; + + const result = executeSync({ schema, document, rootValue }); + expect(result).to.deep.equal({ data: { a: 'b' } }); + }); + + it('uses the only operation if no operation name is provided', () => { + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Type', + fields: { + a: { type: GraphQLString }, + }, + }), + }); + const document = parse('query Example { a }'); + const rootValue = { a: 'b' }; + + const result = executeSync({ schema, document, rootValue }); + expect(result).to.deep.equal({ data: { a: 'b' } }); + }); + + it('uses the named operation if operation name is provided', () => { + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Type', + fields: { + a: { type: GraphQLString }, + }, + }), + }); + + const document = parse(` + query Example { first: a } + query OtherExample { second: a } + `); + const rootValue = { a: 'b' }; + const operationName = 'OtherExample'; + + const result = executeSync({ schema, document, rootValue, operationName }); + expect(result).to.deep.equal({ data: { second: 'b' } }); + }); + + it('provides error if no operation is provided', () => { + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Type', + fields: { + a: { type: GraphQLString }, + }, + }), + }); + const document = parse('fragment Example on Type { a }'); + const rootValue = { a: 'b' }; + + const result = executeSync({ schema, document, rootValue }); + expectJSON(result).toDeepEqual({ + errors: [{ message: 'Must provide an operation.' }], + }); + }); + + it('errors if no op name is provided with multiple operations', () => { + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Type', + fields: { + a: { type: GraphQLString }, + }, + }), + }); + const document = parse(` + query Example { a } + query OtherExample { a } + `); + + const result = executeSync({ schema, document }); + expectJSON(result).toDeepEqual({ + errors: [ + { + message: + 'Must provide operation name if query contains multiple operations.', + }, + ], + }); + }); + + it('errors if unknown operation name is provided', () => { + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Type', + fields: { + a: { type: GraphQLString }, + }, + }), + }); + const document = parse(` + query Example { a } + query OtherExample { a } + `); + const operationName = 'UnknownExample'; + + const result = executeSync({ schema, document, operationName }); + expectJSON(result).toDeepEqual({ + errors: [{ message: 'Unknown operation named "UnknownExample".' }], + }); + }); + + it('errors if empty string is provided as operation name', () => { + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Type', + fields: { + a: { type: GraphQLString }, + }, + }), + }); + const document = parse('{ a }'); + const operationName = ''; + + const result = executeSync({ schema, document, operationName }); + expectJSON(result).toDeepEqual({ + errors: [{ message: 'Unknown operation named "".' }], + }); + }); + + it('uses the query schema for queries', () => { + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Q', + fields: { + a: { type: GraphQLString }, + }, + }), + mutation: new GraphQLObjectType({ + name: 'M', + fields: { + c: { type: GraphQLString }, + }, + }), + subscription: new GraphQLObjectType({ + name: 'S', + fields: { + a: { type: GraphQLString }, + }, + }), + }); + const document = parse(` + query Q { a } + mutation M { c } + subscription S { a } + `); + const rootValue = { a: 'b', c: 'd' }; + const operationName = 'Q'; + + const result = executeSync({ schema, document, rootValue, operationName }); + expect(result).to.deep.equal({ data: { a: 'b' } }); + }); + + it('uses the mutation schema for mutations', () => { + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Q', + fields: { + a: { type: GraphQLString }, + }, + }), + mutation: new GraphQLObjectType({ + name: 'M', + fields: { + c: { type: GraphQLString }, + }, + }), + }); + const document = parse(` + query Q { a } + mutation M { c } + `); + const rootValue = { a: 'b', c: 'd' }; + const operationName = 'M'; + + const result = executeSync({ schema, document, rootValue, operationName }); + expect(result).to.deep.equal({ data: { c: 'd' } }); + }); + + it('uses the subscription schema for subscriptions', () => { + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Q', + fields: { + a: { type: GraphQLString }, + }, + }), + subscription: new GraphQLObjectType({ + name: 'S', + fields: { + a: { type: GraphQLString }, + }, + }), + }); + const document = parse(` + query Q { a } + subscription S { a } + `); + const rootValue = { a: 'b', c: 'd' }; + const operationName = 'S'; + + const result = executeSync({ schema, document, rootValue, operationName }); + expect(result).to.deep.equal({ data: { a: 'b' } }); + }); + + it('resolves to an error if schema does not support operation', () => { + const schema = new GraphQLSchema({ assumeValid: true }); + + const document = parse(` + query Q { __typename } + mutation M { __typename } + subscription S { __typename } + `); + + expectJSON( + executeSync({ schema, document, operationName: 'Q' }), + ).toDeepEqual({ + data: null, + errors: [ + { + message: 'Schema is not configured to execute query operation.', + locations: [{ line: 2, column: 7 }], + }, + ], + }); + + expectJSON( + executeSync({ schema, document, operationName: 'M' }), + ).toDeepEqual({ + data: null, + errors: [ + { + message: 'Schema is not configured to execute mutation operation.', + locations: [{ line: 3, column: 7 }], + }, + ], + }); + + expectJSON( + executeSync({ schema, document, operationName: 'S' }), + ).toDeepEqual({ + data: null, + errors: [ + { + message: + 'Schema is not configured to execute subscription operation.', + locations: [{ line: 4, column: 7 }], + }, + ], + }); + }); + + it('correct field ordering despite execution order', async () => { + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Type', + fields: { + a: { type: GraphQLString }, + b: { type: GraphQLString }, + c: { type: GraphQLString }, + d: { type: GraphQLString }, + e: { type: GraphQLString }, + }, + }), + }); + const document = parse('{ a, b, c, d, e }'); + const rootValue = { + a: () => 'a', + b: () => new Promise((resolve) => resolve('b')), + c: () => 'c', + d: () => new Promise((resolve) => resolve('d')), + e: () => 'e', + }; + + const result = await execute({ schema, document, rootValue }); + expect(result).to.deep.equal({ + data: { a: 'a', b: 'b', c: 'c', d: 'd', e: 'e' }, + }); + }); + + it('Avoids recursion', () => { + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Type', + fields: { + a: { type: GraphQLString }, + }, + }), + }); + const document = parse(` + { + a + ...Frag + ...Frag + } + + fragment Frag on Type { + a, + ...Frag + } + `); + const rootValue = { a: 'b' }; + + const result = executeSync({ schema, document, rootValue }); + expect(result).to.deep.equal({ + data: { a: 'b' }, + }); + }); + + it('ignores missing sub selections on fields', () => { + const someType = new GraphQLObjectType({ + name: 'SomeType', + fields: { + b: { type: GraphQLString }, + }, + }); + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Query', + fields: { + a: { type: someType }, + }, + }), + }); + const document = parse('{ a }'); + const rootValue = { a: { b: 'c' } }; + + const result = executeSync({ schema, document, rootValue }); + expect(result).to.deep.equal({ + data: { a: {} }, + }); + }); + + it('does not include illegal fields in output', () => { + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Q', + fields: { + a: { type: GraphQLString }, + }, + }), + }); + const document = parse('{ thisIsIllegalDoNotIncludeMe }'); + + const result = executeSync({ schema, document }); + expect(result).to.deep.equal({ + data: {}, + }); + }); + + it('does not include arguments that were not set', () => { + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Type', + fields: { + field: { + type: GraphQLString, + resolve: (_source, args) => inspect(args), + args: { + a: { type: GraphQLBoolean }, + b: { type: GraphQLBoolean }, + c: { type: GraphQLBoolean }, + d: { type: GraphQLInt }, + e: { type: GraphQLInt }, + }, + }, + }, + }), + }); + const document = parse('{ field(a: true, c: false, e: 0) }'); + + const result = executeSync({ schema, document }); + expect(result).to.deep.equal({ + data: { + field: '{ a: true, c: false, e: 0 }', + }, + }); + }); + + it('fails when an isTypeOf check is not met', async () => { + class Special { + value: string; + + constructor(value: string) { + this.value = value; + } + } + + class NotSpecial { + value: string; + + constructor(value: string) { + this.value = value; + } + } + + const SpecialType = new GraphQLObjectType({ + name: 'SpecialType', + isTypeOf(obj, context) { + const result = obj instanceof Special; + return context?.async ? Promise.resolve(result) : result; + }, + fields: { value: { type: GraphQLString } }, + }); + + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Query', + fields: { + specials: { type: new GraphQLList(SpecialType) }, + }, + }), + }); + + const document = parse('{ specials { value } }'); + const rootValue = { + specials: [new Special('foo'), new NotSpecial('bar')], + }; + + const result = executeSync({ schema, document, rootValue }); + expectJSON(result).toDeepEqual({ + data: { + specials: [{ value: 'foo' }, null], + }, + errors: [ + { + message: + 'Expected value of type "SpecialType" but got: { value: "bar" }.', + locations: [{ line: 1, column: 3 }], + path: ['specials', 1], + }, + ], + }); + + const contextValue = { async: true }; + const asyncResult = await execute({ + schema, + document, + rootValue, + contextValue, + }); + expect(asyncResult).to.deep.equal(result); + }); + + it('fails when serialize of custom scalar does not return a value', () => { + const customScalar = new GraphQLScalarType({ + name: 'CustomScalar', + serialize() { + /* returns nothing */ + }, + }); + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Query', + fields: { + customScalar: { + type: customScalar, + resolve: () => 'CUSTOM_VALUE', + }, + }, + }), + }); + + const result = executeSync({ schema, document: parse('{ customScalar }') }); + expectJSON(result).toDeepEqual({ + data: { customScalar: null }, + errors: [ + { + message: + 'Expected `CustomScalar.serialize("CUSTOM_VALUE")` to return non-nullable value, returned: undefined', + locations: [{ line: 1, column: 3 }], + path: ['customScalar'], + }, + ], + }); + }); + + it('executes ignoring invalid non-executable definitions', () => { + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Query', + fields: { + foo: { type: GraphQLString }, + }, + }), + }); + + const document = parse(` + { foo } + + type Query { bar: String } + `); + + const result = executeSync({ schema, document }); + expect(result).to.deep.equal({ data: { foo: null } }); + }); + + it('uses a custom field resolver', () => { + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Query', + fields: { + foo: { type: GraphQLString }, + }, + }), + }); + const document = parse('{ foo }'); + + const result = executeSync({ + schema, + document, + fieldResolver(_source, _args, _context, info) { + // For the purposes of test, just return the name of the field! + return info.fieldName; + }, + }); + + expect(result).to.deep.equal({ data: { foo: 'foo' } }); + }); + + it('uses a custom type resolver', () => { + const document = parse('{ foo { bar } }'); + + const fooInterface = new GraphQLInterfaceType({ + name: 'FooInterface', + fields: { + bar: { type: GraphQLString }, + }, + }); + + const fooObject = new GraphQLObjectType({ + name: 'FooObject', + interfaces: [fooInterface], + fields: { + bar: { type: GraphQLString }, + }, + }); + + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Query', + fields: { + foo: { type: fooInterface }, + }, + }), + types: [fooObject], + }); + + const rootValue = { foo: { bar: 'bar' } }; + + let possibleTypes; + const result = executeSync({ + schema, + document, + rootValue, + typeResolver(_source, _context, info, abstractType) { + // Resolver should be able to figure out all possible types on its own + possibleTypes = info.schema.getPossibleTypes(abstractType); + + return 'FooObject'; + }, + }); + + expect(result).to.deep.equal({ data: { foo: { bar: 'bar' } } }); + expect(possibleTypes).to.deep.equal([fooObject]); + }); +}); diff --git a/src/execution/__tests__/lists-test.ts b/src/execution/__tests__/lists-test.ts new file mode 100644 index 00000000..ac6460d5 --- /dev/null +++ b/src/execution/__tests__/lists-test.ts @@ -0,0 +1,225 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { expectJSON } from '../../__testUtils__/expectJSON'; + +import { parse } from '../../language/parser'; + +import { buildSchema } from '../../utilities/buildASTSchema'; + +import { execute, executeSync } from '../execute'; + +describe('Execute: Accepts any iterable as list value', () => { + function complete(rootValue: unknown) { + return executeSync({ + schema: buildSchema('type Query { listField: [String] }'), + document: parse('{ listField }'), + rootValue, + }); + } + + it('Accepts a Set as a List value', () => { + const listField = new Set(['apple', 'banana', 'apple', 'coconut']); + + expect(complete({ listField })).to.deep.equal({ + data: { listField: ['apple', 'banana', 'coconut'] }, + }); + }); + + it('Accepts an Generator function as a List value', () => { + function* listField() { + yield 'one'; + yield 2; + yield true; + } + + expect(complete({ listField })).to.deep.equal({ + data: { listField: ['one', '2', 'true'] }, + }); + }); + + it('Accepts function arguments as a List value', () => { + function getArgs(..._args: ReadonlyArray) { + return arguments; + } + const listField = getArgs('one', 'two'); + + expect(complete({ listField })).to.deep.equal({ + data: { listField: ['one', 'two'] }, + }); + }); + + it('Does not accept (Iterable) String-literal as a List value', () => { + const listField = 'Singular'; + + expectJSON(complete({ listField })).toDeepEqual({ + data: { listField: null }, + errors: [ + { + message: + 'Expected Iterable, but did not find one for field "Query.listField".', + locations: [{ line: 1, column: 3 }], + path: ['listField'], + }, + ], + }); + }); +}); + +describe('Execute: Handles list nullability', () => { + async function complete(args: { listField: unknown; as: string }) { + const { listField, as } = args; + const schema = buildSchema(`type Query { listField: ${as} }`); + const document = parse('{ listField }'); + + const result = await executeQuery(listField); + // Promise> === Array + expectJSON(await executeQuery(promisify(listField))).toDeepEqual(result); + if (Array.isArray(listField)) { + const listOfPromises = listField.map(promisify); + + // Array> === Array + expectJSON(await executeQuery(listOfPromises)).toDeepEqual(result); + // Promise>> === Array + expectJSON(await executeQuery(promisify(listOfPromises))).toDeepEqual( + result, + ); + } + return result; + + function executeQuery(listValue: unknown) { + return execute({ schema, document, rootValue: { listField: listValue } }); + } + + function promisify(value: unknown): Promise { + return value instanceof Error + ? Promise.reject(value) + : Promise.resolve(value); + } + } + + it('Contains values', async () => { + const listField = [1, 2]; + + expect(await complete({ listField, as: '[Int]' })).to.deep.equal({ + data: { listField: [1, 2] }, + }); + expect(await complete({ listField, as: '[Int]!' })).to.deep.equal({ + data: { listField: [1, 2] }, + }); + expect(await complete({ listField, as: '[Int!]' })).to.deep.equal({ + data: { listField: [1, 2] }, + }); + expect(await complete({ listField, as: '[Int!]!' })).to.deep.equal({ + data: { listField: [1, 2] }, + }); + }); + + it('Contains null', async () => { + const listField = [1, null, 2]; + const errors = [ + { + message: 'Cannot return null for non-nullable field Query.listField.', + locations: [{ line: 1, column: 3 }], + path: ['listField', 1], + }, + ]; + + expect(await complete({ listField, as: '[Int]' })).to.deep.equal({ + data: { listField: [1, null, 2] }, + }); + expect(await complete({ listField, as: '[Int]!' })).to.deep.equal({ + data: { listField: [1, null, 2] }, + }); + expectJSON(await complete({ listField, as: '[Int!]' })).toDeepEqual({ + data: { listField: null }, + errors, + }); + expectJSON(await complete({ listField, as: '[Int!]!' })).toDeepEqual({ + data: null, + errors, + }); + }); + + it('Returns null', async () => { + const listField = null; + const errors = [ + { + message: 'Cannot return null for non-nullable field Query.listField.', + locations: [{ line: 1, column: 3 }], + path: ['listField'], + }, + ]; + + expect(await complete({ listField, as: '[Int]' })).to.deep.equal({ + data: { listField: null }, + }); + expectJSON(await complete({ listField, as: '[Int]!' })).toDeepEqual({ + data: null, + errors, + }); + expect(await complete({ listField, as: '[Int!]' })).to.deep.equal({ + data: { listField: null }, + }); + expectJSON(await complete({ listField, as: '[Int!]!' })).toDeepEqual({ + data: null, + errors, + }); + }); + + it('Contains error', async () => { + const listField = [1, new Error('bad'), 2]; + const errors = [ + { + message: 'bad', + locations: [{ line: 1, column: 3 }], + path: ['listField', 1], + }, + ]; + + expectJSON(await complete({ listField, as: '[Int]' })).toDeepEqual({ + data: { listField: [1, null, 2] }, + errors, + }); + expectJSON(await complete({ listField, as: '[Int]!' })).toDeepEqual({ + data: { listField: [1, null, 2] }, + errors, + }); + expectJSON(await complete({ listField, as: '[Int!]' })).toDeepEqual({ + data: { listField: null }, + errors, + }); + expectJSON(await complete({ listField, as: '[Int!]!' })).toDeepEqual({ + data: null, + errors, + }); + }); + + it('Results in error', async () => { + const listField = new Error('bad'); + const errors = [ + { + message: 'bad', + locations: [{ line: 1, column: 3 }], + path: ['listField'], + }, + ]; + + expectJSON(await complete({ listField, as: '[Int]' })).toDeepEqual({ + data: { listField: null }, + errors, + }); + expectJSON(await complete({ listField, as: '[Int]!' })).toDeepEqual({ + data: null, + errors, + }); + expectJSON(await complete({ listField, as: '[Int!]' })).toDeepEqual({ + data: { listField: null }, + errors, + }); + expectJSON(await complete({ listField, as: '[Int!]!' })).toDeepEqual({ + data: null, + errors, + }); + }); +}); diff --git a/src/execution/__tests__/mapAsyncIterator-test.ts b/src/execution/__tests__/mapAsyncIterator-test.ts new file mode 100644 index 00000000..ec01634e --- /dev/null +++ b/src/execution/__tests__/mapAsyncIterator-test.ts @@ -0,0 +1,336 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { mapAsyncIterator } from '../mapAsyncIterator'; + +/* eslint-disable @typescript-eslint/require-await */ +describe('mapAsyncIterator', () => { + it('maps over async generator', async () => { + async function* source() { + yield 1; + yield 2; + yield 3; + } + + const doubles = mapAsyncIterator(source(), (x) => x + x); + + expect(await doubles.next()).to.deep.equal({ value: 2, done: false }); + expect(await doubles.next()).to.deep.equal({ value: 4, done: false }); + expect(await doubles.next()).to.deep.equal({ value: 6, done: false }); + expect(await doubles.next()).to.deep.equal({ + value: undefined, + done: true, + }); + }); + + it('maps over async iterable', async () => { + const items = [1, 2, 3]; + + const iterable = { + [Symbol.asyncIterator]() { + return this; + }, + + next(): Promise> { + if (items.length > 0) { + const value = items[0]; + items.shift(); + return Promise.resolve({ done: false, value }); + } + + return Promise.resolve({ done: true, value: undefined }); + }, + }; + + const doubles = mapAsyncIterator(iterable, (x) => x + x); + + expect(await doubles.next()).to.deep.equal({ value: 2, done: false }); + expect(await doubles.next()).to.deep.equal({ value: 4, done: false }); + expect(await doubles.next()).to.deep.equal({ value: 6, done: false }); + expect(await doubles.next()).to.deep.equal({ + value: undefined, + done: true, + }); + }); + + it('compatible with for-await-of', async () => { + async function* source() { + yield 1; + yield 2; + yield 3; + } + + const doubles = mapAsyncIterator(source(), (x) => x + x); + + const result = []; + for await (const x of doubles) { + result.push(x); + } + expect(result).to.deep.equal([2, 4, 6]); + }); + + it('maps over async values with async function', async () => { + async function* source() { + yield 1; + yield 2; + yield 3; + } + + const doubles = mapAsyncIterator(source(), (x) => Promise.resolve(x + x)); + + expect(await doubles.next()).to.deep.equal({ value: 2, done: false }); + expect(await doubles.next()).to.deep.equal({ value: 4, done: false }); + expect(await doubles.next()).to.deep.equal({ value: 6, done: false }); + expect(await doubles.next()).to.deep.equal({ + value: undefined, + done: true, + }); + }); + + it('allows returning early from mapped async generator', async () => { + async function* source() { + try { + yield 1; + /* c8 ignore next 2 */ + yield 2; + yield 3; // Shouldn't be reached. + } finally { + // eslint-disable-next-line no-unsafe-finally + return 'The End'; + } + } + + const doubles = mapAsyncIterator(source(), (x) => x + x); + + expect(await doubles.next()).to.deep.equal({ value: 2, done: false }); + expect(await doubles.next()).to.deep.equal({ value: 4, done: false }); + + // Early return + expect(await doubles.return('')).to.deep.equal({ + value: 'The End', + done: true, + }); + + // Subsequent next calls + expect(await doubles.next()).to.deep.equal({ + value: undefined, + done: true, + }); + expect(await doubles.next()).to.deep.equal({ + value: undefined, + done: true, + }); + }); + + it('allows returning early from mapped async iterable', async () => { + const items = [1, 2, 3]; + + const iterable = { + [Symbol.asyncIterator]() { + return this; + }, + next() { + const value = items[0]; + items.shift(); + return Promise.resolve({ + done: items.length === 0, + value, + }); + }, + }; + + const doubles = mapAsyncIterator(iterable, (x) => x + x); + + expect(await doubles.next()).to.deep.equal({ value: 2, done: false }); + expect(await doubles.next()).to.deep.equal({ value: 4, done: false }); + + // Early return + expect(await doubles.return(0)).to.deep.equal({ + value: undefined, + done: true, + }); + }); + + it('passes through early return from async values', async () => { + async function* source() { + try { + yield 'a'; + /* c8 ignore next 2 */ + yield 'b'; + yield 'c'; // Shouldn't be reached. + } finally { + yield 'Done'; + yield 'Last'; + } + } + + const doubles = mapAsyncIterator(source(), (x) => x + x); + + expect(await doubles.next()).to.deep.equal({ value: 'aa', done: false }); + expect(await doubles.next()).to.deep.equal({ value: 'bb', done: false }); + + // Early return + expect(await doubles.return()).to.deep.equal({ + value: 'DoneDone', + done: false, + }); + + // Subsequent next calls may yield from finally block + expect(await doubles.next()).to.deep.equal({ + value: 'LastLast', + done: false, + }); + expect(await doubles.next()).to.deep.equal({ + value: undefined, + done: true, + }); + }); + + it('allows throwing errors through async iterable', async () => { + const items = [1, 2, 3]; + + const iterable = { + [Symbol.asyncIterator]() { + return this; + }, + next() { + const value = items[0]; + items.shift(); + return Promise.resolve({ + done: items.length === 0, + value, + }); + }, + }; + + const doubles = mapAsyncIterator(iterable, (x) => x + x); + + expect(await doubles.next()).to.deep.equal({ value: 2, done: false }); + expect(await doubles.next()).to.deep.equal({ value: 4, done: false }); + + // Throw error + let caughtError; + try { + /* c8 ignore next */ + await doubles.throw('ouch'); + } catch (e) { + caughtError = e; + } + expect(caughtError).to.equal('ouch'); + }); + + it('passes through caught errors through async generators', async () => { + async function* source() { + try { + yield 1; + /* c8 ignore next 2 */ + yield 2; + yield 3; // Shouldn't be reached. + } catch (e) { + yield e; + } + } + + const doubles = mapAsyncIterator(source(), (x) => x + x); + + expect(await doubles.next()).to.deep.equal({ value: 2, done: false }); + expect(await doubles.next()).to.deep.equal({ value: 4, done: false }); + + // Throw error + expect(await doubles.throw('Ouch')).to.deep.equal({ + value: 'OuchOuch', + done: false, + }); + + expect(await doubles.next()).to.deep.equal({ + value: undefined, + done: true, + }); + expect(await doubles.next()).to.deep.equal({ + value: undefined, + done: true, + }); + }); + + it('does not normally map over thrown errors', async () => { + async function* source() { + yield 'Hello'; + throw new Error('Goodbye'); + } + + const doubles = mapAsyncIterator(source(), (x) => x + x); + + expect(await doubles.next()).to.deep.equal({ + value: 'HelloHello', + done: false, + }); + + let caughtError; + try { + /* c8 ignore next */ + await doubles.next(); + } catch (e) { + caughtError = e; + } + + expect(caughtError) + .to.be.an.instanceOf(Error) + .with.property('message', 'Goodbye'); + }); + + async function testClosesSourceWithMapper(mapper: (value: number) => T) { + let didVisitFinally = false; + + async function* source() { + try { + yield 1; + /* c8 ignore next 2 */ + yield 2; + yield 3; // Shouldn't be reached. + } finally { + didVisitFinally = true; + yield 1000; + } + } + + const throwOver1 = mapAsyncIterator(source(), mapper); + + expect(await throwOver1.next()).to.deep.equal({ value: 1, done: false }); + + let expectedError; + try { + /* c8 ignore next */ + await throwOver1.next(); + } catch (error) { + expectedError = error; + } + + expect(expectedError) + .to.be.an.instanceOf(Error) + .with.property('message', 'Cannot count to 2'); + + expect(await throwOver1.next()).to.deep.equal({ + value: undefined, + done: true, + }); + + expect(didVisitFinally).to.equal(true); + } + + it('closes source if mapper throws an error', async () => { + await testClosesSourceWithMapper((x) => { + if (x > 1) { + throw new Error('Cannot count to ' + x); + } + return x; + }); + }); + + it('closes source if mapper rejects', async () => { + await testClosesSourceWithMapper((x) => + x > 1 + ? Promise.reject(new Error('Cannot count to ' + x)) + : Promise.resolve(x), + ); + }); +}); diff --git a/src/execution/__tests__/mutations-test.ts b/src/execution/__tests__/mutations-test.ts new file mode 100644 index 00000000..0f0ad1cb --- /dev/null +++ b/src/execution/__tests__/mutations-test.ts @@ -0,0 +1,194 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { expectJSON } from '../../__testUtils__/expectJSON'; +import { resolveOnNextTick } from '../../__testUtils__/resolveOnNextTick'; + +import { parse } from '../../language/parser'; + +import { GraphQLObjectType } from '../../type/definition'; +import { GraphQLInt } from '../../type/scalars'; +import { GraphQLSchema } from '../../type/schema'; + +import { execute, executeSync } from '../execute'; + +class NumberHolder { + theNumber: number; + + constructor(originalNumber: number) { + this.theNumber = originalNumber; + } +} + +class Root { + numberHolder: NumberHolder; + + constructor(originalNumber: number) { + this.numberHolder = new NumberHolder(originalNumber); + } + + immediatelyChangeTheNumber(newNumber: number): NumberHolder { + this.numberHolder.theNumber = newNumber; + return this.numberHolder; + } + + async promiseToChangeTheNumber(newNumber: number): Promise { + await resolveOnNextTick(); + return this.immediatelyChangeTheNumber(newNumber); + } + + failToChangeTheNumber(): NumberHolder { + throw new Error('Cannot change the number'); + } + + async promiseAndFailToChangeTheNumber(): Promise { + await resolveOnNextTick(); + throw new Error('Cannot change the number'); + } +} + +const numberHolderType = new GraphQLObjectType({ + fields: { + theNumber: { type: GraphQLInt }, + }, + name: 'NumberHolder', +}); + +const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + fields: { + numberHolder: { type: numberHolderType }, + }, + name: 'Query', + }), + mutation: new GraphQLObjectType({ + fields: { + immediatelyChangeTheNumber: { + type: numberHolderType, + args: { newNumber: { type: GraphQLInt } }, + resolve(obj, { newNumber }) { + return obj.immediatelyChangeTheNumber(newNumber); + }, + }, + promiseToChangeTheNumber: { + type: numberHolderType, + args: { newNumber: { type: GraphQLInt } }, + resolve(obj, { newNumber }) { + return obj.promiseToChangeTheNumber(newNumber); + }, + }, + failToChangeTheNumber: { + type: numberHolderType, + args: { newNumber: { type: GraphQLInt } }, + resolve(obj, { newNumber }) { + return obj.failToChangeTheNumber(newNumber); + }, + }, + promiseAndFailToChangeTheNumber: { + type: numberHolderType, + args: { newNumber: { type: GraphQLInt } }, + resolve(obj, { newNumber }) { + return obj.promiseAndFailToChangeTheNumber(newNumber); + }, + }, + }, + name: 'Mutation', + }), +}); + +describe('Execute: Handles mutation execution ordering', () => { + it('evaluates mutations serially', async () => { + const document = parse(` + mutation M { + first: immediatelyChangeTheNumber(newNumber: 1) { + theNumber + }, + second: promiseToChangeTheNumber(newNumber: 2) { + theNumber + }, + third: immediatelyChangeTheNumber(newNumber: 3) { + theNumber + } + fourth: promiseToChangeTheNumber(newNumber: 4) { + theNumber + }, + fifth: immediatelyChangeTheNumber(newNumber: 5) { + theNumber + } + } + `); + + const rootValue = new Root(6); + const mutationResult = await execute({ schema, document, rootValue }); + + expect(mutationResult).to.deep.equal({ + data: { + first: { theNumber: 1 }, + second: { theNumber: 2 }, + third: { theNumber: 3 }, + fourth: { theNumber: 4 }, + fifth: { theNumber: 5 }, + }, + }); + }); + + it('does not include illegal mutation fields in output', () => { + const document = parse('mutation { thisIsIllegalDoNotIncludeMe }'); + + const result = executeSync({ schema, document }); + expect(result).to.deep.equal({ + data: {}, + }); + }); + + it('evaluates mutations correctly in the presence of a failed mutation', async () => { + const document = parse(` + mutation M { + first: immediatelyChangeTheNumber(newNumber: 1) { + theNumber + }, + second: promiseToChangeTheNumber(newNumber: 2) { + theNumber + }, + third: failToChangeTheNumber(newNumber: 3) { + theNumber + } + fourth: promiseToChangeTheNumber(newNumber: 4) { + theNumber + }, + fifth: immediatelyChangeTheNumber(newNumber: 5) { + theNumber + } + sixth: promiseAndFailToChangeTheNumber(newNumber: 6) { + theNumber + } + } + `); + + const rootValue = new Root(6); + const result = await execute({ schema, document, rootValue }); + + expectJSON(result).toDeepEqual({ + data: { + first: { theNumber: 1 }, + second: { theNumber: 2 }, + third: null, + fourth: { theNumber: 4 }, + fifth: { theNumber: 5 }, + sixth: null, + }, + errors: [ + { + message: 'Cannot change the number', + locations: [{ line: 9, column: 9 }], + path: ['third'], + }, + { + message: 'Cannot change the number', + locations: [{ line: 18, column: 9 }], + path: ['sixth'], + }, + ], + }); + }); +}); diff --git a/src/execution/__tests__/nonnull-test.ts b/src/execution/__tests__/nonnull-test.ts new file mode 100644 index 00000000..427f2a64 --- /dev/null +++ b/src/execution/__tests__/nonnull-test.ts @@ -0,0 +1,714 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { expectJSON } from '../../__testUtils__/expectJSON'; + +import { parse } from '../../language/parser'; + +import { GraphQLNonNull, GraphQLObjectType } from '../../type/definition'; +import { GraphQLString } from '../../type/scalars'; +import { GraphQLSchema } from '../../type/schema'; + +import { buildSchema } from '../../utilities/buildASTSchema'; + +import type { ExecutionResult } from '../execute'; +import { execute, executeSync } from '../execute'; + +const syncError = new Error('sync'); +const syncNonNullError = new Error('syncNonNull'); +const promiseError = new Error('promise'); +const promiseNonNullError = new Error('promiseNonNull'); + +const throwingData = { + sync() { + throw syncError; + }, + syncNonNull() { + throw syncNonNullError; + }, + promise() { + return new Promise(() => { + throw promiseError; + }); + }, + promiseNonNull() { + return new Promise(() => { + throw promiseNonNullError; + }); + }, + syncNest() { + return throwingData; + }, + syncNonNullNest() { + return throwingData; + }, + promiseNest() { + return new Promise((resolve) => { + resolve(throwingData); + }); + }, + promiseNonNullNest() { + return new Promise((resolve) => { + resolve(throwingData); + }); + }, +}; + +const nullingData = { + sync() { + return null; + }, + syncNonNull() { + return null; + }, + promise() { + return new Promise((resolve) => { + resolve(null); + }); + }, + promiseNonNull() { + return new Promise((resolve) => { + resolve(null); + }); + }, + syncNest() { + return nullingData; + }, + syncNonNullNest() { + return nullingData; + }, + promiseNest() { + return new Promise((resolve) => { + resolve(nullingData); + }); + }, + promiseNonNullNest() { + return new Promise((resolve) => { + resolve(nullingData); + }); + }, +}; + +const schema = buildSchema(` + type DataType { + sync: String + syncNonNull: String! + promise: String + promiseNonNull: String! + syncNest: DataType + syncNonNullNest: DataType! + promiseNest: DataType + promiseNonNullNest: DataType! + } + + schema { + query: DataType + } +`); + +function executeQuery( + query: string, + rootValue: unknown, +): ExecutionResult | Promise { + return execute({ schema, document: parse(query), rootValue }); +} + +function patch(str: string): string { + return str + .replace(/\bsync\b/g, 'promise') + .replace(/\bsyncNonNull\b/g, 'promiseNonNull'); +} + +// avoids also doing any nests +function patchData(data: ExecutionResult): ExecutionResult { + return JSON.parse(patch(JSON.stringify(data))); +} + +async function executeSyncAndAsync(query: string, rootValue: unknown) { + const syncResult = executeSync({ schema, document: parse(query), rootValue }); + const asyncResult = await execute({ + schema, + document: parse(patch(query)), + rootValue, + }); + + expectJSON(asyncResult).toDeepEqual(patchData(syncResult)); + return syncResult; +} + +describe('Execute: handles non-nullable types', () => { + describe('nulls a nullable field', () => { + const query = ` + { + sync + } + `; + + it('that returns null', async () => { + const result = await executeSyncAndAsync(query, nullingData); + expect(result).to.deep.equal({ + data: { sync: null }, + }); + }); + + it('that throws', async () => { + const result = await executeSyncAndAsync(query, throwingData); + expectJSON(result).toDeepEqual({ + data: { sync: null }, + errors: [ + { + message: syncError.message, + path: ['sync'], + locations: [{ line: 3, column: 9 }], + }, + ], + }); + }); + }); + + describe('nulls a returned object that contains a non-nullable field', () => { + const query = ` + { + syncNest { + syncNonNull, + } + } + `; + + it('that returns null', async () => { + const result = await executeSyncAndAsync(query, nullingData); + expectJSON(result).toDeepEqual({ + data: { syncNest: null }, + errors: [ + { + message: + 'Cannot return null for non-nullable field DataType.syncNonNull.', + path: ['syncNest', 'syncNonNull'], + locations: [{ line: 4, column: 11 }], + }, + ], + }); + }); + + it('that throws', async () => { + const result = await executeSyncAndAsync(query, throwingData); + expectJSON(result).toDeepEqual({ + data: { syncNest: null }, + errors: [ + { + message: syncNonNullError.message, + path: ['syncNest', 'syncNonNull'], + locations: [{ line: 4, column: 11 }], + }, + ], + }); + }); + }); + + describe('nulls a complex tree of nullable fields, each', () => { + const query = ` + { + syncNest { + sync + promise + syncNest { sync promise } + promiseNest { sync promise } + } + promiseNest { + sync + promise + syncNest { sync promise } + promiseNest { sync promise } + } + } + `; + const data = { + syncNest: { + sync: null, + promise: null, + syncNest: { sync: null, promise: null }, + promiseNest: { sync: null, promise: null }, + }, + promiseNest: { + sync: null, + promise: null, + syncNest: { sync: null, promise: null }, + promiseNest: { sync: null, promise: null }, + }, + }; + + it('that returns null', async () => { + const result = await executeQuery(query, nullingData); + expect(result).to.deep.equal({ data }); + }); + + it('that throws', async () => { + const result = await executeQuery(query, throwingData); + expectJSON(result).toDeepEqual({ + data, + errors: [ + { + message: syncError.message, + path: ['syncNest', 'sync'], + locations: [{ line: 4, column: 11 }], + }, + { + message: syncError.message, + path: ['syncNest', 'syncNest', 'sync'], + locations: [{ line: 6, column: 22 }], + }, + { + message: syncError.message, + path: ['syncNest', 'promiseNest', 'sync'], + locations: [{ line: 7, column: 25 }], + }, + { + message: syncError.message, + path: ['promiseNest', 'sync'], + locations: [{ line: 10, column: 11 }], + }, + { + message: syncError.message, + path: ['promiseNest', 'syncNest', 'sync'], + locations: [{ line: 12, column: 22 }], + }, + { + message: promiseError.message, + path: ['syncNest', 'promise'], + locations: [{ line: 5, column: 11 }], + }, + { + message: promiseError.message, + path: ['syncNest', 'syncNest', 'promise'], + locations: [{ line: 6, column: 27 }], + }, + { + message: syncError.message, + path: ['promiseNest', 'promiseNest', 'sync'], + locations: [{ line: 13, column: 25 }], + }, + { + message: promiseError.message, + path: ['syncNest', 'promiseNest', 'promise'], + locations: [{ line: 7, column: 30 }], + }, + { + message: promiseError.message, + path: ['promiseNest', 'promise'], + locations: [{ line: 11, column: 11 }], + }, + { + message: promiseError.message, + path: ['promiseNest', 'syncNest', 'promise'], + locations: [{ line: 12, column: 27 }], + }, + { + message: promiseError.message, + path: ['promiseNest', 'promiseNest', 'promise'], + locations: [{ line: 13, column: 30 }], + }, + ], + }); + }); + }); + + describe('nulls the first nullable object after a field in a long chain of non-null fields', () => { + const query = ` + { + syncNest { + syncNonNullNest { + promiseNonNullNest { + syncNonNullNest { + promiseNonNullNest { + syncNonNull + } + } + } + } + } + promiseNest { + syncNonNullNest { + promiseNonNullNest { + syncNonNullNest { + promiseNonNullNest { + syncNonNull + } + } + } + } + } + anotherNest: syncNest { + syncNonNullNest { + promiseNonNullNest { + syncNonNullNest { + promiseNonNullNest { + promiseNonNull + } + } + } + } + } + anotherPromiseNest: promiseNest { + syncNonNullNest { + promiseNonNullNest { + syncNonNullNest { + promiseNonNullNest { + promiseNonNull + } + } + } + } + } + } + `; + const data = { + syncNest: null, + promiseNest: null, + anotherNest: null, + anotherPromiseNest: null, + }; + + it('that returns null', async () => { + const result = await executeQuery(query, nullingData); + expectJSON(result).toDeepEqual({ + data, + errors: [ + { + message: + 'Cannot return null for non-nullable field DataType.syncNonNull.', + path: [ + 'syncNest', + 'syncNonNullNest', + 'promiseNonNullNest', + 'syncNonNullNest', + 'promiseNonNullNest', + 'syncNonNull', + ], + locations: [{ line: 8, column: 19 }], + }, + { + message: + 'Cannot return null for non-nullable field DataType.syncNonNull.', + path: [ + 'promiseNest', + 'syncNonNullNest', + 'promiseNonNullNest', + 'syncNonNullNest', + 'promiseNonNullNest', + 'syncNonNull', + ], + locations: [{ line: 19, column: 19 }], + }, + { + message: + 'Cannot return null for non-nullable field DataType.promiseNonNull.', + path: [ + 'anotherNest', + 'syncNonNullNest', + 'promiseNonNullNest', + 'syncNonNullNest', + 'promiseNonNullNest', + 'promiseNonNull', + ], + locations: [{ line: 30, column: 19 }], + }, + { + message: + 'Cannot return null for non-nullable field DataType.promiseNonNull.', + path: [ + 'anotherPromiseNest', + 'syncNonNullNest', + 'promiseNonNullNest', + 'syncNonNullNest', + 'promiseNonNullNest', + 'promiseNonNull', + ], + locations: [{ line: 41, column: 19 }], + }, + ], + }); + }); + + it('that throws', async () => { + const result = await executeQuery(query, throwingData); + expectJSON(result).toDeepEqual({ + data, + errors: [ + { + message: syncNonNullError.message, + path: [ + 'syncNest', + 'syncNonNullNest', + 'promiseNonNullNest', + 'syncNonNullNest', + 'promiseNonNullNest', + 'syncNonNull', + ], + locations: [{ line: 8, column: 19 }], + }, + { + message: syncNonNullError.message, + path: [ + 'promiseNest', + 'syncNonNullNest', + 'promiseNonNullNest', + 'syncNonNullNest', + 'promiseNonNullNest', + 'syncNonNull', + ], + locations: [{ line: 19, column: 19 }], + }, + { + message: promiseNonNullError.message, + path: [ + 'anotherNest', + 'syncNonNullNest', + 'promiseNonNullNest', + 'syncNonNullNest', + 'promiseNonNullNest', + 'promiseNonNull', + ], + locations: [{ line: 30, column: 19 }], + }, + { + message: promiseNonNullError.message, + path: [ + 'anotherPromiseNest', + 'syncNonNullNest', + 'promiseNonNullNest', + 'syncNonNullNest', + 'promiseNonNullNest', + 'promiseNonNull', + ], + locations: [{ line: 41, column: 19 }], + }, + ], + }); + }); + }); + + describe('nulls the top level if non-nullable field', () => { + const query = ` + { + syncNonNull + } + `; + + it('that returns null', async () => { + const result = await executeSyncAndAsync(query, nullingData); + expectJSON(result).toDeepEqual({ + data: null, + errors: [ + { + message: + 'Cannot return null for non-nullable field DataType.syncNonNull.', + path: ['syncNonNull'], + locations: [{ line: 3, column: 9 }], + }, + ], + }); + }); + + it('that throws', async () => { + const result = await executeSyncAndAsync(query, throwingData); + expectJSON(result).toDeepEqual({ + data: null, + errors: [ + { + message: syncNonNullError.message, + path: ['syncNonNull'], + locations: [{ line: 3, column: 9 }], + }, + ], + }); + }); + }); + + describe('Handles non-null argument', () => { + const schemaWithNonNullArg = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Query', + fields: { + withNonNullArg: { + type: GraphQLString, + args: { + cannotBeNull: { + type: new GraphQLNonNull(GraphQLString), + }, + }, + resolve: (_, args) => 'Passed: ' + String(args.cannotBeNull), + }, + }, + }), + }); + + it('succeeds when passed non-null literal value', () => { + const result = executeSync({ + schema: schemaWithNonNullArg, + document: parse(` + query { + withNonNullArg (cannotBeNull: "literal value") + } + `), + }); + + expect(result).to.deep.equal({ + data: { + withNonNullArg: 'Passed: literal value', + }, + }); + }); + + it('succeeds when passed non-null variable value', () => { + const result = executeSync({ + schema: schemaWithNonNullArg, + document: parse(` + query ($testVar: String!) { + withNonNullArg (cannotBeNull: $testVar) + } + `), + variableValues: { + testVar: 'variable value', + }, + }); + + expect(result).to.deep.equal({ + data: { + withNonNullArg: 'Passed: variable value', + }, + }); + }); + + it('succeeds when missing variable has default value', () => { + const result = executeSync({ + schema: schemaWithNonNullArg, + document: parse(` + query ($testVar: String = "default value") { + withNonNullArg (cannotBeNull: $testVar) + } + `), + variableValues: { + // Intentionally missing variable + }, + }); + + expect(result).to.deep.equal({ + data: { + withNonNullArg: 'Passed: default value', + }, + }); + }); + + it('field error when missing non-null arg', () => { + // Note: validation should identify this issue first (missing args rule) + // however execution should still protect against this. + const result = executeSync({ + schema: schemaWithNonNullArg, + document: parse(` + query { + withNonNullArg + } + `), + }); + + expectJSON(result).toDeepEqual({ + data: { + withNonNullArg: null, + }, + errors: [ + { + message: + 'Argument "cannotBeNull" of required type "String!" was not provided.', + locations: [{ line: 3, column: 13 }], + path: ['withNonNullArg'], + }, + ], + }); + }); + + it('field error when non-null arg provided null', () => { + // Note: validation should identify this issue first (values of correct + // type rule) however execution should still protect against this. + const result = executeSync({ + schema: schemaWithNonNullArg, + document: parse(` + query { + withNonNullArg(cannotBeNull: null) + } + `), + }); + + expectJSON(result).toDeepEqual({ + data: { + withNonNullArg: null, + }, + errors: [ + { + message: + 'Argument "cannotBeNull" of non-null type "String!" must not be null.', + locations: [{ line: 3, column: 42 }], + path: ['withNonNullArg'], + }, + ], + }); + }); + + it('field error when non-null arg not provided variable value', () => { + // Note: validation should identify this issue first (variables in allowed + // position rule) however execution should still protect against this. + const result = executeSync({ + schema: schemaWithNonNullArg, + document: parse(` + query ($testVar: String) { + withNonNullArg(cannotBeNull: $testVar) + } + `), + variableValues: { + // Intentionally missing variable + }, + }); + + expectJSON(result).toDeepEqual({ + data: { + withNonNullArg: null, + }, + errors: [ + { + message: + 'Argument "cannotBeNull" of required type "String!" was provided the variable "$testVar" which was not provided a runtime value.', + locations: [{ line: 3, column: 42 }], + path: ['withNonNullArg'], + }, + ], + }); + }); + + it('field error when non-null arg provided variable with explicit null value', () => { + const result = executeSync({ + schema: schemaWithNonNullArg, + document: parse(` + query ($testVar: String = "default value") { + withNonNullArg (cannotBeNull: $testVar) + } + `), + variableValues: { + testVar: null, + }, + }); + + expectJSON(result).toDeepEqual({ + data: { + withNonNullArg: null, + }, + errors: [ + { + message: + 'Argument "cannotBeNull" of non-null type "String!" must not be null.', + locations: [{ line: 3, column: 43 }], + path: ['withNonNullArg'], + }, + ], + }); + }); + }); +}); diff --git a/src/execution/__tests__/resolve-test.ts b/src/execution/__tests__/resolve-test.ts new file mode 100644 index 00000000..a34da196 --- /dev/null +++ b/src/execution/__tests__/resolve-test.ts @@ -0,0 +1,129 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { parse } from '../../language/parser'; + +import type { GraphQLFieldConfig } from '../../type/definition'; +import { GraphQLObjectType } from '../../type/definition'; +import { GraphQLInt, GraphQLString } from '../../type/scalars'; +import { GraphQLSchema } from '../../type/schema'; + +import { executeSync } from '../execute'; + +describe('Execute: resolve function', () => { + function testSchema(testField: GraphQLFieldConfig) { + return new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Query', + fields: { + test: testField, + }, + }), + }); + } + + it('default function accesses properties', () => { + const result = executeSync({ + schema: testSchema({ type: GraphQLString }), + document: parse('{ test }'), + rootValue: { test: 'testValue' }, + }); + + expect(result).to.deep.equal({ + data: { + test: 'testValue', + }, + }); + }); + + it('default function calls methods', () => { + const rootValue = { + _secret: 'secretValue', + test() { + return this._secret; + }, + }; + + const result = executeSync({ + schema: testSchema({ type: GraphQLString }), + document: parse('{ test }'), + rootValue, + }); + expect(result).to.deep.equal({ + data: { + test: 'secretValue', + }, + }); + }); + + it('default function passes args and context', () => { + class Adder { + _num: number; + + constructor(num: number) { + this._num = num; + } + + test(args: { addend1: number }, context: { addend2: number }) { + return this._num + args.addend1 + context.addend2; + } + } + const rootValue = new Adder(700); + + const schema = testSchema({ + type: GraphQLInt, + args: { + addend1: { type: GraphQLInt }, + }, + }); + const contextValue = { addend2: 9 }; + const document = parse('{ test(addend1: 80) }'); + + const result = executeSync({ schema, document, rootValue, contextValue }); + expect(result).to.deep.equal({ + data: { test: 789 }, + }); + }); + + it('uses provided resolve function', () => { + const schema = testSchema({ + type: GraphQLString, + args: { + aStr: { type: GraphQLString }, + aInt: { type: GraphQLInt }, + }, + resolve: (source, args) => JSON.stringify([source, args]), + }); + + function executeQuery(query: string, rootValue?: unknown) { + const document = parse(query); + return executeSync({ schema, document, rootValue }); + } + + expect(executeQuery('{ test }')).to.deep.equal({ + data: { + test: '[null,{}]', + }, + }); + + expect(executeQuery('{ test }', 'Source!')).to.deep.equal({ + data: { + test: '["Source!",{}]', + }, + }); + + expect(executeQuery('{ test(aStr: "String!") }', 'Source!')).to.deep.equal({ + data: { + test: '["Source!",{"aStr":"String!"}]', + }, + }); + + expect( + executeQuery('{ test(aInt: -123, aStr: "String!") }', 'Source!'), + ).to.deep.equal({ + data: { + test: '["Source!",{"aStr":"String!","aInt":-123}]', + }, + }); + }); +}); diff --git a/src/execution/__tests__/schema-test.ts b/src/execution/__tests__/schema-test.ts new file mode 100644 index 00000000..f9b4e474 --- /dev/null +++ b/src/execution/__tests__/schema-test.ts @@ -0,0 +1,188 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { parse } from '../../language/parser'; + +import { + GraphQLList, + GraphQLNonNull, + GraphQLObjectType, +} from '../../type/definition'; +import { + GraphQLBoolean, + GraphQLID, + GraphQLInt, + GraphQLString, +} from '../../type/scalars'; +import { GraphQLSchema } from '../../type/schema'; + +import { executeSync } from '../execute'; + +describe('Execute: Handles execution with a complex schema', () => { + it('executes using a schema', () => { + const BlogImage = new GraphQLObjectType({ + name: 'Image', + fields: { + url: { type: GraphQLString }, + width: { type: GraphQLInt }, + height: { type: GraphQLInt }, + }, + }); + + const BlogAuthor: GraphQLObjectType = new GraphQLObjectType({ + name: 'Author', + fields: () => ({ + id: { type: GraphQLString }, + name: { type: GraphQLString }, + pic: { + args: { width: { type: GraphQLInt }, height: { type: GraphQLInt } }, + type: BlogImage, + resolve: (obj, { width, height }) => obj.pic(width, height), + }, + recentArticle: { type: BlogArticle }, + }), + }); + + const BlogArticle = new GraphQLObjectType({ + name: 'Article', + fields: { + id: { type: new GraphQLNonNull(GraphQLString) }, + isPublished: { type: GraphQLBoolean }, + author: { type: BlogAuthor }, + title: { type: GraphQLString }, + body: { type: GraphQLString }, + keywords: { type: new GraphQLList(GraphQLString) }, + }, + }); + + const BlogQuery = new GraphQLObjectType({ + name: 'Query', + fields: { + article: { + type: BlogArticle, + args: { id: { type: GraphQLID } }, + resolve: (_, { id }) => article(id), + }, + feed: { + type: new GraphQLList(BlogArticle), + resolve: () => [ + article(1), + article(2), + article(3), + article(4), + article(5), + article(6), + article(7), + article(8), + article(9), + article(10), + ], + }, + }, + }); + + const BlogSchema = new GraphQLSchema({ + query: BlogQuery, + }); + + function article(id: number) { + return { + id, + isPublished: true, + author: { + id: 123, + name: 'John Smith', + pic: (width: number, height: number) => getPic(123, width, height), + recentArticle: () => article(1), + }, + title: 'My Article ' + id, + body: 'This is a post', + hidden: 'This data is not exposed in the schema', + keywords: ['foo', 'bar', 1, true, null], + }; + } + + function getPic(uid: number, width: number, height: number) { + return { + url: `cdn://${uid}`, + width: `${width}`, + height: `${height}`, + }; + } + + const document = parse(` + { + feed { + id, + title + }, + article(id: "1") { + ...articleFields, + author { + id, + name, + pic(width: 640, height: 480) { + url, + width, + height + }, + recentArticle { + ...articleFields, + keywords + } + } + } + } + + fragment articleFields on Article { + id, + isPublished, + title, + body, + hidden, + notDefined + } + `); + + // Note: this is intentionally not validating to ensure appropriate + // behavior occurs when executing an invalid query. + expect(executeSync({ schema: BlogSchema, document })).to.deep.equal({ + data: { + feed: [ + { id: '1', title: 'My Article 1' }, + { id: '2', title: 'My Article 2' }, + { id: '3', title: 'My Article 3' }, + { id: '4', title: 'My Article 4' }, + { id: '5', title: 'My Article 5' }, + { id: '6', title: 'My Article 6' }, + { id: '7', title: 'My Article 7' }, + { id: '8', title: 'My Article 8' }, + { id: '9', title: 'My Article 9' }, + { id: '10', title: 'My Article 10' }, + ], + article: { + id: '1', + isPublished: true, + title: 'My Article 1', + body: 'This is a post', + author: { + id: '123', + name: 'John Smith', + pic: { + url: 'cdn://123', + width: 640, + height: 480, + }, + recentArticle: { + id: '1', + isPublished: true, + title: 'My Article 1', + body: 'This is a post', + keywords: ['foo', 'bar', '1', 'true', null], + }, + }, + }, + }, + }); + }); +}); diff --git a/src/execution/__tests__/simplePubSub-test.ts b/src/execution/__tests__/simplePubSub-test.ts new file mode 100644 index 00000000..e919d770 --- /dev/null +++ b/src/execution/__tests__/simplePubSub-test.ts @@ -0,0 +1,55 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { SimplePubSub } from './simplePubSub'; + +describe('SimplePubSub', () => { + it('subscribe async-iterator mock', async () => { + const pubsub = new SimplePubSub(); + const iterator = pubsub.getSubscriber((x) => x); + + // Queue up publishes + expect(pubsub.emit('Apple')).to.equal(true); + expect(pubsub.emit('Banana')).to.equal(true); + + // Read payloads + expect(await iterator.next()).to.deep.equal({ + done: false, + value: 'Apple', + }); + expect(await iterator.next()).to.deep.equal({ + done: false, + value: 'Banana', + }); + + // Read ahead + const i3 = iterator.next().then((x) => x); + const i4 = iterator.next().then((x) => x); + + // Publish + expect(pubsub.emit('Coconut')).to.equal(true); + expect(pubsub.emit('Durian')).to.equal(true); + + // Await out of order to get correct results + expect(await i4).to.deep.equal({ done: false, value: 'Durian' }); + expect(await i3).to.deep.equal({ done: false, value: 'Coconut' }); + + // Read ahead + const i5 = iterator.next().then((x) => x); + + // Terminate queue + await iterator.return(); + + // Publish is not caught after terminate + expect(pubsub.emit('Fig')).to.equal(false); + + // Find that cancelled read-ahead got a "done" result + expect(await i5).to.deep.equal({ done: true, value: undefined }); + + // And next returns empty completion value + expect(await iterator.next()).to.deep.equal({ + done: true, + value: undefined, + }); + }); +}); diff --git a/src/execution/__tests__/simplePubSub.ts b/src/execution/__tests__/simplePubSub.ts new file mode 100644 index 00000000..7efdf40e --- /dev/null +++ b/src/execution/__tests__/simplePubSub.ts @@ -0,0 +1,74 @@ +import { invariant } from '../../jsutils/invariant'; + +/** + * Create an AsyncIterator from an EventEmitter. Useful for mocking a + * PubSub system for tests. + */ +export class SimplePubSub { + private _subscribers: Set<(value: T) => void>; + + constructor() { + this._subscribers = new Set(); + } + + emit(event: T): boolean { + for (const subscriber of this._subscribers) { + subscriber(event); + } + return this._subscribers.size > 0; + } + + getSubscriber(transform: (value: T) => R): AsyncGenerator { + const pullQueue: Array<(result: IteratorResult) => void> = []; + const pushQueue: Array = []; + let listening = true; + this._subscribers.add(pushValue); + + const emptyQueue = () => { + listening = false; + this._subscribers.delete(pushValue); + for (const resolve of pullQueue) { + resolve({ value: undefined, done: true }); + } + pullQueue.length = 0; + pushQueue.length = 0; + }; + + return { + next(): Promise> { + if (!listening) { + return Promise.resolve({ value: undefined, done: true }); + } + + if (pushQueue.length > 0) { + const value = pushQueue[0]; + pushQueue.shift(); + return Promise.resolve({ value, done: false }); + } + return new Promise((resolve) => pullQueue.push(resolve)); + }, + return(): Promise> { + emptyQueue(); + return Promise.resolve({ value: undefined, done: true }); + }, + throw(error: unknown) { + emptyQueue(); + return Promise.reject(error); + }, + [Symbol.asyncIterator]() { + return this; + }, + }; + + function pushValue(event: T): void { + const value: R = transform(event); + if (pullQueue.length > 0) { + const receiver = pullQueue.shift(); + invariant(receiver); + receiver({ value, done: false }); + } else { + pushQueue.push(value); + } + } + } +} diff --git a/src/execution/__tests__/subscribe-test.ts b/src/execution/__tests__/subscribe-test.ts new file mode 100644 index 00000000..54c5019a --- /dev/null +++ b/src/execution/__tests__/subscribe-test.ts @@ -0,0 +1,1022 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { expectJSON } from '../../__testUtils__/expectJSON'; +import { resolveOnNextTick } from '../../__testUtils__/resolveOnNextTick'; + +import { invariant } from '../../jsutils/invariant'; +import { isAsyncIterable } from '../../jsutils/isAsyncIterable'; + +import { parse } from '../../language/parser'; + +import { GraphQLList, GraphQLObjectType } from '../../type/definition'; +import { GraphQLBoolean, GraphQLInt, GraphQLString } from '../../type/scalars'; +import { GraphQLSchema } from '../../type/schema'; + +import { createSourceEventStream, subscribe } from '../subscribe'; + +import { SimplePubSub } from './simplePubSub'; + +interface Email { + from: string; + subject: string; + message: string; + unread: boolean; +} + +const EmailType = new GraphQLObjectType({ + name: 'Email', + fields: { + from: { type: GraphQLString }, + subject: { type: GraphQLString }, + message: { type: GraphQLString }, + unread: { type: GraphQLBoolean }, + }, +}); + +const InboxType = new GraphQLObjectType({ + name: 'Inbox', + fields: { + total: { + type: GraphQLInt, + resolve: (inbox) => inbox.emails.length, + }, + unread: { + type: GraphQLInt, + resolve: (inbox) => + inbox.emails.filter((email: any) => email.unread).length, + }, + emails: { type: new GraphQLList(EmailType) }, + }, +}); + +const QueryType = new GraphQLObjectType({ + name: 'Query', + fields: { + inbox: { type: InboxType }, + }, +}); + +const EmailEventType = new GraphQLObjectType({ + name: 'EmailEvent', + fields: { + email: { type: EmailType }, + inbox: { type: InboxType }, + }, +}); + +const emailSchema = new GraphQLSchema({ + query: QueryType, + subscription: new GraphQLObjectType({ + name: 'Subscription', + fields: { + importantEmail: { + type: EmailEventType, + args: { + priority: { type: GraphQLInt }, + }, + }, + }, + }), +}); + +function createSubscription(pubsub: SimplePubSub) { + const document = parse(` + subscription ($priority: Int = 0) { + importantEmail(priority: $priority) { + email { + from + subject + } + inbox { + unread + total + } + } + } + `); + + const emails = [ + { + from: 'joe@graphql.org', + subject: 'Hello', + message: 'Hello World', + unread: false, + }, + ]; + + const data: any = { + inbox: { emails }, + // FIXME: we shouldn't use mapAsyncIterator here since it makes tests way more complex + importantEmail: pubsub.getSubscriber((newEmail) => { + emails.push(newEmail); + + return { + importantEmail: { + email: newEmail, + inbox: data.inbox, + }, + }; + }), + }; + + return subscribe({ schema: emailSchema, document, rootValue: data }); +} + +async function expectPromise(promise: Promise) { + let caughtError: Error; + + try { + /* c8 ignore next 2 */ + await promise; + expect.fail('promise should have thrown but did not'); + } catch (error) { + caughtError = error; + } + + return { + toReject() { + expect(caughtError).to.be.an.instanceOf(Error); + }, + toRejectWith(message: string) { + expect(caughtError).to.be.an.instanceOf(Error); + expect(caughtError).to.have.property('message', message); + }, + }; +} + +const DummyQueryType = new GraphQLObjectType({ + name: 'Query', + fields: { + dummy: { type: GraphQLString }, + }, +}); + +/* eslint-disable @typescript-eslint/require-await */ +// Check all error cases when initializing the subscription. +describe('Subscription Initialization Phase', () => { + it('accepts multiple subscription fields defined in schema', async () => { + const schema = new GraphQLSchema({ + query: DummyQueryType, + subscription: new GraphQLObjectType({ + name: 'Subscription', + fields: { + foo: { type: GraphQLString }, + bar: { type: GraphQLString }, + }, + }), + }); + + async function* fooGenerator() { + yield { foo: 'FooValue' }; + } + + const subscription = await subscribe({ + schema, + document: parse('subscription { foo }'), + rootValue: { foo: fooGenerator }, + }); + invariant(isAsyncIterable(subscription)); + + expect(await subscription.next()).to.deep.equal({ + done: false, + value: { data: { foo: 'FooValue' } }, + }); + + expect(await subscription.next()).to.deep.equal({ + done: true, + value: undefined, + }); + }); + + it('accepts type definition with sync subscribe function', async () => { + async function* fooGenerator() { + yield { foo: 'FooValue' }; + } + + const schema = new GraphQLSchema({ + query: DummyQueryType, + subscription: new GraphQLObjectType({ + name: 'Subscription', + fields: { + foo: { + type: GraphQLString, + subscribe: fooGenerator, + }, + }, + }), + }); + + const subscription = await subscribe({ + schema, + document: parse('subscription { foo }'), + }); + invariant(isAsyncIterable(subscription)); + + expect(await subscription.next()).to.deep.equal({ + done: false, + value: { data: { foo: 'FooValue' } }, + }); + + expect(await subscription.next()).to.deep.equal({ + done: true, + value: undefined, + }); + }); + + it('accepts type definition with async subscribe function', async () => { + async function* fooGenerator() { + yield { foo: 'FooValue' }; + } + + const schema = new GraphQLSchema({ + query: DummyQueryType, + subscription: new GraphQLObjectType({ + name: 'Subscription', + fields: { + foo: { + type: GraphQLString, + async subscribe() { + await resolveOnNextTick(); + return fooGenerator(); + }, + }, + }, + }), + }); + + const subscription = await subscribe({ + schema, + document: parse('subscription { foo }'), + }); + invariant(isAsyncIterable(subscription)); + + expect(await subscription.next()).to.deep.equal({ + done: false, + value: { data: { foo: 'FooValue' } }, + }); + + expect(await subscription.next()).to.deep.equal({ + done: true, + value: undefined, + }); + }); + + it('uses a custom default subscribeFieldResolver', async () => { + const schema = new GraphQLSchema({ + query: DummyQueryType, + subscription: new GraphQLObjectType({ + name: 'Subscription', + fields: { + foo: { type: GraphQLString }, + }, + }), + }); + + async function* fooGenerator() { + yield { foo: 'FooValue' }; + } + + const subscription = await subscribe({ + schema, + document: parse('subscription { foo }'), + rootValue: { customFoo: fooGenerator }, + subscribeFieldResolver: (root) => root.customFoo(), + }); + invariant(isAsyncIterable(subscription)); + + expect(await subscription.next()).to.deep.equal({ + done: false, + value: { data: { foo: 'FooValue' } }, + }); + + expect(await subscription.next()).to.deep.equal({ + done: true, + value: undefined, + }); + }); + + it('should only resolve the first field of invalid multi-field', async () => { + async function* fooGenerator() { + yield { foo: 'FooValue' }; + } + + let didResolveFoo = false; + let didResolveBar = false; + + const schema = new GraphQLSchema({ + query: DummyQueryType, + subscription: new GraphQLObjectType({ + name: 'Subscription', + fields: { + foo: { + type: GraphQLString, + subscribe() { + didResolveFoo = true; + return fooGenerator(); + }, + }, + bar: { + type: GraphQLString, + /* c8 ignore next 3 */ + subscribe() { + didResolveBar = true; + }, + }, + }, + }), + }); + + const subscription = await subscribe({ + schema, + document: parse('subscription { foo bar }'), + }); + invariant(isAsyncIterable(subscription)); + + expect(didResolveFoo).to.equal(true); + expect(didResolveBar).to.equal(false); + + expect(await subscription.next()).to.have.property('done', false); + + expect(await subscription.next()).to.deep.equal({ + done: true, + value: undefined, + }); + }); + + it('throws an error if some of required arguments are missing', async () => { + const document = parse('subscription { foo }'); + const schema = new GraphQLSchema({ + query: DummyQueryType, + subscription: new GraphQLObjectType({ + name: 'Subscription', + fields: { + foo: { type: GraphQLString }, + }, + }), + }); + + // @ts-expect-error (schema must not be null) + (await expectPromise(subscribe({ schema: null, document }))).toRejectWith( + 'Expected null to be a GraphQL schema.', + ); + + // @ts-expect-error + (await expectPromise(subscribe({ document }))).toRejectWith( + 'Expected undefined to be a GraphQL schema.', + ); + + // @ts-expect-error (document must not be null) + (await expectPromise(subscribe({ schema, document: null }))).toRejectWith( + 'Must provide document.', + ); + + // @ts-expect-error + (await expectPromise(subscribe({ schema }))).toRejectWith( + 'Must provide document.', + ); + }); + + it('resolves to an error if schema does not support subscriptions', async () => { + const schema = new GraphQLSchema({ query: DummyQueryType }); + const document = parse('subscription { unknownField }'); + + const result = await subscribe({ schema, document }); + expectJSON(result).toDeepEqual({ + errors: [ + { + message: + 'Schema is not configured to execute subscription operation.', + locations: [{ line: 1, column: 1 }], + }, + ], + }); + }); + + it('resolves to an error for unknown subscription field', async () => { + const schema = new GraphQLSchema({ + query: DummyQueryType, + subscription: new GraphQLObjectType({ + name: 'Subscription', + fields: { + foo: { type: GraphQLString }, + }, + }), + }); + const document = parse('subscription { unknownField }'); + + const result = await subscribe({ schema, document }); + expectJSON(result).toDeepEqual({ + errors: [ + { + message: 'The subscription field "unknownField" is not defined.', + locations: [{ line: 1, column: 16 }], + }, + ], + }); + }); + + it('should pass through unexpected errors thrown in subscribe', async () => { + const schema = new GraphQLSchema({ + query: DummyQueryType, + subscription: new GraphQLObjectType({ + name: 'Subscription', + fields: { + foo: { type: GraphQLString }, + }, + }), + }); + + // @ts-expect-error + (await expectPromise(subscribe({ schema, document: {} }))).toReject(); + }); + + it('throws an error if subscribe does not return an iterator', async () => { + const schema = new GraphQLSchema({ + query: DummyQueryType, + subscription: new GraphQLObjectType({ + name: 'Subscription', + fields: { + foo: { + type: GraphQLString, + subscribe: () => 'test', + }, + }, + }), + }); + + const document = parse('subscription { foo }'); + + (await expectPromise(subscribe({ schema, document }))).toRejectWith( + 'Subscription field must return Async Iterable. Received: "test".', + ); + }); + + it('resolves to an error for subscription resolver errors', async () => { + async function subscribeWithFn(subscribeFn: () => unknown) { + const schema = new GraphQLSchema({ + query: DummyQueryType, + subscription: new GraphQLObjectType({ + name: 'Subscription', + fields: { + foo: { type: GraphQLString, subscribe: subscribeFn }, + }, + }), + }); + const document = parse('subscription { foo }'); + const result = await subscribe({ schema, document }); + + expectJSON(await createSourceEventStream(schema, document)).toDeepEqual( + result, + ); + return result; + } + + const expectedResult = { + errors: [ + { + message: 'test error', + locations: [{ line: 1, column: 16 }], + path: ['foo'], + }, + ], + }; + + expectJSON( + // Returning an error + await subscribeWithFn(() => new Error('test error')), + ).toDeepEqual(expectedResult); + + expectJSON( + // Throwing an error + await subscribeWithFn(() => { + throw new Error('test error'); + }), + ).toDeepEqual(expectedResult); + + expectJSON( + // Resolving to an error + await subscribeWithFn(() => Promise.resolve(new Error('test error'))), + ).toDeepEqual(expectedResult); + + expectJSON( + // Rejecting with an error + await subscribeWithFn(() => Promise.reject(new Error('test error'))), + ).toDeepEqual(expectedResult); + }); + + it('resolves to an error if variables were wrong type', async () => { + const schema = new GraphQLSchema({ + query: DummyQueryType, + subscription: new GraphQLObjectType({ + name: 'Subscription', + fields: { + foo: { + type: GraphQLString, + args: { arg: { type: GraphQLInt } }, + }, + }, + }), + }); + + const variableValues = { arg: 'meow' }; + const document = parse(` + subscription ($arg: Int) { + foo(arg: $arg) + } + `); + + // If we receive variables that cannot be coerced correctly, subscribe() will + // resolve to an ExecutionResult that contains an informative error description. + const result = await subscribe({ schema, document, variableValues }); + expectJSON(result).toDeepEqual({ + errors: [ + { + message: + 'Variable "$arg" got invalid value "meow"; Int cannot represent non-integer value: "meow"', + locations: [{ line: 2, column: 21 }], + }, + ], + }); + }); +}); + +// Once a subscription returns a valid AsyncIterator, it can still yield errors. +describe('Subscription Publish Phase', () => { + it('produces a payload for multiple subscribe in same subscription', async () => { + const pubsub = new SimplePubSub(); + + const subscription = await createSubscription(pubsub); + invariant(isAsyncIterable(subscription)); + + const secondSubscription = await createSubscription(pubsub); + invariant(isAsyncIterable(secondSubscription)); + + const payload1 = subscription.next(); + const payload2 = secondSubscription.next(); + + expect( + pubsub.emit({ + from: 'yuzhi@graphql.org', + subject: 'Alright', + message: 'Tests are good', + unread: true, + }), + ).to.equal(true); + + const expectedPayload = { + done: false, + value: { + data: { + importantEmail: { + email: { + from: 'yuzhi@graphql.org', + subject: 'Alright', + }, + inbox: { + unread: 1, + total: 2, + }, + }, + }, + }, + }; + + expect(await payload1).to.deep.equal(expectedPayload); + expect(await payload2).to.deep.equal(expectedPayload); + }); + + it('produces a payload per subscription event', async () => { + const pubsub = new SimplePubSub(); + const subscription = await createSubscription(pubsub); + invariant(isAsyncIterable(subscription)); + + // Wait for the next subscription payload. + const payload = subscription.next(); + + // A new email arrives! + expect( + pubsub.emit({ + from: 'yuzhi@graphql.org', + subject: 'Alright', + message: 'Tests are good', + unread: true, + }), + ).to.equal(true); + + // The previously waited on payload now has a value. + expect(await payload).to.deep.equal({ + done: false, + value: { + data: { + importantEmail: { + email: { + from: 'yuzhi@graphql.org', + subject: 'Alright', + }, + inbox: { + unread: 1, + total: 2, + }, + }, + }, + }, + }); + + // Another new email arrives, before subscription.next() is called. + expect( + pubsub.emit({ + from: 'hyo@graphql.org', + subject: 'Tools', + message: 'I <3 making things', + unread: true, + }), + ).to.equal(true); + + // The next waited on payload will have a value. + expect(await subscription.next()).to.deep.equal({ + done: false, + value: { + data: { + importantEmail: { + email: { + from: 'hyo@graphql.org', + subject: 'Tools', + }, + inbox: { + unread: 2, + total: 3, + }, + }, + }, + }, + }); + + // The client decides to disconnect. + expect(await subscription.return()).to.deep.equal({ + done: true, + value: undefined, + }); + + // Which may result in disconnecting upstream services as well. + expect( + pubsub.emit({ + from: 'adam@graphql.org', + subject: 'Important', + message: 'Read me please', + unread: true, + }), + ).to.equal(false); // No more listeners. + + // Awaiting a subscription after closing it results in completed results. + expect(await subscription.next()).to.deep.equal({ + done: true, + value: undefined, + }); + }); + + it('produces a payload when there are multiple events', async () => { + const pubsub = new SimplePubSub(); + const subscription = await createSubscription(pubsub); + invariant(isAsyncIterable(subscription)); + + let payload = subscription.next(); + + // A new email arrives! + expect( + pubsub.emit({ + from: 'yuzhi@graphql.org', + subject: 'Alright', + message: 'Tests are good', + unread: true, + }), + ).to.equal(true); + + expect(await payload).to.deep.equal({ + done: false, + value: { + data: { + importantEmail: { + email: { + from: 'yuzhi@graphql.org', + subject: 'Alright', + }, + inbox: { + unread: 1, + total: 2, + }, + }, + }, + }, + }); + + payload = subscription.next(); + + // A new email arrives! + expect( + pubsub.emit({ + from: 'yuzhi@graphql.org', + subject: 'Alright 2', + message: 'Tests are good 2', + unread: true, + }), + ).to.equal(true); + + expect(await payload).to.deep.equal({ + done: false, + value: { + data: { + importantEmail: { + email: { + from: 'yuzhi@graphql.org', + subject: 'Alright 2', + }, + inbox: { + unread: 2, + total: 3, + }, + }, + }, + }, + }); + }); + + it('should not trigger when subscription is already done', async () => { + const pubsub = new SimplePubSub(); + const subscription = await createSubscription(pubsub); + invariant(isAsyncIterable(subscription)); + + let payload = subscription.next(); + + // A new email arrives! + expect( + pubsub.emit({ + from: 'yuzhi@graphql.org', + subject: 'Alright', + message: 'Tests are good', + unread: true, + }), + ).to.equal(true); + + expect(await payload).to.deep.equal({ + done: false, + value: { + data: { + importantEmail: { + email: { + from: 'yuzhi@graphql.org', + subject: 'Alright', + }, + inbox: { + unread: 1, + total: 2, + }, + }, + }, + }, + }); + + payload = subscription.next(); + await subscription.return(); + + // A new email arrives! + expect( + pubsub.emit({ + from: 'yuzhi@graphql.org', + subject: 'Alright 2', + message: 'Tests are good 2', + unread: true, + }), + ).to.equal(false); + + expect(await payload).to.deep.equal({ + done: true, + value: undefined, + }); + }); + + it('should not trigger when subscription is thrown', async () => { + const pubsub = new SimplePubSub(); + const subscription = await createSubscription(pubsub); + invariant(isAsyncIterable(subscription)); + + let payload = subscription.next(); + + // A new email arrives! + expect( + pubsub.emit({ + from: 'yuzhi@graphql.org', + subject: 'Alright', + message: 'Tests are good', + unread: true, + }), + ).to.equal(true); + + expect(await payload).to.deep.equal({ + done: false, + value: { + data: { + importantEmail: { + email: { + from: 'yuzhi@graphql.org', + subject: 'Alright', + }, + inbox: { + unread: 1, + total: 2, + }, + }, + }, + }, + }); + + payload = subscription.next(); + + // Throw error + let caughtError; + try { + /* c8 ignore next */ + await subscription.throw('ouch'); + } catch (e) { + caughtError = e; + } + expect(caughtError).to.equal('ouch'); + + expect(await payload).to.deep.equal({ + done: true, + value: undefined, + }); + }); + + it('event order is correct for multiple publishes', async () => { + const pubsub = new SimplePubSub(); + const subscription = await createSubscription(pubsub); + invariant(isAsyncIterable(subscription)); + + let payload = subscription.next(); + + // A new email arrives! + expect( + pubsub.emit({ + from: 'yuzhi@graphql.org', + subject: 'Message', + message: 'Tests are good', + unread: true, + }), + ).to.equal(true); + + // A new email arrives! + expect( + pubsub.emit({ + from: 'yuzhi@graphql.org', + subject: 'Message 2', + message: 'Tests are good 2', + unread: true, + }), + ).to.equal(true); + + expect(await payload).to.deep.equal({ + done: false, + value: { + data: { + importantEmail: { + email: { + from: 'yuzhi@graphql.org', + subject: 'Message', + }, + inbox: { + unread: 2, + total: 3, + }, + }, + }, + }, + }); + + payload = subscription.next(); + + expect(await payload).to.deep.equal({ + done: false, + value: { + data: { + importantEmail: { + email: { + from: 'yuzhi@graphql.org', + subject: 'Message 2', + }, + inbox: { + unread: 2, + total: 3, + }, + }, + }, + }, + }); + }); + + it('should handle error during execution of source event', async () => { + async function* generateMessages() { + yield 'Hello'; + yield 'Goodbye'; + yield 'Bonjour'; + } + + const schema = new GraphQLSchema({ + query: DummyQueryType, + subscription: new GraphQLObjectType({ + name: 'Subscription', + fields: { + newMessage: { + type: GraphQLString, + subscribe: generateMessages, + resolve(message) { + if (message === 'Goodbye') { + throw new Error('Never leave.'); + } + return message; + }, + }, + }, + }), + }); + + const document = parse('subscription { newMessage }'); + const subscription = await subscribe({ schema, document }); + invariant(isAsyncIterable(subscription)); + + expect(await subscription.next()).to.deep.equal({ + done: false, + value: { + data: { newMessage: 'Hello' }, + }, + }); + + // An error in execution is presented as such. + expectJSON(await subscription.next()).toDeepEqual({ + done: false, + value: { + data: { newMessage: null }, + errors: [ + { + message: 'Never leave.', + locations: [{ line: 1, column: 16 }], + path: ['newMessage'], + }, + ], + }, + }); + + // However that does not close the response event stream. + // Subsequent events are still executed. + expectJSON(await subscription.next()).toDeepEqual({ + done: false, + value: { + data: { newMessage: 'Bonjour' }, + }, + }); + + expectJSON(await subscription.next()).toDeepEqual({ + done: true, + value: undefined, + }); + }); + + it('should pass through error thrown in source event stream', async () => { + async function* generateMessages() { + yield 'Hello'; + throw new Error('test error'); + } + + const schema = new GraphQLSchema({ + query: DummyQueryType, + subscription: new GraphQLObjectType({ + name: 'Subscription', + fields: { + newMessage: { + type: GraphQLString, + resolve: (message) => message, + subscribe: generateMessages, + }, + }, + }), + }); + + const document = parse('subscription { newMessage }'); + const subscription = await subscribe({ schema, document }); + invariant(isAsyncIterable(subscription)); + + expect(await subscription.next()).to.deep.equal({ + done: false, + value: { + data: { newMessage: 'Hello' }, + }, + }); + + (await expectPromise(subscription.next())).toRejectWith('test error'); + + expect(await subscription.next()).to.deep.equal({ + done: true, + value: undefined, + }); + }); +}); diff --git a/src/execution/__tests__/sync-test.ts b/src/execution/__tests__/sync-test.ts new file mode 100644 index 00000000..021f09fa --- /dev/null +++ b/src/execution/__tests__/sync-test.ts @@ -0,0 +1,177 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { expectJSON } from '../../__testUtils__/expectJSON'; + +import { parse } from '../../language/parser'; + +import { GraphQLObjectType } from '../../type/definition'; +import { GraphQLString } from '../../type/scalars'; +import { GraphQLSchema } from '../../type/schema'; + +import { validate } from '../../validation/validate'; + +import { graphqlSync } from '../../graphql'; + +import { execute, executeSync } from '../execute'; + +describe('Execute: synchronously when possible', () => { + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Query', + fields: { + syncField: { + type: GraphQLString, + resolve(rootValue) { + return rootValue; + }, + }, + asyncField: { + type: GraphQLString, + resolve(rootValue) { + return Promise.resolve(rootValue); + }, + }, + }, + }), + mutation: new GraphQLObjectType({ + name: 'Mutation', + fields: { + syncMutationField: { + type: GraphQLString, + resolve(rootValue) { + return rootValue; + }, + }, + }, + }), + }); + + it('does not return a Promise for initial errors', () => { + const doc = 'fragment Example on Query { syncField }'; + const result = execute({ + schema, + document: parse(doc), + rootValue: 'rootValue', + }); + expectJSON(result).toDeepEqual({ + errors: [{ message: 'Must provide an operation.' }], + }); + }); + + it('does not return a Promise if fields are all synchronous', () => { + const doc = 'query Example { syncField }'; + const result = execute({ + schema, + document: parse(doc), + rootValue: 'rootValue', + }); + expect(result).to.deep.equal({ data: { syncField: 'rootValue' } }); + }); + + it('does not return a Promise if mutation fields are all synchronous', () => { + const doc = 'mutation Example { syncMutationField }'; + const result = execute({ + schema, + document: parse(doc), + rootValue: 'rootValue', + }); + expect(result).to.deep.equal({ data: { syncMutationField: 'rootValue' } }); + }); + + it('returns a Promise if any field is asynchronous', async () => { + const doc = 'query Example { syncField, asyncField }'; + const result = execute({ + schema, + document: parse(doc), + rootValue: 'rootValue', + }); + expect(result).to.be.instanceOf(Promise); + expect(await result).to.deep.equal({ + data: { syncField: 'rootValue', asyncField: 'rootValue' }, + }); + }); + + describe('executeSync', () => { + it('does not return a Promise for sync execution', () => { + const doc = 'query Example { syncField }'; + const result = executeSync({ + schema, + document: parse(doc), + rootValue: 'rootValue', + }); + expect(result).to.deep.equal({ data: { syncField: 'rootValue' } }); + }); + + it('throws if encountering async execution', () => { + const doc = 'query Example { syncField, asyncField }'; + expect(() => { + executeSync({ + schema, + document: parse(doc), + rootValue: 'rootValue', + }); + }).to.throw('GraphQL execution failed to complete synchronously.'); + }); + }); + + describe('graphqlSync', () => { + it('report errors raised during schema validation', () => { + const badSchema = new GraphQLSchema({}); + const result = graphqlSync({ + schema: badSchema, + source: '{ __typename }', + }); + expectJSON(result).toDeepEqual({ + errors: [{ message: 'Query root type must be provided.' }], + }); + }); + + it('does not return a Promise for syntax errors', () => { + const doc = 'fragment Example on Query { { { syncField }'; + const result = graphqlSync({ + schema, + source: doc, + }); + expectJSON(result).toDeepEqual({ + errors: [ + { + message: 'Syntax Error: Expected Name, found "{".', + locations: [{ line: 1, column: 29 }], + }, + ], + }); + }); + + it('does not return a Promise for validation errors', () => { + const doc = 'fragment Example on Query { unknownField }'; + const validationErrors = validate(schema, parse(doc)); + const result = graphqlSync({ + schema, + source: doc, + }); + expect(result).to.deep.equal({ errors: validationErrors }); + }); + + it('does not return a Promise for sync execution', () => { + const doc = 'query Example { syncField }'; + const result = graphqlSync({ + schema, + source: doc, + rootValue: 'rootValue', + }); + expect(result).to.deep.equal({ data: { syncField: 'rootValue' } }); + }); + + it('throws if encountering async execution', () => { + const doc = 'query Example { syncField, asyncField }'; + expect(() => { + graphqlSync({ + schema, + source: doc, + rootValue: 'rootValue', + }); + }).to.throw('GraphQL execution failed to complete synchronously.'); + }); + }); +}); diff --git a/src/execution/__tests__/union-interface-test.ts b/src/execution/__tests__/union-interface-test.ts new file mode 100644 index 00000000..7ce9f8b3 --- /dev/null +++ b/src/execution/__tests__/union-interface-test.ts @@ -0,0 +1,548 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { parse } from '../../language/parser'; + +import { + GraphQLInterfaceType, + GraphQLList, + GraphQLObjectType, + GraphQLUnionType, +} from '../../type/definition'; +import { GraphQLBoolean, GraphQLString } from '../../type/scalars'; +import { GraphQLSchema } from '../../type/schema'; + +import { executeSync } from '../execute'; + +class Dog { + name: string; + barks: boolean; + mother?: Dog; + father?: Dog; + progeny: ReadonlyArray; + + constructor(name: string, barks: boolean) { + this.name = name; + this.barks = barks; + this.progeny = []; + } +} + +class Cat { + name: string; + meows: boolean; + mother?: Cat; + father?: Cat; + progeny: ReadonlyArray; + + constructor(name: string, meows: boolean) { + this.name = name; + this.meows = meows; + this.progeny = []; + } +} + +class Person { + name: string; + pets?: ReadonlyArray; + friends?: ReadonlyArray; + + constructor( + name: string, + pets?: ReadonlyArray, + friends?: ReadonlyArray, + ) { + this.name = name; + this.pets = pets; + this.friends = friends; + } +} + +const NamedType = new GraphQLInterfaceType({ + name: 'Named', + fields: { + name: { type: GraphQLString }, + }, +}); + +const LifeType: GraphQLInterfaceType = new GraphQLInterfaceType({ + name: 'Life', + fields: () => ({ + progeny: { type: new GraphQLList(LifeType) }, + }), +}); + +const MammalType: GraphQLInterfaceType = new GraphQLInterfaceType({ + name: 'Mammal', + interfaces: [LifeType], + fields: () => ({ + progeny: { type: new GraphQLList(MammalType) }, + mother: { type: MammalType }, + father: { type: MammalType }, + }), +}); + +const DogType: GraphQLObjectType = new GraphQLObjectType({ + name: 'Dog', + interfaces: [MammalType, LifeType, NamedType], + fields: () => ({ + name: { type: GraphQLString }, + barks: { type: GraphQLBoolean }, + progeny: { type: new GraphQLList(DogType) }, + mother: { type: DogType }, + father: { type: DogType }, + }), + isTypeOf: (value) => value instanceof Dog, +}); + +const CatType: GraphQLObjectType = new GraphQLObjectType({ + name: 'Cat', + interfaces: [MammalType, LifeType, NamedType], + fields: () => ({ + name: { type: GraphQLString }, + meows: { type: GraphQLBoolean }, + progeny: { type: new GraphQLList(CatType) }, + mother: { type: CatType }, + father: { type: CatType }, + }), + isTypeOf: (value) => value instanceof Cat, +}); + +const PetType = new GraphQLUnionType({ + name: 'Pet', + types: [DogType, CatType], + resolveType(value) { + if (value instanceof Dog) { + return DogType.name; + } + if (value instanceof Cat) { + return CatType.name; + } + /* c8 ignore next 3 */ + // Not reachable, all possible types have been considered. + expect.fail('Not reachable'); + }, +}); + +const PersonType: GraphQLObjectType = new GraphQLObjectType({ + name: 'Person', + interfaces: [NamedType, MammalType, LifeType], + fields: () => ({ + name: { type: GraphQLString }, + pets: { type: new GraphQLList(PetType) }, + friends: { type: new GraphQLList(NamedType) }, + progeny: { type: new GraphQLList(PersonType) }, + mother: { type: PersonType }, + father: { type: PersonType }, + }), + isTypeOf: (value) => value instanceof Person, +}); + +const schema = new GraphQLSchema({ + query: PersonType, + types: [PetType], +}); + +const garfield = new Cat('Garfield', false); +garfield.mother = new Cat("Garfield's Mom", false); +garfield.mother.progeny = [garfield]; + +const odie = new Dog('Odie', true); +odie.mother = new Dog("Odie's Mom", true); +odie.mother.progeny = [odie]; + +const liz = new Person('Liz'); +const john = new Person('John', [garfield, odie], [liz, odie]); + +describe('Execute: Union and intersection types', () => { + it('can introspect on union and intersection types', () => { + const document = parse(` + { + Named: __type(name: "Named") { + kind + name + fields { name } + interfaces { name } + possibleTypes { name } + enumValues { name } + inputFields { name } + } + Mammal: __type(name: "Mammal") { + kind + name + fields { name } + interfaces { name } + possibleTypes { name } + enumValues { name } + inputFields { name } + } + Pet: __type(name: "Pet") { + kind + name + fields { name } + interfaces { name } + possibleTypes { name } + enumValues { name } + inputFields { name } + } + } + `); + + expect(executeSync({ schema, document })).to.deep.equal({ + data: { + Named: { + kind: 'INTERFACE', + name: 'Named', + fields: [{ name: 'name' }], + interfaces: [], + possibleTypes: [{ name: 'Dog' }, { name: 'Cat' }, { name: 'Person' }], + enumValues: null, + inputFields: null, + }, + Mammal: { + kind: 'INTERFACE', + name: 'Mammal', + fields: [{ name: 'progeny' }, { name: 'mother' }, { name: 'father' }], + interfaces: [{ name: 'Life' }], + possibleTypes: [{ name: 'Dog' }, { name: 'Cat' }, { name: 'Person' }], + enumValues: null, + inputFields: null, + }, + Pet: { + kind: 'UNION', + name: 'Pet', + fields: null, + interfaces: null, + possibleTypes: [{ name: 'Dog' }, { name: 'Cat' }], + enumValues: null, + inputFields: null, + }, + }, + }); + }); + + it('executes using union types', () => { + // NOTE: This is an *invalid* query, but it should be an *executable* query. + const document = parse(` + { + __typename + name + pets { + __typename + name + barks + meows + } + } + `); + + expect(executeSync({ schema, document, rootValue: john })).to.deep.equal({ + data: { + __typename: 'Person', + name: 'John', + pets: [ + { + __typename: 'Cat', + name: 'Garfield', + meows: false, + }, + { + __typename: 'Dog', + name: 'Odie', + barks: true, + }, + ], + }, + }); + }); + + it('executes union types with inline fragments', () => { + // This is the valid version of the query in the above test. + const document = parse(` + { + __typename + name + pets { + __typename + ... on Dog { + name + barks + } + ... on Cat { + name + meows + } + } + } + `); + + expect(executeSync({ schema, document, rootValue: john })).to.deep.equal({ + data: { + __typename: 'Person', + name: 'John', + pets: [ + { + __typename: 'Cat', + name: 'Garfield', + meows: false, + }, + { + __typename: 'Dog', + name: 'Odie', + barks: true, + }, + ], + }, + }); + }); + + it('executes using interface types', () => { + // NOTE: This is an *invalid* query, but it should be an *executable* query. + const document = parse(` + { + __typename + name + friends { + __typename + name + barks + meows + } + } + `); + + expect(executeSync({ schema, document, rootValue: john })).to.deep.equal({ + data: { + __typename: 'Person', + name: 'John', + friends: [ + { __typename: 'Person', name: 'Liz' }, + { __typename: 'Dog', name: 'Odie', barks: true }, + ], + }, + }); + }); + + it('executes interface types with inline fragments', () => { + // This is the valid version of the query in the above test. + const document = parse(` + { + __typename + name + friends { + __typename + name + ... on Dog { + barks + } + ... on Cat { + meows + } + + ... on Mammal { + mother { + __typename + ... on Dog { + name + barks + } + ... on Cat { + name + meows + } + } + } + } + } + `); + + expect(executeSync({ schema, document, rootValue: john })).to.deep.equal({ + data: { + __typename: 'Person', + name: 'John', + friends: [ + { + __typename: 'Person', + name: 'Liz', + mother: null, + }, + { + __typename: 'Dog', + name: 'Odie', + barks: true, + mother: { __typename: 'Dog', name: "Odie's Mom", barks: true }, + }, + ], + }, + }); + }); + + it('executes interface types with named fragments', () => { + const document = parse(` + { + __typename + name + friends { + __typename + name + ...DogBarks + ...CatMeows + } + } + + fragment DogBarks on Dog { + barks + } + + fragment CatMeows on Cat { + meows + } + `); + + expect(executeSync({ schema, document, rootValue: john })).to.deep.equal({ + data: { + __typename: 'Person', + name: 'John', + friends: [ + { + __typename: 'Person', + name: 'Liz', + }, + { + __typename: 'Dog', + name: 'Odie', + barks: true, + }, + ], + }, + }); + }); + + it('allows fragment conditions to be abstract types', () => { + const document = parse(` + { + __typename + name + pets { + ...PetFields, + ...on Mammal { + mother { + ...ProgenyFields + } + } + } + friends { ...FriendFields } + } + + fragment PetFields on Pet { + __typename + ... on Dog { + name + barks + } + ... on Cat { + name + meows + } + } + + fragment FriendFields on Named { + __typename + name + ... on Dog { + barks + } + ... on Cat { + meows + } + } + + fragment ProgenyFields on Life { + progeny { + __typename + } + } + `); + + expect(executeSync({ schema, document, rootValue: john })).to.deep.equal({ + data: { + __typename: 'Person', + name: 'John', + pets: [ + { + __typename: 'Cat', + name: 'Garfield', + meows: false, + mother: { progeny: [{ __typename: 'Cat' }] }, + }, + { + __typename: 'Dog', + name: 'Odie', + barks: true, + mother: { progeny: [{ __typename: 'Dog' }] }, + }, + ], + friends: [ + { + __typename: 'Person', + name: 'Liz', + }, + { + __typename: 'Dog', + name: 'Odie', + barks: true, + }, + ], + }, + }); + }); + + it('gets execution info in resolver', () => { + let encounteredContext; + let encounteredSchema; + let encounteredRootValue; + + const NamedType2: GraphQLInterfaceType = new GraphQLInterfaceType({ + name: 'Named', + fields: { + name: { type: GraphQLString }, + }, + resolveType(_source, context, info) { + encounteredContext = context; + encounteredSchema = info.schema; + encounteredRootValue = info.rootValue; + return PersonType2.name; + }, + }); + + const PersonType2: GraphQLObjectType = new GraphQLObjectType({ + name: 'Person', + interfaces: [NamedType2], + fields: { + name: { type: GraphQLString }, + friends: { type: new GraphQLList(NamedType2) }, + }, + }); + const schema2 = new GraphQLSchema({ query: PersonType2 }); + const document = parse('{ name, friends { name } }'); + const rootValue = new Person('John', [], [liz]); + const contextValue = { authToken: '123abc' }; + + const result = executeSync({ + schema: schema2, + document, + rootValue, + contextValue, + }); + expect(result).to.deep.equal({ + data: { + name: 'John', + friends: [{ name: 'Liz' }], + }, + }); + + expect(encounteredSchema).to.equal(schema2); + expect(encounteredRootValue).to.equal(rootValue); + expect(encounteredContext).to.equal(contextValue); + }); +}); diff --git a/src/execution/__tests__/variables-test.ts b/src/execution/__tests__/variables-test.ts new file mode 100644 index 00000000..786a4810 --- /dev/null +++ b/src/execution/__tests__/variables-test.ts @@ -0,0 +1,1080 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { expectJSON } from '../../__testUtils__/expectJSON'; + +import { inspect } from '../../jsutils/inspect'; +import { invariant } from '../../jsutils/invariant'; + +import { Kind } from '../../language/kinds'; +import { parse } from '../../language/parser'; + +import type { + GraphQLArgumentConfig, + GraphQLFieldConfig, +} from '../../type/definition'; +import { + GraphQLEnumType, + GraphQLInputObjectType, + GraphQLList, + GraphQLNonNull, + GraphQLObjectType, + GraphQLScalarType, +} from '../../type/definition'; +import { GraphQLString } from '../../type/scalars'; +import { GraphQLSchema } from '../../type/schema'; + +import { executeSync } from '../execute'; +import { getVariableValues } from '../values'; + +const TestComplexScalar = new GraphQLScalarType({ + name: 'ComplexScalar', + parseValue(value) { + expect(value).to.equal('SerializedValue'); + return 'DeserializedValue'; + }, + parseLiteral(ast) { + expect(ast).to.include({ kind: 'StringValue', value: 'SerializedValue' }); + return 'DeserializedValue'; + }, +}); + +const TestInputObject = new GraphQLInputObjectType({ + name: 'TestInputObject', + fields: { + a: { type: GraphQLString }, + b: { type: new GraphQLList(GraphQLString) }, + c: { type: new GraphQLNonNull(GraphQLString) }, + d: { type: TestComplexScalar }, + }, +}); + +const TestNestedInputObject = new GraphQLInputObjectType({ + name: 'TestNestedInputObject', + fields: { + na: { type: new GraphQLNonNull(TestInputObject) }, + nb: { type: new GraphQLNonNull(GraphQLString) }, + }, +}); + +const TestEnum = new GraphQLEnumType({ + name: 'TestEnum', + values: { + NULL: { value: null }, + UNDEFINED: { value: undefined }, + NAN: { value: NaN }, + FALSE: { value: false }, + CUSTOM: { value: 'custom value' }, + DEFAULT_VALUE: {}, + }, +}); + +function fieldWithInputArg( + inputArg: GraphQLArgumentConfig, +): GraphQLFieldConfig { + return { + type: GraphQLString, + args: { input: inputArg }, + resolve(_, args) { + if ('input' in args) { + return inspect(args.input); + } + }, + }; +} + +const TestType = new GraphQLObjectType({ + name: 'TestType', + fields: { + fieldWithEnumInput: fieldWithInputArg({ type: TestEnum }), + fieldWithNonNullableEnumInput: fieldWithInputArg({ + type: new GraphQLNonNull(TestEnum), + }), + fieldWithObjectInput: fieldWithInputArg({ type: TestInputObject }), + fieldWithNullableStringInput: fieldWithInputArg({ type: GraphQLString }), + fieldWithNonNullableStringInput: fieldWithInputArg({ + type: new GraphQLNonNull(GraphQLString), + }), + fieldWithDefaultArgumentValue: fieldWithInputArg({ + type: GraphQLString, + defaultValue: 'Hello World', + }), + fieldWithNonNullableStringInputAndDefaultArgumentValue: fieldWithInputArg({ + type: new GraphQLNonNull(GraphQLString), + defaultValue: 'Hello World', + }), + fieldWithNestedInputObject: fieldWithInputArg({ + type: TestNestedInputObject, + defaultValue: 'Hello World', + }), + list: fieldWithInputArg({ type: new GraphQLList(GraphQLString) }), + nnList: fieldWithInputArg({ + type: new GraphQLNonNull(new GraphQLList(GraphQLString)), + }), + listNN: fieldWithInputArg({ + type: new GraphQLList(new GraphQLNonNull(GraphQLString)), + }), + nnListNN: fieldWithInputArg({ + type: new GraphQLNonNull( + new GraphQLList(new GraphQLNonNull(GraphQLString)), + ), + }), + }, +}); + +const schema = new GraphQLSchema({ query: TestType }); + +function executeQuery( + query: string, + variableValues?: { [variable: string]: unknown }, +) { + const document = parse(query); + return executeSync({ schema, document, variableValues }); +} + +describe('Execute: Handles inputs', () => { + describe('Handles objects and nullability', () => { + describe('using inline structs', () => { + it('executes with complex input', () => { + const result = executeQuery(` + { + fieldWithObjectInput(input: {a: "foo", b: ["bar"], c: "baz"}) + } + `); + + expect(result).to.deep.equal({ + data: { + fieldWithObjectInput: '{ a: "foo", b: ["bar"], c: "baz" }', + }, + }); + }); + + it('properly parses single value to list', () => { + const result = executeQuery(` + { + fieldWithObjectInput(input: {a: "foo", b: "bar", c: "baz"}) + } + `); + + expect(result).to.deep.equal({ + data: { + fieldWithObjectInput: '{ a: "foo", b: ["bar"], c: "baz" }', + }, + }); + }); + + it('properly parses null value to null', () => { + const result = executeQuery(` + { + fieldWithObjectInput(input: {a: null, b: null, c: "C", d: null}) + } + `); + + expect(result).to.deep.equal({ + data: { + fieldWithObjectInput: '{ a: null, b: null, c: "C", d: null }', + }, + }); + }); + + it('properly parses null value in list', () => { + const result = executeQuery(` + { + fieldWithObjectInput(input: {b: ["A",null,"C"], c: "C"}) + } + `); + + expect(result).to.deep.equal({ + data: { + fieldWithObjectInput: '{ b: ["A", null, "C"], c: "C" }', + }, + }); + }); + + it('does not use incorrect value', () => { + const result = executeQuery(` + { + fieldWithObjectInput(input: ["foo", "bar", "baz"]) + } + `); + + expectJSON(result).toDeepEqual({ + data: { + fieldWithObjectInput: null, + }, + errors: [ + { + message: + 'Argument "input" has invalid value ["foo", "bar", "baz"].', + path: ['fieldWithObjectInput'], + locations: [{ line: 3, column: 41 }], + }, + ], + }); + }); + + it('properly runs parseLiteral on complex scalar types', () => { + const result = executeQuery(` + { + fieldWithObjectInput(input: {c: "foo", d: "SerializedValue"}) + } + `); + + expect(result).to.deep.equal({ + data: { + fieldWithObjectInput: '{ c: "foo", d: "DeserializedValue" }', + }, + }); + }); + }); + + describe('using variables', () => { + const doc = ` + query ($input: TestInputObject) { + fieldWithObjectInput(input: $input) + } + `; + + it('executes with complex input', () => { + const params = { input: { a: 'foo', b: ['bar'], c: 'baz' } }; + const result = executeQuery(doc, params); + + expect(result).to.deep.equal({ + data: { + fieldWithObjectInput: '{ a: "foo", b: ["bar"], c: "baz" }', + }, + }); + }); + + it('uses undefined when variable not provided', () => { + const result = executeQuery( + ` + query q($input: String) { + fieldWithNullableStringInput(input: $input) + }`, + { + // Intentionally missing variable values. + }, + ); + + expect(result).to.deep.equal({ + data: { + fieldWithNullableStringInput: null, + }, + }); + }); + + it('uses null when variable provided explicit null value', () => { + const result = executeQuery( + ` + query q($input: String) { + fieldWithNullableStringInput(input: $input) + }`, + { input: null }, + ); + + expect(result).to.deep.equal({ + data: { + fieldWithNullableStringInput: 'null', + }, + }); + }); + + it('uses default value when not provided', () => { + const result = executeQuery(` + query ($input: TestInputObject = {a: "foo", b: ["bar"], c: "baz"}) { + fieldWithObjectInput(input: $input) + } + `); + + expect(result).to.deep.equal({ + data: { + fieldWithObjectInput: '{ a: "foo", b: ["bar"], c: "baz" }', + }, + }); + }); + + it('does not use default value when provided', () => { + const result = executeQuery( + ` + query q($input: String = "Default value") { + fieldWithNullableStringInput(input: $input) + } + `, + { input: 'Variable value' }, + ); + + expect(result).to.deep.equal({ + data: { + fieldWithNullableStringInput: '"Variable value"', + }, + }); + }); + + it('uses explicit null value instead of default value', () => { + const result = executeQuery( + ` + query q($input: String = "Default value") { + fieldWithNullableStringInput(input: $input) + }`, + { input: null }, + ); + + expect(result).to.deep.equal({ + data: { + fieldWithNullableStringInput: 'null', + }, + }); + }); + + it('uses null default value when not provided', () => { + const result = executeQuery( + ` + query q($input: String = null) { + fieldWithNullableStringInput(input: $input) + }`, + { + // Intentionally missing variable values. + }, + ); + + expect(result).to.deep.equal({ + data: { + fieldWithNullableStringInput: 'null', + }, + }); + }); + + it('properly parses single value to list', () => { + const params = { input: { a: 'foo', b: 'bar', c: 'baz' } }; + const result = executeQuery(doc, params); + + expect(result).to.deep.equal({ + data: { + fieldWithObjectInput: '{ a: "foo", b: ["bar"], c: "baz" }', + }, + }); + }); + + it('executes with complex scalar input', () => { + const params = { input: { c: 'foo', d: 'SerializedValue' } }; + const result = executeQuery(doc, params); + + expect(result).to.deep.equal({ + data: { + fieldWithObjectInput: '{ c: "foo", d: "DeserializedValue" }', + }, + }); + }); + + it('errors on null for nested non-null', () => { + const params = { input: { a: 'foo', b: 'bar', c: null } }; + const result = executeQuery(doc, params); + + expectJSON(result).toDeepEqual({ + errors: [ + { + message: + 'Variable "$input" got invalid value null at "input.c"; Expected non-nullable type "String!" not to be null.', + locations: [{ line: 2, column: 16 }], + }, + ], + }); + }); + + it('errors on incorrect type', () => { + const result = executeQuery(doc, { input: 'foo bar' }); + + expectJSON(result).toDeepEqual({ + errors: [ + { + message: + 'Variable "$input" got invalid value "foo bar"; Expected type "TestInputObject" to be an object.', + locations: [{ line: 2, column: 16 }], + }, + ], + }); + }); + + it('errors on omission of nested non-null', () => { + const result = executeQuery(doc, { input: { a: 'foo', b: 'bar' } }); + + expectJSON(result).toDeepEqual({ + errors: [ + { + message: + 'Variable "$input" got invalid value { a: "foo", b: "bar" }; Field "c" of required type "String!" was not provided.', + locations: [{ line: 2, column: 16 }], + }, + ], + }); + }); + + it('errors on deep nested errors and with many errors', () => { + const nestedDoc = ` + query ($input: TestNestedInputObject) { + fieldWithNestedObjectInput(input: $input) + } + `; + const result = executeQuery(nestedDoc, { input: { na: { a: 'foo' } } }); + + expectJSON(result).toDeepEqual({ + errors: [ + { + message: + 'Variable "$input" got invalid value { a: "foo" } at "input.na"; Field "c" of required type "String!" was not provided.', + locations: [{ line: 2, column: 18 }], + }, + { + message: + 'Variable "$input" got invalid value { na: { a: "foo" } }; Field "nb" of required type "String!" was not provided.', + locations: [{ line: 2, column: 18 }], + }, + ], + }); + }); + + it('errors on addition of unknown input field', () => { + const params = { + input: { a: 'foo', b: 'bar', c: 'baz', extra: 'dog' }, + }; + const result = executeQuery(doc, params); + + expectJSON(result).toDeepEqual({ + errors: [ + { + message: + 'Variable "$input" got invalid value { a: "foo", b: "bar", c: "baz", extra: "dog" }; Field "extra" is not defined by type "TestInputObject".', + locations: [{ line: 2, column: 16 }], + }, + ], + }); + }); + }); + }); + + describe('Handles custom enum values', () => { + it('allows custom enum values as inputs', () => { + const result = executeQuery(` + { + null: fieldWithEnumInput(input: NULL) + NaN: fieldWithEnumInput(input: NAN) + false: fieldWithEnumInput(input: FALSE) + customValue: fieldWithEnumInput(input: CUSTOM) + defaultValue: fieldWithEnumInput(input: DEFAULT_VALUE) + } + `); + + expect(result).to.deep.equal({ + data: { + null: 'null', + NaN: 'NaN', + false: 'false', + customValue: '"custom value"', + defaultValue: '"DEFAULT_VALUE"', + }, + }); + }); + + it('allows non-nullable inputs to have null as enum custom value', () => { + const result = executeQuery(` + { + fieldWithNonNullableEnumInput(input: NULL) + } + `); + + expect(result).to.deep.equal({ + data: { + fieldWithNonNullableEnumInput: 'null', + }, + }); + }); + }); + + describe('Handles nullable scalars', () => { + it('allows nullable inputs to be omitted', () => { + const result = executeQuery(` + { + fieldWithNullableStringInput + } + `); + + expect(result).to.deep.equal({ + data: { + fieldWithNullableStringInput: null, + }, + }); + }); + + it('allows nullable inputs to be omitted in a variable', () => { + const result = executeQuery(` + query ($value: String) { + fieldWithNullableStringInput(input: $value) + } + `); + + expect(result).to.deep.equal({ + data: { + fieldWithNullableStringInput: null, + }, + }); + }); + + it('allows nullable inputs to be omitted in an unlisted variable', () => { + const result = executeQuery(` + query { + fieldWithNullableStringInput(input: $value) + } + `); + + expect(result).to.deep.equal({ + data: { + fieldWithNullableStringInput: null, + }, + }); + }); + + it('allows nullable inputs to be set to null in a variable', () => { + const doc = ` + query ($value: String) { + fieldWithNullableStringInput(input: $value) + } + `; + const result = executeQuery(doc, { value: null }); + + expect(result).to.deep.equal({ + data: { + fieldWithNullableStringInput: 'null', + }, + }); + }); + + it('allows nullable inputs to be set to a value in a variable', () => { + const doc = ` + query ($value: String) { + fieldWithNullableStringInput(input: $value) + } + `; + const result = executeQuery(doc, { value: 'a' }); + + expect(result).to.deep.equal({ + data: { + fieldWithNullableStringInput: '"a"', + }, + }); + }); + + it('allows nullable inputs to be set to a value directly', () => { + const result = executeQuery(` + { + fieldWithNullableStringInput(input: "a") + } + `); + + expect(result).to.deep.equal({ + data: { + fieldWithNullableStringInput: '"a"', + }, + }); + }); + }); + + describe('Handles non-nullable scalars', () => { + it('allows non-nullable variable to be omitted given a default', () => { + const result = executeQuery(` + query ($value: String! = "default") { + fieldWithNullableStringInput(input: $value) + } + `); + + expect(result).to.deep.equal({ + data: { + fieldWithNullableStringInput: '"default"', + }, + }); + }); + + it('allows non-nullable inputs to be omitted given a default', () => { + const result = executeQuery(` + query ($value: String = "default") { + fieldWithNonNullableStringInput(input: $value) + } + `); + + expect(result).to.deep.equal({ + data: { + fieldWithNonNullableStringInput: '"default"', + }, + }); + }); + + it('does not allow non-nullable inputs to be omitted in a variable', () => { + const result = executeQuery(` + query ($value: String!) { + fieldWithNonNullableStringInput(input: $value) + } + `); + + expectJSON(result).toDeepEqual({ + errors: [ + { + message: + 'Variable "$value" of required type "String!" was not provided.', + locations: [{ line: 2, column: 16 }], + }, + ], + }); + }); + + it('does not allow non-nullable inputs to be set to null in a variable', () => { + const doc = ` + query ($value: String!) { + fieldWithNonNullableStringInput(input: $value) + } + `; + const result = executeQuery(doc, { value: null }); + + expectJSON(result).toDeepEqual({ + errors: [ + { + message: + 'Variable "$value" of non-null type "String!" must not be null.', + locations: [{ line: 2, column: 16 }], + }, + ], + }); + }); + + it('allows non-nullable inputs to be set to a value in a variable', () => { + const doc = ` + query ($value: String!) { + fieldWithNonNullableStringInput(input: $value) + } + `; + const result = executeQuery(doc, { value: 'a' }); + + expect(result).to.deep.equal({ + data: { + fieldWithNonNullableStringInput: '"a"', + }, + }); + }); + + it('allows non-nullable inputs to be set to a value directly', () => { + const result = executeQuery(` + { + fieldWithNonNullableStringInput(input: "a") + } + `); + + expect(result).to.deep.equal({ + data: { + fieldWithNonNullableStringInput: '"a"', + }, + }); + }); + + it('reports error for missing non-nullable inputs', () => { + const result = executeQuery('{ fieldWithNonNullableStringInput }'); + + expectJSON(result).toDeepEqual({ + data: { + fieldWithNonNullableStringInput: null, + }, + errors: [ + { + message: + 'Argument "input" of required type "String!" was not provided.', + locations: [{ line: 1, column: 3 }], + path: ['fieldWithNonNullableStringInput'], + }, + ], + }); + }); + + it('reports error for array passed into string input', () => { + const doc = ` + query ($value: String!) { + fieldWithNonNullableStringInput(input: $value) + } + `; + const result = executeQuery(doc, { value: [1, 2, 3] }); + + expectJSON(result).toDeepEqual({ + errors: [ + { + message: + 'Variable "$value" got invalid value [1, 2, 3]; String cannot represent a non string value: [1, 2, 3]', + locations: [{ line: 2, column: 16 }], + }, + ], + }); + + expect(result).to.have.nested.property('errors[0].originalError'); + }); + + it('reports error for non-provided variables for non-nullable inputs', () => { + // Note: this test would typically fail validation before encountering + // this execution error, however for queries which previously validated + // and are being run against a new schema which have introduced a breaking + // change to make a formerly non-required argument required, this asserts + // failure before allowing the underlying code to receive a non-null value. + const result = executeQuery(` + { + fieldWithNonNullableStringInput(input: $foo) + } + `); + + expectJSON(result).toDeepEqual({ + data: { + fieldWithNonNullableStringInput: null, + }, + errors: [ + { + message: + 'Argument "input" of required type "String!" was provided the variable "$foo" which was not provided a runtime value.', + locations: [{ line: 3, column: 50 }], + path: ['fieldWithNonNullableStringInput'], + }, + ], + }); + }); + }); + + describe('Handles lists and nullability', () => { + it('allows lists to be null', () => { + const doc = ` + query ($input: [String]) { + list(input: $input) + } + `; + const result = executeQuery(doc, { input: null }); + + expect(result).to.deep.equal({ data: { list: 'null' } }); + }); + + it('allows lists to contain values', () => { + const doc = ` + query ($input: [String]) { + list(input: $input) + } + `; + const result = executeQuery(doc, { input: ['A'] }); + + expect(result).to.deep.equal({ data: { list: '["A"]' } }); + }); + + it('allows lists to contain null', () => { + const doc = ` + query ($input: [String]) { + list(input: $input) + } + `; + const result = executeQuery(doc, { input: ['A', null, 'B'] }); + + expect(result).to.deep.equal({ data: { list: '["A", null, "B"]' } }); + }); + + it('does not allow non-null lists to be null', () => { + const doc = ` + query ($input: [String]!) { + nnList(input: $input) + } + `; + const result = executeQuery(doc, { input: null }); + + expectJSON(result).toDeepEqual({ + errors: [ + { + message: + 'Variable "$input" of non-null type "[String]!" must not be null.', + locations: [{ line: 2, column: 16 }], + }, + ], + }); + }); + + it('allows non-null lists to contain values', () => { + const doc = ` + query ($input: [String]!) { + nnList(input: $input) + } + `; + const result = executeQuery(doc, { input: ['A'] }); + + expect(result).to.deep.equal({ data: { nnList: '["A"]' } }); + }); + + it('allows non-null lists to contain null', () => { + const doc = ` + query ($input: [String]!) { + nnList(input: $input) + } + `; + const result = executeQuery(doc, { input: ['A', null, 'B'] }); + + expect(result).to.deep.equal({ data: { nnList: '["A", null, "B"]' } }); + }); + + it('allows lists of non-nulls to be null', () => { + const doc = ` + query ($input: [String!]) { + listNN(input: $input) + } + `; + const result = executeQuery(doc, { input: null }); + + expect(result).to.deep.equal({ data: { listNN: 'null' } }); + }); + + it('allows lists of non-nulls to contain values', () => { + const doc = ` + query ($input: [String!]) { + listNN(input: $input) + } + `; + const result = executeQuery(doc, { input: ['A'] }); + + expect(result).to.deep.equal({ data: { listNN: '["A"]' } }); + }); + + it('does not allow lists of non-nulls to contain null', () => { + const doc = ` + query ($input: [String!]) { + listNN(input: $input) + } + `; + const result = executeQuery(doc, { input: ['A', null, 'B'] }); + + expectJSON(result).toDeepEqual({ + errors: [ + { + message: + 'Variable "$input" got invalid value null at "input[1]"; Expected non-nullable type "String!" not to be null.', + locations: [{ line: 2, column: 16 }], + }, + ], + }); + }); + + it('does not allow non-null lists of non-nulls to be null', () => { + const doc = ` + query ($input: [String!]!) { + nnListNN(input: $input) + } + `; + const result = executeQuery(doc, { input: null }); + + expectJSON(result).toDeepEqual({ + errors: [ + { + message: + 'Variable "$input" of non-null type "[String!]!" must not be null.', + locations: [{ line: 2, column: 16 }], + }, + ], + }); + }); + + it('allows non-null lists of non-nulls to contain values', () => { + const doc = ` + query ($input: [String!]!) { + nnListNN(input: $input) + } + `; + const result = executeQuery(doc, { input: ['A'] }); + + expect(result).to.deep.equal({ data: { nnListNN: '["A"]' } }); + }); + + it('does not allow non-null lists of non-nulls to contain null', () => { + const doc = ` + query ($input: [String!]!) { + nnListNN(input: $input) + } + `; + const result = executeQuery(doc, { input: ['A', null, 'B'] }); + + expectJSON(result).toDeepEqual({ + errors: [ + { + message: + 'Variable "$input" got invalid value null at "input[1]"; Expected non-nullable type "String!" not to be null.', + locations: [{ line: 2, column: 16 }], + }, + ], + }); + }); + + it('does not allow invalid types to be used as values', () => { + const doc = ` + query ($input: TestType!) { + fieldWithObjectInput(input: $input) + } + `; + const result = executeQuery(doc, { input: { list: ['A', 'B'] } }); + + expectJSON(result).toDeepEqual({ + errors: [ + { + message: + 'Variable "$input" expected value of type "TestType!" which cannot be used as an input type.', + locations: [{ line: 2, column: 24 }], + }, + ], + }); + }); + + it('does not allow unknown types to be used as values', () => { + const doc = ` + query ($input: UnknownType!) { + fieldWithObjectInput(input: $input) + } + `; + const result = executeQuery(doc, { input: 'WhoKnows' }); + + expectJSON(result).toDeepEqual({ + errors: [ + { + message: + 'Variable "$input" expected value of type "UnknownType!" which cannot be used as an input type.', + locations: [{ line: 2, column: 24 }], + }, + ], + }); + }); + }); + + describe('Execute: Uses argument default values', () => { + it('when no argument provided', () => { + const result = executeQuery('{ fieldWithDefaultArgumentValue }'); + + expect(result).to.deep.equal({ + data: { + fieldWithDefaultArgumentValue: '"Hello World"', + }, + }); + }); + + it('when omitted variable provided', () => { + const result = executeQuery(` + query ($optional: String) { + fieldWithDefaultArgumentValue(input: $optional) + } + `); + + expect(result).to.deep.equal({ + data: { + fieldWithDefaultArgumentValue: '"Hello World"', + }, + }); + }); + + it('not when argument cannot be coerced', () => { + const result = executeQuery(` + { + fieldWithDefaultArgumentValue(input: WRONG_TYPE) + } + `); + + expectJSON(result).toDeepEqual({ + data: { + fieldWithDefaultArgumentValue: null, + }, + errors: [ + { + message: 'Argument "input" has invalid value WRONG_TYPE.', + locations: [{ line: 3, column: 48 }], + path: ['fieldWithDefaultArgumentValue'], + }, + ], + }); + }); + + it('when no runtime value is provided to a non-null argument', () => { + const result = executeQuery(` + query optionalVariable($optional: String) { + fieldWithNonNullableStringInputAndDefaultArgumentValue(input: $optional) + } + `); + + expect(result).to.deep.equal({ + data: { + fieldWithNonNullableStringInputAndDefaultArgumentValue: + '"Hello World"', + }, + }); + }); + }); + + describe('getVariableValues: limit maximum number of coercion errors', () => { + const doc = parse(` + query ($input: [String!]) { + listNN(input: $input) + } + `); + + const operation = doc.definitions[0]; + invariant(operation.kind === Kind.OPERATION_DEFINITION); + const { variableDefinitions } = operation; + invariant(variableDefinitions != null); + + const inputValue = { input: [0, 1, 2] }; + + function invalidValueError(value: number, index: number) { + return { + message: `Variable "$input" got invalid value ${value} at "input[${index}]"; String cannot represent a non string value: ${value}`, + locations: [{ line: 2, column: 14 }], + }; + } + + it('return all errors by default', () => { + const result = getVariableValues(schema, variableDefinitions, inputValue); + + expectJSON(result).toDeepEqual({ + errors: [ + invalidValueError(0, 0), + invalidValueError(1, 1), + invalidValueError(2, 2), + ], + }); + }); + + it('when maxErrors is equal to number of errors', () => { + const result = getVariableValues( + schema, + variableDefinitions, + inputValue, + { maxErrors: 3 }, + ); + + expectJSON(result).toDeepEqual({ + errors: [ + invalidValueError(0, 0), + invalidValueError(1, 1), + invalidValueError(2, 2), + ], + }); + }); + + it('when maxErrors is less than number of errors', () => { + const result = getVariableValues( + schema, + variableDefinitions, + inputValue, + { maxErrors: 2 }, + ); + + expectJSON(result).toDeepEqual({ + errors: [ + invalidValueError(0, 0), + invalidValueError(1, 1), + { + message: + 'Too many errors processing variables, error limit reached. Execution aborted.', + }, + ], + }); + }); + }); +}); diff --git a/src/execution/collectFields.ts b/src/execution/collectFields.ts new file mode 100644 index 00000000..d0961bfa --- /dev/null +++ b/src/execution/collectFields.ts @@ -0,0 +1,212 @@ +import type { ObjMap } from '../jsutils/ObjMap'; + +import type { + FieldNode, + FragmentDefinitionNode, + FragmentSpreadNode, + InlineFragmentNode, + SelectionSetNode, +} from '../language/ast'; +import { Kind } from '../language/kinds'; + +import type { GraphQLObjectType } from '../type/definition'; +import { isAbstractType } from '../type/definition'; +import { + GraphQLIncludeDirective, + GraphQLSkipDirective, +} from '../type/directives'; +import type { GraphQLSchema } from '../type/schema'; + +import { typeFromAST } from '../utilities/typeFromAST'; + +import { getDirectiveValues } from './values'; + +/** + * Given a selectionSet, collects all of the fields and returns them. + * + * CollectFields requires the "runtime type" of an object. For a field that + * returns an Interface or Union type, the "runtime type" will be the actual + * object type returned by that field. + * + * @internal + */ +export function collectFields( + schema: GraphQLSchema, + fragments: ObjMap, + variableValues: { [variable: string]: unknown }, + runtimeType: GraphQLObjectType, + selectionSet: SelectionSetNode, +): Map> { + const fields = new Map(); + collectFieldsImpl( + schema, + fragments, + variableValues, + runtimeType, + selectionSet, + fields, + new Set(), + ); + return fields; +} + +/** + * Given an array of field nodes, collects all of the subfields of the passed + * in fields, and returns them at the end. + * + * CollectSubFields requires the "return type" of an object. For a field that + * returns an Interface or Union type, the "return type" will be the actual + * object type returned by that field. + * + * @internal + */ +export function collectSubfields( + schema: GraphQLSchema, + fragments: ObjMap, + variableValues: { [variable: string]: unknown }, + returnType: GraphQLObjectType, + fieldNodes: ReadonlyArray, +): Map> { + const subFieldNodes = new Map(); + const visitedFragmentNames = new Set(); + for (const node of fieldNodes) { + if (node.selectionSet) { + collectFieldsImpl( + schema, + fragments, + variableValues, + returnType, + node.selectionSet, + subFieldNodes, + visitedFragmentNames, + ); + } + } + return subFieldNodes; +} + +function collectFieldsImpl( + schema: GraphQLSchema, + fragments: ObjMap, + variableValues: { [variable: string]: unknown }, + runtimeType: GraphQLObjectType, + selectionSet: SelectionSetNode, + fields: Map>, + visitedFragmentNames: Set, +): void { + for (const selection of selectionSet.selections) { + switch (selection.kind) { + case Kind.FIELD: { + if (!shouldIncludeNode(variableValues, selection)) { + continue; + } + const name = getFieldEntryKey(selection); + const fieldList = fields.get(name); + if (fieldList !== undefined) { + fieldList.push(selection); + } else { + fields.set(name, [selection]); + } + break; + } + case Kind.INLINE_FRAGMENT: { + if ( + !shouldIncludeNode(variableValues, selection) || + !doesFragmentConditionMatch(schema, selection, runtimeType) + ) { + continue; + } + collectFieldsImpl( + schema, + fragments, + variableValues, + runtimeType, + selection.selectionSet, + fields, + visitedFragmentNames, + ); + break; + } + case Kind.FRAGMENT_SPREAD: { + const fragName = selection.name.value; + if ( + visitedFragmentNames.has(fragName) || + !shouldIncludeNode(variableValues, selection) + ) { + continue; + } + visitedFragmentNames.add(fragName); + const fragment = fragments[fragName]; + if ( + !fragment || + !doesFragmentConditionMatch(schema, fragment, runtimeType) + ) { + continue; + } + collectFieldsImpl( + schema, + fragments, + variableValues, + runtimeType, + fragment.selectionSet, + fields, + visitedFragmentNames, + ); + break; + } + } + } +} + +/** + * Determines if a field should be included based on the `@include` and `@skip` + * directives, where `@skip` has higher precedence than `@include`. + */ +function shouldIncludeNode( + variableValues: { [variable: string]: unknown }, + node: FragmentSpreadNode | FieldNode | InlineFragmentNode, +): boolean { + const skip = getDirectiveValues(GraphQLSkipDirective, node, variableValues); + if (skip?.if === true) { + return false; + } + + const include = getDirectiveValues( + GraphQLIncludeDirective, + node, + variableValues, + ); + if (include?.if === false) { + return false; + } + return true; +} + +/** + * Determines if a fragment is applicable to the given type. + */ +function doesFragmentConditionMatch( + schema: GraphQLSchema, + fragment: FragmentDefinitionNode | InlineFragmentNode, + type: GraphQLObjectType, +): boolean { + const typeConditionNode = fragment.typeCondition; + if (!typeConditionNode) { + return true; + } + const conditionalType = typeFromAST(schema, typeConditionNode); + if (conditionalType === type) { + return true; + } + if (isAbstractType(conditionalType)) { + return schema.isSubType(conditionalType, type); + } + return false; +} + +/** + * Implements the logic to compute the key of a given field's entry + */ +function getFieldEntryKey(node: FieldNode): string { + return node.alias ? node.alias.value : node.name.value; +} diff --git a/src/execution/execute.ts b/src/execution/execute.ts new file mode 100644 index 00000000..d3c21385 --- /dev/null +++ b/src/execution/execute.ts @@ -0,0 +1,1055 @@ +import { devAssert } from '../jsutils/devAssert'; +import { inspect } from '../jsutils/inspect'; +import { invariant } from '../jsutils/invariant'; +import { isIterableObject } from '../jsutils/isIterableObject'; +import { isObjectLike } from '../jsutils/isObjectLike'; +import { isPromise } from '../jsutils/isPromise'; +import type { Maybe } from '../jsutils/Maybe'; +import { memoize3 } from '../jsutils/memoize3'; +import type { ObjMap } from '../jsutils/ObjMap'; +import type { Path } from '../jsutils/Path'; +import { addPath, pathToArray } from '../jsutils/Path'; +import { promiseForObject } from '../jsutils/promiseForObject'; +import type { PromiseOrValue } from '../jsutils/PromiseOrValue'; +import { promiseReduce } from '../jsutils/promiseReduce'; + +import type { GraphQLFormattedError } from '../error/GraphQLError'; +import { GraphQLError } from '../error/GraphQLError'; +import { locatedError } from '../error/locatedError'; + +import type { + DocumentNode, + FieldNode, + FragmentDefinitionNode, + OperationDefinitionNode, +} from '../language/ast'; +import { OperationTypeNode } from '../language/ast'; +import { Kind } from '../language/kinds'; + +import type { + GraphQLAbstractType, + GraphQLField, + GraphQLFieldResolver, + GraphQLLeafType, + GraphQLList, + GraphQLObjectType, + GraphQLOutputType, + GraphQLResolveInfo, + GraphQLTypeResolver, +} from '../type/definition'; +import { + isAbstractType, + isLeafType, + isListType, + isNonNullType, + isObjectType, +} from '../type/definition'; +import { + SchemaMetaFieldDef, + TypeMetaFieldDef, + TypeNameMetaFieldDef, +} from '../type/introspection'; +import type { GraphQLSchema } from '../type/schema'; +import { assertValidSchema } from '../type/validate'; + +import { + collectFields, + collectSubfields as _collectSubfields, +} from './collectFields'; +import { getArgumentValues, getVariableValues } from './values'; + +/** + * A memoized collection of relevant subfields with regard to the return + * type. Memoizing ensures the subfields are not repeatedly calculated, which + * saves overhead when resolving lists of values. + */ +const collectSubfields = memoize3( + ( + exeContext: ExecutionContext, + returnType: GraphQLObjectType, + fieldNodes: ReadonlyArray, + ) => + _collectSubfields( + exeContext.schema, + exeContext.fragments, + exeContext.variableValues, + returnType, + fieldNodes, + ), +); + +/** + * Terminology + * + * "Definitions" are the generic name for top-level statements in the document. + * Examples of this include: + * 1) Operations (such as a query) + * 2) Fragments + * + * "Operations" are a generic name for requests in the document. + * Examples of this include: + * 1) query, + * 2) mutation + * + * "Selections" are the definitions that can appear legally and at + * single level of the query. These include: + * 1) field references e.g `a` + * 2) fragment "spreads" e.g. `...c` + * 3) inline fragment "spreads" e.g. `...on Type { a }` + */ + +/** + * Data that must be available at all points during query execution. + * + * Namely, schema of the type system that is currently executing, + * and the fragments defined in the query document + */ +export interface ExecutionContext { + schema: GraphQLSchema; + fragments: ObjMap; + rootValue: unknown; + contextValue: unknown; + operation: OperationDefinitionNode; + variableValues: { [variable: string]: unknown }; + fieldResolver: GraphQLFieldResolver; + typeResolver: GraphQLTypeResolver; + subscribeFieldResolver: GraphQLFieldResolver; + errors: Array; +} + +/** + * The result of GraphQL execution. + * + * - `errors` is included when any errors occurred as a non-empty array. + * - `data` is the result of a successful execution of the query. + * - `extensions` is reserved for adding non-standard properties. + */ +export interface ExecutionResult< + TData = ObjMap, + TExtensions = ObjMap, +> { + errors?: ReadonlyArray; + data?: TData | null; + extensions?: TExtensions; +} + +export interface FormattedExecutionResult< + TData = ObjMap, + TExtensions = ObjMap, +> { + errors?: ReadonlyArray; + data?: TData | null; + extensions?: TExtensions; +} + +export interface ExecutionArgs { + schema: GraphQLSchema; + document: DocumentNode; + rootValue?: unknown; + contextValue?: unknown; + variableValues?: Maybe<{ readonly [variable: string]: unknown }>; + operationName?: Maybe; + fieldResolver?: Maybe>; + typeResolver?: Maybe>; + subscribeFieldResolver?: Maybe>; +} + +/** + * Implements the "Executing requests" section of the GraphQL specification. + * + * Returns either a synchronous ExecutionResult (if all encountered resolvers + * are synchronous), or a Promise of an ExecutionResult that will eventually be + * resolved and never rejected. + * + * If the arguments to this function do not result in a legal execution context, + * a GraphQLError will be thrown immediately explaining the invalid input. + */ +export function execute(args: ExecutionArgs): PromiseOrValue { + // Temporary for v15 to v16 migration. Remove in v17 + devAssert( + arguments.length < 2, + 'graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.', + ); + + const { schema, document, variableValues, rootValue } = args; + + // If arguments are missing or incorrect, throw an error. + assertValidExecutionArguments(schema, document, variableValues); + + // If a valid execution context cannot be created due to incorrect arguments, + // a "Response" with only errors is returned. + const exeContext = buildExecutionContext(args); + + // Return early errors if execution context failed. + if (!('schema' in exeContext)) { + return { errors: exeContext }; + } + + // Return a Promise that will eventually resolve to the data described by + // The "Response" section of the GraphQL specification. + // + // If errors are encountered while executing a GraphQL field, only that + // field and its descendants will be omitted, and sibling fields will still + // be executed. An execution which encounters errors will still result in a + // resolved Promise. + // + // Errors from sub-fields of a NonNull type may propagate to the top level, + // at which point we still log the error and null the parent field, which + // in this case is the entire response. + try { + const { operation } = exeContext; + const result = executeOperation(exeContext, operation, rootValue); + if (isPromise(result)) { + return result.then( + (data) => buildResponse(data, exeContext.errors), + (error) => { + exeContext.errors.push(error); + return buildResponse(null, exeContext.errors); + }, + ); + } + return buildResponse(result, exeContext.errors); + } catch (error) { + exeContext.errors.push(error); + return buildResponse(null, exeContext.errors); + } +} + +/** + * Also implements the "Executing requests" section of the GraphQL specification. + * However, it guarantees to complete synchronously (or throw an error) assuming + * that all field resolvers are also synchronous. + */ +export function executeSync(args: ExecutionArgs): ExecutionResult { + const result = execute(args); + + // Assert that the execution was synchronous. + if (isPromise(result)) { + throw new Error('GraphQL execution failed to complete synchronously.'); + } + + return result; +} + +/** + * Given a completed execution context and data, build the `{ errors, data }` + * response defined by the "Response" section of the GraphQL specification. + */ +function buildResponse( + data: ObjMap | null, + errors: ReadonlyArray, +): ExecutionResult { + return errors.length === 0 ? { data } : { errors, data }; +} + +/** + * Essential assertions before executing to provide developer feedback for + * improper use of the GraphQL library. + * + * @internal + */ +export function assertValidExecutionArguments( + schema: GraphQLSchema, + document: DocumentNode, + rawVariableValues: Maybe<{ readonly [variable: string]: unknown }>, +): void { + devAssert(document, 'Must provide document.'); + + // If the schema used for execution is invalid, throw an error. + assertValidSchema(schema); + + // Variables, if provided, must be an object. + devAssert( + rawVariableValues == null || isObjectLike(rawVariableValues), + 'Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.', + ); +} + +/** + * Constructs a ExecutionContext object from the arguments passed to + * execute, which we will pass throughout the other execution methods. + * + * Throws a GraphQLError if a valid execution context cannot be created. + * + * @internal + */ +export function buildExecutionContext( + args: ExecutionArgs, +): ReadonlyArray | ExecutionContext { + const { + schema, + document, + rootValue, + contextValue, + variableValues: rawVariableValues, + operationName, + fieldResolver, + typeResolver, + subscribeFieldResolver, + } = args; + + let operation: OperationDefinitionNode | undefined; + const fragments: ObjMap = Object.create(null); + for (const definition of document.definitions) { + switch (definition.kind) { + case Kind.OPERATION_DEFINITION: + if (operationName == null) { + if (operation !== undefined) { + return [ + new GraphQLError( + 'Must provide operation name if query contains multiple operations.', + ), + ]; + } + operation = definition; + } else if (definition.name?.value === operationName) { + operation = definition; + } + break; + case Kind.FRAGMENT_DEFINITION: + fragments[definition.name.value] = definition; + break; + default: + // ignore non-executable definitions + } + } + + if (!operation) { + if (operationName != null) { + return [new GraphQLError(`Unknown operation named "${operationName}".`)]; + } + return [new GraphQLError('Must provide an operation.')]; + } + + // FIXME: https://github.com/graphql/graphql-js/issues/2203 + /* c8 ignore next */ + const variableDefinitions = operation.variableDefinitions ?? []; + + const coercedVariableValues = getVariableValues( + schema, + variableDefinitions, + rawVariableValues ?? {}, + { maxErrors: 50 }, + ); + + if (coercedVariableValues.errors) { + return coercedVariableValues.errors; + } + + return { + schema, + fragments, + rootValue, + contextValue, + operation, + variableValues: coercedVariableValues.coerced, + fieldResolver: fieldResolver ?? defaultFieldResolver, + typeResolver: typeResolver ?? defaultTypeResolver, + subscribeFieldResolver: subscribeFieldResolver ?? defaultFieldResolver, + errors: [], + }; +} + +/** + * Implements the "Executing operations" section of the spec. + */ +function executeOperation( + exeContext: ExecutionContext, + operation: OperationDefinitionNode, + rootValue: unknown, +): PromiseOrValue | null> { + const rootType = exeContext.schema.getRootType(operation.operation); + if (rootType == null) { + throw new GraphQLError( + `Schema is not configured to execute ${operation.operation} operation.`, + operation, + ); + } + + const rootFields = collectFields( + exeContext.schema, + exeContext.fragments, + exeContext.variableValues, + rootType, + operation.selectionSet, + ); + const path = undefined; + + switch (operation.operation) { + case OperationTypeNode.QUERY: + return executeFields(exeContext, rootType, rootValue, path, rootFields); + case OperationTypeNode.MUTATION: + return executeFieldsSerially( + exeContext, + rootType, + rootValue, + path, + rootFields, + ); + case OperationTypeNode.SUBSCRIPTION: + // TODO: deprecate `subscribe` and move all logic here + // Temporary solution until we finish merging execute and subscribe together + return executeFields(exeContext, rootType, rootValue, path, rootFields); + } +} + +/** + * Implements the "Executing selection sets" section of the spec + * for fields that must be executed serially. + */ +function executeFieldsSerially( + exeContext: ExecutionContext, + parentType: GraphQLObjectType, + sourceValue: unknown, + path: Path | undefined, + fields: Map>, +): PromiseOrValue> { + return promiseReduce( + fields.entries(), + (results, [responseName, fieldNodes]) => { + const fieldPath = addPath(path, responseName, parentType.name); + const result = executeField( + exeContext, + parentType, + sourceValue, + fieldNodes, + fieldPath, + ); + if (result === undefined) { + return results; + } + if (isPromise(result)) { + return result.then((resolvedResult) => { + results[responseName] = resolvedResult; + return results; + }); + } + results[responseName] = result; + return results; + }, + Object.create(null), + ); +} + +/** + * Implements the "Executing selection sets" section of the spec + * for fields that may be executed in parallel. + */ +function executeFields( + exeContext: ExecutionContext, + parentType: GraphQLObjectType, + sourceValue: unknown, + path: Path | undefined, + fields: Map>, +): PromiseOrValue> { + const results = Object.create(null); + let containsPromise = false; + + for (const [responseName, fieldNodes] of fields.entries()) { + const fieldPath = addPath(path, responseName, parentType.name); + const result = executeField( + exeContext, + parentType, + sourceValue, + fieldNodes, + fieldPath, + ); + + if (result !== undefined) { + results[responseName] = result; + if (isPromise(result)) { + containsPromise = true; + } + } + } + + // If there are no promises, we can just return the object + if (!containsPromise) { + return results; + } + + // Otherwise, results is a map from field name to the result of resolving that + // field, which is possibly a promise. Return a promise that will return this + // same map, but with any promises replaced with the values they resolved to. + return promiseForObject(results); +} + +/** + * Implements the "Executing fields" section of the spec + * In particular, this function figures out the value that the field returns by + * calling its resolve function, then calls completeValue to complete promises, + * serialize scalars, or execute the sub-selection-set for objects. + */ +function executeField( + exeContext: ExecutionContext, + parentType: GraphQLObjectType, + source: unknown, + fieldNodes: ReadonlyArray, + path: Path, +): PromiseOrValue { + const fieldDef = getFieldDef(exeContext.schema, parentType, fieldNodes[0]); + if (!fieldDef) { + return; + } + + const returnType = fieldDef.type; + const resolveFn = fieldDef.resolve ?? exeContext.fieldResolver; + + const info = buildResolveInfo( + exeContext, + fieldDef, + fieldNodes, + parentType, + path, + ); + + // Get the resolve function, regardless of if its result is normal or abrupt (error). + try { + // Build a JS object of arguments from the field.arguments AST, using the + // variables scope to fulfill any variable references. + // TODO: find a way to memoize, in case this field is within a List type. + const args = getArgumentValues( + fieldDef, + fieldNodes[0], + exeContext.variableValues, + ); + + // The resolve function's optional third argument is a context value that + // is provided to every resolve function within an execution. It is commonly + // used to represent an authenticated user, or request-specific caches. + const contextValue = exeContext.contextValue; + + const result = resolveFn(source, args, contextValue, info); + + let completed; + if (isPromise(result)) { + completed = result.then((resolved) => + completeValue(exeContext, returnType, fieldNodes, info, path, resolved), + ); + } else { + completed = completeValue( + exeContext, + returnType, + fieldNodes, + info, + path, + result, + ); + } + + if (isPromise(completed)) { + // Note: we don't rely on a `catch` method, but we do expect "thenable" + // to take a second callback for the error case. + return completed.then(undefined, (rawError) => { + const error = locatedError(rawError, fieldNodes, pathToArray(path)); + return handleFieldError(error, returnType, exeContext); + }); + } + return completed; + } catch (rawError) { + const error = locatedError(rawError, fieldNodes, pathToArray(path)); + return handleFieldError(error, returnType, exeContext); + } +} + +/** + * @internal + */ +export function buildResolveInfo( + exeContext: ExecutionContext, + fieldDef: GraphQLField, + fieldNodes: ReadonlyArray, + parentType: GraphQLObjectType, + path: Path, +): GraphQLResolveInfo { + // The resolve function's optional fourth argument is a collection of + // information about the current execution state. + return { + fieldName: fieldDef.name, + fieldNodes, + returnType: fieldDef.type, + parentType, + path, + schema: exeContext.schema, + fragments: exeContext.fragments, + rootValue: exeContext.rootValue, + operation: exeContext.operation, + variableValues: exeContext.variableValues, + }; +} + +function handleFieldError( + error: GraphQLError, + returnType: GraphQLOutputType, + exeContext: ExecutionContext, +): null { + // If the field type is non-nullable, then it is resolved without any + // protection from errors, however it still properly locates the error. + if (isNonNullType(returnType)) { + throw error; + } + + // Otherwise, error protection is applied, logging the error and resolving + // a null value for this field if one is encountered. + exeContext.errors.push(error); + return null; +} + +/** + * Implements the instructions for completeValue as defined in the + * "Value Completion" section of the spec. + * + * If the field type is Non-Null, then this recursively completes the value + * for the inner type. It throws a field error if that completion returns null, + * as per the "Nullability" section of the spec. + * + * If the field type is a List, then this recursively completes the value + * for the inner type on each item in the list. + * + * If the field type is a Scalar or Enum, ensures the completed value is a legal + * value of the type by calling the `serialize` method of GraphQL type + * definition. + * + * If the field is an abstract type, determine the runtime type of the value + * and then complete based on that type + * + * Otherwise, the field type expects a sub-selection set, and will complete the + * value by executing all sub-selections. + */ +function completeValue( + exeContext: ExecutionContext, + returnType: GraphQLOutputType, + fieldNodes: ReadonlyArray, + info: GraphQLResolveInfo, + path: Path, + result: unknown, +): PromiseOrValue { + // If result is an Error, throw a located error. + if (result instanceof Error) { + throw result; + } + + // If field type is NonNull, complete for inner type, and throw field error + // if result is null. + if (isNonNullType(returnType)) { + const completed = completeValue( + exeContext, + returnType.ofType, + fieldNodes, + info, + path, + result, + ); + if (completed === null) { + throw new Error( + `Cannot return null for non-nullable field ${info.parentType.name}.${info.fieldName}.`, + ); + } + return completed; + } + + // If result value is null or undefined then return null. + if (result == null) { + return null; + } + + // If field type is List, complete each item in the list with the inner type + if (isListType(returnType)) { + return completeListValue( + exeContext, + returnType, + fieldNodes, + info, + path, + result, + ); + } + + // If field type is a leaf type, Scalar or Enum, serialize to a valid value, + // returning null if serialization is not possible. + if (isLeafType(returnType)) { + return completeLeafValue(returnType, result); + } + + // If field type is an abstract type, Interface or Union, determine the + // runtime Object type and complete for that type. + if (isAbstractType(returnType)) { + return completeAbstractValue( + exeContext, + returnType, + fieldNodes, + info, + path, + result, + ); + } + + // If field type is Object, execute and complete all sub-selections. + if (isObjectType(returnType)) { + return completeObjectValue( + exeContext, + returnType, + fieldNodes, + info, + path, + result, + ); + } + /* c8 ignore next 6 */ + // Not reachable, all possible output types have been considered. + invariant( + false, + 'Cannot complete value of unexpected output type: ' + inspect(returnType), + ); +} + +/** + * Complete a list value by completing each item in the list with the + * inner type + */ +function completeListValue( + exeContext: ExecutionContext, + returnType: GraphQLList, + fieldNodes: ReadonlyArray, + info: GraphQLResolveInfo, + path: Path, + result: unknown, +): PromiseOrValue> { + if (!isIterableObject(result)) { + throw new GraphQLError( + `Expected Iterable, but did not find one for field "${info.parentType.name}.${info.fieldName}".`, + ); + } + + // This is specified as a simple map, however we're optimizing the path + // where the list contains no Promises by avoiding creating another Promise. + const itemType = returnType.ofType; + let containsPromise = false; + const completedResults = Array.from(result, (item, index) => { + // No need to modify the info object containing the path, + // since from here on it is not ever accessed by resolver functions. + const itemPath = addPath(path, index, undefined); + try { + let completedItem; + if (isPromise(item)) { + completedItem = item.then((resolved) => + completeValue( + exeContext, + itemType, + fieldNodes, + info, + itemPath, + resolved, + ), + ); + } else { + completedItem = completeValue( + exeContext, + itemType, + fieldNodes, + info, + itemPath, + item, + ); + } + + if (isPromise(completedItem)) { + containsPromise = true; + // Note: we don't rely on a `catch` method, but we do expect "thenable" + // to take a second callback for the error case. + return completedItem.then(undefined, (rawError) => { + const error = locatedError( + rawError, + fieldNodes, + pathToArray(itemPath), + ); + return handleFieldError(error, itemType, exeContext); + }); + } + return completedItem; + } catch (rawError) { + const error = locatedError(rawError, fieldNodes, pathToArray(itemPath)); + return handleFieldError(error, itemType, exeContext); + } + }); + + return containsPromise ? Promise.all(completedResults) : completedResults; +} + +/** + * Complete a Scalar or Enum by serializing to a valid value, returning + * null if serialization is not possible. + */ +function completeLeafValue( + returnType: GraphQLLeafType, + result: unknown, +): unknown { + const serializedResult = returnType.serialize(result); + if (serializedResult == null) { + throw new Error( + `Expected \`${inspect(returnType)}.serialize(${inspect(result)})\` to ` + + `return non-nullable value, returned: ${inspect(serializedResult)}`, + ); + } + return serializedResult; +} + +/** + * Complete a value of an abstract type by determining the runtime object type + * of that value, then complete the value for that type. + */ +function completeAbstractValue( + exeContext: ExecutionContext, + returnType: GraphQLAbstractType, + fieldNodes: ReadonlyArray, + info: GraphQLResolveInfo, + path: Path, + result: unknown, +): PromiseOrValue> { + const resolveTypeFn = returnType.resolveType ?? exeContext.typeResolver; + const contextValue = exeContext.contextValue; + const runtimeType = resolveTypeFn(result, contextValue, info, returnType); + + if (isPromise(runtimeType)) { + return runtimeType.then((resolvedRuntimeType) => + completeObjectValue( + exeContext, + ensureValidRuntimeType( + resolvedRuntimeType, + exeContext, + returnType, + fieldNodes, + info, + result, + ), + fieldNodes, + info, + path, + result, + ), + ); + } + + return completeObjectValue( + exeContext, + ensureValidRuntimeType( + runtimeType, + exeContext, + returnType, + fieldNodes, + info, + result, + ), + fieldNodes, + info, + path, + result, + ); +} + +function ensureValidRuntimeType( + runtimeTypeName: unknown, + exeContext: ExecutionContext, + returnType: GraphQLAbstractType, + fieldNodes: ReadonlyArray, + info: GraphQLResolveInfo, + result: unknown, +): GraphQLObjectType { + if (runtimeTypeName == null) { + throw new GraphQLError( + `Abstract type "${returnType.name}" must resolve to an Object type at runtime for field "${info.parentType.name}.${info.fieldName}". Either the "${returnType.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`, + fieldNodes, + ); + } + + // releases before 16.0.0 supported returning `GraphQLObjectType` from `resolveType` + // TODO: remove in 17.0.0 release + if (isObjectType(runtimeTypeName)) { + throw new GraphQLError( + 'Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead.', + ); + } + + if (typeof runtimeTypeName !== 'string') { + throw new GraphQLError( + `Abstract type "${returnType.name}" must resolve to an Object type at runtime for field "${info.parentType.name}.${info.fieldName}" with ` + + `value ${inspect(result)}, received "${inspect(runtimeTypeName)}".`, + ); + } + + const runtimeType = exeContext.schema.getType(runtimeTypeName); + if (runtimeType == null) { + throw new GraphQLError( + `Abstract type "${returnType.name}" was resolved to a type "${runtimeTypeName}" that does not exist inside the schema.`, + fieldNodes, + ); + } + + if (!isObjectType(runtimeType)) { + throw new GraphQLError( + `Abstract type "${returnType.name}" was resolved to a non-object type "${runtimeTypeName}".`, + fieldNodes, + ); + } + + if (!exeContext.schema.isSubType(returnType, runtimeType)) { + throw new GraphQLError( + `Runtime Object type "${runtimeType.name}" is not a possible type for "${returnType.name}".`, + fieldNodes, + ); + } + + return runtimeType; +} + +/** + * Complete an Object value by executing all sub-selections. + */ +function completeObjectValue( + exeContext: ExecutionContext, + returnType: GraphQLObjectType, + fieldNodes: ReadonlyArray, + info: GraphQLResolveInfo, + path: Path, + result: unknown, +): PromiseOrValue> { + // Collect sub-fields to execute to complete this value. + const subFieldNodes = collectSubfields(exeContext, returnType, fieldNodes); + + // If there is an isTypeOf predicate function, call it with the + // current result. If isTypeOf returns false, then raise an error rather + // than continuing execution. + if (returnType.isTypeOf) { + const isTypeOf = returnType.isTypeOf(result, exeContext.contextValue, info); + + if (isPromise(isTypeOf)) { + return isTypeOf.then((resolvedIsTypeOf) => { + if (!resolvedIsTypeOf) { + throw invalidReturnTypeError(returnType, result, fieldNodes); + } + return executeFields( + exeContext, + returnType, + result, + path, + subFieldNodes, + ); + }); + } + + if (!isTypeOf) { + throw invalidReturnTypeError(returnType, result, fieldNodes); + } + } + + return executeFields(exeContext, returnType, result, path, subFieldNodes); +} + +function invalidReturnTypeError( + returnType: GraphQLObjectType, + result: unknown, + fieldNodes: ReadonlyArray, +): GraphQLError { + return new GraphQLError( + `Expected value of type "${returnType.name}" but got: ${inspect(result)}.`, + fieldNodes, + ); +} + +/** + * If a resolveType function is not given, then a default resolve behavior is + * used which attempts two strategies: + * + * First, See if the provided value has a `__typename` field defined, if so, use + * that value as name of the resolved type. + * + * Otherwise, test each possible type for the abstract type by calling + * isTypeOf for the object being coerced, returning the first type that matches. + */ +export const defaultTypeResolver: GraphQLTypeResolver = + function (value, contextValue, info, abstractType) { + // First, look for `__typename`. + if (isObjectLike(value) && typeof value.__typename === 'string') { + return value.__typename; + } + + // Otherwise, test each possible type. + const possibleTypes = info.schema.getPossibleTypes(abstractType); + const promisedIsTypeOfResults = []; + + for (let i = 0; i < possibleTypes.length; i++) { + const type = possibleTypes[i]; + + if (type.isTypeOf) { + const isTypeOfResult = type.isTypeOf(value, contextValue, info); + + if (isPromise(isTypeOfResult)) { + promisedIsTypeOfResults[i] = isTypeOfResult; + } else if (isTypeOfResult) { + return type.name; + } + } + } + + if (promisedIsTypeOfResults.length) { + return Promise.all(promisedIsTypeOfResults).then((isTypeOfResults) => { + for (let i = 0; i < isTypeOfResults.length; i++) { + if (isTypeOfResults[i]) { + return possibleTypes[i].name; + } + } + }); + } + }; + +/** + * If a resolve function is not given, then a default resolve behavior is used + * which takes the property of the source object of the same name as the field + * and returns it as the result, or if it's a function, returns the result + * of calling that function while passing along args and context value. + */ +export const defaultFieldResolver: GraphQLFieldResolver = + function (source: any, args, contextValue, info) { + // ensure source is a value for which property access is acceptable. + if (isObjectLike(source) || typeof source === 'function') { + const property = source[info.fieldName]; + if (typeof property === 'function') { + return source[info.fieldName](args, contextValue, info); + } + return property; + } + }; + +/** + * This method looks up the field on the given type definition. + * It has special casing for the three introspection fields, + * __schema, __type and __typename. __typename is special because + * it can always be queried as a field, even in situations where no + * other fields are allowed, like on a Union. __schema and __type + * could get automatically added to the query type, but that would + * require mutating type definitions, which would cause issues. + * + * @internal + */ +export function getFieldDef( + schema: GraphQLSchema, + parentType: GraphQLObjectType, + fieldNode: FieldNode, +): Maybe> { + const fieldName = fieldNode.name.value; + + if ( + fieldName === SchemaMetaFieldDef.name && + schema.getQueryType() === parentType + ) { + return SchemaMetaFieldDef; + } else if ( + fieldName === TypeMetaFieldDef.name && + schema.getQueryType() === parentType + ) { + return TypeMetaFieldDef; + } else if (fieldName === TypeNameMetaFieldDef.name) { + return TypeNameMetaFieldDef; + } + return parentType.getFields()[fieldName]; +} diff --git a/src/execution/index.ts b/src/execution/index.ts new file mode 100644 index 00000000..b5871d47 --- /dev/null +++ b/src/execution/index.ts @@ -0,0 +1,18 @@ +export { pathToArray as responsePathAsArray } from '../jsutils/Path'; + +export { + execute, + executeSync, + defaultFieldResolver, + defaultTypeResolver, +} from './execute'; + +export type { + ExecutionArgs, + ExecutionResult, + FormattedExecutionResult, +} from './execute'; + +export { subscribe, createSourceEventStream } from './subscribe'; + +export { getDirectiveValues } from './values'; diff --git a/src/execution/mapAsyncIterator.ts b/src/execution/mapAsyncIterator.ts new file mode 100644 index 00000000..82e863c6 --- /dev/null +++ b/src/execution/mapAsyncIterator.ts @@ -0,0 +1,57 @@ +import type { PromiseOrValue } from '../jsutils/PromiseOrValue'; + +/** + * Given an AsyncIterable and a callback function, return an AsyncIterator + * which produces values mapped via calling the callback function. + */ +export function mapAsyncIterator( + iterable: AsyncGenerator | AsyncIterable, + callback: (value: T) => PromiseOrValue, +): AsyncGenerator { + const iterator = iterable[Symbol.asyncIterator](); + + async function mapResult( + result: IteratorResult, + ): Promise> { + if (result.done) { + return result; + } + + try { + return { value: await callback(result.value), done: false }; + } catch (error) { + /* c8 ignore start */ + // FIXME: add test case + if (typeof iterator.return === 'function') { + try { + await iterator.return(); + } catch (_e) { + /* ignore error */ + } + } + throw error; + /* c8 ignore stop */ + } + } + + return { + async next() { + return mapResult(await iterator.next()); + }, + async return(): Promise> { + // If iterator.return() does not exist, then type R must be undefined. + return typeof iterator.return === 'function' + ? mapResult(await iterator.return()) + : { value: undefined as any, done: true }; + }, + async throw(error?: unknown) { + if (typeof iterator.throw === 'function') { + return mapResult(await iterator.throw(error)); + } + throw error; + }, + [Symbol.asyncIterator]() { + return this; + }, + }; +} diff --git a/src/execution/subscribe.ts b/src/execution/subscribe.ts new file mode 100644 index 00000000..7ff57125 --- /dev/null +++ b/src/execution/subscribe.ts @@ -0,0 +1,253 @@ +import { devAssert } from '../jsutils/devAssert'; +import { inspect } from '../jsutils/inspect'; +import { isAsyncIterable } from '../jsutils/isAsyncIterable'; +import type { Maybe } from '../jsutils/Maybe'; +import { addPath, pathToArray } from '../jsutils/Path'; + +import { GraphQLError } from '../error/GraphQLError'; +import { locatedError } from '../error/locatedError'; + +import type { DocumentNode } from '../language/ast'; + +import type { GraphQLFieldResolver } from '../type/definition'; +import type { GraphQLSchema } from '../type/schema'; + +import { collectFields } from './collectFields'; +import type { + ExecutionArgs, + ExecutionContext, + ExecutionResult, +} from './execute'; +import { + assertValidExecutionArguments, + buildExecutionContext, + buildResolveInfo, + execute, + getFieldDef, +} from './execute'; +import { mapAsyncIterator } from './mapAsyncIterator'; +import { getArgumentValues } from './values'; + +/** + * Implements the "Subscribe" algorithm described in the GraphQL specification. + * + * Returns a Promise which resolves to either an AsyncIterator (if successful) + * or an ExecutionResult (error). The promise will be rejected if the schema or + * other arguments to this function are invalid, or if the resolved event stream + * is not an async iterable. + * + * If the client-provided arguments to this function do not result in a + * compliant subscription, a GraphQL Response (ExecutionResult) with + * descriptive errors and no data will be returned. + * + * If the source stream could not be created due to faulty subscription + * resolver logic or underlying systems, the promise will resolve to a single + * ExecutionResult containing `errors` and no `data`. + * + * If the operation succeeded, the promise resolves to an AsyncIterator, which + * yields a stream of ExecutionResults representing the response stream. + * + * Accepts either an object with named arguments, or individual arguments. + */ +export async function subscribe( + args: ExecutionArgs, +): Promise | ExecutionResult> { + // Temporary for v15 to v16 migration. Remove in v17 + devAssert( + arguments.length < 2, + 'graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.', + ); + + const { + schema, + document, + rootValue, + contextValue, + variableValues, + operationName, + fieldResolver, + subscribeFieldResolver, + } = args; + + const resultOrStream = await createSourceEventStream( + schema, + document, + rootValue, + contextValue, + variableValues, + operationName, + subscribeFieldResolver, + ); + + if (!isAsyncIterable(resultOrStream)) { + return resultOrStream; + } + + // For each payload yielded from a subscription, map it over the normal + // GraphQL `execute` function, with `payload` as the rootValue. + // This implements the "MapSourceToResponseEvent" algorithm described in + // the GraphQL specification. The `execute` function provides the + // "ExecuteSubscriptionEvent" algorithm, as it is nearly identical to the + // "ExecuteQuery" algorithm, for which `execute` is also used. + const mapSourceToResponse = (payload: unknown) => + execute({ + schema, + document, + rootValue: payload, + contextValue, + variableValues, + operationName, + fieldResolver, + }); + + // Map every source value to a ExecutionResult value as described above. + return mapAsyncIterator(resultOrStream, mapSourceToResponse); +} + +/** + * Implements the "CreateSourceEventStream" algorithm described in the + * GraphQL specification, resolving the subscription source event stream. + * + * Returns a Promise which resolves to either an AsyncIterable (if successful) + * or an ExecutionResult (error). The promise will be rejected if the schema or + * other arguments to this function are invalid, or if the resolved event stream + * is not an async iterable. + * + * If the client-provided arguments to this function do not result in a + * compliant subscription, a GraphQL Response (ExecutionResult) with + * descriptive errors and no data will be returned. + * + * If the the source stream could not be created due to faulty subscription + * resolver logic or underlying systems, the promise will resolve to a single + * ExecutionResult containing `errors` and no `data`. + * + * If the operation succeeded, the promise resolves to the AsyncIterable for the + * event stream returned by the resolver. + * + * A Source Event Stream represents a sequence of events, each of which triggers + * a GraphQL execution for that event. + * + * This may be useful when hosting the stateful subscription service in a + * different process or machine than the stateless GraphQL execution engine, + * or otherwise separating these two steps. For more on this, see the + * "Supporting Subscriptions at Scale" information in the GraphQL specification. + */ +export async function createSourceEventStream( + schema: GraphQLSchema, + document: DocumentNode, + rootValue?: unknown, + contextValue?: unknown, + variableValues?: Maybe<{ readonly [variable: string]: unknown }>, + operationName?: Maybe, + subscribeFieldResolver?: Maybe>, +): Promise | ExecutionResult> { + // If arguments are missing or incorrectly typed, this is an internal + // developer mistake which should throw an early error. + assertValidExecutionArguments(schema, document, variableValues); + + // If a valid execution context cannot be created due to incorrect arguments, + // a "Response" with only errors is returned. + const exeContext = buildExecutionContext({ + schema, + document, + rootValue, + contextValue, + variableValues, + operationName, + subscribeFieldResolver, + }); + + // Return early errors if execution context failed. + if (!('schema' in exeContext)) { + return { errors: exeContext }; + } + + try { + const eventStream = await executeSubscription(exeContext); + + // Assert field returned an event stream, otherwise yield an error. + if (!isAsyncIterable(eventStream)) { + throw new Error( + 'Subscription field must return Async Iterable. ' + + `Received: ${inspect(eventStream)}.`, + ); + } + + return eventStream; + } catch (error) { + // If it GraphQLError, report it as an ExecutionResult, containing only errors and no data. + // Otherwise treat the error as a system-class error and re-throw it. + if (error instanceof GraphQLError) { + return { errors: [error] }; + } + throw error; + } +} + +async function executeSubscription( + exeContext: ExecutionContext, +): Promise { + const { schema, fragments, operation, variableValues, rootValue } = + exeContext; + + const rootType = schema.getSubscriptionType(); + if (rootType == null) { + throw new GraphQLError( + 'Schema is not configured to execute subscription operation.', + operation, + ); + } + + const rootFields = collectFields( + schema, + fragments, + variableValues, + rootType, + operation.selectionSet, + ); + const [responseName, fieldNodes] = [...rootFields.entries()][0]; + const fieldDef = getFieldDef(schema, rootType, fieldNodes[0]); + + if (!fieldDef) { + const fieldName = fieldNodes[0].name.value; + throw new GraphQLError( + `The subscription field "${fieldName}" is not defined.`, + fieldNodes, + ); + } + + const path = addPath(undefined, responseName, rootType.name); + const info = buildResolveInfo( + exeContext, + fieldDef, + fieldNodes, + rootType, + path, + ); + + try { + // Implements the "ResolveFieldEventStream" algorithm from GraphQL specification. + // It differs from "ResolveFieldValue" due to providing a different `resolveFn`. + + // Build a JS object of arguments from the field.arguments AST, using the + // variables scope to fulfill any variable references. + const args = getArgumentValues(fieldDef, fieldNodes[0], variableValues); + + // The resolve function's optional third argument is a context value that + // is provided to every resolve function within an execution. It is commonly + // used to represent an authenticated user, or request-specific caches. + const contextValue = exeContext.contextValue; + + // Call the `subscribe()` resolver or the default resolver to produce an + // AsyncIterable yielding raw payloads. + const resolveFn = fieldDef.subscribe ?? exeContext.subscribeFieldResolver; + const eventStream = await resolveFn(rootValue, args, contextValue, info); + + if (eventStream instanceof Error) { + throw eventStream; + } + return eventStream; + } catch (error) { + throw locatedError(error, fieldNodes, pathToArray(path)); + } +} diff --git a/src/execution/values.ts b/src/execution/values.ts new file mode 100644 index 00000000..124319a6 --- /dev/null +++ b/src/execution/values.ts @@ -0,0 +1,263 @@ +import { inspect } from '../jsutils/inspect'; +import { keyMap } from '../jsutils/keyMap'; +import type { Maybe } from '../jsutils/Maybe'; +import type { ObjMap } from '../jsutils/ObjMap'; +import { printPathArray } from '../jsutils/printPathArray'; + +import { GraphQLError } from '../error/GraphQLError'; + +import type { + DirectiveNode, + FieldNode, + VariableDefinitionNode, +} from '../language/ast'; +import { Kind } from '../language/kinds'; +import { print } from '../language/printer'; + +import type { GraphQLField } from '../type/definition'; +import { isInputType, isNonNullType } from '../type/definition'; +import type { GraphQLDirective } from '../type/directives'; +import type { GraphQLSchema } from '../type/schema'; + +import { coerceInputValue } from '../utilities/coerceInputValue'; +import { typeFromAST } from '../utilities/typeFromAST'; +import { valueFromAST } from '../utilities/valueFromAST'; + +type CoercedVariableValues = + | { errors: ReadonlyArray; coerced?: never } + | { coerced: { [variable: string]: unknown }; errors?: never }; + +/** + * Prepares an object map of variableValues of the correct type based on the + * provided variable definitions and arbitrary input. If the input cannot be + * parsed to match the variable definitions, a GraphQLError will be thrown. + * + * Note: The returned value is a plain Object with a prototype, since it is + * exposed to user code. Care should be taken to not pull values from the + * Object prototype. + * + * @internal + */ +export function getVariableValues( + schema: GraphQLSchema, + varDefNodes: ReadonlyArray, + inputs: { readonly [variable: string]: unknown }, + options?: { maxErrors?: number }, +): CoercedVariableValues { + const errors = []; + const maxErrors = options?.maxErrors; + try { + const coerced = coerceVariableValues( + schema, + varDefNodes, + inputs, + (error) => { + if (maxErrors != null && errors.length >= maxErrors) { + throw new GraphQLError( + 'Too many errors processing variables, error limit reached. Execution aborted.', + ); + } + errors.push(error); + }, + ); + + if (errors.length === 0) { + return { coerced }; + } + } catch (error) { + errors.push(error); + } + + return { errors }; +} + +function coerceVariableValues( + schema: GraphQLSchema, + varDefNodes: ReadonlyArray, + inputs: { readonly [variable: string]: unknown }, + onError: (error: GraphQLError) => void, +): { [variable: string]: unknown } { + const coercedValues: { [variable: string]: unknown } = {}; + for (const varDefNode of varDefNodes) { + const varName = varDefNode.variable.name.value; + const varType = typeFromAST(schema, varDefNode.type); + if (!isInputType(varType)) { + // Must use input types for variables. This should be caught during + // validation, however is checked again here for safety. + const varTypeStr = print(varDefNode.type); + onError( + new GraphQLError( + `Variable "$${varName}" expected value of type "${varTypeStr}" which cannot be used as an input type.`, + varDefNode.type, + ), + ); + continue; + } + + if (!hasOwnProperty(inputs, varName)) { + if (varDefNode.defaultValue) { + coercedValues[varName] = valueFromAST(varDefNode.defaultValue, varType); + } else if (isNonNullType(varType)) { + const varTypeStr = inspect(varType); + onError( + new GraphQLError( + `Variable "$${varName}" of required type "${varTypeStr}" was not provided.`, + varDefNode, + ), + ); + } + continue; + } + + const value = inputs[varName]; + if (value === null && isNonNullType(varType)) { + const varTypeStr = inspect(varType); + onError( + new GraphQLError( + `Variable "$${varName}" of non-null type "${varTypeStr}" must not be null.`, + varDefNode, + ), + ); + continue; + } + + coercedValues[varName] = coerceInputValue( + value, + varType, + (path, invalidValue, error) => { + let prefix = + `Variable "$${varName}" got invalid value ` + inspect(invalidValue); + if (path.length > 0) { + prefix += ` at "${varName}${printPathArray(path)}"`; + } + onError( + new GraphQLError( + prefix + '; ' + error.message, + varDefNode, + undefined, + undefined, + undefined, + error.originalError, + ), + ); + }, + ); + } + + return coercedValues; +} + +/** + * Prepares an object map of argument values given a list of argument + * definitions and list of argument AST nodes. + * + * Note: The returned value is a plain Object with a prototype, since it is + * exposed to user code. Care should be taken to not pull values from the + * Object prototype. + * + * @internal + */ +export function getArgumentValues( + def: GraphQLField | GraphQLDirective, + node: FieldNode | DirectiveNode, + variableValues?: Maybe>, +): { [argument: string]: unknown } { + const coercedValues: { [argument: string]: unknown } = {}; + + // FIXME: https://github.com/graphql/graphql-js/issues/2203 + /* c8 ignore next */ + const argumentNodes = node.arguments ?? []; + const argNodeMap = keyMap(argumentNodes, (arg) => arg.name.value); + + for (const argDef of def.args) { + const name = argDef.name; + const argType = argDef.type; + const argumentNode = argNodeMap[name]; + + if (!argumentNode) { + if (argDef.defaultValue !== undefined) { + coercedValues[name] = argDef.defaultValue; + } else if (isNonNullType(argType)) { + throw new GraphQLError( + `Argument "${name}" of required type "${inspect(argType)}" ` + + 'was not provided.', + node, + ); + } + continue; + } + + const valueNode = argumentNode.value; + let isNull = valueNode.kind === Kind.NULL; + + if (valueNode.kind === Kind.VARIABLE) { + const variableName = valueNode.name.value; + if ( + variableValues == null || + !hasOwnProperty(variableValues, variableName) + ) { + if (argDef.defaultValue !== undefined) { + coercedValues[name] = argDef.defaultValue; + } else if (isNonNullType(argType)) { + throw new GraphQLError( + `Argument "${name}" of required type "${inspect(argType)}" ` + + `was provided the variable "$${variableName}" which was not provided a runtime value.`, + valueNode, + ); + } + continue; + } + isNull = variableValues[variableName] == null; + } + + if (isNull && isNonNullType(argType)) { + throw new GraphQLError( + `Argument "${name}" of non-null type "${inspect(argType)}" ` + + 'must not be null.', + valueNode, + ); + } + + const coercedValue = valueFromAST(valueNode, argType, variableValues); + if (coercedValue === undefined) { + // Note: ValuesOfCorrectTypeRule validation should catch this before + // execution. This is a runtime check to ensure execution does not + // continue with an invalid argument value. + throw new GraphQLError( + `Argument "${name}" has invalid value ${print(valueNode)}.`, + valueNode, + ); + } + coercedValues[name] = coercedValue; + } + return coercedValues; +} + +/** + * Prepares an object map of argument values given a directive definition + * and a AST node which may contain directives. Optionally also accepts a map + * of variable values. + * + * If the directive does not exist on the node, returns undefined. + * + * Note: The returned value is a plain Object with a prototype, since it is + * exposed to user code. Care should be taken to not pull values from the + * Object prototype. + */ +export function getDirectiveValues( + directiveDef: GraphQLDirective, + node: { readonly directives?: ReadonlyArray }, + variableValues?: Maybe>, +): undefined | { [argument: string]: unknown } { + const directiveNode = node.directives?.find( + (directive) => directive.name.value === directiveDef.name, + ); + + if (directiveNode) { + return getArgumentValues(directiveDef, directiveNode, variableValues); + } +} + +function hasOwnProperty(obj: unknown, prop: string): boolean { + return Object.prototype.hasOwnProperty.call(obj, prop); +} diff --git a/src/graphql.ts b/src/graphql.ts new file mode 100644 index 00000000..bc6fb9bb --- /dev/null +++ b/src/graphql.ts @@ -0,0 +1,142 @@ +import { devAssert } from './jsutils/devAssert'; +import { isPromise } from './jsutils/isPromise'; +import type { Maybe } from './jsutils/Maybe'; +import type { PromiseOrValue } from './jsutils/PromiseOrValue'; + +import { parse } from './language/parser'; +import type { Source } from './language/source'; + +import type { + GraphQLFieldResolver, + GraphQLTypeResolver, +} from './type/definition'; +import type { GraphQLSchema } from './type/schema'; +import { validateSchema } from './type/validate'; + +import { validate } from './validation/validate'; + +import type { ExecutionResult } from './execution/execute'; +import { execute } from './execution/execute'; + +/** + * This is the primary entry point function for fulfilling GraphQL operations + * by parsing, validating, and executing a GraphQL document along side a + * GraphQL schema. + * + * More sophisticated GraphQL servers, such as those which persist queries, + * may wish to separate the validation and execution phases to a static time + * tooling step, and a server runtime step. + * + * Accepts either an object with named arguments, or individual arguments: + * + * schema: + * The GraphQL type system to use when validating and executing a query. + * source: + * A GraphQL language formatted string representing the requested operation. + * rootValue: + * The value provided as the first argument to resolver functions on the top + * level type (e.g. the query object type). + * contextValue: + * The context value is provided as an argument to resolver functions after + * field arguments. It is used to pass shared information useful at any point + * during executing this query, for example the currently logged in user and + * connections to databases or other services. + * variableValues: + * A mapping of variable name to runtime value to use for all variables + * defined in the requestString. + * operationName: + * The name of the operation to use if requestString contains multiple + * possible operations. Can be omitted if requestString contains only + * one operation. + * fieldResolver: + * A resolver function to use when one is not provided by the schema. + * If not provided, the default field resolver is used (which looks for a + * value or method on the source value with the field's name). + * typeResolver: + * A type resolver function to use when none is provided by the schema. + * If not provided, the default type resolver is used (which looks for a + * `__typename` field or alternatively calls the `isTypeOf` method). + */ +export interface GraphQLArgs { + schema: GraphQLSchema; + source: string | Source; + rootValue?: unknown; + contextValue?: unknown; + variableValues?: Maybe<{ readonly [variable: string]: unknown }>; + operationName?: Maybe; + fieldResolver?: Maybe>; + typeResolver?: Maybe>; +} + +export function graphql(args: GraphQLArgs): Promise { + // Always return a Promise for a consistent API. + return new Promise((resolve) => resolve(graphqlImpl(args))); +} + +/** + * The graphqlSync function also fulfills GraphQL operations by parsing, + * validating, and executing a GraphQL document along side a GraphQL schema. + * However, it guarantees to complete synchronously (or throw an error) assuming + * that all field resolvers are also synchronous. + */ +export function graphqlSync(args: GraphQLArgs): ExecutionResult { + const result = graphqlImpl(args); + + // Assert that the execution was synchronous. + if (isPromise(result)) { + throw new Error('GraphQL execution failed to complete synchronously.'); + } + + return result; +} + +function graphqlImpl(args: GraphQLArgs): PromiseOrValue { + // Temporary for v15 to v16 migration. Remove in v17 + devAssert( + arguments.length < 2, + 'graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.', + ); + + const { + schema, + source, + rootValue, + contextValue, + variableValues, + operationName, + fieldResolver, + typeResolver, + } = args; + + // Validate Schema + const schemaValidationErrors = validateSchema(schema); + if (schemaValidationErrors.length > 0) { + return { errors: schemaValidationErrors }; + } + + // Parse + let document; + try { + document = parse(source); + } catch (syntaxError) { + return { errors: [syntaxError] }; + } + + // Validate + const validationErrors = validate(schema, document); + if (validationErrors.length > 0) { + return { errors: validationErrors }; + } + + // Execute + return execute({ + schema, + document, + rootValue, + contextValue, + variableValues, + operationName, + fieldResolver, + typeResolver, + }); +} diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 00000000..bde23ad5 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,485 @@ +/** + * GraphQL.js provides a reference implementation for the GraphQL specification + * but is also a useful utility for operating on GraphQL files and building + * sophisticated tools. + * + * This primary module exports a general purpose function for fulfilling all + * steps of the GraphQL specification in a single operation, but also includes + * utilities for every part of the GraphQL specification: + * + * - Parsing the GraphQL language. + * - Building a GraphQL type schema. + * - Validating a GraphQL request against a type schema. + * - Executing a GraphQL request against a type schema. + * + * This also includes utility functions for operating on GraphQL types and + * GraphQL documents to facilitate building tools. + * + * You may also import from each sub-directory directly. For example, the + * following two import statements are equivalent: + * + * ```ts + * import { parse } from 'graphql'; + * import { parse } from 'graphql/language'; + * ``` + * + * @packageDocumentation + */ + +// The GraphQL.js version info. +export { version, versionInfo } from './version'; + +// The primary entry point into fulfilling a GraphQL request. +export type { GraphQLArgs } from './graphql'; +export { graphql, graphqlSync } from './graphql'; + +// Create and operate on GraphQL type definitions and schema. +export { + resolveObjMapThunk, + resolveReadonlyArrayThunk, + // Definitions + GraphQLSchema, + GraphQLDirective, + GraphQLScalarType, + GraphQLObjectType, + GraphQLInterfaceType, + GraphQLUnionType, + GraphQLEnumType, + GraphQLInputObjectType, + GraphQLList, + GraphQLNonNull, + // Standard GraphQL Scalars + specifiedScalarTypes, + GraphQLInt, + GraphQLFloat, + GraphQLString, + GraphQLBoolean, + GraphQLID, + // Int boundaries constants + GRAPHQL_MAX_INT, + GRAPHQL_MIN_INT, + // Built-in Directives defined by the Spec + specifiedDirectives, + GraphQLIncludeDirective, + GraphQLSkipDirective, + GraphQLDeprecatedDirective, + GraphQLSpecifiedByDirective, + // "Enum" of Type Kinds + TypeKind, + // Constant Deprecation Reason + DEFAULT_DEPRECATION_REASON, + // GraphQL Types for introspection. + introspectionTypes, + __Schema, + __Directive, + __DirectiveLocation, + __Type, + __Field, + __InputValue, + __EnumValue, + __TypeKind, + // Meta-field definitions. + SchemaMetaFieldDef, + TypeMetaFieldDef, + TypeNameMetaFieldDef, + // Predicates + isSchema, + isDirective, + isType, + isScalarType, + isObjectType, + isInterfaceType, + isUnionType, + isEnumType, + isInputObjectType, + isListType, + isNonNullType, + isInputType, + isOutputType, + isLeafType, + isCompositeType, + isAbstractType, + isWrappingType, + isNullableType, + isNamedType, + isRequiredArgument, + isRequiredInputField, + isSpecifiedScalarType, + isIntrospectionType, + isSpecifiedDirective, + // Assertions + assertSchema, + assertDirective, + assertType, + assertScalarType, + assertObjectType, + assertInterfaceType, + assertUnionType, + assertEnumType, + assertInputObjectType, + assertListType, + assertNonNullType, + assertInputType, + assertOutputType, + assertLeafType, + assertCompositeType, + assertAbstractType, + assertWrappingType, + assertNullableType, + assertNamedType, + // Un-modifiers + getNullableType, + getNamedType, + // Validate GraphQL schema. + validateSchema, + assertValidSchema, + // Upholds the spec rules about naming. + assertName, + assertEnumValueName, +} from './type/index'; + +export type { + GraphQLType, + GraphQLInputType, + GraphQLOutputType, + GraphQLLeafType, + GraphQLCompositeType, + GraphQLAbstractType, + GraphQLWrappingType, + GraphQLNullableType, + GraphQLNamedType, + GraphQLNamedInputType, + GraphQLNamedOutputType, + ThunkReadonlyArray, + ThunkObjMap, + GraphQLSchemaConfig, + GraphQLSchemaExtensions, + GraphQLDirectiveConfig, + GraphQLDirectiveExtensions, + GraphQLArgument, + GraphQLArgumentConfig, + GraphQLArgumentExtensions, + GraphQLEnumTypeConfig, + GraphQLEnumTypeExtensions, + GraphQLEnumValue, + GraphQLEnumValueConfig, + GraphQLEnumValueConfigMap, + GraphQLEnumValueExtensions, + GraphQLField, + GraphQLFieldConfig, + GraphQLFieldConfigArgumentMap, + GraphQLFieldConfigMap, + GraphQLFieldExtensions, + GraphQLFieldMap, + GraphQLFieldResolver, + GraphQLInputField, + GraphQLInputFieldConfig, + GraphQLInputFieldConfigMap, + GraphQLInputFieldExtensions, + GraphQLInputFieldMap, + GraphQLInputObjectTypeConfig, + GraphQLInputObjectTypeExtensions, + GraphQLInterfaceTypeConfig, + GraphQLInterfaceTypeExtensions, + GraphQLIsTypeOfFn, + GraphQLObjectTypeConfig, + GraphQLObjectTypeExtensions, + GraphQLResolveInfo, + ResponsePath, + GraphQLScalarTypeConfig, + GraphQLScalarTypeExtensions, + GraphQLTypeResolver, + GraphQLUnionTypeConfig, + GraphQLUnionTypeExtensions, + GraphQLScalarSerializer, + GraphQLScalarValueParser, + GraphQLScalarLiteralParser, +} from './type/index'; + +// Parse and operate on GraphQL language source files. +export { + Token, + Source, + Location, + OperationTypeNode, + getLocation, + // Print source location. + printLocation, + printSourceLocation, + // Lex + Lexer, + TokenKind, + // Parse + parse, + parseValue, + parseConstValue, + parseType, + // Print + print, + // Visit + visit, + visitInParallel, + getVisitFn, + getEnterLeaveForKind, + BREAK, + Kind, + DirectiveLocation, + // Predicates + isDefinitionNode, + isExecutableDefinitionNode, + isSelectionNode, + isValueNode, + isConstValueNode, + isTypeNode, + isTypeSystemDefinitionNode, + isTypeDefinitionNode, + isTypeSystemExtensionNode, + isTypeExtensionNode, +} from './language/index'; + +export type { + ParseOptions, + SourceLocation, + TokenKindEnum, + KindEnum, + DirectiveLocationEnum, + // Visitor utilities + ASTVisitor, + ASTVisitFn, + ASTVisitorKeyMap, + // AST nodes + ASTNode, + ASTKindToNode, + // Each kind of AST node + NameNode, + DocumentNode, + DefinitionNode, + ExecutableDefinitionNode, + OperationDefinitionNode, + VariableDefinitionNode, + VariableNode, + SelectionSetNode, + SelectionNode, + FieldNode, + ArgumentNode, + ConstArgumentNode, + FragmentSpreadNode, + InlineFragmentNode, + FragmentDefinitionNode, + ValueNode, + ConstValueNode, + IntValueNode, + FloatValueNode, + StringValueNode, + BooleanValueNode, + NullValueNode, + EnumValueNode, + ListValueNode, + ConstListValueNode, + ObjectValueNode, + ConstObjectValueNode, + ObjectFieldNode, + ConstObjectFieldNode, + DirectiveNode, + ConstDirectiveNode, + TypeNode, + NamedTypeNode, + ListTypeNode, + NonNullTypeNode, + TypeSystemDefinitionNode, + SchemaDefinitionNode, + OperationTypeDefinitionNode, + TypeDefinitionNode, + ScalarTypeDefinitionNode, + ObjectTypeDefinitionNode, + FieldDefinitionNode, + InputValueDefinitionNode, + InterfaceTypeDefinitionNode, + UnionTypeDefinitionNode, + EnumTypeDefinitionNode, + EnumValueDefinitionNode, + InputObjectTypeDefinitionNode, + DirectiveDefinitionNode, + TypeSystemExtensionNode, + SchemaExtensionNode, + TypeExtensionNode, + ScalarTypeExtensionNode, + ObjectTypeExtensionNode, + InterfaceTypeExtensionNode, + UnionTypeExtensionNode, + EnumTypeExtensionNode, + InputObjectTypeExtensionNode, +} from './language/index'; + +// Execute GraphQL queries. +export { + execute, + executeSync, + defaultFieldResolver, + defaultTypeResolver, + responsePathAsArray, + getDirectiveValues, + subscribe, + createSourceEventStream, +} from './execution/index'; + +export type { + ExecutionArgs, + ExecutionResult, + FormattedExecutionResult, +} from './execution/index'; + +export type { SubscriptionArgs } from './subscription/index'; + +// Validate GraphQL documents. +export { + validate, + ValidationContext, + // All validation rules in the GraphQL Specification. + specifiedRules, + // Individual validation rules. + ExecutableDefinitionsRule, + FieldsOnCorrectTypeRule, + FragmentsOnCompositeTypesRule, + KnownArgumentNamesRule, + KnownDirectivesRule, + KnownFragmentNamesRule, + KnownTypeNamesRule, + LoneAnonymousOperationRule, + NoFragmentCyclesRule, + NoUndefinedVariablesRule, + NoUnusedFragmentsRule, + NoUnusedVariablesRule, + OverlappingFieldsCanBeMergedRule, + PossibleFragmentSpreadsRule, + ProvidedRequiredArgumentsRule, + ScalarLeafsRule, + SingleFieldSubscriptionsRule, + UniqueArgumentNamesRule, + UniqueDirectivesPerLocationRule, + UniqueFragmentNamesRule, + UniqueInputFieldNamesRule, + UniqueOperationNamesRule, + UniqueVariableNamesRule, + ValuesOfCorrectTypeRule, + VariablesAreInputTypesRule, + VariablesInAllowedPositionRule, + // SDL-specific validation rules + LoneSchemaDefinitionRule, + UniqueOperationTypesRule, + UniqueTypeNamesRule, + UniqueEnumValueNamesRule, + UniqueFieldDefinitionNamesRule, + UniqueArgumentDefinitionNamesRule, + UniqueDirectiveNamesRule, + PossibleTypeExtensionsRule, + // Custom validation rules + NoDeprecatedCustomRule, + NoSchemaIntrospectionCustomRule, +} from './validation/index'; + +export type { ValidationRule } from './validation/index'; + +// Create, format, and print GraphQL errors. +export { + GraphQLError, + syntaxError, + locatedError, + printError, + formatError, +} from './error/index'; + +export type { + GraphQLFormattedError, + GraphQLErrorExtensions, +} from './error/index'; + +// Utilities for operating on GraphQL type schema and parsed sources. +export { + // Produce the GraphQL query recommended for a full schema introspection. + // Accepts optional IntrospectionOptions. + getIntrospectionQuery, + // Gets the target Operation from a Document. + getOperationAST, + // Gets the Type for the target Operation AST. + getOperationRootType, + // Convert a GraphQLSchema to an IntrospectionQuery. + introspectionFromSchema, + // Build a GraphQLSchema from an introspection result. + buildClientSchema, + // Build a GraphQLSchema from a parsed GraphQL Schema language AST. + buildASTSchema, + // Build a GraphQLSchema from a GraphQL schema language document. + buildSchema, + // Extends an existing GraphQLSchema from a parsed GraphQL Schema language AST. + extendSchema, + // Sort a GraphQLSchema. + lexicographicSortSchema, + // Print a GraphQLSchema to GraphQL Schema language. + printSchema, + // Print a GraphQLType to GraphQL Schema language. + printType, + // Prints the built-in introspection schema in the Schema Language format. + printIntrospectionSchema, + // Create a GraphQLType from a GraphQL language AST. + typeFromAST, + // Create a JavaScript value from a GraphQL language AST with a Type. + valueFromAST, + // Create a JavaScript value from a GraphQL language AST without a Type. + valueFromASTUntyped, + // Create a GraphQL language AST from a JavaScript value. + astFromValue, + // A helper to use within recursive-descent visitors which need to be aware of the GraphQL type system. + TypeInfo, + visitWithTypeInfo, + // Coerces a JavaScript value to a GraphQL type, or produces errors. + coerceInputValue, + // Concatenates multiple AST together. + concatAST, + // Separates an AST into an AST per Operation. + separateOperations, + // Strips characters that are not significant to the validity or execution of a GraphQL document. + stripIgnoredCharacters, + // Comparators for types + isEqualType, + isTypeSubTypeOf, + doTypesOverlap, + // Asserts a string is a valid GraphQL name. + assertValidName, + // Determine if a string is a valid GraphQL name. + isValidNameError, + // Compares two GraphQLSchemas and detects breaking changes. + BreakingChangeType, + DangerousChangeType, + findBreakingChanges, + findDangerousChanges, +} from './utilities/index'; + +export type { + IntrospectionOptions, + IntrospectionQuery, + IntrospectionSchema, + IntrospectionType, + IntrospectionInputType, + IntrospectionOutputType, + IntrospectionScalarType, + IntrospectionObjectType, + IntrospectionInterfaceType, + IntrospectionUnionType, + IntrospectionEnumType, + IntrospectionInputObjectType, + IntrospectionTypeRef, + IntrospectionInputTypeRef, + IntrospectionOutputTypeRef, + IntrospectionNamedTypeRef, + IntrospectionListTypeRef, + IntrospectionNonNullTypeRef, + IntrospectionField, + IntrospectionInputValue, + IntrospectionEnumValue, + IntrospectionDirective, + BuildSchemaOptions, + BreakingChange, + DangerousChange, + TypedQueryDocumentNode, +} from './utilities/index'; diff --git a/src/jsutils/Maybe.ts b/src/jsutils/Maybe.ts new file mode 100644 index 00000000..0ba64a4b --- /dev/null +++ b/src/jsutils/Maybe.ts @@ -0,0 +1,2 @@ +/** Conveniently represents flow's "Maybe" type https://flow.org/en/docs/types/maybe/ */ +export type Maybe = null | undefined | T; diff --git a/src/jsutils/ObjMap.ts b/src/jsutils/ObjMap.ts new file mode 100644 index 00000000..2c202821 --- /dev/null +++ b/src/jsutils/ObjMap.ts @@ -0,0 +1,13 @@ +export interface ObjMap { + [key: string]: T; +} + +export type ObjMapLike = ObjMap | { [key: string]: T }; + +export interface ReadOnlyObjMap { + readonly [key: string]: T; +} + +export type ReadOnlyObjMapLike = + | ReadOnlyObjMap + | { readonly [key: string]: T }; diff --git a/src/jsutils/Path.ts b/src/jsutils/Path.ts new file mode 100644 index 00000000..64f6c783 --- /dev/null +++ b/src/jsutils/Path.ts @@ -0,0 +1,33 @@ +import type { Maybe } from './Maybe'; + +export interface Path { + readonly prev: Path | undefined; + readonly key: string | number; + readonly typename: string | undefined; +} + +/** + * Given a Path and a key, return a new Path containing the new key. + */ +export function addPath( + prev: Readonly | undefined, + key: string | number, + typename: string | undefined, +): Path { + return { prev, key, typename }; +} + +/** + * Given a Path, return an Array of the path keys. + */ +export function pathToArray( + path: Maybe>, +): Array { + const flattened = []; + let curr = path; + while (curr) { + flattened.push(curr.key); + curr = curr.prev; + } + return flattened.reverse(); +} diff --git a/src/jsutils/PromiseOrValue.ts b/src/jsutils/PromiseOrValue.ts new file mode 100644 index 00000000..6b2517ee --- /dev/null +++ b/src/jsutils/PromiseOrValue.ts @@ -0,0 +1 @@ +export type PromiseOrValue = Promise | T; diff --git a/src/jsutils/README.md b/src/jsutils/README.md new file mode 100644 index 00000000..9eb96485 --- /dev/null +++ b/src/jsutils/README.md @@ -0,0 +1,8 @@ +## JavaScript Utils + +This directory contains dependency-free JavaScript utility functions used +throughout the codebase. + +Each utility should belong in its own file and be the default export. + +These functions are not part of the module interface and are subject to change. diff --git a/src/jsutils/__tests__/Path-test.ts b/src/jsutils/__tests__/Path-test.ts new file mode 100644 index 00000000..43bca192 --- /dev/null +++ b/src/jsutils/__tests__/Path-test.ts @@ -0,0 +1,36 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { addPath, pathToArray } from '../Path'; + +describe('Path', () => { + it('can create a Path', () => { + const first = addPath(undefined, 1, 'First'); + + expect(first).to.deep.equal({ + prev: undefined, + key: 1, + typename: 'First', + }); + }); + + it('can add a new key to an existing Path', () => { + const first = addPath(undefined, 1, 'First'); + const second = addPath(first, 'two', 'Second'); + + expect(second).to.deep.equal({ + prev: first, + key: 'two', + typename: 'Second', + }); + }); + + it('can convert a Path to an array of its keys', () => { + const root = addPath(undefined, 0, 'Root'); + const first = addPath(root, 'one', 'First'); + const second = addPath(first, 2, 'Second'); + + const path = pathToArray(second); + expect(path).to.deep.equal([0, 'one', 2]); + }); +}); diff --git a/src/jsutils/__tests__/didYouMean-test.ts b/src/jsutils/__tests__/didYouMean-test.ts new file mode 100644 index 00000000..bc01e180 --- /dev/null +++ b/src/jsutils/__tests__/didYouMean-test.ts @@ -0,0 +1,36 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { didYouMean } from '../didYouMean'; + +describe('didYouMean', () => { + it('Does accept an empty list', () => { + expect(didYouMean([])).to.equal(''); + }); + + it('Handles single suggestion', () => { + expect(didYouMean(['A'])).to.equal(' Did you mean "A"?'); + }); + + it('Handles two suggestions', () => { + expect(didYouMean(['A', 'B'])).to.equal(' Did you mean "A" or "B"?'); + }); + + it('Handles multiple suggestions', () => { + expect(didYouMean(['A', 'B', 'C'])).to.equal( + ' Did you mean "A", "B", or "C"?', + ); + }); + + it('Limits to five suggestions', () => { + expect(didYouMean(['A', 'B', 'C', 'D', 'E', 'F'])).to.equal( + ' Did you mean "A", "B", "C", "D", or "E"?', + ); + }); + + it('Adds sub-message', () => { + expect(didYouMean('the letter', ['A'])).to.equal( + ' Did you mean the letter "A"?', + ); + }); +}); diff --git a/src/jsutils/__tests__/identityFunc-test.ts b/src/jsutils/__tests__/identityFunc-test.ts new file mode 100644 index 00000000..97cc25eb --- /dev/null +++ b/src/jsutils/__tests__/identityFunc-test.ts @@ -0,0 +1,16 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { identityFunc } from '../identityFunc'; + +describe('identityFunc', () => { + it('returns the first argument it receives', () => { + // @ts-expect-error (Expects an argument) + expect(identityFunc()).to.equal(undefined); + expect(identityFunc(undefined)).to.equal(undefined); + expect(identityFunc(null)).to.equal(null); + + const obj = {}; + expect(identityFunc(obj)).to.equal(obj); + }); +}); diff --git a/src/jsutils/__tests__/inspect-test.ts b/src/jsutils/__tests__/inspect-test.ts new file mode 100644 index 00000000..d1ac1731 --- /dev/null +++ b/src/jsutils/__tests__/inspect-test.ts @@ -0,0 +1,187 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { inspect } from '../inspect'; + +describe('inspect', () => { + it('undefined', () => { + expect(inspect(undefined)).to.equal('undefined'); + }); + + it('null', () => { + expect(inspect(null)).to.equal('null'); + }); + + it('boolean', () => { + expect(inspect(true)).to.equal('true'); + expect(inspect(false)).to.equal('false'); + }); + + it('string', () => { + expect(inspect('')).to.equal('""'); + expect(inspect('abc')).to.equal('"abc"'); + expect(inspect('"')).to.equal('"\\""'); + }); + + it('number', () => { + expect(inspect(0.0)).to.equal('0'); + expect(inspect(3.14)).to.equal('3.14'); + expect(inspect(NaN)).to.equal('NaN'); + expect(inspect(Infinity)).to.equal('Infinity'); + expect(inspect(-Infinity)).to.equal('-Infinity'); + }); + + it('function', () => { + const unnamedFuncStr = inspect( + // Never called and used as a placeholder + /* c8 ignore next */ + () => expect.fail('Should not be called'), + ); + expect(unnamedFuncStr).to.equal('[function]'); + + // Never called and used as a placeholder + /* c8 ignore next 3 */ + function namedFunc() { + expect.fail('Should not be called'); + } + expect(inspect(namedFunc)).to.equal('[function namedFunc]'); + }); + + it('array', () => { + expect(inspect([])).to.equal('[]'); + expect(inspect([null])).to.equal('[null]'); + expect(inspect([1, NaN])).to.equal('[1, NaN]'); + expect(inspect([['a', 'b'], 'c'])).to.equal('[["a", "b"], "c"]'); + + expect(inspect([[[]]])).to.equal('[[[]]]'); + expect(inspect([[['a']]])).to.equal('[[[Array]]]'); + + expect(inspect([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])).to.equal( + '[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]', + ); + + expect(inspect([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10])).to.equal( + '[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ... 1 more item]', + ); + + expect(inspect([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11])).to.equal( + '[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ... 2 more items]', + ); + }); + + it('object', () => { + expect(inspect({})).to.equal('{}'); + expect(inspect({ a: 1 })).to.equal('{ a: 1 }'); + expect(inspect({ a: 1, b: 2 })).to.equal('{ a: 1, b: 2 }'); + expect(inspect({ array: [null, 0] })).to.equal('{ array: [null, 0] }'); + + expect(inspect({ a: { b: {} } })).to.equal('{ a: { b: {} } }'); + expect(inspect({ a: { b: { c: 1 } } })).to.equal('{ a: { b: [Object] } }'); + + const map = Object.create(null); + map.a = true; + map.b = null; + expect(inspect(map)).to.equal('{ a: true, b: null }'); + }); + + it('use toJSON if provided', () => { + const object = { + toJSON() { + return ''; + }, + }; + + expect(inspect(object)).to.equal(''); + }); + + it('handles toJSON that return `this` should work', () => { + const object = { + toJSON() { + return this; + }, + }; + + expect(inspect(object)).to.equal('{ toJSON: [function toJSON] }'); + }); + + it('handles toJSON returning object values', () => { + const object = { + toJSON() { + return { json: 'value' }; + }, + }; + + expect(inspect(object)).to.equal('{ json: "value" }'); + }); + + it('handles toJSON function that uses this', () => { + const object = { + str: 'Hello World!', + toJSON() { + return this.str; + }, + }; + + expect(inspect(object)).to.equal('Hello World!'); + }); + + it('detect circular objects', () => { + const obj: { [name: string]: unknown } = {}; + obj.self = obj; + obj.deepSelf = { self: obj }; + + expect(inspect(obj)).to.equal( + '{ self: [Circular], deepSelf: { self: [Circular] } }', + ); + + const array: any = []; + array[0] = array; + array[1] = [array]; + + expect(inspect(array)).to.equal('[[Circular], [[Circular]]]'); + + const mixed: any = { array: [] }; + mixed.array[0] = mixed; + + expect(inspect(mixed)).to.equal('{ array: [[Circular]] }'); + + const customA = { + toJSON: () => customB, + }; + + const customB = { + toJSON: () => customA, + }; + + expect(inspect(customA)).to.equal('[Circular]'); + }); + + it('Use class names for the short form of an object', () => { + class Foo { + foo: string; + + constructor() { + this.foo = 'bar'; + } + } + + expect(inspect([[new Foo()]])).to.equal('[[[Foo]]]'); + + class Foo2 { + foo: string; + + [Symbol.toStringTag] = 'Bar'; + + constructor() { + this.foo = 'bar'; + } + } + expect(inspect([[new Foo2()]])).to.equal('[[[Bar]]]'); + + // eslint-disable-next-line func-names + const objectWithoutClassName = new (function (this: any) { + this.foo = 1; + } as any)(); + expect(inspect([[objectWithoutClassName]])).to.equal('[[[Object]]]'); + }); +}); diff --git a/src/jsutils/__tests__/instanceOf-test.ts b/src/jsutils/__tests__/instanceOf-test.ts new file mode 100644 index 00000000..cbd649bf --- /dev/null +++ b/src/jsutils/__tests__/instanceOf-test.ts @@ -0,0 +1,79 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { instanceOf } from '../instanceOf'; + +describe('instanceOf', () => { + it('do not throw on values without prototype', () => { + class Foo { + get [Symbol.toStringTag]() { + return 'Foo'; + } + } + + expect(instanceOf(true, Foo)).to.equal(false); + expect(instanceOf(null, Foo)).to.equal(false); + expect(instanceOf(Object.create(null), Foo)).to.equal(false); + }); + + it('detect name clashes with older versions of this lib', () => { + function oldVersion() { + class Foo {} + return Foo; + } + + function newVersion() { + class Foo { + get [Symbol.toStringTag]() { + return 'Foo'; + } + } + return Foo; + } + + const NewClass = newVersion(); + const OldClass = oldVersion(); + expect(instanceOf(new NewClass(), NewClass)).to.equal(true); + expect(() => instanceOf(new OldClass(), NewClass)).to.throw(); + }); + + it('allows instances to have share the same constructor name', () => { + function getMinifiedClass(tag: string) { + class SomeNameAfterMinification { + get [Symbol.toStringTag]() { + return tag; + } + } + return SomeNameAfterMinification; + } + + const Foo = getMinifiedClass('Foo'); + const Bar = getMinifiedClass('Bar'); + expect(instanceOf(new Foo(), Bar)).to.equal(false); + expect(instanceOf(new Bar(), Foo)).to.equal(false); + + const DuplicateOfFoo = getMinifiedClass('Foo'); + expect(() => instanceOf(new DuplicateOfFoo(), Foo)).to.throw(); + expect(() => instanceOf(new Foo(), DuplicateOfFoo)).to.throw(); + }); + + it('fails with descriptive error message', () => { + function getFoo() { + class Foo { + get [Symbol.toStringTag]() { + return 'Foo'; + } + } + return Foo; + } + const Foo1 = getFoo(); + const Foo2 = getFoo(); + + expect(() => instanceOf(new Foo1(), Foo2)).to.throw( + /^Cannot use Foo "{}" from another module or realm./m, + ); + expect(() => instanceOf(new Foo2(), Foo1)).to.throw( + /^Cannot use Foo "{}" from another module or realm./m, + ); + }); +}); diff --git a/src/jsutils/__tests__/invariant-test.ts b/src/jsutils/__tests__/invariant-test.ts new file mode 100644 index 00000000..2a438b69 --- /dev/null +++ b/src/jsutils/__tests__/invariant-test.ts @@ -0,0 +1,14 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { invariant } from '../invariant'; + +describe('invariant', () => { + it('throws on false conditions', () => { + expect(() => invariant(false, 'Oops!')).to.throw('Oops!'); + }); + + it('use default error message', () => { + expect(() => invariant(false)).to.throw('Unexpected invariant triggered.'); + }); +}); diff --git a/src/jsutils/__tests__/isAsyncIterable-test.ts b/src/jsutils/__tests__/isAsyncIterable-test.ts new file mode 100644 index 00000000..e62bb534 --- /dev/null +++ b/src/jsutils/__tests__/isAsyncIterable-test.ts @@ -0,0 +1,52 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { identityFunc } from '../identityFunc'; +import { isAsyncIterable } from '../isAsyncIterable'; + +describe('isAsyncIterable', () => { + it('should return `true` for AsyncIterable', () => { + const asyncIterable = { [Symbol.asyncIterator]: identityFunc }; + expect(isAsyncIterable(asyncIterable)).to.equal(true); + + async function* asyncGeneratorFunc() { + /* do nothing */ + } + + expect(isAsyncIterable(asyncGeneratorFunc())).to.equal(true); + + // But async generator function itself is not iterable + expect(isAsyncIterable(asyncGeneratorFunc)).to.equal(false); + }); + + it('should return `false` for all other values', () => { + expect(isAsyncIterable(null)).to.equal(false); + expect(isAsyncIterable(undefined)).to.equal(false); + + expect(isAsyncIterable('ABC')).to.equal(false); + expect(isAsyncIterable('0')).to.equal(false); + expect(isAsyncIterable('')).to.equal(false); + + expect(isAsyncIterable([])).to.equal(false); + expect(isAsyncIterable(new Int8Array(1))).to.equal(false); + + expect(isAsyncIterable({})).to.equal(false); + expect(isAsyncIterable({ iterable: true })).to.equal(false); + + const asyncIteratorWithoutSymbol = { next: identityFunc }; + expect(isAsyncIterable(asyncIteratorWithoutSymbol)).to.equal(false); + + const nonAsyncIterable = { [Symbol.iterator]: identityFunc }; + expect(isAsyncIterable(nonAsyncIterable)).to.equal(false); + + function* generatorFunc() { + /* do nothing */ + } + expect(isAsyncIterable(generatorFunc())).to.equal(false); + + const invalidAsyncIterable = { + [Symbol.asyncIterator]: { next: identityFunc }, + }; + expect(isAsyncIterable(invalidAsyncIterable)).to.equal(false); + }); +}); diff --git a/src/jsutils/__tests__/isIterableObject-test.ts b/src/jsutils/__tests__/isIterableObject-test.ts new file mode 100644 index 00000000..c631cb4b --- /dev/null +++ b/src/jsutils/__tests__/isIterableObject-test.ts @@ -0,0 +1,70 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { identityFunc } from '../identityFunc'; +import { isIterableObject } from '../isIterableObject'; + +describe('isIterableObject', () => { + it('should return `true` for collections', () => { + expect(isIterableObject([])).to.equal(true); + expect(isIterableObject(new Int8Array(1))).to.equal(true); + + // eslint-disable-next-line no-new-wrappers + expect(isIterableObject(new String('ABC'))).to.equal(true); + + function getArguments() { + return arguments; + } + expect(isIterableObject(getArguments())).to.equal(true); + + const iterable = { [Symbol.iterator]: identityFunc }; + expect(isIterableObject(iterable)).to.equal(true); + + function* generatorFunc() { + /* do nothing */ + } + expect(isIterableObject(generatorFunc())).to.equal(true); + + // But generator function itself is not iterable + expect(isIterableObject(generatorFunc)).to.equal(false); + }); + + it('should return `false` for non-collections', () => { + expect(isIterableObject(null)).to.equal(false); + expect(isIterableObject(undefined)).to.equal(false); + + expect(isIterableObject('ABC')).to.equal(false); + expect(isIterableObject('0')).to.equal(false); + expect(isIterableObject('')).to.equal(false); + + expect(isIterableObject(1)).to.equal(false); + expect(isIterableObject(0)).to.equal(false); + expect(isIterableObject(NaN)).to.equal(false); + // eslint-disable-next-line no-new-wrappers + expect(isIterableObject(new Number(123))).to.equal(false); + + expect(isIterableObject(true)).to.equal(false); + expect(isIterableObject(false)).to.equal(false); + // eslint-disable-next-line no-new-wrappers + expect(isIterableObject(new Boolean(true))).to.equal(false); + + expect(isIterableObject({})).to.equal(false); + expect(isIterableObject({ iterable: true })).to.equal(false); + + const iteratorWithoutSymbol = { next: identityFunc }; + expect(isIterableObject(iteratorWithoutSymbol)).to.equal(false); + + const invalidIterable = { + [Symbol.iterator]: { next: identityFunc }, + }; + expect(isIterableObject(invalidIterable)).to.equal(false); + + const arrayLike: { [key: string]: unknown } = {}; + arrayLike[0] = 'Alpha'; + arrayLike[1] = 'Bravo'; + arrayLike[2] = 'Charlie'; + arrayLike.length = 3; + + expect(isIterableObject(arrayLike)).to.equal(false); + }); +}); diff --git a/src/jsutils/__tests__/isObjectLike-test.ts b/src/jsutils/__tests__/isObjectLike-test.ts new file mode 100644 index 00000000..536ecb5f --- /dev/null +++ b/src/jsutils/__tests__/isObjectLike-test.ts @@ -0,0 +1,22 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { identityFunc } from '../identityFunc'; +import { isObjectLike } from '../isObjectLike'; + +describe('isObjectLike', () => { + it('should return `true` for objects', () => { + expect(isObjectLike({})).to.equal(true); + expect(isObjectLike(Object.create(null))).to.equal(true); + expect(isObjectLike(/a/)).to.equal(true); + expect(isObjectLike([])).to.equal(true); + }); + + it('should return `false` for non-objects', () => { + expect(isObjectLike(undefined)).to.equal(false); + expect(isObjectLike(null)).to.equal(false); + expect(isObjectLike(true)).to.equal(false); + expect(isObjectLike('')).to.equal(false); + expect(isObjectLike(identityFunc)).to.equal(false); + }); +}); diff --git a/src/jsutils/__tests__/naturalCompare-test.ts b/src/jsutils/__tests__/naturalCompare-test.ts new file mode 100644 index 00000000..4c5291e5 --- /dev/null +++ b/src/jsutils/__tests__/naturalCompare-test.ts @@ -0,0 +1,72 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { naturalCompare } from '../naturalCompare'; + +describe('naturalCompare', () => { + it('Handles empty strings', () => { + expect(naturalCompare('', '')).to.equal(0); + + expect(naturalCompare('', 'a')).to.equal(-1); + expect(naturalCompare('', '1')).to.equal(-1); + + expect(naturalCompare('a', '')).to.equal(1); + expect(naturalCompare('1', '')).to.equal(1); + }); + + it('Handles strings of different length', () => { + expect(naturalCompare('A', 'A')).to.equal(0); + expect(naturalCompare('A1', 'A1')).to.equal(0); + + expect(naturalCompare('A', 'AA')).to.equal(-1); + expect(naturalCompare('A1', 'A1A')).to.equal(-1); + + expect(naturalCompare('AA', 'A')).to.equal(1); + expect(naturalCompare('A1A', 'A1')).to.equal(1); + }); + + it('Handles numbers', () => { + expect(naturalCompare('0', '0')).to.equal(0); + expect(naturalCompare('1', '1')).to.equal(0); + + expect(naturalCompare('1', '2')).to.equal(-1); + expect(naturalCompare('2', '1')).to.equal(1); + + expect(naturalCompare('2', '11')).to.equal(-1); + expect(naturalCompare('11', '2')).to.equal(1); + }); + + it('Handles numbers with leading zeros', () => { + expect(naturalCompare('00', '00')).to.equal(0); + expect(naturalCompare('0', '00')).to.equal(-1); + expect(naturalCompare('00', '0')).to.equal(1); + + expect(naturalCompare('02', '11')).to.equal(-1); + expect(naturalCompare('11', '02')).to.equal(1); + + expect(naturalCompare('011', '200')).to.equal(-1); + expect(naturalCompare('200', '011')).to.equal(1); + }); + + it('Handles numbers embedded into names', () => { + expect(naturalCompare('a0a', 'a0a')).to.equal(0); + expect(naturalCompare('a0a', 'a9a')).to.equal(-1); + expect(naturalCompare('a9a', 'a0a')).to.equal(1); + + expect(naturalCompare('a00a', 'a00a')).to.equal(0); + expect(naturalCompare('a00a', 'a09a')).to.equal(-1); + expect(naturalCompare('a09a', 'a00a')).to.equal(1); + + expect(naturalCompare('a0a1', 'a0a1')).to.equal(0); + expect(naturalCompare('a0a1', 'a0a9')).to.equal(-1); + expect(naturalCompare('a0a9', 'a0a1')).to.equal(1); + + expect(naturalCompare('a10a11a', 'a10a11a')).to.equal(0); + expect(naturalCompare('a10a11a', 'a10a19a')).to.equal(-1); + expect(naturalCompare('a10a19a', 'a10a11a')).to.equal(1); + + expect(naturalCompare('a10a11a', 'a10a11a')).to.equal(0); + expect(naturalCompare('a10a11a', 'a10a11b')).to.equal(-1); + expect(naturalCompare('a10a11b', 'a10a11a')).to.equal(1); + }); +}); diff --git a/src/jsutils/__tests__/suggestionList-test.ts b/src/jsutils/__tests__/suggestionList-test.ts new file mode 100644 index 00000000..2b905248 --- /dev/null +++ b/src/jsutils/__tests__/suggestionList-test.ts @@ -0,0 +1,69 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { suggestionList } from '../suggestionList'; + +function expectSuggestions(input: string, options: ReadonlyArray) { + return expect(suggestionList(input, options)); +} + +describe('suggestionList', () => { + it('Returns results when input is empty', () => { + expectSuggestions('', ['a']).to.deep.equal(['a']); + }); + + it('Returns empty array when there are no options', () => { + expectSuggestions('input', []).to.deep.equal([]); + }); + + it('Returns options with small lexical distance', () => { + expectSuggestions('greenish', ['green']).to.deep.equal(['green']); + expectSuggestions('green', ['greenish']).to.deep.equal(['greenish']); + }); + + it('Rejects options with distance that exceeds threshold', () => { + // spell-checker:disable + expectSuggestions('aaaa', ['aaab']).to.deep.equal(['aaab']); + expectSuggestions('aaaa', ['aabb']).to.deep.equal(['aabb']); + expectSuggestions('aaaa', ['abbb']).to.deep.equal([]); + // spell-checker:enable + + expectSuggestions('ab', ['ca']).to.deep.equal([]); + }); + + it('Returns options with different case', () => { + // cSpell:ignore verylongstring + expectSuggestions('verylongstring', ['VERYLONGSTRING']).to.deep.equal([ + 'VERYLONGSTRING', + ]); + + expectSuggestions('VERYLONGSTRING', ['verylongstring']).to.deep.equal([ + 'verylongstring', + ]); + + expectSuggestions('VERYLONGSTRING', ['VeryLongString']).to.deep.equal([ + 'VeryLongString', + ]); + }); + + it('Returns options with transpositions', () => { + expectSuggestions('agr', ['arg']).to.deep.equal(['arg']); + expectSuggestions('214365879', ['123456789']).to.deep.equal(['123456789']); + }); + + it('Returns options sorted based on lexical distance', () => { + expectSuggestions('abc', ['a', 'ab', 'abc']).to.deep.equal([ + 'abc', + 'ab', + 'a', + ]); + }); + + it('Returns options with the same lexical distance sorted lexicographically', () => { + expectSuggestions('a', ['az', 'ax', 'ay']).to.deep.equal([ + 'ax', + 'ay', + 'az', + ]); + }); +}); diff --git a/src/jsutils/__tests__/toObjMap-test.ts b/src/jsutils/__tests__/toObjMap-test.ts new file mode 100644 index 00000000..f9136b87 --- /dev/null +++ b/src/jsutils/__tests__/toObjMap-test.ts @@ -0,0 +1,61 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import type { ObjMapLike } from '../ObjMap'; +import { toObjMap } from '../toObjMap'; + +// Workaround to make both ESLint happy +const __proto__ = '__proto__'; + +describe('toObjMap', () => { + it('convert undefined to ObjMap', () => { + const result = toObjMap(undefined); + expect(result).to.deep.equal({}); + expect(Object.getPrototypeOf(result)).to.equal(null); + }); + + it('convert null to ObjMap', () => { + const result = toObjMap(null); + expect(result).to.deep.equal({}); + expect(Object.getPrototypeOf(result)).to.equal(null); + }); + + it('convert empty object to ObjMap', () => { + const result = toObjMap({}); + expect(result).to.deep.equal({}); + expect(Object.getPrototypeOf(result)).to.equal(null); + }); + + it('convert object with own properties to ObjMap', () => { + const obj: ObjMapLike = Object.freeze({ foo: 'bar' }); + + const result = toObjMap(obj); + expect(result).to.deep.equal(obj); + expect(Object.getPrototypeOf(result)).to.equal(null); + }); + + it('convert object with __proto__ property to ObjMap', () => { + const protoObj = Object.freeze({ toString: false }); + const obj = Object.create(null); + obj[__proto__] = protoObj; + Object.freeze(obj); + + const result = toObjMap(obj); + expect(Object.keys(result)).to.deep.equal(['__proto__']); + expect(Object.getPrototypeOf(result)).to.equal(null); + expect(result[__proto__]).to.equal(protoObj); + }); + + it('passthrough empty ObjMap', () => { + const objMap = Object.create(null); + expect(toObjMap(objMap)).to.deep.equal(objMap); + }); + + it('passthrough ObjMap with properties', () => { + const objMap = Object.freeze({ + __proto__: null, + foo: 'bar', + }); + expect(toObjMap(objMap)).to.deep.equal(objMap); + }); +}); diff --git a/src/jsutils/devAssert.ts b/src/jsutils/devAssert.ts new file mode 100644 index 00000000..ff97228b --- /dev/null +++ b/src/jsutils/devAssert.ts @@ -0,0 +1,6 @@ +export function devAssert(condition: unknown, message: string): void { + const booleanCondition = Boolean(condition); + if (!booleanCondition) { + throw new Error(message); + } +} diff --git a/src/jsutils/didYouMean.ts b/src/jsutils/didYouMean.ts new file mode 100644 index 00000000..33e10a42 --- /dev/null +++ b/src/jsutils/didYouMean.ts @@ -0,0 +1,37 @@ +const MAX_SUGGESTIONS = 5; + +/** + * Given [ A, B, C ] return ' Did you mean A, B, or C?'. + */ +export function didYouMean(suggestions: ReadonlyArray): string; +export function didYouMean( + subMessage: string, + suggestions: ReadonlyArray, +): string; +export function didYouMean( + firstArg: string | ReadonlyArray, + secondArg?: ReadonlyArray, +) { + const [subMessage, suggestionsArg] = secondArg + ? [firstArg as string, secondArg] + : [undefined, firstArg as ReadonlyArray]; + + let message = ' Did you mean '; + if (subMessage) { + message += subMessage + ' '; + } + + const suggestions = suggestionsArg.map((x) => `"${x}"`); + switch (suggestions.length) { + case 0: + return ''; + case 1: + return message + suggestions[0] + '?'; + case 2: + return message + suggestions[0] + ' or ' + suggestions[1] + '?'; + } + + const selected = suggestions.slice(0, MAX_SUGGESTIONS); + const lastItem = selected.pop(); + return message + selected.join(', ') + ', or ' + lastItem + '?'; +} diff --git a/src/jsutils/groupBy.ts b/src/jsutils/groupBy.ts new file mode 100644 index 00000000..f3b0c076 --- /dev/null +++ b/src/jsutils/groupBy.ts @@ -0,0 +1,19 @@ +/** + * Groups array items into a Map, given a function to produce grouping key. + */ +export function groupBy( + list: ReadonlyArray, + keyFn: (item: T) => K, +): Map> { + const result = new Map>(); + for (const item of list) { + const key = keyFn(item); + const group = result.get(key); + if (group === undefined) { + result.set(key, [item]); + } else { + group.push(item); + } + } + return result; +} diff --git a/src/jsutils/identityFunc.ts b/src/jsutils/identityFunc.ts new file mode 100644 index 00000000..a249b51c --- /dev/null +++ b/src/jsutils/identityFunc.ts @@ -0,0 +1,6 @@ +/** + * Returns the first argument it receives. + */ +export function identityFunc(x: T): T { + return x; +} diff --git a/src/jsutils/inspect.ts b/src/jsutils/inspect.ts new file mode 100644 index 00000000..514cbaad --- /dev/null +++ b/src/jsutils/inspect.ts @@ -0,0 +1,123 @@ +const MAX_ARRAY_LENGTH = 10; +const MAX_RECURSIVE_DEPTH = 2; + +/** + * Used to print values in error messages. + */ +export function inspect(value: unknown): string { + return formatValue(value, []); +} + +function formatValue( + value: unknown, + seenValues: ReadonlyArray, +): string { + switch (typeof value) { + case 'string': + return JSON.stringify(value); + case 'function': + return value.name ? `[function ${value.name}]` : '[function]'; + case 'object': + return formatObjectValue(value, seenValues); + default: + return String(value); + } +} + +function formatObjectValue( + value: object | null, + previouslySeenValues: ReadonlyArray, +): string { + if (value === null) { + return 'null'; + } + + if (previouslySeenValues.includes(value)) { + return '[Circular]'; + } + + const seenValues = [...previouslySeenValues, value]; + + if (isJSONable(value)) { + const jsonValue = value.toJSON(); + + // check for infinite recursion + if (jsonValue !== value) { + return typeof jsonValue === 'string' + ? jsonValue + : formatValue(jsonValue, seenValues); + } + } else if (Array.isArray(value)) { + return formatArray(value, seenValues); + } + + return formatObject(value, seenValues); +} + +function isJSONable(value: any): value is { toJSON: () => unknown } { + return typeof value.toJSON === 'function'; +} + +function formatObject( + object: object, + seenValues: ReadonlyArray, +): string { + const entries = Object.entries(object); + if (entries.length === 0) { + return '{}'; + } + + if (seenValues.length > MAX_RECURSIVE_DEPTH) { + return '[' + getObjectTag(object) + ']'; + } + + const properties = entries.map( + ([key, value]) => key + ': ' + formatValue(value, seenValues), + ); + return '{ ' + properties.join(', ') + ' }'; +} + +function formatArray( + array: ReadonlyArray, + seenValues: ReadonlyArray, +): string { + if (array.length === 0) { + return '[]'; + } + + if (seenValues.length > MAX_RECURSIVE_DEPTH) { + return '[Array]'; + } + + const len = Math.min(MAX_ARRAY_LENGTH, array.length); + const remaining = array.length - len; + const items = []; + + for (let i = 0; i < len; ++i) { + items.push(formatValue(array[i], seenValues)); + } + + if (remaining === 1) { + items.push('... 1 more item'); + } else if (remaining > 1) { + items.push(`... ${remaining} more items`); + } + + return '[' + items.join(', ') + ']'; +} + +function getObjectTag(object: object): string { + const tag = Object.prototype.toString + .call(object) + .replace(/^\[object /, '') + .replace(/]$/, ''); + + if (tag === 'Object' && typeof object.constructor === 'function') { + const name = object.constructor.name; + if (typeof name === 'string' && name !== '') { + return name; + } + } + + return tag; +} diff --git a/src/jsutils/instanceOf.ts b/src/jsutils/instanceOf.ts new file mode 100644 index 00000000..3f24a770 --- /dev/null +++ b/src/jsutils/instanceOf.ts @@ -0,0 +1,54 @@ +import { inspect } from './inspect'; + +/** + * A replacement for instanceof which includes an error warning when multi-realm + * constructors are detected. + * See: https://expressjs.com/en/advanced/best-practice-performance.html#set-node_env-to-production + * See: https://webpack.js.org/guides/production/ + */ +export const instanceOf: (value: unknown, constructor: Constructor) => boolean = + /* c8 ignore next 5 */ + // FIXME: https://github.com/graphql/graphql-js/issues/2317 + process.env.NODE_ENV === 'production' + ? function instanceOf(value: unknown, constructor: Constructor): boolean { + return value instanceof constructor; + } + : function instanceOf(value: unknown, constructor: Constructor): boolean { + if (value instanceof constructor) { + return true; + } + if (typeof value === 'object' && value !== null) { + // Prefer Symbol.toStringTag since it is immune to minification. + const className = constructor.prototype[Symbol.toStringTag]; + const valueClassName = + // We still need to support constructor's name to detect conflicts with older versions of this library. + Symbol.toStringTag in value + ? // @ts-expect-error TS bug see, https://github.com/microsoft/TypeScript/issues/38009 + value[Symbol.toStringTag] + : value.constructor?.name; + if (className === valueClassName) { + const stringifiedValue = inspect(value); + throw new Error( + `Cannot use ${className} "${stringifiedValue}" from another module or realm. + +Ensure that there is only one instance of "graphql" in the node_modules +directory. If different versions of "graphql" are the dependencies of other +relied on modules, use "resolutions" to ensure only one version is installed. + +https://yarnpkg.com/en/docs/selective-version-resolutions + +Duplicate "graphql" modules cannot be used at the same time since different +versions may have different capabilities and behavior. The data from one +version used in the function from another could produce confusing and +spurious results.`, + ); + } + } + return false; + }; + +interface Constructor extends Function { + prototype: { + [Symbol.toStringTag]: string; + }; +} diff --git a/src/jsutils/invariant.ts b/src/jsutils/invariant.ts new file mode 100644 index 00000000..f2c5d4c6 --- /dev/null +++ b/src/jsutils/invariant.ts @@ -0,0 +1,11 @@ +export function invariant( + condition: unknown, + message?: string, +): asserts condition { + const booleanCondition = Boolean(condition); + if (!booleanCondition) { + throw new Error( + message != null ? message : 'Unexpected invariant triggered.', + ); + } +} diff --git a/src/jsutils/isAsyncIterable.ts b/src/jsutils/isAsyncIterable.ts new file mode 100644 index 00000000..0eb4ab1d --- /dev/null +++ b/src/jsutils/isAsyncIterable.ts @@ -0,0 +1,9 @@ +/** + * Returns true if the provided object implements the AsyncIterator protocol via + * implementing a `Symbol.asyncIterator` method. + */ +export function isAsyncIterable( + maybeAsyncIterable: any, +): maybeAsyncIterable is AsyncIterable { + return typeof maybeAsyncIterable?.[Symbol.asyncIterator] === 'function'; +} diff --git a/src/jsutils/isIterableObject.ts b/src/jsutils/isIterableObject.ts new file mode 100644 index 00000000..5c9d6fb3 --- /dev/null +++ b/src/jsutils/isIterableObject.ts @@ -0,0 +1,25 @@ +/** + * Returns true if the provided object is an Object (i.e. not a string literal) + * and implements the Iterator protocol. + * + * This may be used in place of [Array.isArray()][isArray] to determine if + * an object should be iterated-over e.g. Array, Map, Set, Int8Array, + * TypedArray, etc. but excludes string literals. + * + * @example + * ```ts + * isIterableObject([ 1, 2, 3 ]) // true + * isIterableObject(new Map()) // true + * isIterableObject('ABC') // false + * isIterableObject({ key: 'value' }) // false + * isIterableObject({ length: 1, 0: 'Alpha' }) // false + * ``` + */ +export function isIterableObject( + maybeIterable: any, +): maybeIterable is Iterable { + return ( + typeof maybeIterable === 'object' && + typeof maybeIterable?.[Symbol.iterator] === 'function' + ); +} diff --git a/src/jsutils/isObjectLike.ts b/src/jsutils/isObjectLike.ts new file mode 100644 index 00000000..1d43e267 --- /dev/null +++ b/src/jsutils/isObjectLike.ts @@ -0,0 +1,9 @@ +/** + * Return true if `value` is object-like. A value is object-like if it's not + * `null` and has a `typeof` result of "object". + */ +export function isObjectLike( + value: unknown, +): value is { [key: string]: unknown } { + return typeof value == 'object' && value !== null; +} diff --git a/src/jsutils/isPromise.ts b/src/jsutils/isPromise.ts new file mode 100644 index 00000000..5fc3c104 --- /dev/null +++ b/src/jsutils/isPromise.ts @@ -0,0 +1,7 @@ +/** + * Returns true if the value acts like a Promise, i.e. has a "then" function, + * otherwise returns false. + */ +export function isPromise(value: any): value is Promise { + return typeof value?.then === 'function'; +} diff --git a/src/jsutils/keyMap.ts b/src/jsutils/keyMap.ts new file mode 100644 index 00000000..592a98c8 --- /dev/null +++ b/src/jsutils/keyMap.ts @@ -0,0 +1,39 @@ +import type { ObjMap } from './ObjMap'; + +/** + * Creates a keyed JS object from an array, given a function to produce the keys + * for each value in the array. + * + * This provides a convenient lookup for the array items if the key function + * produces unique results. + * ```ts + * const phoneBook = [ + * { name: 'Jon', num: '555-1234' }, + * { name: 'Jenny', num: '867-5309' } + * ] + * + * const entriesByName = keyMap( + * phoneBook, + * entry => entry.name + * ) + * + * // { + * // Jon: { name: 'Jon', num: '555-1234' }, + * // Jenny: { name: 'Jenny', num: '867-5309' } + * // } + * + * const jennyEntry = entriesByName['Jenny'] + * + * // { name: 'Jenny', num: '857-6309' } + * ``` + */ +export function keyMap( + list: ReadonlyArray, + keyFn: (item: T) => string, +): ObjMap { + const result = Object.create(null); + for (const item of list) { + result[keyFn(item)] = item; + } + return result; +} diff --git a/src/jsutils/keyValMap.ts b/src/jsutils/keyValMap.ts new file mode 100644 index 00000000..94d688c2 --- /dev/null +++ b/src/jsutils/keyValMap.ts @@ -0,0 +1,30 @@ +import type { ObjMap } from './ObjMap'; + +/** + * Creates a keyed JS object from an array, given a function to produce the keys + * and a function to produce the values from each item in the array. + * ```ts + * const phoneBook = [ + * { name: 'Jon', num: '555-1234' }, + * { name: 'Jenny', num: '867-5309' } + * ] + * + * // { Jon: '555-1234', Jenny: '867-5309' } + * const phonesByName = keyValMap( + * phoneBook, + * entry => entry.name, + * entry => entry.num + * ) + * ``` + */ +export function keyValMap( + list: ReadonlyArray, + keyFn: (item: T) => string, + valFn: (item: T) => V, +): ObjMap { + const result = Object.create(null); + for (const item of list) { + result[keyFn(item)] = valFn(item); + } + return result; +} diff --git a/src/jsutils/mapValue.ts b/src/jsutils/mapValue.ts new file mode 100644 index 00000000..32686a29 --- /dev/null +++ b/src/jsutils/mapValue.ts @@ -0,0 +1,17 @@ +import type { ObjMap, ReadOnlyObjMap } from './ObjMap'; + +/** + * Creates an object map with the same keys as `map` and values generated by + * running each value of `map` thru `fn`. + */ +export function mapValue( + map: ReadOnlyObjMap, + fn: (value: T, key: string) => V, +): ObjMap { + const result = Object.create(null); + + for (const key of Object.keys(map)) { + result[key] = fn(map[key], key); + } + return result; +} diff --git a/src/jsutils/memoize3.ts b/src/jsutils/memoize3.ts new file mode 100644 index 00000000..213cb95d --- /dev/null +++ b/src/jsutils/memoize3.ts @@ -0,0 +1,37 @@ +/** + * Memoizes the provided three-argument function. + */ +export function memoize3< + A1 extends object, + A2 extends object, + A3 extends object, + R, +>(fn: (a1: A1, a2: A2, a3: A3) => R): (a1: A1, a2: A2, a3: A3) => R { + let cache0: WeakMap>>; + + return function memoized(a1, a2, a3) { + if (cache0 === undefined) { + cache0 = new WeakMap(); + } + + let cache1 = cache0.get(a1); + if (cache1 === undefined) { + cache1 = new WeakMap(); + cache0.set(a1, cache1); + } + + let cache2 = cache1.get(a2); + if (cache2 === undefined) { + cache2 = new WeakMap(); + cache1.set(a2, cache2); + } + + let fnResult = cache2.get(a3); + if (fnResult === undefined) { + fnResult = fn(a1, a2, a3); + cache2.set(a3, fnResult); + } + + return fnResult; + }; +} diff --git a/src/jsutils/naturalCompare.ts b/src/jsutils/naturalCompare.ts new file mode 100644 index 00000000..7a562863 --- /dev/null +++ b/src/jsutils/naturalCompare.ts @@ -0,0 +1,58 @@ +/** + * Returns a number indicating whether a reference string comes before, or after, + * or is the same as the given string in natural sort order. + * + * See: https://en.wikipedia.org/wiki/Natural_sort_order + * + */ +export function naturalCompare(aStr: string, bStr: string): number { + let aIndex = 0; + let bIndex = 0; + + while (aIndex < aStr.length && bIndex < bStr.length) { + let aChar = aStr.charCodeAt(aIndex); + let bChar = bStr.charCodeAt(bIndex); + + if (isDigit(aChar) && isDigit(bChar)) { + let aNum = 0; + do { + ++aIndex; + aNum = aNum * 10 + aChar - DIGIT_0; + aChar = aStr.charCodeAt(aIndex); + } while (isDigit(aChar) && aNum > 0); + + let bNum = 0; + do { + ++bIndex; + bNum = bNum * 10 + bChar - DIGIT_0; + bChar = bStr.charCodeAt(bIndex); + } while (isDigit(bChar) && bNum > 0); + + if (aNum < bNum) { + return -1; + } + + if (aNum > bNum) { + return 1; + } + } else { + if (aChar < bChar) { + return -1; + } + if (aChar > bChar) { + return 1; + } + ++aIndex; + ++bIndex; + } + } + + return aStr.length - bStr.length; +} + +const DIGIT_0 = 48; +const DIGIT_9 = 57; + +function isDigit(code: number): boolean { + return !isNaN(code) && DIGIT_0 <= code && code <= DIGIT_9; +} diff --git a/src/jsutils/printPathArray.ts b/src/jsutils/printPathArray.ts new file mode 100644 index 00000000..0d9fcc2b --- /dev/null +++ b/src/jsutils/printPathArray.ts @@ -0,0 +1,10 @@ +/** + * Build a string describing the path. + */ +export function printPathArray(path: ReadonlyArray): string { + return path + .map((key) => + typeof key === 'number' ? '[' + key.toString() + ']' : '.' + key, + ) + .join(''); +} diff --git a/src/jsutils/promiseForObject.ts b/src/jsutils/promiseForObject.ts new file mode 100644 index 00000000..10746760 --- /dev/null +++ b/src/jsutils/promiseForObject.ts @@ -0,0 +1,20 @@ +import type { ObjMap } from './ObjMap'; + +/** + * This function transforms a JS object `ObjMap>` into + * a `Promise>` + * + * This is akin to bluebird's `Promise.props`, but implemented only using + * `Promise.all` so it will work with any implementation of ES6 promises. + */ +export function promiseForObject( + object: ObjMap>, +): Promise> { + return Promise.all(Object.values(object)).then((resolvedValues) => { + const resolvedObject = Object.create(null); + for (const [i, key] of Object.keys(object).entries()) { + resolvedObject[key] = resolvedValues[i]; + } + return resolvedObject; + }); +} diff --git a/src/jsutils/promiseReduce.ts b/src/jsutils/promiseReduce.ts new file mode 100644 index 00000000..58db2e85 --- /dev/null +++ b/src/jsutils/promiseReduce.ts @@ -0,0 +1,23 @@ +import { isPromise } from './isPromise'; +import type { PromiseOrValue } from './PromiseOrValue'; + +/** + * Similar to Array.prototype.reduce(), however the reducing callback may return + * a Promise, in which case reduction will continue after each promise resolves. + * + * If the callback does not return a Promise, then this function will also not + * return a Promise. + */ +export function promiseReduce( + values: Iterable, + callbackFn: (accumulator: U, currentValue: T) => PromiseOrValue, + initialValue: PromiseOrValue, +): PromiseOrValue { + let accumulator = initialValue; + for (const value of values) { + accumulator = isPromise(accumulator) + ? accumulator.then((resolved) => callbackFn(resolved, value)) + : callbackFn(accumulator, value); + } + return accumulator; +} diff --git a/src/jsutils/suggestionList.ts b/src/jsutils/suggestionList.ts new file mode 100644 index 00000000..53ad685c --- /dev/null +++ b/src/jsutils/suggestionList.ts @@ -0,0 +1,137 @@ +import { naturalCompare } from './naturalCompare'; + +/** + * Given an invalid input string and a list of valid options, returns a filtered + * list of valid options sorted based on their similarity with the input. + */ +export function suggestionList( + input: string, + options: ReadonlyArray, +): Array { + const optionsByDistance = Object.create(null); + const lexicalDistance = new LexicalDistance(input); + + const threshold = Math.floor(input.length * 0.4) + 1; + for (const option of options) { + const distance = lexicalDistance.measure(option, threshold); + if (distance !== undefined) { + optionsByDistance[option] = distance; + } + } + + return Object.keys(optionsByDistance).sort((a, b) => { + const distanceDiff = optionsByDistance[a] - optionsByDistance[b]; + return distanceDiff !== 0 ? distanceDiff : naturalCompare(a, b); + }); +} + +/** + * Computes the lexical distance between strings A and B. + * + * The "distance" between two strings is given by counting the minimum number + * of edits needed to transform string A into string B. An edit can be an + * insertion, deletion, or substitution of a single character, or a swap of two + * adjacent characters. + * + * Includes a custom alteration from Damerau-Levenshtein to treat case changes + * as a single edit which helps identify mis-cased values with an edit distance + * of 1. + * + * This distance can be useful for detecting typos in input or sorting + */ +class LexicalDistance { + _input: string; + _inputLowerCase: string; + _inputArray: Array; + _rows: [Array, Array, Array]; + + constructor(input: string) { + this._input = input; + this._inputLowerCase = input.toLowerCase(); + this._inputArray = stringToArray(this._inputLowerCase); + + this._rows = [ + new Array(input.length + 1).fill(0), + new Array(input.length + 1).fill(0), + new Array(input.length + 1).fill(0), + ]; + } + + measure(option: string, threshold: number): number | undefined { + if (this._input === option) { + return 0; + } + + const optionLowerCase = option.toLowerCase(); + + // Any case change counts as a single edit + if (this._inputLowerCase === optionLowerCase) { + return 1; + } + + let a = stringToArray(optionLowerCase); + let b = this._inputArray; + + if (a.length < b.length) { + const tmp = a; + a = b; + b = tmp; + } + const aLength = a.length; + const bLength = b.length; + + if (aLength - bLength > threshold) { + return undefined; + } + + const rows = this._rows; + for (let j = 0; j <= bLength; j++) { + rows[0][j] = j; + } + + for (let i = 1; i <= aLength; i++) { + const upRow = rows[(i - 1) % 3]; + const currentRow = rows[i % 3]; + + let smallestCell = (currentRow[0] = i); + for (let j = 1; j <= bLength; j++) { + const cost = a[i - 1] === b[j - 1] ? 0 : 1; + + let currentCell = Math.min( + upRow[j] + 1, // delete + currentRow[j - 1] + 1, // insert + upRow[j - 1] + cost, // substitute + ); + + if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) { + // transposition + const doubleDiagonalCell = rows[(i - 2) % 3][j - 2]; + currentCell = Math.min(currentCell, doubleDiagonalCell + 1); + } + + if (currentCell < smallestCell) { + smallestCell = currentCell; + } + + currentRow[j] = currentCell; + } + + // Early exit, since distance can't go smaller than smallest element of the previous row. + if (smallestCell > threshold) { + return undefined; + } + } + + const distance = rows[aLength % 3][bLength]; + return distance <= threshold ? distance : undefined; + } +} + +function stringToArray(str: string): Array { + const strLength = str.length; + const array = new Array(strLength); + for (let i = 0; i < strLength; ++i) { + array[i] = str.charCodeAt(i); + } + return array; +} diff --git a/src/jsutils/toError.ts b/src/jsutils/toError.ts new file mode 100644 index 00000000..8d562273 --- /dev/null +++ b/src/jsutils/toError.ts @@ -0,0 +1,20 @@ +import { inspect } from './inspect'; + +/** + * Sometimes a non-error is thrown, wrap it as an Error instance to ensure a consistent Error interface. + */ +export function toError(thrownValue: unknown): Error { + return thrownValue instanceof Error + ? thrownValue + : new NonErrorThrown(thrownValue); +} + +class NonErrorThrown extends Error { + thrownValue: unknown; + + constructor(thrownValue: unknown) { + super('Unexpected error value: ' + inspect(thrownValue)); + this.name = 'NonErrorThrown'; + this.thrownValue = thrownValue; + } +} diff --git a/src/jsutils/toObjMap.ts b/src/jsutils/toObjMap.ts new file mode 100644 index 00000000..6fe352db --- /dev/null +++ b/src/jsutils/toObjMap.ts @@ -0,0 +1,20 @@ +import type { Maybe } from './Maybe'; +import type { ReadOnlyObjMap, ReadOnlyObjMapLike } from './ObjMap'; + +export function toObjMap( + obj: Maybe>, +): ReadOnlyObjMap { + if (obj == null) { + return Object.create(null); + } + + if (Object.getPrototypeOf(obj) === null) { + return obj; + } + + const map = Object.create(null); + for (const [key, value] of Object.entries(obj)) { + map[key] = value; + } + return map; +} diff --git a/src/language/README.md b/src/language/README.md new file mode 100644 index 00000000..68cc9fd4 --- /dev/null +++ b/src/language/README.md @@ -0,0 +1,9 @@ +## GraphQL Language + +The `graphql/language` module is responsible for parsing and operating on the +GraphQL language. + +```js +import { ... } from 'graphql/language'; // ES6 +var GraphQLLanguage = require('graphql/language'); // CommonJS +``` diff --git a/src/language/__tests__/blockString-fuzz.ts b/src/language/__tests__/blockString-fuzz.ts new file mode 100644 index 00000000..4ed010cc --- /dev/null +++ b/src/language/__tests__/blockString-fuzz.ts @@ -0,0 +1,67 @@ +import { describe, it } from 'mocha'; + +import { dedent } from '../../__testUtils__/dedent'; +import { genFuzzStrings } from '../../__testUtils__/genFuzzStrings'; +import { inspectStr } from '../../__testUtils__/inspectStr'; + +import { invariant } from '../../jsutils/invariant'; + +import { isPrintableAsBlockString, printBlockString } from '../blockString'; +import { Lexer } from '../lexer'; +import { Source } from '../source'; + +function lexValue(str: string): string { + const lexer = new Lexer(new Source(str)); + const value = lexer.advance().value; + + invariant(typeof value === 'string'); + invariant(lexer.advance().kind === '', 'Expected EOF'); + return value; +} + +function testPrintableBlockString( + testValue: string, + options?: { minimize: boolean }, +): void { + const blockString = printBlockString(testValue, options); + const printedValue = lexValue(blockString); + invariant( + testValue === printedValue, + dedent` + Expected lexValue(${inspectStr(blockString)}) + to equal ${inspectStr(testValue)} + but got ${inspectStr(printedValue)} + `, + ); +} + +function testNonPrintableBlockString(testValue: string): void { + const blockString = printBlockString(testValue); + const printedValue = lexValue(blockString); + invariant( + testValue !== printedValue, + dedent` + Expected lexValue(${inspectStr(blockString)}) + to not equal ${inspectStr(testValue)} + `, + ); +} + +describe('printBlockString', () => { + it('correctly print random strings', () => { + // Testing with length >7 is taking exponentially more time. However it is + // highly recommended to test with increased limit if you make any change. + for (const fuzzStr of genFuzzStrings({ + allowedChars: ['\n', '\t', ' ', '"', 'a', '\\'], + maxLength: 7, + })) { + if (!isPrintableAsBlockString(fuzzStr)) { + testNonPrintableBlockString(fuzzStr); + continue; + } + + testPrintableBlockString(fuzzStr); + testPrintableBlockString(fuzzStr, { minimize: true }); + } + }).timeout(20000); +}); diff --git a/src/language/__tests__/blockString-test.ts b/src/language/__tests__/blockString-test.ts new file mode 100644 index 00000000..a37858d3 --- /dev/null +++ b/src/language/__tests__/blockString-test.ts @@ -0,0 +1,294 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { + dedentBlockStringLines, + isPrintableAsBlockString, + printBlockString, +} from '../blockString'; + +function joinLines(...args: ReadonlyArray) { + return args.join('\n'); +} + +describe('dedentBlockStringLines', () => { + function expectDedent(lines: ReadonlyArray) { + return expect(dedentBlockStringLines(lines)); + } + + it('handles empty string', () => { + expectDedent(['']).to.deep.equal([]); + }); + + it('do not dedent first line', () => { + expectDedent([' a']).to.deep.equal([' a']); + expectDedent([' a', ' b']).to.deep.equal([' a', 'b']); + }); + + it('removes minimal indentation length', () => { + expectDedent(['', ' a', ' b']).to.deep.equal(['a', ' b']); + expectDedent(['', ' a', ' b']).to.deep.equal([' a', 'b']); + expectDedent(['', ' a', ' b', 'c']).to.deep.equal([' a', ' b', 'c']); + }); + + it('dedent both tab and space as single character', () => { + expectDedent(['', '\ta', ' b']).to.deep.equal(['a', ' b']); + expectDedent(['', '\t a', ' b']).to.deep.equal(['a', ' b']); + expectDedent(['', ' \t a', ' b']).to.deep.equal(['a', ' b']); + }); + + it('dedent do not take empty lines into account', () => { + expectDedent(['a', '', ' b']).to.deep.equal(['a', '', 'b']); + expectDedent(['a', ' ', ' b']).to.deep.equal(['a', '', 'b']); + }); + + it('removes uniform indentation from a string', () => { + const lines = [ + '', + ' Hello,', + ' World!', + '', + ' Yours,', + ' GraphQL.', + ]; + expectDedent(lines).to.deep.equal([ + 'Hello,', + ' World!', + '', + 'Yours,', + ' GraphQL.', + ]); + }); + + it('removes empty leading and trailing lines', () => { + const lines = [ + '', + '', + ' Hello,', + ' World!', + '', + ' Yours,', + ' GraphQL.', + '', + '', + ]; + expectDedent(lines).to.deep.equal([ + 'Hello,', + ' World!', + '', + 'Yours,', + ' GraphQL.', + ]); + }); + + it('removes blank leading and trailing lines', () => { + const lines = [ + ' ', + ' ', + ' Hello,', + ' World!', + '', + ' Yours,', + ' GraphQL.', + ' ', + ' ', + ]; + expectDedent(lines).to.deep.equal([ + 'Hello,', + ' World!', + '', + 'Yours,', + ' GraphQL.', + ]); + }); + + it('retains indentation from first line', () => { + const lines = [ + ' Hello,', + ' World!', + '', + ' Yours,', + ' GraphQL.', + ]; + expectDedent(lines).to.deep.equal([ + ' Hello,', + ' World!', + '', + 'Yours,', + ' GraphQL.', + ]); + }); + + it('does not alter trailing spaces', () => { + const lines = [ + ' ', + ' Hello, ', + ' World! ', + ' ', + ' Yours, ', + ' GraphQL. ', + ' ', + ]; + expectDedent(lines).to.deep.equal([ + 'Hello, ', + ' World! ', + ' ', + 'Yours, ', + ' GraphQL. ', + ]); + }); +}); + +describe('isPrintableAsBlockString', () => { + function expectPrintable(str: string) { + return expect(isPrintableAsBlockString(str)).to.equal(true); + } + + function expectNonPrintable(str: string) { + return expect(isPrintableAsBlockString(str)).to.equal(false); + } + + it('accepts valid strings', () => { + expectPrintable(''); + expectPrintable(' a'); + expectPrintable('\t"\n"'); + expectNonPrintable('\t"\n \n\t"'); + }); + + it('rejects strings with only whitespace', () => { + expectNonPrintable(' '); + expectNonPrintable('\t'); + expectNonPrintable('\t '); + expectNonPrintable(' \t'); + }); + + it('rejects strings with non-printable character', () => { + expectNonPrintable('\x00'); + expectNonPrintable('a\x00b'); + }); + + it('rejects strings with non-printable character', () => { + expectNonPrintable('\x00'); + expectNonPrintable('a\x00b'); + }); + + it('rejects strings with only empty lines', () => { + expectNonPrintable('\n'); + expectNonPrintable('\n\n'); + expectNonPrintable('\n\n\n'); + expectNonPrintable(' \n \n'); + expectNonPrintable('\t\n\t\t\n'); + }); + + it('rejects strings with carriage return', () => { + expectNonPrintable('\r'); + expectNonPrintable('\n\r'); + expectNonPrintable('\r\n'); + expectNonPrintable('a\rb'); + }); + + it('rejects strings with leading empty lines', () => { + expectNonPrintable('\na'); + expectNonPrintable(' \na'); + expectNonPrintable('\t\na'); + expectNonPrintable('\n\na'); + }); + + it('rejects strings with leading empty lines', () => { + expectNonPrintable('a\n'); + expectNonPrintable('a\n '); + expectNonPrintable('a\n\t'); + expectNonPrintable('a\n\n'); + }); +}); + +describe('printBlockString', () => { + function expectBlockString(str: string) { + return { + toEqual(expected: string | { readable: string; minimize: string }) { + const { readable, minimize } = + typeof expected === 'string' + ? { readable: expected, minimize: expected } + : expected; + + expect(printBlockString(str)).to.equal(readable); + expect(printBlockString(str, { minimize: true })).to.equal(minimize); + }, + }; + } + + it('do not escape characters', () => { + const str = '" \\ / \b \f \n \r \t'; + expectBlockString(str).toEqual({ + readable: '"""\n' + str + '\n"""', + minimize: '"""\n' + str + '"""', + }); + }); + + it('by default print block strings as single line', () => { + const str = 'one liner'; + expectBlockString(str).toEqual('"""one liner"""'); + }); + + it('by default print block strings ending with triple quotation as multi-line', () => { + const str = 'triple quotation """'; + expectBlockString(str).toEqual({ + readable: '"""\ntriple quotation \\"""\n"""', + minimize: '"""triple quotation \\""""""', + }); + }); + + it('correctly prints single-line with leading space', () => { + const str = ' space-led string'; + expectBlockString(str).toEqual('""" space-led string"""'); + }); + + it('correctly prints single-line with leading space and trailing quotation', () => { + const str = ' space-led value "quoted string"'; + expectBlockString(str).toEqual( + '""" space-led value "quoted string"\n"""', + ); + }); + + it('correctly prints single-line with trailing backslash', () => { + const str = 'backslash \\'; + expectBlockString(str).toEqual({ + readable: '"""\nbackslash \\\n"""', + minimize: '"""backslash \\\n"""', + }); + }); + + it('correctly prints multi-line with internal indent', () => { + const str = 'no indent\n with indent'; + expectBlockString(str).toEqual({ + readable: '"""\nno indent\n with indent\n"""', + minimize: '"""\nno indent\n with indent"""', + }); + }); + + it('correctly prints string with a first line indentation', () => { + const str = joinLines( + ' first ', + ' line ', + 'indentation', + ' string', + ); + + expectBlockString(str).toEqual({ + readable: joinLines( + '"""', + ' first ', + ' line ', + 'indentation', + ' string', + '"""', + ), + minimize: joinLines( + '""" first ', + ' line ', + 'indentation', + ' string"""', + ), + }); + }); +}); diff --git a/src/language/__tests__/lexer-test.ts b/src/language/__tests__/lexer-test.ts new file mode 100644 index 00000000..46bf971d --- /dev/null +++ b/src/language/__tests__/lexer-test.ts @@ -0,0 +1,1207 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { dedent } from '../../__testUtils__/dedent'; +import { expectToThrowJSON } from '../../__testUtils__/expectJSON'; + +import { inspect } from '../../jsutils/inspect'; + +import { GraphQLError } from '../../error/GraphQLError'; + +import type { Token } from '../ast'; +import { isPunctuatorTokenKind, Lexer } from '../lexer'; +import { Source } from '../source'; +import { TokenKind } from '../tokenKind'; + +function lexOne(str: string) { + const lexer = new Lexer(new Source(str)); + return lexer.advance(); +} + +function lexSecond(str: string) { + const lexer = new Lexer(new Source(str)); + lexer.advance(); + return lexer.advance(); +} + +function expectSyntaxError(text: string) { + return expectToThrowJSON(() => lexSecond(text)); +} + +describe('Lexer', () => { + it('ignores BOM header', () => { + expect(lexOne('\uFEFF foo')).to.contain({ + kind: TokenKind.NAME, + start: 2, + end: 5, + value: 'foo', + }); + }); + + it('tracks line breaks', () => { + expect(lexOne('foo')).to.contain({ + kind: TokenKind.NAME, + start: 0, + end: 3, + line: 1, + column: 1, + value: 'foo', + }); + expect(lexOne('\nfoo')).to.contain({ + kind: TokenKind.NAME, + start: 1, + end: 4, + line: 2, + column: 1, + value: 'foo', + }); + expect(lexOne('\rfoo')).to.contain({ + kind: TokenKind.NAME, + start: 1, + end: 4, + line: 2, + column: 1, + value: 'foo', + }); + expect(lexOne('\r\nfoo')).to.contain({ + kind: TokenKind.NAME, + start: 2, + end: 5, + line: 2, + column: 1, + value: 'foo', + }); + expect(lexOne('\n\rfoo')).to.contain({ + kind: TokenKind.NAME, + start: 2, + end: 5, + line: 3, + column: 1, + value: 'foo', + }); + expect(lexOne('\r\r\n\nfoo')).to.contain({ + kind: TokenKind.NAME, + start: 4, + end: 7, + line: 4, + column: 1, + value: 'foo', + }); + expect(lexOne('\n\n\r\rfoo')).to.contain({ + kind: TokenKind.NAME, + start: 4, + end: 7, + line: 5, + column: 1, + value: 'foo', + }); + }); + + it('records line and column', () => { + expect(lexOne('\n \r\n \r foo\n')).to.contain({ + kind: TokenKind.NAME, + start: 8, + end: 11, + line: 4, + column: 3, + value: 'foo', + }); + }); + + it('can be Object.toStringified, JSON.stringified, or jsutils.inspected', () => { + const lexer = new Lexer(new Source('foo')); + const token = lexer.advance(); + + expect(Object.prototype.toString.call(lexer)).to.equal('[object Lexer]'); + + expect(Object.prototype.toString.call(token)).to.equal('[object Token]'); + expect(JSON.stringify(token)).to.equal( + '{"kind":"Name","value":"foo","line":1,"column":1}', + ); + expect(inspect(token)).to.equal( + '{ kind: "Name", value: "foo", line: 1, column: 1 }', + ); + }); + + it('skips whitespace and comments', () => { + expect( + lexOne(` + + foo + + +`), + ).to.contain({ + kind: TokenKind.NAME, + start: 6, + end: 9, + value: 'foo', + }); + + expect(lexOne('\t\tfoo\t\t')).to.contain({ + kind: TokenKind.NAME, + start: 2, + end: 5, + value: 'foo', + }); + + expect( + lexOne(` + #comment + foo#comment +`), + ).to.contain({ + kind: TokenKind.NAME, + start: 18, + end: 21, + value: 'foo', + }); + + expect(lexOne(',,,foo,,,')).to.contain({ + kind: TokenKind.NAME, + start: 3, + end: 6, + value: 'foo', + }); + }); + + it('errors respect whitespace', () => { + let caughtError; + try { + lexOne(['', '', ' ~', ''].join('\n')); + } catch (error) { + caughtError = error; + } + expect(String(caughtError)).to.equal(dedent` + Syntax Error: Unexpected character: "~". + + GraphQL request:3:2 + 2 | + 3 | ~ + | ^ + 4 | + `); + }); + + it('updates line numbers in error for file context', () => { + let caughtError; + try { + const str = ['', '', ' ~', ''].join('\n'); + const source = new Source(str, 'foo.js', { line: 11, column: 12 }); + new Lexer(source).advance(); + } catch (error) { + caughtError = error; + } + expect(String(caughtError)).to.equal(dedent` + Syntax Error: Unexpected character: "~". + + foo.js:13:6 + 12 | + 13 | ~ + | ^ + 14 | + `); + }); + + it('updates column numbers in error for file context', () => { + let caughtError; + try { + const source = new Source('~', 'foo.js', { line: 1, column: 5 }); + new Lexer(source).advance(); + } catch (error) { + caughtError = error; + } + expect(String(caughtError)).to.equal(dedent` + Syntax Error: Unexpected character: "~". + + foo.js:1:5 + 1 | ~ + | ^ + `); + }); + + it('lexes strings', () => { + expect(lexOne('""')).to.contain({ + kind: TokenKind.STRING, + start: 0, + end: 2, + value: '', + }); + + expect(lexOne('"simple"')).to.contain({ + kind: TokenKind.STRING, + start: 0, + end: 8, + value: 'simple', + }); + + expect(lexOne('" white space "')).to.contain({ + kind: TokenKind.STRING, + start: 0, + end: 15, + value: ' white space ', + }); + + expect(lexOne('"quote \\""')).to.contain({ + kind: TokenKind.STRING, + start: 0, + end: 10, + value: 'quote "', + }); + + expect(lexOne('"escaped \\n\\r\\b\\t\\f"')).to.contain({ + kind: TokenKind.STRING, + start: 0, + end: 20, + value: 'escaped \n\r\b\t\f', + }); + + expect(lexOne('"slashes \\\\ \\/"')).to.contain({ + kind: TokenKind.STRING, + start: 0, + end: 15, + value: 'slashes \\ /', + }); + + expect(lexOne('"unescaped unicode outside BMP \u{1f600}"')).to.contain({ + kind: TokenKind.STRING, + start: 0, + end: 34, + value: 'unescaped unicode outside BMP \u{1f600}', + }); + + expect( + lexOne('"unescaped maximal unicode outside BMP \u{10ffff}"'), + ).to.contain({ + kind: TokenKind.STRING, + start: 0, + end: 42, + value: 'unescaped maximal unicode outside BMP \u{10ffff}', + }); + + expect(lexOne('"unicode \\u1234\\u5678\\u90AB\\uCDEF"')).to.contain({ + kind: TokenKind.STRING, + start: 0, + end: 34, + value: 'unicode \u1234\u5678\u90AB\uCDEF', + }); + + expect(lexOne('"unicode \\u{1234}\\u{5678}\\u{90AB}\\u{CDEF}"')).to.contain( + { + kind: TokenKind.STRING, + start: 0, + end: 42, + value: 'unicode \u1234\u5678\u90AB\uCDEF', + }, + ); + + expect( + lexOne('"string with unicode escape outside BMP \\u{1F600}"'), + ).to.contain({ + kind: TokenKind.STRING, + start: 0, + end: 50, + value: 'string with unicode escape outside BMP \u{1f600}', + }); + + expect(lexOne('"string with minimal unicode escape \\u{0}"')).to.contain({ + kind: TokenKind.STRING, + start: 0, + end: 42, + value: 'string with minimal unicode escape \u{0}', + }); + + expect( + lexOne('"string with maximal unicode escape \\u{10FFFF}"'), + ).to.contain({ + kind: TokenKind.STRING, + start: 0, + end: 47, + value: 'string with maximal unicode escape \u{10FFFF}', + }); + + expect( + lexOne('"string with maximal minimal unicode escape \\u{00000000}"'), + ).to.contain({ + kind: TokenKind.STRING, + start: 0, + end: 57, + value: 'string with maximal minimal unicode escape \u{0}', + }); + + expect( + lexOne('"string with unicode surrogate pair escape \\uD83D\\uDE00"'), + ).to.contain({ + kind: TokenKind.STRING, + start: 0, + end: 56, + value: 'string with unicode surrogate pair escape \u{1f600}', + }); + + expect( + lexOne('"string with minimal surrogate pair escape \\uD800\\uDC00"'), + ).to.contain({ + kind: TokenKind.STRING, + start: 0, + end: 56, + value: 'string with minimal surrogate pair escape \u{10000}', + }); + + expect( + lexOne('"string with maximal surrogate pair escape \\uDBFF\\uDFFF"'), + ).to.contain({ + kind: TokenKind.STRING, + start: 0, + end: 56, + value: 'string with maximal surrogate pair escape \u{10FFFF}', + }); + }); + + it('lex reports useful string errors', () => { + expectSyntaxError('"').to.deep.equal({ + message: 'Syntax Error: Unterminated string.', + locations: [{ line: 1, column: 2 }], + }); + + expectSyntaxError('"""').to.deep.equal({ + message: 'Syntax Error: Unterminated string.', + locations: [{ line: 1, column: 4 }], + }); + + expectSyntaxError('""""').to.deep.equal({ + message: 'Syntax Error: Unterminated string.', + locations: [{ line: 1, column: 5 }], + }); + + expectSyntaxError('"no end quote').to.deep.equal({ + message: 'Syntax Error: Unterminated string.', + locations: [{ line: 1, column: 14 }], + }); + + expectSyntaxError("'single quotes'").to.deep.equal({ + message: + 'Syntax Error: Unexpected single quote character (\'), did you mean to use a double quote (")?', + locations: [{ line: 1, column: 1 }], + }); + + expectSyntaxError('"bad surrogate \uDEAD"').to.deep.equal({ + message: 'Syntax Error: Invalid character within String: U+DEAD.', + locations: [{ line: 1, column: 16 }], + }); + + expectSyntaxError('"bad high surrogate pair \uDEAD\uDEAD"').to.deep.equal({ + message: 'Syntax Error: Invalid character within String: U+DEAD.', + locations: [{ line: 1, column: 26 }], + }); + + expectSyntaxError('"bad low surrogate pair \uD800\uD800"').to.deep.equal({ + message: 'Syntax Error: Invalid character within String: U+D800.', + locations: [{ line: 1, column: 25 }], + }); + + expectSyntaxError('"multi\nline"').to.deep.equal({ + message: 'Syntax Error: Unterminated string.', + locations: [{ line: 1, column: 7 }], + }); + + expectSyntaxError('"multi\rline"').to.deep.equal({ + message: 'Syntax Error: Unterminated string.', + locations: [{ line: 1, column: 7 }], + }); + + expectSyntaxError('"bad \\z esc"').to.deep.equal({ + message: 'Syntax Error: Invalid character escape sequence: "\\z".', + locations: [{ line: 1, column: 6 }], + }); + + expectSyntaxError('"bad \\x esc"').to.deep.equal({ + message: 'Syntax Error: Invalid character escape sequence: "\\x".', + locations: [{ line: 1, column: 6 }], + }); + + expectSyntaxError('"bad \\u1 esc"').to.deep.equal({ + message: 'Syntax Error: Invalid Unicode escape sequence: "\\u1 es".', + locations: [{ line: 1, column: 6 }], + }); + + expectSyntaxError('"bad \\u0XX1 esc"').to.deep.equal({ + message: 'Syntax Error: Invalid Unicode escape sequence: "\\u0XX1".', + locations: [{ line: 1, column: 6 }], + }); + + expectSyntaxError('"bad \\uXXXX esc"').to.deep.equal({ + message: 'Syntax Error: Invalid Unicode escape sequence: "\\uXXXX".', + locations: [{ line: 1, column: 6 }], + }); + + expectSyntaxError('"bad \\uFXXX esc"').to.deep.equal({ + message: 'Syntax Error: Invalid Unicode escape sequence: "\\uFXXX".', + locations: [{ line: 1, column: 6 }], + }); + + expectSyntaxError('"bad \\uXXXF esc"').to.deep.equal({ + message: 'Syntax Error: Invalid Unicode escape sequence: "\\uXXXF".', + locations: [{ line: 1, column: 6 }], + }); + + expectSyntaxError('"bad \\u{} esc"').to.deep.equal({ + message: 'Syntax Error: Invalid Unicode escape sequence: "\\u{}".', + locations: [{ line: 1, column: 6 }], + }); + + expectSyntaxError('"bad \\u{FXXX} esc"').to.deep.equal({ + message: 'Syntax Error: Invalid Unicode escape sequence: "\\u{FX".', + locations: [{ line: 1, column: 6 }], + }); + + expectSyntaxError('"bad \\u{FFFF esc"').to.deep.equal({ + message: 'Syntax Error: Invalid Unicode escape sequence: "\\u{FFFF ".', + locations: [{ line: 1, column: 6 }], + }); + + expectSyntaxError('"bad \\u{FFFF"').to.deep.equal({ + message: 'Syntax Error: Invalid Unicode escape sequence: "\\u{FFFF"".', + locations: [{ line: 1, column: 6 }], + }); + + expectSyntaxError('"too high \\u{110000} esc"').to.deep.equal({ + message: 'Syntax Error: Invalid Unicode escape sequence: "\\u{110000}".', + locations: [{ line: 1, column: 11 }], + }); + + expectSyntaxError('"way too high \\u{12345678} esc"').to.deep.equal({ + message: + 'Syntax Error: Invalid Unicode escape sequence: "\\u{12345678}".', + locations: [{ line: 1, column: 15 }], + }); + + expectSyntaxError('"too long \\u{000000000} esc"').to.deep.equal({ + message: + 'Syntax Error: Invalid Unicode escape sequence: "\\u{000000000".', + locations: [{ line: 1, column: 11 }], + }); + + expectSyntaxError('"bad surrogate \\uDEAD esc"').to.deep.equal({ + message: 'Syntax Error: Invalid Unicode escape sequence: "\\uDEAD".', + locations: [{ line: 1, column: 16 }], + }); + + expectSyntaxError('"bad surrogate \\u{DEAD} esc"').to.deep.equal({ + message: 'Syntax Error: Invalid Unicode escape sequence: "\\u{DEAD}".', + locations: [{ line: 1, column: 16 }], + }); + + expectSyntaxError( + '"cannot use braces for surrogate pair \\u{D83D}\\u{DE00} esc"', + ).to.deep.equal({ + message: 'Syntax Error: Invalid Unicode escape sequence: "\\u{D83D}".', + locations: [{ line: 1, column: 39 }], + }); + + expectSyntaxError( + '"bad high surrogate pair \\uDEAD\\uDEAD esc"', + ).to.deep.equal({ + message: 'Syntax Error: Invalid Unicode escape sequence: "\\uDEAD".', + locations: [{ line: 1, column: 26 }], + }); + + expectSyntaxError( + '"bad low surrogate pair \\uD800\\uD800 esc"', + ).to.deep.equal({ + message: 'Syntax Error: Invalid Unicode escape sequence: "\\uD800".', + locations: [{ line: 1, column: 25 }], + }); + + expectSyntaxError( + '"cannot escape half a pair \uD83D\\uDE00 esc"', + ).to.deep.equal({ + message: 'Syntax Error: Invalid character within String: U+D83D.', + locations: [{ line: 1, column: 28 }], + }); + + expectSyntaxError( + '"cannot escape half a pair \\uD83D\uDE00 esc"', + ).to.deep.equal({ + message: 'Syntax Error: Invalid Unicode escape sequence: "\\uD83D".', + locations: [{ line: 1, column: 28 }], + }); + + expectSyntaxError('"bad \\uD83D\\not an escape"').to.deep.equal({ + message: 'Syntax Error: Invalid Unicode escape sequence: "\\uD83D".', + locations: [{ line: 1, column: 6 }], + }); + }); + + it('lexes block strings', () => { + expect(lexOne('""""""')).to.contain({ + kind: TokenKind.BLOCK_STRING, + start: 0, + end: 6, + line: 1, + column: 1, + value: '', + }); + + expect(lexOne('"""simple"""')).to.contain({ + kind: TokenKind.BLOCK_STRING, + start: 0, + end: 12, + line: 1, + column: 1, + value: 'simple', + }); + + expect(lexOne('""" white space """')).to.contain({ + kind: TokenKind.BLOCK_STRING, + start: 0, + end: 19, + line: 1, + column: 1, + value: ' white space ', + }); + + expect(lexOne('"""contains " quote"""')).to.contain({ + kind: TokenKind.BLOCK_STRING, + start: 0, + end: 22, + line: 1, + column: 1, + value: 'contains " quote', + }); + + expect(lexOne('"""contains \\""" triple quote"""')).to.contain({ + kind: TokenKind.BLOCK_STRING, + start: 0, + end: 32, + line: 1, + column: 1, + value: 'contains """ triple quote', + }); + + expect(lexOne('"""multi\nline"""')).to.contain({ + kind: TokenKind.BLOCK_STRING, + start: 0, + end: 16, + line: 1, + column: 1, + value: 'multi\nline', + }); + + expect(lexOne('"""multi\rline\r\nnormalized"""')).to.contain({ + kind: TokenKind.BLOCK_STRING, + start: 0, + end: 28, + line: 1, + column: 1, + value: 'multi\nline\nnormalized', + }); + + expect(lexOne('"""unescaped \\n\\r\\b\\t\\f\\u1234"""')).to.contain({ + kind: TokenKind.BLOCK_STRING, + start: 0, + end: 32, + line: 1, + column: 1, + value: 'unescaped \\n\\r\\b\\t\\f\\u1234', + }); + + expect(lexOne('"""unescaped unicode outside BMP \u{1f600}"""')).to.contain({ + kind: TokenKind.BLOCK_STRING, + start: 0, + end: 38, + line: 1, + column: 1, + value: 'unescaped unicode outside BMP \u{1f600}', + }); + + expect(lexOne('"""slashes \\\\ \\/"""')).to.contain({ + kind: TokenKind.BLOCK_STRING, + start: 0, + end: 19, + line: 1, + column: 1, + value: 'slashes \\\\ \\/', + }); + + expect( + lexOne(`""" + + spans + multiple + lines + + """`), + ).to.contain({ + kind: TokenKind.BLOCK_STRING, + start: 0, + end: 68, + line: 1, + column: 1, + value: 'spans\n multiple\n lines', + }); + }); + + it('advance line after lexing multiline block string', () => { + expect( + lexSecond(`""" + + spans + multiple + lines + + \n """ second_token`), + ).to.contain({ + kind: TokenKind.NAME, + start: 71, + end: 83, + line: 8, + column: 6, + value: 'second_token', + }); + + expect( + lexSecond( + [ + '""" \n', + 'spans \r\n', + 'multiple \n\r', + 'lines \n\n', + '"""\n second_token', + ].join(''), + ), + ).to.contain({ + kind: TokenKind.NAME, + start: 37, + end: 49, + line: 8, + column: 2, + value: 'second_token', + }); + }); + + it('lex reports useful block string errors', () => { + expectSyntaxError('"""').to.deep.equal({ + message: 'Syntax Error: Unterminated string.', + locations: [{ line: 1, column: 4 }], + }); + + expectSyntaxError('"""no end quote').to.deep.equal({ + message: 'Syntax Error: Unterminated string.', + locations: [{ line: 1, column: 16 }], + }); + + expectSyntaxError('"""contains invalid surrogate \uDEAD"""').to.deep.equal({ + message: 'Syntax Error: Invalid character within String: U+DEAD.', + locations: [{ line: 1, column: 31 }], + }); + }); + + it('lexes numbers', () => { + expect(lexOne('4')).to.contain({ + kind: TokenKind.INT, + start: 0, + end: 1, + value: '4', + }); + + expect(lexOne('4.123')).to.contain({ + kind: TokenKind.FLOAT, + start: 0, + end: 5, + value: '4.123', + }); + + expect(lexOne('-4')).to.contain({ + kind: TokenKind.INT, + start: 0, + end: 2, + value: '-4', + }); + + expect(lexOne('9')).to.contain({ + kind: TokenKind.INT, + start: 0, + end: 1, + value: '9', + }); + + expect(lexOne('0')).to.contain({ + kind: TokenKind.INT, + start: 0, + end: 1, + value: '0', + }); + + expect(lexOne('-4.123')).to.contain({ + kind: TokenKind.FLOAT, + start: 0, + end: 6, + value: '-4.123', + }); + + expect(lexOne('0.123')).to.contain({ + kind: TokenKind.FLOAT, + start: 0, + end: 5, + value: '0.123', + }); + + expect(lexOne('123e4')).to.contain({ + kind: TokenKind.FLOAT, + start: 0, + end: 5, + value: '123e4', + }); + + expect(lexOne('123E4')).to.contain({ + kind: TokenKind.FLOAT, + start: 0, + end: 5, + value: '123E4', + }); + + expect(lexOne('123e-4')).to.contain({ + kind: TokenKind.FLOAT, + start: 0, + end: 6, + value: '123e-4', + }); + + expect(lexOne('123e+4')).to.contain({ + kind: TokenKind.FLOAT, + start: 0, + end: 6, + value: '123e+4', + }); + + expect(lexOne('-1.123e4')).to.contain({ + kind: TokenKind.FLOAT, + start: 0, + end: 8, + value: '-1.123e4', + }); + + expect(lexOne('-1.123E4')).to.contain({ + kind: TokenKind.FLOAT, + start: 0, + end: 8, + value: '-1.123E4', + }); + + expect(lexOne('-1.123e-4')).to.contain({ + kind: TokenKind.FLOAT, + start: 0, + end: 9, + value: '-1.123e-4', + }); + + expect(lexOne('-1.123e+4')).to.contain({ + kind: TokenKind.FLOAT, + start: 0, + end: 9, + value: '-1.123e+4', + }); + + expect(lexOne('-1.123e4567')).to.contain({ + kind: TokenKind.FLOAT, + start: 0, + end: 11, + value: '-1.123e4567', + }); + }); + + it('lex reports useful number errors', () => { + expectSyntaxError('00').to.deep.equal({ + message: 'Syntax Error: Invalid number, unexpected digit after 0: "0".', + locations: [{ line: 1, column: 2 }], + }); + + expectSyntaxError('01').to.deep.equal({ + message: 'Syntax Error: Invalid number, unexpected digit after 0: "1".', + locations: [{ line: 1, column: 2 }], + }); + + expectSyntaxError('01.23').to.deep.equal({ + message: 'Syntax Error: Invalid number, unexpected digit after 0: "1".', + locations: [{ line: 1, column: 2 }], + }); + + expectSyntaxError('+1').to.deep.equal({ + message: 'Syntax Error: Unexpected character: "+".', + locations: [{ line: 1, column: 1 }], + }); + + expectSyntaxError('1.').to.deep.equal({ + message: 'Syntax Error: Invalid number, expected digit but got: .', + locations: [{ line: 1, column: 3 }], + }); + + expectSyntaxError('1e').to.deep.equal({ + message: 'Syntax Error: Invalid number, expected digit but got: .', + locations: [{ line: 1, column: 3 }], + }); + + expectSyntaxError('1E').to.deep.equal({ + message: 'Syntax Error: Invalid number, expected digit but got: .', + locations: [{ line: 1, column: 3 }], + }); + + expectSyntaxError('1.e1').to.deep.equal({ + message: 'Syntax Error: Invalid number, expected digit but got: "e".', + locations: [{ line: 1, column: 3 }], + }); + + expectSyntaxError('.123').to.deep.equal({ + message: 'Syntax Error: Unexpected character: ".".', + locations: [{ line: 1, column: 1 }], + }); + + expectSyntaxError('1.A').to.deep.equal({ + message: 'Syntax Error: Invalid number, expected digit but got: "A".', + locations: [{ line: 1, column: 3 }], + }); + + expectSyntaxError('-A').to.deep.equal({ + message: 'Syntax Error: Invalid number, expected digit but got: "A".', + locations: [{ line: 1, column: 2 }], + }); + + expectSyntaxError('1.0e').to.deep.equal({ + message: 'Syntax Error: Invalid number, expected digit but got: .', + locations: [{ line: 1, column: 5 }], + }); + + expectSyntaxError('1.0eA').to.deep.equal({ + message: 'Syntax Error: Invalid number, expected digit but got: "A".', + locations: [{ line: 1, column: 5 }], + }); + + expectSyntaxError('1.0e"').to.deep.equal({ + message: "Syntax Error: Invalid number, expected digit but got: '\"'.", + locations: [{ line: 1, column: 5 }], + }); + + expectSyntaxError('1.2e3e').to.deep.equal({ + message: 'Syntax Error: Invalid number, expected digit but got: "e".', + locations: [{ line: 1, column: 6 }], + }); + + expectSyntaxError('1.2e3.4').to.deep.equal({ + message: 'Syntax Error: Invalid number, expected digit but got: ".".', + locations: [{ line: 1, column: 6 }], + }); + + expectSyntaxError('1.23.4').to.deep.equal({ + message: 'Syntax Error: Invalid number, expected digit but got: ".".', + locations: [{ line: 1, column: 5 }], + }); + }); + + it('lex does not allow name-start after a number', () => { + expectSyntaxError('0xF1').to.deep.equal({ + message: 'Syntax Error: Invalid number, expected digit but got: "x".', + locations: [{ line: 1, column: 2 }], + }); + expectSyntaxError('0b10').to.deep.equal({ + message: 'Syntax Error: Invalid number, expected digit but got: "b".', + locations: [{ line: 1, column: 2 }], + }); + expectSyntaxError('123abc').to.deep.equal({ + message: 'Syntax Error: Invalid number, expected digit but got: "a".', + locations: [{ line: 1, column: 4 }], + }); + expectSyntaxError('1_234').to.deep.equal({ + message: 'Syntax Error: Invalid number, expected digit but got: "_".', + locations: [{ line: 1, column: 2 }], + }); + expectSyntaxError('1\u00DF').to.deep.equal({ + message: 'Syntax Error: Unexpected character: U+00DF.', + locations: [{ line: 1, column: 2 }], + }); + expectSyntaxError('1.23f').to.deep.equal({ + message: 'Syntax Error: Invalid number, expected digit but got: "f".', + locations: [{ line: 1, column: 5 }], + }); + expectSyntaxError('1.234_5').to.deep.equal({ + message: 'Syntax Error: Invalid number, expected digit but got: "_".', + locations: [{ line: 1, column: 6 }], + }); + }); + + it('lexes punctuation', () => { + expect(lexOne('!')).to.contain({ + kind: TokenKind.BANG, + start: 0, + end: 1, + value: undefined, + }); + + expect(lexOne('$')).to.contain({ + kind: TokenKind.DOLLAR, + start: 0, + end: 1, + value: undefined, + }); + + expect(lexOne('(')).to.contain({ + kind: TokenKind.PAREN_L, + start: 0, + end: 1, + value: undefined, + }); + + expect(lexOne(')')).to.contain({ + kind: TokenKind.PAREN_R, + start: 0, + end: 1, + value: undefined, + }); + + expect(lexOne('...')).to.contain({ + kind: TokenKind.SPREAD, + start: 0, + end: 3, + value: undefined, + }); + + expect(lexOne(':')).to.contain({ + kind: TokenKind.COLON, + start: 0, + end: 1, + value: undefined, + }); + + expect(lexOne('=')).to.contain({ + kind: TokenKind.EQUALS, + start: 0, + end: 1, + value: undefined, + }); + + expect(lexOne('@')).to.contain({ + kind: TokenKind.AT, + start: 0, + end: 1, + value: undefined, + }); + + expect(lexOne('[')).to.contain({ + kind: TokenKind.BRACKET_L, + start: 0, + end: 1, + value: undefined, + }); + + expect(lexOne(']')).to.contain({ + kind: TokenKind.BRACKET_R, + start: 0, + end: 1, + value: undefined, + }); + + expect(lexOne('{')).to.contain({ + kind: TokenKind.BRACE_L, + start: 0, + end: 1, + value: undefined, + }); + + expect(lexOne('|')).to.contain({ + kind: TokenKind.PIPE, + start: 0, + end: 1, + value: undefined, + }); + + expect(lexOne('}')).to.contain({ + kind: TokenKind.BRACE_R, + start: 0, + end: 1, + value: undefined, + }); + }); + + it('lex reports useful unknown character error', () => { + expectSyntaxError('..').to.deep.equal({ + message: 'Syntax Error: Unexpected character: ".".', + locations: [{ line: 1, column: 1 }], + }); + + expectSyntaxError('~').to.deep.equal({ + message: 'Syntax Error: Unexpected character: "~".', + locations: [{ line: 1, column: 1 }], + }); + + expectSyntaxError('\x00').to.deep.equal({ + message: 'Syntax Error: Unexpected character: U+0000.', + locations: [{ line: 1, column: 1 }], + }); + + expectSyntaxError('\b').to.deep.equal({ + message: 'Syntax Error: Unexpected character: U+0008.', + locations: [{ line: 1, column: 1 }], + }); + + expectSyntaxError('\u00AA').to.deep.equal({ + message: 'Syntax Error: Unexpected character: U+00AA.', + locations: [{ line: 1, column: 1 }], + }); + + expectSyntaxError('\u0AAA').to.deep.equal({ + message: 'Syntax Error: Unexpected character: U+0AAA.', + locations: [{ line: 1, column: 1 }], + }); + + expectSyntaxError('\u203B').to.deep.equal({ + message: 'Syntax Error: Unexpected character: U+203B.', + locations: [{ line: 1, column: 1 }], + }); + + expectSyntaxError('\u{1f600}').to.deep.equal({ + message: 'Syntax Error: Unexpected character: U+1F600.', + locations: [{ line: 1, column: 1 }], + }); + + expectSyntaxError('\uD83D\uDE00').to.deep.equal({ + message: 'Syntax Error: Unexpected character: U+1F600.', + locations: [{ line: 1, column: 1 }], + }); + + expectSyntaxError('\uD800\uDC00').to.deep.equal({ + message: 'Syntax Error: Unexpected character: U+10000.', + locations: [{ line: 1, column: 1 }], + }); + + expectSyntaxError('\uDBFF\uDFFF').to.deep.equal({ + message: 'Syntax Error: Unexpected character: U+10FFFF.', + locations: [{ line: 1, column: 1 }], + }); + + expectSyntaxError('\uDEAD').to.deep.equal({ + message: 'Syntax Error: Invalid character: U+DEAD.', + locations: [{ line: 1, column: 1 }], + }); + }); + + it('lex reports useful information for dashes in names', () => { + const source = new Source('a-b'); + const lexer = new Lexer(source); + const firstToken = lexer.advance(); + expect(firstToken).to.contain({ + kind: TokenKind.NAME, + start: 0, + end: 1, + value: 'a', + }); + + expect(() => lexer.advance()) + .throw(GraphQLError) + .that.deep.include({ + message: 'Syntax Error: Invalid number, expected digit but got: "b".', + locations: [{ line: 1, column: 3 }], + }); + }); + + it('produces double linked list of tokens, including comments', () => { + const source = new Source(` + { + #comment + field + } + `); + + const lexer = new Lexer(source); + const startToken = lexer.token; + let endToken; + do { + endToken = lexer.advance(); + // Lexer advances over ignored comment tokens to make writing parsers + // easier, but will include them in the linked list result. + expect(endToken.kind).to.not.equal(TokenKind.COMMENT); + } while (endToken.kind !== TokenKind.EOF); + + expect(startToken.prev).to.equal(null); + expect(endToken.next).to.equal(null); + + const tokens = []; + for (let tok: Token | null = startToken; tok; tok = tok.next) { + if (tokens.length) { + // Tokens are double-linked, prev should point to last seen token. + expect(tok.prev).to.equal(tokens[tokens.length - 1]); + } + tokens.push(tok); + } + + expect(tokens.map((tok) => tok.kind)).to.deep.equal([ + TokenKind.SOF, + TokenKind.BRACE_L, + TokenKind.COMMENT, + TokenKind.NAME, + TokenKind.BRACE_R, + TokenKind.EOF, + ]); + }); + + it('lexes comments', () => { + expect(lexOne('# Comment').prev).to.contain({ + kind: TokenKind.COMMENT, + start: 0, + end: 9, + value: ' Comment', + }); + expect(lexOne('# Comment\nAnother line').prev).to.contain({ + kind: TokenKind.COMMENT, + start: 0, + end: 9, + value: ' Comment', + }); + expect(lexOne('# Comment\r\nAnother line').prev).to.contain({ + kind: TokenKind.COMMENT, + start: 0, + end: 9, + value: ' Comment', + }); + expect(lexOne('# Comment \u{1f600}').prev).to.contain({ + kind: TokenKind.COMMENT, + start: 0, + end: 12, + value: ' Comment \u{1f600}', + }); + expectSyntaxError('# Invalid surrogate \uDEAD').to.deep.equal({ + message: 'Syntax Error: Invalid character: U+DEAD.', + locations: [{ line: 1, column: 21 }], + }); + }); +}); + +describe('isPunctuatorTokenKind', () => { + function isPunctuatorToken(text: string) { + return isPunctuatorTokenKind(lexOne(text).kind); + } + + it('returns true for punctuator tokens', () => { + expect(isPunctuatorToken('!')).to.equal(true); + expect(isPunctuatorToken('$')).to.equal(true); + expect(isPunctuatorToken('&')).to.equal(true); + expect(isPunctuatorToken('(')).to.equal(true); + expect(isPunctuatorToken(')')).to.equal(true); + expect(isPunctuatorToken('...')).to.equal(true); + expect(isPunctuatorToken(':')).to.equal(true); + expect(isPunctuatorToken('=')).to.equal(true); + expect(isPunctuatorToken('@')).to.equal(true); + expect(isPunctuatorToken('[')).to.equal(true); + expect(isPunctuatorToken(']')).to.equal(true); + expect(isPunctuatorToken('{')).to.equal(true); + expect(isPunctuatorToken('|')).to.equal(true); + expect(isPunctuatorToken('}')).to.equal(true); + }); + + it('returns false for non-punctuator tokens', () => { + expect(isPunctuatorToken('')).to.equal(false); + expect(isPunctuatorToken('name')).to.equal(false); + expect(isPunctuatorToken('1')).to.equal(false); + expect(isPunctuatorToken('3.14')).to.equal(false); + expect(isPunctuatorToken('"str"')).to.equal(false); + expect(isPunctuatorToken('"""str"""')).to.equal(false); + }); +}); diff --git a/src/language/__tests__/parser-test.ts b/src/language/__tests__/parser-test.ts new file mode 100644 index 00000000..3571b757 --- /dev/null +++ b/src/language/__tests__/parser-test.ts @@ -0,0 +1,642 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { dedent } from '../../__testUtils__/dedent'; +import { expectJSON, expectToThrowJSON } from '../../__testUtils__/expectJSON'; +import { kitchenSinkQuery } from '../../__testUtils__/kitchenSinkQuery'; + +import { inspect } from '../../jsutils/inspect'; + +import { Kind } from '../kinds'; +import { parse, parseConstValue, parseType, parseValue } from '../parser'; +import { Source } from '../source'; +import { TokenKind } from '../tokenKind'; + +function expectSyntaxError(text: string) { + return expectToThrowJSON(() => parse(text)); +} + +describe('Parser', () => { + it('parse provides useful errors', () => { + let caughtError; + try { + parse('{'); + } catch (error) { + caughtError = error; + } + + expect(caughtError).to.deep.contain({ + message: 'Syntax Error: Expected Name, found .', + positions: [1], + locations: [{ line: 1, column: 2 }], + }); + + expect(String(caughtError)).to.equal(dedent` + Syntax Error: Expected Name, found . + + GraphQL request:1:2 + 1 | { + | ^ + `); + + expectSyntaxError(` + { ...MissingOn } + fragment MissingOn Type + `).to.deep.include({ + message: 'Syntax Error: Expected "on", found Name "Type".', + locations: [{ line: 3, column: 26 }], + }); + + expectSyntaxError('{ field: {} }').to.deep.include({ + message: 'Syntax Error: Expected Name, found "{".', + locations: [{ line: 1, column: 10 }], + }); + + expectSyntaxError('notAnOperation Foo { field }').to.deep.include({ + message: 'Syntax Error: Unexpected Name "notAnOperation".', + locations: [{ line: 1, column: 1 }], + }); + + expectSyntaxError('...').to.deep.include({ + message: 'Syntax Error: Unexpected "...".', + locations: [{ line: 1, column: 1 }], + }); + + expectSyntaxError('{ ""').to.deep.include({ + message: 'Syntax Error: Expected Name, found String "".', + locations: [{ line: 1, column: 3 }], + }); + }); + + it('parse provides useful error when using source', () => { + let caughtError; + try { + parse(new Source('query', 'MyQuery.graphql')); + } catch (error) { + caughtError = error; + } + expect(String(caughtError)).to.equal(dedent` + Syntax Error: Expected "{", found . + + MyQuery.graphql:1:6 + 1 | query + | ^ + `); + }); + + it('parses variable inline values', () => { + expect(() => + parse('{ field(complex: { a: { b: [ $var ] } }) }'), + ).to.not.throw(); + }); + + it('parses constant default values', () => { + expectSyntaxError( + 'query Foo($x: Complex = { a: { b: [ $var ] } }) { field }', + ).to.deep.equal({ + message: 'Syntax Error: Unexpected variable "$var" in constant value.', + locations: [{ line: 1, column: 37 }], + }); + }); + + it('parses variable definition directives', () => { + expect(() => + parse('query Foo($x: Boolean = false @bar) { field }'), + ).to.not.throw(); + }); + + it('does not accept fragments named "on"', () => { + expectSyntaxError('fragment on on on { on }').to.deep.equal({ + message: 'Syntax Error: Unexpected Name "on".', + locations: [{ line: 1, column: 10 }], + }); + }); + + it('does not accept fragments spread of "on"', () => { + expectSyntaxError('{ ...on }').to.deep.equal({ + message: 'Syntax Error: Expected Name, found "}".', + locations: [{ line: 1, column: 9 }], + }); + }); + + it('does not allow "true", "false", or "null" as enum value', () => { + expectSyntaxError('enum Test { VALID, true }').to.deep.equal({ + message: + 'Syntax Error: Name "true" is reserved and cannot be used for an enum value.', + locations: [{ line: 1, column: 20 }], + }); + + expectSyntaxError('enum Test { VALID, false }').to.deep.equal({ + message: + 'Syntax Error: Name "false" is reserved and cannot be used for an enum value.', + locations: [{ line: 1, column: 20 }], + }); + + expectSyntaxError('enum Test { VALID, null }').to.deep.equal({ + message: + 'Syntax Error: Name "null" is reserved and cannot be used for an enum value.', + locations: [{ line: 1, column: 20 }], + }); + }); + + it('parses multi-byte characters', () => { + // Note: \u0A0A could be naively interpreted as two line-feed chars. + const ast = parse(` + # This comment has a \u0A0A multi-byte character. + { field(arg: "Has a \u0A0A multi-byte character.") } + `); + + expect(ast).to.have.nested.property( + 'definitions[0].selectionSet.selections[0].arguments[0].value.value', + 'Has a \u0A0A multi-byte character.', + ); + }); + + it('parses kitchen sink', () => { + expect(() => parse(kitchenSinkQuery)).to.not.throw(); + }); + + it('allows non-keywords anywhere a Name is allowed', () => { + const nonKeywords = [ + 'on', + 'fragment', + 'query', + 'mutation', + 'subscription', + 'true', + 'false', + ]; + for (const keyword of nonKeywords) { + // You can't define or reference a fragment named `on`. + const fragmentName = keyword !== 'on' ? keyword : 'a'; + const document = ` + query ${keyword} { + ... ${fragmentName} + ... on ${keyword} { field } + } + fragment ${fragmentName} on Type { + ${keyword}(${keyword}: $${keyword}) + @${keyword}(${keyword}: ${keyword}) + } + `; + + expect(() => parse(document)).to.not.throw(); + } + }); + + it('parses anonymous mutation operations', () => { + expect(() => + parse(` + mutation { + mutationField + } + `), + ).to.not.throw(); + }); + + it('parses anonymous subscription operations', () => { + expect(() => + parse(` + subscription { + subscriptionField + } + `), + ).to.not.throw(); + }); + + it('parses named mutation operations', () => { + expect(() => + parse(` + mutation Foo { + mutationField + } + `), + ).to.not.throw(); + }); + + it('parses named subscription operations', () => { + expect(() => + parse(` + subscription Foo { + subscriptionField + } + `), + ).to.not.throw(); + }); + + it('creates ast', () => { + const result = parse(dedent` + { + node(id: 4) { + id, + name + } + } + `); + + expectJSON(result).toDeepEqual({ + kind: Kind.DOCUMENT, + loc: { start: 0, end: 40 }, + definitions: [ + { + kind: Kind.OPERATION_DEFINITION, + loc: { start: 0, end: 40 }, + operation: 'query', + name: undefined, + variableDefinitions: [], + directives: [], + selectionSet: { + kind: Kind.SELECTION_SET, + loc: { start: 0, end: 40 }, + selections: [ + { + kind: Kind.FIELD, + loc: { start: 4, end: 38 }, + alias: undefined, + name: { + kind: Kind.NAME, + loc: { start: 4, end: 8 }, + value: 'node', + }, + arguments: [ + { + kind: Kind.ARGUMENT, + name: { + kind: Kind.NAME, + loc: { start: 9, end: 11 }, + value: 'id', + }, + value: { + kind: Kind.INT, + loc: { start: 13, end: 14 }, + value: '4', + }, + loc: { start: 9, end: 14 }, + }, + ], + directives: [], + selectionSet: { + kind: Kind.SELECTION_SET, + loc: { start: 16, end: 38 }, + selections: [ + { + kind: Kind.FIELD, + loc: { start: 22, end: 24 }, + alias: undefined, + name: { + kind: Kind.NAME, + loc: { start: 22, end: 24 }, + value: 'id', + }, + arguments: [], + directives: [], + selectionSet: undefined, + }, + { + kind: Kind.FIELD, + loc: { start: 30, end: 34 }, + alias: undefined, + name: { + kind: Kind.NAME, + loc: { start: 30, end: 34 }, + value: 'name', + }, + arguments: [], + directives: [], + selectionSet: undefined, + }, + ], + }, + }, + ], + }, + }, + ], + }); + }); + + it('creates ast from nameless query without variables', () => { + const result = parse(dedent` + query { + node { + id + } + } + `); + + expectJSON(result).toDeepEqual({ + kind: Kind.DOCUMENT, + loc: { start: 0, end: 29 }, + definitions: [ + { + kind: Kind.OPERATION_DEFINITION, + loc: { start: 0, end: 29 }, + operation: 'query', + name: undefined, + variableDefinitions: [], + directives: [], + selectionSet: { + kind: Kind.SELECTION_SET, + loc: { start: 6, end: 29 }, + selections: [ + { + kind: Kind.FIELD, + loc: { start: 10, end: 27 }, + alias: undefined, + name: { + kind: Kind.NAME, + loc: { start: 10, end: 14 }, + value: 'node', + }, + arguments: [], + directives: [], + selectionSet: { + kind: Kind.SELECTION_SET, + loc: { start: 15, end: 27 }, + selections: [ + { + kind: Kind.FIELD, + loc: { start: 21, end: 23 }, + alias: undefined, + name: { + kind: Kind.NAME, + loc: { start: 21, end: 23 }, + value: 'id', + }, + arguments: [], + directives: [], + selectionSet: undefined, + }, + ], + }, + }, + ], + }, + }, + ], + }); + }); + + it('allows parsing without source location information', () => { + const result = parse('{ id }', { noLocation: true }); + expect('loc' in result).to.equal(false); + }); + + it('Legacy: allows parsing fragment defined variables', () => { + const document = 'fragment a($v: Boolean = false) on t { f(v: $v) }'; + + expect(() => + parse(document, { allowLegacyFragmentVariables: true }), + ).to.not.throw(); + expect(() => parse(document)).to.throw('Syntax Error'); + }); + + it('contains location that can be Object.toStringified, JSON.stringified, or jsutils.inspected', () => { + const { loc } = parse('{ id }'); + + expect(Object.prototype.toString.call(loc)).to.equal('[object Location]'); + expect(JSON.stringify(loc)).to.equal('{"start":0,"end":6}'); + expect(inspect(loc)).to.equal('{ start: 0, end: 6 }'); + }); + + it('contains references to source', () => { + const source = new Source('{ id }'); + const result = parse(source); + + expect(result).to.have.nested.property('loc.source', source); + }); + + it('contains references to start and end tokens', () => { + const result = parse('{ id }'); + + expect(result).to.have.nested.property( + 'loc.startToken.kind', + TokenKind.SOF, + ); + expect(result).to.have.nested.property('loc.endToken.kind', TokenKind.EOF); + }); + + describe('parseValue', () => { + it('parses null value', () => { + const result = parseValue('null'); + expectJSON(result).toDeepEqual({ + kind: Kind.NULL, + loc: { start: 0, end: 4 }, + }); + }); + + it('parses list values', () => { + const result = parseValue('[123 "abc"]'); + expectJSON(result).toDeepEqual({ + kind: Kind.LIST, + loc: { start: 0, end: 11 }, + values: [ + { + kind: Kind.INT, + loc: { start: 1, end: 4 }, + value: '123', + }, + { + kind: Kind.STRING, + loc: { start: 5, end: 10 }, + value: 'abc', + block: false, + }, + ], + }); + }); + + it('parses block strings', () => { + const result = parseValue('["""long""" "short"]'); + expectJSON(result).toDeepEqual({ + kind: Kind.LIST, + loc: { start: 0, end: 20 }, + values: [ + { + kind: Kind.STRING, + loc: { start: 1, end: 11 }, + value: 'long', + block: true, + }, + { + kind: Kind.STRING, + loc: { start: 12, end: 19 }, + value: 'short', + block: false, + }, + ], + }); + }); + + it('allows variables', () => { + const result = parseValue('{ field: $var }'); + expectJSON(result).toDeepEqual({ + kind: Kind.OBJECT, + loc: { start: 0, end: 15 }, + fields: [ + { + kind: Kind.OBJECT_FIELD, + loc: { start: 2, end: 13 }, + name: { + kind: Kind.NAME, + loc: { start: 2, end: 7 }, + value: 'field', + }, + value: { + kind: Kind.VARIABLE, + loc: { start: 9, end: 13 }, + name: { + kind: Kind.NAME, + loc: { start: 10, end: 13 }, + value: 'var', + }, + }, + }, + ], + }); + }); + + it('correct message for incomplete variable', () => { + expect(() => parseValue('$')) + .to.throw() + .to.deep.include({ + message: 'Syntax Error: Expected Name, found .', + locations: [{ line: 1, column: 2 }], + }); + }); + + it('correct message for unexpected token', () => { + expect(() => parseValue(':')) + .to.throw() + .to.deep.include({ + message: 'Syntax Error: Unexpected ":".', + locations: [{ line: 1, column: 1 }], + }); + }); + }); + + describe('parseConstValue', () => { + it('parses values', () => { + const result = parseConstValue('[123 "abc"]'); + expectJSON(result).toDeepEqual({ + kind: Kind.LIST, + loc: { start: 0, end: 11 }, + values: [ + { + kind: Kind.INT, + loc: { start: 1, end: 4 }, + value: '123', + }, + { + kind: Kind.STRING, + loc: { start: 5, end: 10 }, + value: 'abc', + block: false, + }, + ], + }); + }); + + it('does not allow variables', () => { + expect(() => parseConstValue('{ field: $var }')) + .to.throw() + .to.deep.include({ + message: + 'Syntax Error: Unexpected variable "$var" in constant value.', + locations: [{ line: 1, column: 10 }], + }); + }); + + it('correct message for unexpected token', () => { + expect(() => parseConstValue('$')) + .to.throw() + .to.deep.include({ + message: 'Syntax Error: Unexpected "$".', + locations: [{ line: 1, column: 1 }], + }); + }); + }); + + describe('parseType', () => { + it('parses well known types', () => { + const result = parseType('String'); + expectJSON(result).toDeepEqual({ + kind: Kind.NAMED_TYPE, + loc: { start: 0, end: 6 }, + name: { + kind: Kind.NAME, + loc: { start: 0, end: 6 }, + value: 'String', + }, + }); + }); + + it('parses custom types', () => { + const result = parseType('MyType'); + expectJSON(result).toDeepEqual({ + kind: Kind.NAMED_TYPE, + loc: { start: 0, end: 6 }, + name: { + kind: Kind.NAME, + loc: { start: 0, end: 6 }, + value: 'MyType', + }, + }); + }); + + it('parses list types', () => { + const result = parseType('[MyType]'); + expectJSON(result).toDeepEqual({ + kind: Kind.LIST_TYPE, + loc: { start: 0, end: 8 }, + type: { + kind: Kind.NAMED_TYPE, + loc: { start: 1, end: 7 }, + name: { + kind: Kind.NAME, + loc: { start: 1, end: 7 }, + value: 'MyType', + }, + }, + }); + }); + + it('parses non-null types', () => { + const result = parseType('MyType!'); + expectJSON(result).toDeepEqual({ + kind: Kind.NON_NULL_TYPE, + loc: { start: 0, end: 7 }, + type: { + kind: Kind.NAMED_TYPE, + loc: { start: 0, end: 6 }, + name: { + kind: Kind.NAME, + loc: { start: 0, end: 6 }, + value: 'MyType', + }, + }, + }); + }); + + it('parses nested types', () => { + const result = parseType('[MyType!]'); + expectJSON(result).toDeepEqual({ + kind: Kind.LIST_TYPE, + loc: { start: 0, end: 9 }, + type: { + kind: Kind.NON_NULL_TYPE, + loc: { start: 1, end: 8 }, + type: { + kind: Kind.NAMED_TYPE, + loc: { start: 1, end: 7 }, + name: { + kind: Kind.NAME, + loc: { start: 1, end: 7 }, + value: 'MyType', + }, + }, + }, + }); + }); + }); +}); diff --git a/src/language/__tests__/predicates-test.ts b/src/language/__tests__/predicates-test.ts new file mode 100644 index 00000000..13477f8d --- /dev/null +++ b/src/language/__tests__/predicates-test.ts @@ -0,0 +1,144 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import type { ASTNode } from '../ast'; +import { Kind } from '../kinds'; +import { parseValue } from '../parser'; +import { + isConstValueNode, + isDefinitionNode, + isExecutableDefinitionNode, + isSelectionNode, + isTypeDefinitionNode, + isTypeExtensionNode, + isTypeNode, + isTypeSystemDefinitionNode, + isTypeSystemExtensionNode, + isValueNode, +} from '../predicates'; + +function filterNodes(predicate: (node: ASTNode) => boolean): Array { + return Object.values(Kind).filter( + // @ts-expect-error create node only with kind + (kind) => predicate({ kind }), + ); +} + +describe('AST node predicates', () => { + it('isDefinitionNode', () => { + expect(filterNodes(isDefinitionNode)).to.deep.equal([ + 'OperationDefinition', + 'FragmentDefinition', + 'SchemaDefinition', + 'ScalarTypeDefinition', + 'ObjectTypeDefinition', + 'InterfaceTypeDefinition', + 'UnionTypeDefinition', + 'EnumTypeDefinition', + 'InputObjectTypeDefinition', + 'DirectiveDefinition', + 'SchemaExtension', + 'ScalarTypeExtension', + 'ObjectTypeExtension', + 'InterfaceTypeExtension', + 'UnionTypeExtension', + 'EnumTypeExtension', + 'InputObjectTypeExtension', + ]); + }); + + it('isExecutableDefinitionNode', () => { + expect(filterNodes(isExecutableDefinitionNode)).to.deep.equal([ + 'OperationDefinition', + 'FragmentDefinition', + ]); + }); + + it('isSelectionNode', () => { + expect(filterNodes(isSelectionNode)).to.deep.equal([ + 'Field', + 'FragmentSpread', + 'InlineFragment', + ]); + }); + + it('isValueNode', () => { + expect(filterNodes(isValueNode)).to.deep.equal([ + 'Variable', + 'IntValue', + 'FloatValue', + 'StringValue', + 'BooleanValue', + 'NullValue', + 'EnumValue', + 'ListValue', + 'ObjectValue', + ]); + }); + + it('isConstValueNode', () => { + expect(isConstValueNode(parseValue('"value"'))).to.equal(true); + expect(isConstValueNode(parseValue('$var'))).to.equal(false); + + expect(isConstValueNode(parseValue('{ field: "value" }'))).to.equal(true); + expect(isConstValueNode(parseValue('{ field: $var }'))).to.equal(false); + + expect(isConstValueNode(parseValue('[ "value" ]'))).to.equal(true); + expect(isConstValueNode(parseValue('[ $var ]'))).to.equal(false); + }); + + it('isTypeNode', () => { + expect(filterNodes(isTypeNode)).to.deep.equal([ + 'NamedType', + 'ListType', + 'NonNullType', + ]); + }); + + it('isTypeSystemDefinitionNode', () => { + expect(filterNodes(isTypeSystemDefinitionNode)).to.deep.equal([ + 'SchemaDefinition', + 'ScalarTypeDefinition', + 'ObjectTypeDefinition', + 'InterfaceTypeDefinition', + 'UnionTypeDefinition', + 'EnumTypeDefinition', + 'InputObjectTypeDefinition', + 'DirectiveDefinition', + ]); + }); + + it('isTypeDefinitionNode', () => { + expect(filterNodes(isTypeDefinitionNode)).to.deep.equal([ + 'ScalarTypeDefinition', + 'ObjectTypeDefinition', + 'InterfaceTypeDefinition', + 'UnionTypeDefinition', + 'EnumTypeDefinition', + 'InputObjectTypeDefinition', + ]); + }); + + it('isTypeSystemExtensionNode', () => { + expect(filterNodes(isTypeSystemExtensionNode)).to.deep.equal([ + 'SchemaExtension', + 'ScalarTypeExtension', + 'ObjectTypeExtension', + 'InterfaceTypeExtension', + 'UnionTypeExtension', + 'EnumTypeExtension', + 'InputObjectTypeExtension', + ]); + }); + + it('isTypeExtensionNode', () => { + expect(filterNodes(isTypeExtensionNode)).to.deep.equal([ + 'ScalarTypeExtension', + 'ObjectTypeExtension', + 'InterfaceTypeExtension', + 'UnionTypeExtension', + 'EnumTypeExtension', + 'InputObjectTypeExtension', + ]); + }); +}); diff --git a/src/language/__tests__/printLocation-test.ts b/src/language/__tests__/printLocation-test.ts new file mode 100644 index 00000000..c5eac8cc --- /dev/null +++ b/src/language/__tests__/printLocation-test.ts @@ -0,0 +1,77 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { dedent } from '../../__testUtils__/dedent'; + +import { printSourceLocation } from '../printLocation'; +import { Source } from '../source'; + +describe('printSourceLocation', () => { + it('prints minified documents', () => { + const minifiedSource = new Source( + 'query SomeMinifiedQueryWithErrorInside($foo:String!=FIRST_ERROR_HERE$bar:String){someField(foo:$foo bar:$bar baz:SECOND_ERROR_HERE){fieldA fieldB{fieldC fieldD...on THIRD_ERROR_HERE}}}', + ); + + const firstLocation = printSourceLocation(minifiedSource, { + line: 1, + column: minifiedSource.body.indexOf('FIRST_ERROR_HERE') + 1, + }); + expect(firstLocation).to.equal(dedent` + GraphQL request:1:53 + 1 | query SomeMinifiedQueryWithErrorInside($foo:String!=FIRST_ERROR_HERE$bar:String) + | ^ + | {someField(foo:$foo bar:$bar baz:SECOND_ERROR_HERE){fieldA fieldB{fieldC fieldD. + `); + + const secondLocation = printSourceLocation(minifiedSource, { + line: 1, + column: minifiedSource.body.indexOf('SECOND_ERROR_HERE') + 1, + }); + expect(secondLocation).to.equal(dedent` + GraphQL request:1:114 + 1 | query SomeMinifiedQueryWithErrorInside($foo:String!=FIRST_ERROR_HERE$bar:String) + | {someField(foo:$foo bar:$bar baz:SECOND_ERROR_HERE){fieldA fieldB{fieldC fieldD. + | ^ + | ..on THIRD_ERROR_HERE}}} + `); + + const thirdLocation = printSourceLocation(minifiedSource, { + line: 1, + column: minifiedSource.body.indexOf('THIRD_ERROR_HERE') + 1, + }); + expect(thirdLocation).to.equal(dedent` + GraphQL request:1:166 + 1 | query SomeMinifiedQueryWithErrorInside($foo:String!=FIRST_ERROR_HERE$bar:String) + | {someField(foo:$foo bar:$bar baz:SECOND_ERROR_HERE){fieldA fieldB{fieldC fieldD. + | ..on THIRD_ERROR_HERE}}} + | ^ + `); + }); + + it('prints single digit line number with no padding', () => { + const result = printSourceLocation( + new Source('*', 'Test', { line: 9, column: 1 }), + { line: 1, column: 1 }, + ); + + expect(result).to.equal(dedent` + Test:9:1 + 9 | * + | ^ + `); + }); + + it('prints an line numbers with correct padding', () => { + const result = printSourceLocation( + new Source('*\n', 'Test', { line: 9, column: 1 }), + { line: 1, column: 1 }, + ); + + expect(result).to.equal(dedent` + Test:9:1 + 9 | * + | ^ + 10 | + `); + }); +}); diff --git a/src/language/__tests__/printString-test.ts b/src/language/__tests__/printString-test.ts new file mode 100644 index 00000000..fff1bfee --- /dev/null +++ b/src/language/__tests__/printString-test.ts @@ -0,0 +1,82 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { printString } from '../printString'; + +describe('printString', () => { + it('prints a simple string', () => { + expect(printString('hello world')).to.equal('"hello world"'); + }); + + it('escapes quotes', () => { + expect(printString('"hello world"')).to.equal('"\\"hello world\\""'); + }); + + it('does not escape single quote', () => { + expect(printString("who's test")).to.equal('"who\'s test"'); + }); + + it('escapes backslashes', () => { + expect(printString('escape: \\')).to.equal('"escape: \\\\"'); + }); + + it('escapes well-known control chars', () => { + expect(printString('\b\f\n\r\t')).to.equal('"\\b\\f\\n\\r\\t"'); + }); + + it('escapes zero byte', () => { + expect(printString('\x00')).to.equal('"\\u0000"'); + }); + + it('does not escape space', () => { + expect(printString(' ')).to.equal('" "'); + }); + + it('does not escape non-ascii character', () => { + expect(printString('\u21BB')).to.equal('"\u21BB"'); + }); + + it('does not escape supplementary character', () => { + expect(printString('\u{1f600}')).to.equal('"\u{1f600}"'); + }); + + it('escapes all control chars', () => { + /* spellchecker:ignore abcdefghijklmnopqrstuvwxyz */ + expect( + printString( + '\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007' + + '\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F' + + '\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017' + + '\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F' + + '\u0020\u0021\u0022\u0023\u0024\u0025\u0026\u0027' + + '\u0028\u0029\u002A\u002B\u002C\u002D\u002E\u002F' + + '\u0030\u0031\u0032\u0033\u0034\u0035\u0036\u0037' + + '\u0038\u0039\u003A\u003B\u003C\u003D\u003E\u003F' + + '\u0040\u0041\u0042\u0043\u0044\u0045\u0046\u0047' + + '\u0048\u0049\u004A\u004B\u004C\u004D\u004E\u004F' + + '\u0050\u0051\u0052\u0053\u0054\u0055\u0056\u0057' + + '\u0058\u0059\u005A\u005B\u005C\u005D\u005E\u005F' + + '\u0060\u0061\u0062\u0063\u0064\u0065\u0066\u0067' + + '\u0068\u0069\u006A\u006B\u006C\u006D\u006E\u006F' + + '\u0070\u0071\u0072\u0073\u0074\u0075\u0076\u0077' + + '\u0078\u0079\u007A\u007B\u007C\u007D\u007E\u007F' + + '\u0080\u0081\u0082\u0083\u0084\u0085\u0086\u0087' + + '\u0088\u0089\u008A\u008B\u008C\u008D\u008E\u008F' + + '\u0090\u0091\u0092\u0093\u0094\u0095\u0096\u0097' + + '\u0098\u0099\u009A\u009B\u009C\u009D\u009E\u009F', + ), + ).to.equal( + '"\\u0000\\u0001\\u0002\\u0003\\u0004\\u0005\\u0006\\u0007' + + '\\b\\t\\n\\u000B\\f\\r\\u000E\\u000F' + + '\\u0010\\u0011\\u0012\\u0013\\u0014\\u0015\\u0016\\u0017' + + '\\u0018\\u0019\\u001A\\u001B\\u001C\\u001D\\u001E\\u001F' + + ' !\\"#$%&\'()*+,-./0123456789:;<=>?' + + '@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_' + + '`abcdefghijklmnopqrstuvwxyz{|}~\\u007F' + + '\\u0080\\u0081\\u0082\\u0083\\u0084\\u0085\\u0086\\u0087' + + '\\u0088\\u0089\\u008A\\u008B\\u008C\\u008D\\u008E\\u008F' + + '\\u0090\\u0091\\u0092\\u0093\\u0094\\u0095\\u0096\\u0097' + + '\\u0098\\u0099\\u009A\\u009B\\u009C\\u009D\\u009E\\u009F"', + ); + }); +}); diff --git a/src/language/__tests__/printer-test.ts b/src/language/__tests__/printer-test.ts new file mode 100644 index 00000000..227e90dd --- /dev/null +++ b/src/language/__tests__/printer-test.ts @@ -0,0 +1,216 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { dedent, dedentString } from '../../__testUtils__/dedent'; +import { kitchenSinkQuery } from '../../__testUtils__/kitchenSinkQuery'; + +import { Kind } from '../kinds'; +import { parse } from '../parser'; +import { print } from '../printer'; + +describe('Printer: Query document', () => { + it('prints minimal ast', () => { + const ast = { + kind: Kind.FIELD, + name: { kind: Kind.NAME, value: 'foo' }, + } as const; + expect(print(ast)).to.equal('foo'); + }); + + it('produces helpful error messages', () => { + const badAST = { random: 'Data' }; + + // @ts-expect-error + expect(() => print(badAST)).to.throw( + 'Invalid AST Node: { random: "Data" }.', + ); + }); + + it('correctly prints non-query operations without name', () => { + const queryASTShorthanded = parse('query { id, name }'); + expect(print(queryASTShorthanded)).to.equal(dedent` + { + id + name + } + `); + + const mutationAST = parse('mutation { id, name }'); + expect(print(mutationAST)).to.equal(dedent` + mutation { + id + name + } + `); + + const queryASTWithArtifacts = parse( + 'query ($foo: TestType) @testDirective { id, name }', + ); + expect(print(queryASTWithArtifacts)).to.equal(dedent` + query ($foo: TestType) @testDirective { + id + name + } + `); + + const mutationASTWithArtifacts = parse( + 'mutation ($foo: TestType) @testDirective { id, name }', + ); + expect(print(mutationASTWithArtifacts)).to.equal(dedent` + mutation ($foo: TestType) @testDirective { + id + name + } + `); + }); + + it('prints query with variable directives', () => { + const queryASTWithVariableDirective = parse( + 'query ($foo: TestType = {a: 123} @testDirective(if: true) @test) { id }', + ); + expect(print(queryASTWithVariableDirective)).to.equal(dedent` + query ($foo: TestType = {a: 123} @testDirective(if: true) @test) { + id + } + `); + }); + + it('keeps arguments on one line if line is short (<= 80 chars)', () => { + const printed = print( + parse('{trip(wheelchair:false arriveBy:false){dateTime}}'), + ); + + expect(printed).to.equal(dedent` + { + trip(wheelchair: false, arriveBy: false) { + dateTime + } + } + `); + }); + + it('puts arguments on multiple lines if line is long (> 80 chars)', () => { + const printed = print( + parse( + '{trip(wheelchair:false arriveBy:false includePlannedCancellations:true transitDistanceReluctance:2000){dateTime}}', + ), + ); + + expect(printed).to.equal(dedent` + { + trip( + wheelchair: false + arriveBy: false + includePlannedCancellations: true + transitDistanceReluctance: 2000 + ) { + dateTime + } + } + `); + }); + + it('Legacy: prints fragment with variable directives', () => { + const queryASTWithVariableDirective = parse( + 'fragment Foo($foo: TestType @test) on TestType @testDirective { id }', + { allowLegacyFragmentVariables: true }, + ); + expect(print(queryASTWithVariableDirective)).to.equal(dedent` + fragment Foo($foo: TestType @test) on TestType @testDirective { + id + } + `); + }); + + it('Legacy: correctly prints fragment defined variables', () => { + const fragmentWithVariable = parse( + ` + fragment Foo($a: ComplexType, $b: Boolean = false) on TestType { + id + } + `, + { allowLegacyFragmentVariables: true }, + ); + expect(print(fragmentWithVariable)).to.equal(dedent` + fragment Foo($a: ComplexType, $b: Boolean = false) on TestType { + id + } + `); + }); + + it('prints kitchen sink without altering ast', () => { + const ast = parse(kitchenSinkQuery, { noLocation: true }); + + const astBeforePrintCall = JSON.stringify(ast); + const printed = print(ast); + const printedAST = parse(printed, { noLocation: true }); + + expect(printedAST).to.deep.equal(ast); + expect(JSON.stringify(ast)).to.equal(astBeforePrintCall); + + expect(printed).to.equal( + dedentString(String.raw` + query queryName($foo: ComplexType, $site: Site = MOBILE) @onQuery { + whoever123is: node(id: [123, 456]) { + id + ... on User @onInlineFragment { + field2 { + id + alias: field1(first: 10, after: $foo) @include(if: $foo) { + id + ...frag @onFragmentSpread + } + } + } + ... @skip(unless: $foo) { + id + } + ... { + id + } + } + } + + mutation likeStory @onMutation { + like(story: 123) @onField { + story { + id @onField + } + } + } + + subscription StoryLikeSubscription($input: StoryLikeSubscribeInput @onVariableDefinition) @onSubscription { + storyLikeSubscribe(input: $input) { + story { + likers { + count + } + likeSentence { + text + } + } + } + } + + fragment frag on Friend @onFragmentDefinition { + foo( + size: $size + bar: $b + obj: {key: "value", block: """ + block string uses \""" + """} + ) + } + + { + unnamed(truthy: true, falsy: false, nullish: null) + query + } + + { + __typename + } + `), + ); + }); +}); diff --git a/src/language/__tests__/schema-parser-test.ts b/src/language/__tests__/schema-parser-test.ts new file mode 100644 index 00000000..cbb337c3 --- /dev/null +++ b/src/language/__tests__/schema-parser-test.ts @@ -0,0 +1,1106 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { dedent } from '../../__testUtils__/dedent'; +import { expectJSON, expectToThrowJSON } from '../../__testUtils__/expectJSON'; +import { kitchenSinkSDL } from '../../__testUtils__/kitchenSinkSDL'; + +import { parse } from '../parser'; + +function expectSyntaxError(text: string) { + return expectToThrowJSON(() => parse(text)); +} + +function typeNode(name: unknown, loc: unknown) { + return { + kind: 'NamedType', + name: nameNode(name, loc), + loc, + }; +} + +function nameNode(name: unknown, loc: unknown) { + return { + kind: 'Name', + value: name, + loc, + }; +} + +function fieldNode(name: unknown, type: unknown, loc: unknown) { + return fieldNodeWithArgs(name, type, [], loc); +} + +function fieldNodeWithArgs( + name: unknown, + type: unknown, + args: unknown, + loc: unknown, +) { + return { + kind: 'FieldDefinition', + description: undefined, + name, + arguments: args, + type, + directives: [], + loc, + }; +} + +function enumValueNode(name: unknown, loc: unknown) { + return { + kind: 'EnumValueDefinition', + name: nameNode(name, loc), + description: undefined, + directives: [], + loc, + }; +} + +function inputValueNode( + name: unknown, + type: unknown, + defaultValue: unknown, + loc: unknown, +) { + return { + kind: 'InputValueDefinition', + name, + description: undefined, + type, + defaultValue, + directives: [], + loc, + }; +} + +describe('Schema Parser', () => { + it('Simple type', () => { + const doc = parse(dedent` + type Hello { + world: String + } + `); + + expectJSON(doc).toDeepEqual({ + kind: 'Document', + definitions: [ + { + kind: 'ObjectTypeDefinition', + name: nameNode('Hello', { start: 5, end: 10 }), + description: undefined, + interfaces: [], + directives: [], + fields: [ + fieldNode( + nameNode('world', { start: 15, end: 20 }), + typeNode('String', { start: 22, end: 28 }), + { start: 15, end: 28 }, + ), + ], + loc: { start: 0, end: 30 }, + }, + ], + loc: { start: 0, end: 30 }, + }); + }); + + it('parses type with description string', () => { + const doc = parse(dedent` + "Description" + type Hello { + world: String + } + `); + + expectJSON(doc).toDeepNestedProperty('definitions[0].description', { + kind: 'StringValue', + value: 'Description', + block: false, + loc: { start: 0, end: 13 }, + }); + }); + + it('parses type with description multi-line string', () => { + const doc = parse(dedent` + """ + Description + """ + # Even with comments between them + type Hello { + world: String + } + `); + + expectJSON(doc).toDeepNestedProperty('definitions[0].description', { + kind: 'StringValue', + value: 'Description', + block: true, + loc: { start: 0, end: 19 }, + }); + }); + + it('parses schema with description string', () => { + const doc = parse(dedent` + "Description" + schema { + query: Foo + } + `); + + expectJSON(doc).toDeepNestedProperty('definitions[0].description', { + kind: 'StringValue', + value: 'Description', + block: false, + loc: { start: 0, end: 13 }, + }); + }); + + it('Description followed by something other than type system definition throws', () => { + expectSyntaxError('"Description" 1').to.deep.equal({ + message: 'Syntax Error: Unexpected Int "1".', + locations: [{ line: 1, column: 15 }], + }); + }); + + it('Simple extension', () => { + const doc = parse(dedent` + extend type Hello { + world: String + } + `); + + expectJSON(doc).toDeepEqual({ + kind: 'Document', + definitions: [ + { + kind: 'ObjectTypeExtension', + name: nameNode('Hello', { start: 12, end: 17 }), + interfaces: [], + directives: [], + fields: [ + fieldNode( + nameNode('world', { start: 22, end: 27 }), + typeNode('String', { start: 29, end: 35 }), + { start: 22, end: 35 }, + ), + ], + loc: { start: 0, end: 37 }, + }, + ], + loc: { start: 0, end: 37 }, + }); + }); + + it('Object extension without fields', () => { + const doc = parse('extend type Hello implements Greeting'); + + expectJSON(doc).toDeepEqual({ + kind: 'Document', + definitions: [ + { + kind: 'ObjectTypeExtension', + name: nameNode('Hello', { start: 12, end: 17 }), + interfaces: [typeNode('Greeting', { start: 29, end: 37 })], + directives: [], + fields: [], + loc: { start: 0, end: 37 }, + }, + ], + loc: { start: 0, end: 37 }, + }); + }); + + it('Interface extension without fields', () => { + const doc = parse('extend interface Hello implements Greeting'); + expectJSON(doc).toDeepEqual({ + kind: 'Document', + definitions: [ + { + kind: 'InterfaceTypeExtension', + name: nameNode('Hello', { start: 17, end: 22 }), + interfaces: [typeNode('Greeting', { start: 34, end: 42 })], + directives: [], + fields: [], + loc: { start: 0, end: 42 }, + }, + ], + loc: { start: 0, end: 42 }, + }); + }); + + it('Object extension without fields followed by extension', () => { + const doc = parse(` + extend type Hello implements Greeting + + extend type Hello implements SecondGreeting + `); + + expectJSON(doc).toDeepEqual({ + kind: 'Document', + definitions: [ + { + kind: 'ObjectTypeExtension', + name: nameNode('Hello', { start: 19, end: 24 }), + interfaces: [typeNode('Greeting', { start: 36, end: 44 })], + directives: [], + fields: [], + loc: { start: 7, end: 44 }, + }, + { + kind: 'ObjectTypeExtension', + name: nameNode('Hello', { start: 64, end: 69 }), + interfaces: [typeNode('SecondGreeting', { start: 81, end: 95 })], + directives: [], + fields: [], + loc: { start: 52, end: 95 }, + }, + ], + loc: { start: 0, end: 100 }, + }); + }); + + it('Extension without anything throws', () => { + expectSyntaxError('extend scalar Hello').to.deep.equal({ + message: 'Syntax Error: Unexpected .', + locations: [{ line: 1, column: 20 }], + }); + + expectSyntaxError('extend type Hello').to.deep.equal({ + message: 'Syntax Error: Unexpected .', + locations: [{ line: 1, column: 18 }], + }); + + expectSyntaxError('extend interface Hello').to.deep.equal({ + message: 'Syntax Error: Unexpected .', + locations: [{ line: 1, column: 23 }], + }); + + expectSyntaxError('extend union Hello').to.deep.equal({ + message: 'Syntax Error: Unexpected .', + locations: [{ line: 1, column: 19 }], + }); + + expectSyntaxError('extend enum Hello').to.deep.equal({ + message: 'Syntax Error: Unexpected .', + locations: [{ line: 1, column: 18 }], + }); + + expectSyntaxError('extend input Hello').to.deep.equal({ + message: 'Syntax Error: Unexpected .', + locations: [{ line: 1, column: 19 }], + }); + }); + + it('Interface extension without fields followed by extension', () => { + const doc = parse(` + extend interface Hello implements Greeting + + extend interface Hello implements SecondGreeting + `); + expectJSON(doc).toDeepEqual({ + kind: 'Document', + definitions: [ + { + kind: 'InterfaceTypeExtension', + name: nameNode('Hello', { start: 24, end: 29 }), + interfaces: [typeNode('Greeting', { start: 41, end: 49 })], + directives: [], + fields: [], + loc: { start: 7, end: 49 }, + }, + { + kind: 'InterfaceTypeExtension', + name: nameNode('Hello', { start: 74, end: 79 }), + interfaces: [typeNode('SecondGreeting', { start: 91, end: 105 })], + directives: [], + fields: [], + loc: { start: 57, end: 105 }, + }, + ], + loc: { start: 0, end: 110 }, + }); + }); + + it('Object extension do not include descriptions', () => { + expectSyntaxError(` + "Description" + extend type Hello { + world: String + } + `).to.deep.equal({ + message: + 'Syntax Error: Unexpected description, descriptions are supported only on type definitions.', + locations: [{ line: 2, column: 7 }], + }); + + expectSyntaxError(` + extend "Description" type Hello { + world: String + } + `).to.deep.equal({ + message: 'Syntax Error: Unexpected String "Description".', + locations: [{ line: 2, column: 14 }], + }); + }); + + it('Interface extension do not include descriptions', () => { + expectSyntaxError(` + "Description" + extend interface Hello { + world: String + } + `).to.deep.equal({ + message: + 'Syntax Error: Unexpected description, descriptions are supported only on type definitions.', + locations: [{ line: 2, column: 7 }], + }); + + expectSyntaxError(` + extend "Description" interface Hello { + world: String + } + `).to.deep.equal({ + message: 'Syntax Error: Unexpected String "Description".', + locations: [{ line: 2, column: 14 }], + }); + }); + + it('Schema extension', () => { + const body = ` + extend schema { + mutation: Mutation + }`; + const doc = parse(body); + expectJSON(doc).toDeepEqual({ + kind: 'Document', + definitions: [ + { + kind: 'SchemaExtension', + directives: [], + operationTypes: [ + { + kind: 'OperationTypeDefinition', + operation: 'mutation', + type: typeNode('Mutation', { start: 41, end: 49 }), + loc: { start: 31, end: 49 }, + }, + ], + loc: { start: 7, end: 57 }, + }, + ], + loc: { start: 0, end: 57 }, + }); + }); + + it('Schema extension with only directives', () => { + const body = 'extend schema @directive'; + const doc = parse(body); + expectJSON(doc).toDeepEqual({ + kind: 'Document', + definitions: [ + { + kind: 'SchemaExtension', + directives: [ + { + kind: 'Directive', + name: nameNode('directive', { start: 15, end: 24 }), + arguments: [], + loc: { start: 14, end: 24 }, + }, + ], + operationTypes: [], + loc: { start: 0, end: 24 }, + }, + ], + loc: { start: 0, end: 24 }, + }); + }); + + it('Schema extension without anything throws', () => { + expectSyntaxError('extend schema').to.deep.equal({ + message: 'Syntax Error: Unexpected .', + locations: [{ line: 1, column: 14 }], + }); + }); + + it('Schema extension with invalid operation type throws', () => { + expectSyntaxError('extend schema { unknown: SomeType }').to.deep.equal({ + message: 'Syntax Error: Unexpected Name "unknown".', + locations: [{ line: 1, column: 17 }], + }); + }); + + it('Simple non-null type', () => { + const doc = parse(dedent` + type Hello { + world: String! + } + `); + + expectJSON(doc).toDeepEqual({ + kind: 'Document', + definitions: [ + { + kind: 'ObjectTypeDefinition', + name: nameNode('Hello', { start: 5, end: 10 }), + description: undefined, + interfaces: [], + directives: [], + fields: [ + fieldNode( + nameNode('world', { start: 15, end: 20 }), + { + kind: 'NonNullType', + type: typeNode('String', { start: 22, end: 28 }), + loc: { start: 22, end: 29 }, + }, + { start: 15, end: 29 }, + ), + ], + loc: { start: 0, end: 31 }, + }, + ], + loc: { start: 0, end: 31 }, + }); + }); + + it('Simple interface inheriting interface', () => { + const doc = parse('interface Hello implements World { field: String }'); + expectJSON(doc).toDeepEqual({ + kind: 'Document', + definitions: [ + { + kind: 'InterfaceTypeDefinition', + name: nameNode('Hello', { start: 10, end: 15 }), + description: undefined, + interfaces: [typeNode('World', { start: 27, end: 32 })], + directives: [], + fields: [ + fieldNode( + nameNode('field', { start: 35, end: 40 }), + typeNode('String', { start: 42, end: 48 }), + { start: 35, end: 48 }, + ), + ], + loc: { start: 0, end: 50 }, + }, + ], + loc: { start: 0, end: 50 }, + }); + }); + + it('Simple type inheriting interface', () => { + const doc = parse('type Hello implements World { field: String }'); + + expectJSON(doc).toDeepEqual({ + kind: 'Document', + definitions: [ + { + kind: 'ObjectTypeDefinition', + name: nameNode('Hello', { start: 5, end: 10 }), + description: undefined, + interfaces: [typeNode('World', { start: 22, end: 27 })], + directives: [], + fields: [ + fieldNode( + nameNode('field', { start: 30, end: 35 }), + typeNode('String', { start: 37, end: 43 }), + { start: 30, end: 43 }, + ), + ], + loc: { start: 0, end: 45 }, + }, + ], + loc: { start: 0, end: 45 }, + }); + }); + + it('Simple type inheriting multiple interfaces', () => { + const doc = parse('type Hello implements Wo & rld { field: String }'); + + expectJSON(doc).toDeepEqual({ + kind: 'Document', + definitions: [ + { + kind: 'ObjectTypeDefinition', + name: nameNode('Hello', { start: 5, end: 10 }), + description: undefined, + interfaces: [ + typeNode('Wo', { start: 22, end: 24 }), + typeNode('rld', { start: 27, end: 30 }), + ], + directives: [], + fields: [ + fieldNode( + nameNode('field', { start: 33, end: 38 }), + typeNode('String', { start: 40, end: 46 }), + { start: 33, end: 46 }, + ), + ], + loc: { start: 0, end: 48 }, + }, + ], + loc: { start: 0, end: 48 }, + }); + }); + + it('Simple interface inheriting multiple interfaces', () => { + const doc = parse('interface Hello implements Wo & rld { field: String }'); + expectJSON(doc).toDeepEqual({ + kind: 'Document', + definitions: [ + { + kind: 'InterfaceTypeDefinition', + name: nameNode('Hello', { start: 10, end: 15 }), + description: undefined, + interfaces: [ + typeNode('Wo', { start: 27, end: 29 }), + typeNode('rld', { start: 32, end: 35 }), + ], + directives: [], + fields: [ + fieldNode( + nameNode('field', { start: 38, end: 43 }), + typeNode('String', { start: 45, end: 51 }), + { start: 38, end: 51 }, + ), + ], + loc: { start: 0, end: 53 }, + }, + ], + loc: { start: 0, end: 53 }, + }); + }); + + it('Simple type inheriting multiple interfaces with leading ampersand', () => { + const doc = parse('type Hello implements & Wo & rld { field: String }'); + + expectJSON(doc).toDeepEqual({ + kind: 'Document', + definitions: [ + { + kind: 'ObjectTypeDefinition', + name: nameNode('Hello', { start: 5, end: 10 }), + description: undefined, + interfaces: [ + typeNode('Wo', { start: 24, end: 26 }), + typeNode('rld', { start: 29, end: 32 }), + ], + directives: [], + fields: [ + fieldNode( + nameNode('field', { start: 35, end: 40 }), + typeNode('String', { start: 42, end: 48 }), + { start: 35, end: 48 }, + ), + ], + loc: { start: 0, end: 50 }, + }, + ], + loc: { start: 0, end: 50 }, + }); + }); + + it('Simple interface inheriting multiple interfaces with leading ampersand', () => { + const doc = parse( + 'interface Hello implements & Wo & rld { field: String }', + ); + expectJSON(doc).toDeepEqual({ + kind: 'Document', + definitions: [ + { + kind: 'InterfaceTypeDefinition', + name: nameNode('Hello', { start: 10, end: 15 }), + description: undefined, + interfaces: [ + typeNode('Wo', { start: 29, end: 31 }), + typeNode('rld', { start: 34, end: 37 }), + ], + directives: [], + fields: [ + fieldNode( + nameNode('field', { start: 40, end: 45 }), + typeNode('String', { start: 47, end: 53 }), + { start: 40, end: 53 }, + ), + ], + loc: { start: 0, end: 55 }, + }, + ], + loc: { start: 0, end: 55 }, + }); + }); + + it('Single value enum', () => { + const doc = parse('enum Hello { WORLD }'); + + expectJSON(doc).toDeepEqual({ + kind: 'Document', + definitions: [ + { + kind: 'EnumTypeDefinition', + name: nameNode('Hello', { start: 5, end: 10 }), + description: undefined, + directives: [], + values: [enumValueNode('WORLD', { start: 13, end: 18 })], + loc: { start: 0, end: 20 }, + }, + ], + loc: { start: 0, end: 20 }, + }); + }); + + it('Double value enum', () => { + const doc = parse('enum Hello { WO, RLD }'); + + expectJSON(doc).toDeepEqual({ + kind: 'Document', + definitions: [ + { + kind: 'EnumTypeDefinition', + name: nameNode('Hello', { start: 5, end: 10 }), + description: undefined, + directives: [], + values: [ + enumValueNode('WO', { start: 13, end: 15 }), + enumValueNode('RLD', { start: 17, end: 20 }), + ], + loc: { start: 0, end: 22 }, + }, + ], + loc: { start: 0, end: 22 }, + }); + }); + + it('Simple interface', () => { + const doc = parse(dedent` + interface Hello { + world: String + } + `); + + expectJSON(doc).toDeepEqual({ + kind: 'Document', + definitions: [ + { + kind: 'InterfaceTypeDefinition', + name: nameNode('Hello', { start: 10, end: 15 }), + description: undefined, + interfaces: [], + directives: [], + fields: [ + fieldNode( + nameNode('world', { start: 20, end: 25 }), + typeNode('String', { start: 27, end: 33 }), + { start: 20, end: 33 }, + ), + ], + loc: { start: 0, end: 35 }, + }, + ], + loc: { start: 0, end: 35 }, + }); + }); + + it('Simple field with arg', () => { + const doc = parse(dedent` + type Hello { + world(flag: Boolean): String + } + `); + + expectJSON(doc).toDeepEqual({ + kind: 'Document', + definitions: [ + { + kind: 'ObjectTypeDefinition', + name: nameNode('Hello', { start: 5, end: 10 }), + description: undefined, + interfaces: [], + directives: [], + fields: [ + fieldNodeWithArgs( + nameNode('world', { start: 15, end: 20 }), + typeNode('String', { start: 37, end: 43 }), + [ + inputValueNode( + nameNode('flag', { start: 21, end: 25 }), + typeNode('Boolean', { start: 27, end: 34 }), + undefined, + { start: 21, end: 34 }, + ), + ], + { start: 15, end: 43 }, + ), + ], + loc: { start: 0, end: 45 }, + }, + ], + loc: { start: 0, end: 45 }, + }); + }); + + it('Simple field with arg with default value', () => { + const doc = parse(dedent` + type Hello { + world(flag: Boolean = true): String + } + `); + + expectJSON(doc).toDeepEqual({ + kind: 'Document', + definitions: [ + { + kind: 'ObjectTypeDefinition', + name: nameNode('Hello', { start: 5, end: 10 }), + description: undefined, + interfaces: [], + directives: [], + fields: [ + fieldNodeWithArgs( + nameNode('world', { start: 15, end: 20 }), + typeNode('String', { start: 44, end: 50 }), + [ + inputValueNode( + nameNode('flag', { start: 21, end: 25 }), + typeNode('Boolean', { start: 27, end: 34 }), + { + kind: 'BooleanValue', + value: true, + loc: { start: 37, end: 41 }, + }, + { start: 21, end: 41 }, + ), + ], + { start: 15, end: 50 }, + ), + ], + loc: { start: 0, end: 52 }, + }, + ], + loc: { start: 0, end: 52 }, + }); + }); + + it('Simple field with list arg', () => { + const doc = parse(dedent` + type Hello { + world(things: [String]): String + } + `); + + expectJSON(doc).toDeepEqual({ + kind: 'Document', + definitions: [ + { + kind: 'ObjectTypeDefinition', + name: nameNode('Hello', { start: 5, end: 10 }), + description: undefined, + interfaces: [], + directives: [], + fields: [ + fieldNodeWithArgs( + nameNode('world', { start: 15, end: 20 }), + typeNode('String', { start: 40, end: 46 }), + [ + inputValueNode( + nameNode('things', { start: 21, end: 27 }), + { + kind: 'ListType', + type: typeNode('String', { start: 30, end: 36 }), + loc: { start: 29, end: 37 }, + }, + undefined, + { start: 21, end: 37 }, + ), + ], + { start: 15, end: 46 }, + ), + ], + loc: { start: 0, end: 48 }, + }, + ], + loc: { start: 0, end: 48 }, + }); + }); + + it('Simple field with two args', () => { + const doc = parse(dedent` + type Hello { + world(argOne: Boolean, argTwo: Int): String + } + `); + + expectJSON(doc).toDeepEqual({ + kind: 'Document', + definitions: [ + { + kind: 'ObjectTypeDefinition', + name: nameNode('Hello', { start: 5, end: 10 }), + description: undefined, + interfaces: [], + directives: [], + fields: [ + fieldNodeWithArgs( + nameNode('world', { start: 15, end: 20 }), + typeNode('String', { start: 52, end: 58 }), + [ + inputValueNode( + nameNode('argOne', { start: 21, end: 27 }), + typeNode('Boolean', { start: 29, end: 36 }), + undefined, + { start: 21, end: 36 }, + ), + inputValueNode( + nameNode('argTwo', { start: 38, end: 44 }), + typeNode('Int', { start: 46, end: 49 }), + undefined, + { start: 38, end: 49 }, + ), + ], + { start: 15, end: 58 }, + ), + ], + loc: { start: 0, end: 60 }, + }, + ], + loc: { start: 0, end: 60 }, + }); + }); + + it('Simple union', () => { + const doc = parse('union Hello = World'); + + expectJSON(doc).toDeepEqual({ + kind: 'Document', + definitions: [ + { + kind: 'UnionTypeDefinition', + name: nameNode('Hello', { start: 6, end: 11 }), + description: undefined, + directives: [], + types: [typeNode('World', { start: 14, end: 19 })], + loc: { start: 0, end: 19 }, + }, + ], + loc: { start: 0, end: 19 }, + }); + }); + + it('Union with two types', () => { + const doc = parse('union Hello = Wo | Rld'); + + expectJSON(doc).toDeepEqual({ + kind: 'Document', + definitions: [ + { + kind: 'UnionTypeDefinition', + name: nameNode('Hello', { start: 6, end: 11 }), + description: undefined, + directives: [], + types: [ + typeNode('Wo', { start: 14, end: 16 }), + typeNode('Rld', { start: 19, end: 22 }), + ], + loc: { start: 0, end: 22 }, + }, + ], + loc: { start: 0, end: 22 }, + }); + }); + + it('Union with two types and leading pipe', () => { + const doc = parse('union Hello = | Wo | Rld'); + + expectJSON(doc).toDeepEqual({ + kind: 'Document', + definitions: [ + { + kind: 'UnionTypeDefinition', + name: nameNode('Hello', { start: 6, end: 11 }), + description: undefined, + directives: [], + types: [ + typeNode('Wo', { start: 16, end: 18 }), + typeNode('Rld', { start: 21, end: 24 }), + ], + loc: { start: 0, end: 24 }, + }, + ], + loc: { start: 0, end: 24 }, + }); + }); + + it('Union fails with no types', () => { + expectSyntaxError('union Hello = |').to.deep.equal({ + message: 'Syntax Error: Expected Name, found .', + locations: [{ line: 1, column: 16 }], + }); + }); + + it('Union fails with leading double pipe', () => { + expectSyntaxError('union Hello = || Wo | Rld').to.deep.equal({ + message: 'Syntax Error: Expected Name, found "|".', + locations: [{ line: 1, column: 16 }], + }); + }); + + it('Union fails with double pipe', () => { + expectSyntaxError('union Hello = Wo || Rld').to.deep.equal({ + message: 'Syntax Error: Expected Name, found "|".', + locations: [{ line: 1, column: 19 }], + }); + }); + + it('Union fails with trailing pipe', () => { + expectSyntaxError('union Hello = | Wo | Rld |').to.deep.equal({ + message: 'Syntax Error: Expected Name, found .', + locations: [{ line: 1, column: 27 }], + }); + }); + + it('Scalar', () => { + const doc = parse('scalar Hello'); + + expectJSON(doc).toDeepEqual({ + kind: 'Document', + definitions: [ + { + kind: 'ScalarTypeDefinition', + name: nameNode('Hello', { start: 7, end: 12 }), + description: undefined, + directives: [], + loc: { start: 0, end: 12 }, + }, + ], + loc: { start: 0, end: 12 }, + }); + }); + + it('Simple input object', () => { + const doc = parse(` +input Hello { + world: String +}`); + + expectJSON(doc).toDeepEqual({ + kind: 'Document', + definitions: [ + { + kind: 'InputObjectTypeDefinition', + name: nameNode('Hello', { start: 7, end: 12 }), + description: undefined, + directives: [], + fields: [ + inputValueNode( + nameNode('world', { start: 17, end: 22 }), + typeNode('String', { start: 24, end: 30 }), + undefined, + { start: 17, end: 30 }, + ), + ], + loc: { start: 1, end: 32 }, + }, + ], + loc: { start: 0, end: 32 }, + }); + }); + + it('Simple input object with args should fail', () => { + expectSyntaxError(` + input Hello { + world(foo: Int): String + } + `).to.deep.equal({ + message: 'Syntax Error: Expected ":", found "(".', + locations: [{ line: 3, column: 14 }], + }); + }); + + it('Directive definition', () => { + const body = 'directive @foo on OBJECT | INTERFACE'; + const doc = parse(body); + + expectJSON(doc).toDeepEqual({ + kind: 'Document', + definitions: [ + { + kind: 'DirectiveDefinition', + description: undefined, + name: { + kind: 'Name', + value: 'foo', + loc: { start: 11, end: 14 }, + }, + arguments: [], + repeatable: false, + locations: [ + { + kind: 'Name', + value: 'OBJECT', + loc: { start: 18, end: 24 }, + }, + { + kind: 'Name', + value: 'INTERFACE', + loc: { start: 27, end: 36 }, + }, + ], + loc: { start: 0, end: 36 }, + }, + ], + loc: { start: 0, end: 36 }, + }); + }); + + it('Repeatable directive definition', () => { + const body = 'directive @foo repeatable on OBJECT | INTERFACE'; + const doc = parse(body); + + expectJSON(doc).toDeepEqual({ + kind: 'Document', + definitions: [ + { + kind: 'DirectiveDefinition', + description: undefined, + name: { + kind: 'Name', + value: 'foo', + loc: { start: 11, end: 14 }, + }, + arguments: [], + repeatable: true, + locations: [ + { + kind: 'Name', + value: 'OBJECT', + loc: { start: 29, end: 35 }, + }, + { + kind: 'Name', + value: 'INTERFACE', + loc: { start: 38, end: 47 }, + }, + ], + loc: { start: 0, end: 47 }, + }, + ], + loc: { start: 0, end: 47 }, + }); + }); + + it('Directive with incorrect locations', () => { + expectSyntaxError( + 'directive @foo on FIELD | INCORRECT_LOCATION', + ).to.deep.equal({ + message: 'Syntax Error: Unexpected Name "INCORRECT_LOCATION".', + locations: [{ line: 1, column: 27 }], + }); + }); + + it('parses kitchen sink schema', () => { + expect(() => parse(kitchenSinkSDL)).to.not.throw(); + }); +}); diff --git a/src/language/__tests__/schema-printer-test.ts b/src/language/__tests__/schema-printer-test.ts new file mode 100644 index 00000000..49a32693 --- /dev/null +++ b/src/language/__tests__/schema-printer-test.ts @@ -0,0 +1,177 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { dedent } from '../../__testUtils__/dedent'; +import { kitchenSinkSDL } from '../../__testUtils__/kitchenSinkSDL'; + +import { Kind } from '../kinds'; +import { parse } from '../parser'; +import { print } from '../printer'; + +describe('Printer: SDL document', () => { + it('prints minimal ast', () => { + const ast = { + kind: Kind.SCALAR_TYPE_DEFINITION, + name: { kind: Kind.NAME, value: 'foo' }, + } as const; + expect(print(ast)).to.equal('scalar foo'); + }); + + it('produces helpful error messages', () => { + const badAST = { random: 'Data' }; + + // @ts-expect-error + expect(() => print(badAST)).to.throw( + 'Invalid AST Node: { random: "Data" }.', + ); + }); + + it('prints kitchen sink without altering ast', () => { + const ast = parse(kitchenSinkSDL, { noLocation: true }); + + const astBeforePrintCall = JSON.stringify(ast); + const printed = print(ast); + const printedAST = parse(printed, { noLocation: true }); + + expect(printedAST).to.deep.equal(ast); + expect(JSON.stringify(ast)).to.equal(astBeforePrintCall); + + expect(printed).to.equal(dedent` + """This is a description of the schema as a whole.""" + schema { + query: QueryType + mutation: MutationType + } + + """ + This is a description + of the \`Foo\` type. + """ + type Foo implements Bar & Baz & Two { + "Description of the \`one\` field." + one: Type + """This is a description of the \`two\` field.""" + two( + """This is a description of the \`argument\` argument.""" + argument: InputType! + ): Type + """This is a description of the \`three\` field.""" + three(argument: InputType, other: String): Int + four(argument: String = "string"): String + five(argument: [String] = ["string", "string"]): String + six(argument: InputType = {key: "value"}): Type + seven(argument: Int = null): Type + } + + type AnnotatedObject @onObject(arg: "value") { + annotatedField(arg: Type = "default" @onArgumentDefinition): Type @onField + } + + type UndefinedType + + extend type Foo { + seven(argument: [String]): Type + } + + extend type Foo @onType + + interface Bar { + one: Type + four(argument: String = "string"): String + } + + interface AnnotatedInterface @onInterface { + annotatedField(arg: Type @onArgumentDefinition): Type @onField + } + + interface UndefinedInterface + + extend interface Bar implements Two { + two(argument: InputType!): Type + } + + extend interface Bar @onInterface + + interface Baz implements Bar & Two { + one: Type + two(argument: InputType!): Type + four(argument: String = "string"): String + } + + union Feed = Story | Article | Advert + + union AnnotatedUnion @onUnion = A | B + + union AnnotatedUnionTwo @onUnion = A | B + + union UndefinedUnion + + extend union Feed = Photo | Video + + extend union Feed @onUnion + + scalar CustomScalar + + scalar AnnotatedScalar @onScalar + + extend scalar CustomScalar @onScalar + + enum Site { + """This is a description of the \`DESKTOP\` value""" + DESKTOP + """This is a description of the \`MOBILE\` value""" + MOBILE + "This is a description of the \`WEB\` value" + WEB + } + + enum AnnotatedEnum @onEnum { + ANNOTATED_VALUE @onEnumValue + OTHER_VALUE + } + + enum UndefinedEnum + + extend enum Site { + VR + } + + extend enum Site @onEnum + + input InputType { + key: String! + answer: Int = 42 + } + + input AnnotatedInput @onInputObject { + annotatedField: Type @onInputFieldDefinition + } + + input UndefinedInput + + extend input InputType { + other: Float = 1.23e4 @onInputFieldDefinition + } + + extend input InputType @onInputObject + + """This is a description of the \`@skip\` directive""" + directive @skip( + """This is a description of the \`if\` argument""" + if: Boolean! @onArgumentDefinition + ) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT + + directive @include(if: Boolean!) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT + + directive @include2(if: Boolean!) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT + + directive @myRepeatableDir(name: String!) repeatable on OBJECT | INTERFACE + + extend schema @onSchema + + extend schema @onSchema { + subscription: SubscriptionType + } + `); + }); +}); diff --git a/src/language/__tests__/source-test.ts b/src/language/__tests__/source-test.ts new file mode 100644 index 00000000..6bf8a93e --- /dev/null +++ b/src/language/__tests__/source-test.ts @@ -0,0 +1,46 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { Source } from '../source'; + +describe('Source', () => { + it('asserts that a body was provided', () => { + // @ts-expect-error + expect(() => new Source()).to.throw( + 'Body must be a string. Received: undefined.', + ); + }); + + it('asserts that a valid body was provided', () => { + // @ts-expect-error + expect(() => new Source({})).to.throw( + 'Body must be a string. Received: {}.', + ); + }); + + it('can be Object.toStringified', () => { + const source = new Source(''); + + expect(Object.prototype.toString.call(source)).to.equal('[object Source]'); + }); + + it('rejects invalid locationOffset', () => { + function createSource(locationOffset: { line: number; column: number }) { + return new Source('', '', locationOffset); + } + + expect(() => createSource({ line: 0, column: 1 })).to.throw( + 'line in locationOffset is 1-indexed and must be positive.', + ); + expect(() => createSource({ line: -1, column: 1 })).to.throw( + 'line in locationOffset is 1-indexed and must be positive.', + ); + + expect(() => createSource({ line: 1, column: 0 })).to.throw( + 'column in locationOffset is 1-indexed and must be positive.', + ); + expect(() => createSource({ line: 1, column: -1 })).to.throw( + 'column in locationOffset is 1-indexed and must be positive.', + ); + }); +}); diff --git a/src/language/__tests__/visitor-test.ts b/src/language/__tests__/visitor-test.ts new file mode 100644 index 00000000..9149b103 --- /dev/null +++ b/src/language/__tests__/visitor-test.ts @@ -0,0 +1,1364 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { kitchenSinkQuery } from '../../__testUtils__/kitchenSinkQuery'; + +import type { ASTNode, SelectionSetNode } from '../ast'; +import { isNode } from '../ast'; +import { Kind } from '../kinds'; +import { parse } from '../parser'; +import type { ASTVisitor, ASTVisitorKeyMap } from '../visitor'; +import { BREAK, visit, visitInParallel } from '../visitor'; + +function checkVisitorFnArgs(ast: any, args: any, isEdited: boolean = false) { + const [node, key, parent, path, ancestors] = args; + + expect(node).to.be.an.instanceof(Object); + expect(node.kind).to.be.oneOf(Object.values(Kind)); + + const isRoot = key === undefined; + if (isRoot) { + if (!isEdited) { + expect(node).to.equal(ast); + } + expect(parent).to.equal(undefined); + expect(path).to.deep.equal([]); + expect(ancestors).to.deep.equal([]); + return; + } + + expect(typeof key).to.be.oneOf(['number', 'string']); + + expect(parent).to.have.property(key); + + expect(path).to.be.an.instanceof(Array); + expect(path[path.length - 1]).to.equal(key); + + expect(ancestors).to.be.an.instanceof(Array); + expect(ancestors.length).to.equal(path.length - 1); + + if (!isEdited) { + let currentNode = ast; + for (let i = 0; i < ancestors.length; ++i) { + expect(ancestors[i]).to.equal(currentNode); + + currentNode = currentNode[path[i]]; + expect(currentNode).to.not.equal(undefined); + } + + expect(parent).to.equal(currentNode); + expect(parent[key]).to.equal(node); + } +} + +function getValue(node: ASTNode) { + return 'value' in node ? node.value : undefined; +} + +describe('Visitor', () => { + it('handles empty visitor', () => { + const ast = parse('{ a }', { noLocation: true }); + expect(() => visit(ast, {})).to.not.throw(); + }); + + it('validates path argument', () => { + const visited: Array = []; + + const ast = parse('{ a }', { noLocation: true }); + + visit(ast, { + enter(_node, _key, _parent, path) { + checkVisitorFnArgs(ast, arguments); + visited.push(['enter', path.slice()]); + }, + leave(_node, _key, _parent, path) { + checkVisitorFnArgs(ast, arguments); + visited.push(['leave', path.slice()]); + }, + }); + + expect(visited).to.deep.equal([ + ['enter', []], + ['enter', ['definitions', 0]], + ['enter', ['definitions', 0, 'selectionSet']], + ['enter', ['definitions', 0, 'selectionSet', 'selections', 0]], + ['enter', ['definitions', 0, 'selectionSet', 'selections', 0, 'name']], + ['leave', ['definitions', 0, 'selectionSet', 'selections', 0, 'name']], + ['leave', ['definitions', 0, 'selectionSet', 'selections', 0]], + ['leave', ['definitions', 0, 'selectionSet']], + ['leave', ['definitions', 0]], + ['leave', []], + ]); + }); + + it('validates ancestors argument', () => { + const ast = parse('{ a }', { noLocation: true }); + const visitedNodes: Array = []; + + visit(ast, { + enter(node, key, parent, _path, ancestors) { + const inArray = typeof key === 'number'; + if (inArray) { + visitedNodes.push(parent); + } + visitedNodes.push(node); + + const expectedAncestors = visitedNodes.slice(0, -2); + expect(ancestors).to.deep.equal(expectedAncestors); + }, + leave(_node, key, _parent, _path, ancestors) { + const expectedAncestors = visitedNodes.slice(0, -2); + expect(ancestors).to.deep.equal(expectedAncestors); + + const inArray = typeof key === 'number'; + if (inArray) { + visitedNodes.pop(); + } + visitedNodes.pop(); + }, + }); + }); + + it('allows editing a node both on enter and on leave', () => { + const ast = parse('{ a, b, c { a, b, c } }', { noLocation: true }); + + let selectionSet: SelectionSetNode; + + const editedAST = visit(ast, { + OperationDefinition: { + enter(node) { + checkVisitorFnArgs(ast, arguments); + selectionSet = node.selectionSet; + return { + ...node, + selectionSet: { + kind: 'SelectionSet', + selections: [], + }, + didEnter: true, + }; + }, + leave(node) { + checkVisitorFnArgs(ast, arguments, /* isEdited */ true); + return { + ...node, + selectionSet, + didLeave: true, + }; + }, + }, + }); + + expect(editedAST).to.deep.equal({ + ...ast, + definitions: [ + { + ...ast.definitions[0], + didEnter: true, + didLeave: true, + }, + ], + }); + }); + + it('allows editing the root node on enter and on leave', () => { + const ast = parse('{ a, b, c { a, b, c } }', { noLocation: true }); + + const { definitions } = ast; + + const editedAST = visit(ast, { + Document: { + enter(node) { + checkVisitorFnArgs(ast, arguments); + return { + ...node, + definitions: [], + didEnter: true, + }; + }, + leave(node) { + checkVisitorFnArgs(ast, arguments, /* isEdited */ true); + return { + ...node, + definitions, + didLeave: true, + }; + }, + }, + }); + + expect(editedAST).to.deep.equal({ + ...ast, + didEnter: true, + didLeave: true, + }); + }); + + it('allows for editing on enter', () => { + const ast = parse('{ a, b, c { a, b, c } }', { noLocation: true }); + const editedAST = visit(ast, { + enter(node) { + checkVisitorFnArgs(ast, arguments); + if (node.kind === 'Field' && node.name.value === 'b') { + return null; + } + }, + }); + + expect(ast).to.deep.equal( + parse('{ a, b, c { a, b, c } }', { noLocation: true }), + ); + + expect(editedAST).to.deep.equal( + parse('{ a, c { a, c } }', { noLocation: true }), + ); + }); + + it('allows for editing on leave', () => { + const ast = parse('{ a, b, c { a, b, c } }', { noLocation: true }); + const editedAST = visit(ast, { + leave(node) { + checkVisitorFnArgs(ast, arguments, /* isEdited */ true); + if (node.kind === 'Field' && node.name.value === 'b') { + return null; + } + }, + }); + + expect(ast).to.deep.equal( + parse('{ a, b, c { a, b, c } }', { noLocation: true }), + ); + + expect(editedAST).to.deep.equal( + parse('{ a, c { a, c } }', { noLocation: true }), + ); + }); + + it('ignores false returned on leave', () => { + const ast = parse('{ a, b, c { a, b, c } }', { noLocation: true }); + const returnedAST = visit(ast, { + leave() { + return false; + }, + }); + + expect(returnedAST).to.deep.equal( + parse('{ a, b, c { a, b, c } }', { noLocation: true }), + ); + }); + + it('visits edited node', () => { + const addedField = { + kind: 'Field', + name: { + kind: 'Name', + value: '__typename', + }, + }; + + let didVisitAddedField; + + const ast = parse('{ a { x } }', { noLocation: true }); + visit(ast, { + enter(node) { + checkVisitorFnArgs(ast, arguments, /* isEdited */ true); + if (node.kind === 'Field' && node.name.value === 'a') { + return { + kind: 'Field', + selectionSet: [addedField, node.selectionSet], + }; + } + if (node === addedField) { + didVisitAddedField = true; + } + }, + }); + + expect(didVisitAddedField).to.equal(true); + }); + + it('allows skipping a sub-tree', () => { + const visited: Array = []; + + const ast = parse('{ a, b { x }, c }', { noLocation: true }); + visit(ast, { + enter(node) { + checkVisitorFnArgs(ast, arguments); + visited.push(['enter', node.kind, getValue(node)]); + if (node.kind === 'Field' && node.name.value === 'b') { + return false; + } + }, + + leave(node) { + checkVisitorFnArgs(ast, arguments); + visited.push(['leave', node.kind, getValue(node)]); + }, + }); + + expect(visited).to.deep.equal([ + ['enter', 'Document', undefined], + ['enter', 'OperationDefinition', undefined], + ['enter', 'SelectionSet', undefined], + ['enter', 'Field', undefined], + ['enter', 'Name', 'a'], + ['leave', 'Name', 'a'], + ['leave', 'Field', undefined], + ['enter', 'Field', undefined], + ['enter', 'Field', undefined], + ['enter', 'Name', 'c'], + ['leave', 'Name', 'c'], + ['leave', 'Field', undefined], + ['leave', 'SelectionSet', undefined], + ['leave', 'OperationDefinition', undefined], + ['leave', 'Document', undefined], + ]); + }); + + it('allows early exit while visiting', () => { + const visited: Array = []; + + const ast = parse('{ a, b { x }, c }', { noLocation: true }); + visit(ast, { + enter(node) { + checkVisitorFnArgs(ast, arguments); + visited.push(['enter', node.kind, getValue(node)]); + if (node.kind === 'Name' && node.value === 'x') { + return BREAK; + } + }, + leave(node) { + checkVisitorFnArgs(ast, arguments); + visited.push(['leave', node.kind, getValue(node)]); + }, + }); + + expect(visited).to.deep.equal([ + ['enter', 'Document', undefined], + ['enter', 'OperationDefinition', undefined], + ['enter', 'SelectionSet', undefined], + ['enter', 'Field', undefined], + ['enter', 'Name', 'a'], + ['leave', 'Name', 'a'], + ['leave', 'Field', undefined], + ['enter', 'Field', undefined], + ['enter', 'Name', 'b'], + ['leave', 'Name', 'b'], + ['enter', 'SelectionSet', undefined], + ['enter', 'Field', undefined], + ['enter', 'Name', 'x'], + ]); + }); + + it('allows early exit while leaving', () => { + const visited: Array = []; + + const ast = parse('{ a, b { x }, c }', { noLocation: true }); + visit(ast, { + enter(node) { + checkVisitorFnArgs(ast, arguments); + visited.push(['enter', node.kind, getValue(node)]); + }, + + leave(node) { + checkVisitorFnArgs(ast, arguments); + visited.push(['leave', node.kind, getValue(node)]); + if (node.kind === 'Name' && node.value === 'x') { + return BREAK; + } + }, + }); + + expect(visited).to.deep.equal([ + ['enter', 'Document', undefined], + ['enter', 'OperationDefinition', undefined], + ['enter', 'SelectionSet', undefined], + ['enter', 'Field', undefined], + ['enter', 'Name', 'a'], + ['leave', 'Name', 'a'], + ['leave', 'Field', undefined], + ['enter', 'Field', undefined], + ['enter', 'Name', 'b'], + ['leave', 'Name', 'b'], + ['enter', 'SelectionSet', undefined], + ['enter', 'Field', undefined], + ['enter', 'Name', 'x'], + ['leave', 'Name', 'x'], + ]); + }); + + it('allows a named functions visitor API', () => { + const visited: Array = []; + + const ast = parse('{ a, b { x }, c }', { noLocation: true }); + visit(ast, { + Name(node) { + checkVisitorFnArgs(ast, arguments); + visited.push(['enter', node.kind, getValue(node)]); + }, + SelectionSet: { + enter(node) { + checkVisitorFnArgs(ast, arguments); + visited.push(['enter', node.kind, getValue(node)]); + }, + leave(node) { + checkVisitorFnArgs(ast, arguments); + visited.push(['leave', node.kind, getValue(node)]); + }, + }, + }); + + expect(visited).to.deep.equal([ + ['enter', 'SelectionSet', undefined], + ['enter', 'Name', 'a'], + ['enter', 'Name', 'b'], + ['enter', 'SelectionSet', undefined], + ['enter', 'Name', 'x'], + ['leave', 'SelectionSet', undefined], + ['enter', 'Name', 'c'], + ['leave', 'SelectionSet', undefined], + ]); + }); + + it('visits only the specified `Kind` in visitorKeyMap', () => { + const visited: Array = []; + + const visitorKeyMap: ASTVisitorKeyMap = { + Document: ['definitions'], + OperationDefinition: ['name'], + }; + + const visitor: ASTVisitor = { + enter(node) { + visited.push(['enter', node.kind, getValue(node)]); + }, + leave(node) { + visited.push(['leave', node.kind, getValue(node)]); + }, + }; + + const exampleDocumentAST = parse(` + query ExampleOperation { + someField + } + `); + + visit(exampleDocumentAST, visitor, visitorKeyMap); + + expect(visited).to.deep.equal([ + ['enter', 'Document', undefined], + ['enter', 'OperationDefinition', undefined], + ['enter', 'Name', 'ExampleOperation'], + ['leave', 'Name', 'ExampleOperation'], + ['leave', 'OperationDefinition', undefined], + ['leave', 'Document', undefined], + ]); + }); + + it('Legacy: visits variables defined in fragments', () => { + const ast = parse('fragment a($v: Boolean = false) on t { f }', { + noLocation: true, + allowLegacyFragmentVariables: true, + }); + const visited: Array = []; + + visit(ast, { + enter(node) { + checkVisitorFnArgs(ast, arguments); + visited.push(['enter', node.kind, getValue(node)]); + }, + leave(node) { + checkVisitorFnArgs(ast, arguments); + visited.push(['leave', node.kind, getValue(node)]); + }, + }); + + expect(visited).to.deep.equal([ + ['enter', 'Document', undefined], + ['enter', 'FragmentDefinition', undefined], + ['enter', 'Name', 'a'], + ['leave', 'Name', 'a'], + ['enter', 'VariableDefinition', undefined], + ['enter', 'Variable', undefined], + ['enter', 'Name', 'v'], + ['leave', 'Name', 'v'], + ['leave', 'Variable', undefined], + ['enter', 'NamedType', undefined], + ['enter', 'Name', 'Boolean'], + ['leave', 'Name', 'Boolean'], + ['leave', 'NamedType', undefined], + ['enter', 'BooleanValue', false], + ['leave', 'BooleanValue', false], + ['leave', 'VariableDefinition', undefined], + ['enter', 'NamedType', undefined], + ['enter', 'Name', 't'], + ['leave', 'Name', 't'], + ['leave', 'NamedType', undefined], + ['enter', 'SelectionSet', undefined], + ['enter', 'Field', undefined], + ['enter', 'Name', 'f'], + ['leave', 'Name', 'f'], + ['leave', 'Field', undefined], + ['leave', 'SelectionSet', undefined], + ['leave', 'FragmentDefinition', undefined], + ['leave', 'Document', undefined], + ]); + }); + + it('visits kitchen sink', () => { + const ast = parse(kitchenSinkQuery); + const visited: Array = []; + const argsStack: Array = []; + + visit(ast, { + enter(node, key, parent) { + visited.push([ + 'enter', + node.kind, + key, + isNode(parent) ? parent.kind : undefined, + ]); + + checkVisitorFnArgs(ast, arguments); + argsStack.push([...arguments]); + }, + + leave(node, key, parent) { + visited.push([ + 'leave', + node.kind, + key, + isNode(parent) ? parent.kind : undefined, + ]); + + expect(argsStack.pop()).to.deep.equal([...arguments]); + }, + }); + + expect(argsStack).to.deep.equal([]); + expect(visited).to.deep.equal([ + ['enter', 'Document', undefined, undefined], + ['enter', 'OperationDefinition', 0, undefined], + ['enter', 'Name', 'name', 'OperationDefinition'], + ['leave', 'Name', 'name', 'OperationDefinition'], + ['enter', 'VariableDefinition', 0, undefined], + ['enter', 'Variable', 'variable', 'VariableDefinition'], + ['enter', 'Name', 'name', 'Variable'], + ['leave', 'Name', 'name', 'Variable'], + ['leave', 'Variable', 'variable', 'VariableDefinition'], + ['enter', 'NamedType', 'type', 'VariableDefinition'], + ['enter', 'Name', 'name', 'NamedType'], + ['leave', 'Name', 'name', 'NamedType'], + ['leave', 'NamedType', 'type', 'VariableDefinition'], + ['leave', 'VariableDefinition', 0, undefined], + ['enter', 'VariableDefinition', 1, undefined], + ['enter', 'Variable', 'variable', 'VariableDefinition'], + ['enter', 'Name', 'name', 'Variable'], + ['leave', 'Name', 'name', 'Variable'], + ['leave', 'Variable', 'variable', 'VariableDefinition'], + ['enter', 'NamedType', 'type', 'VariableDefinition'], + ['enter', 'Name', 'name', 'NamedType'], + ['leave', 'Name', 'name', 'NamedType'], + ['leave', 'NamedType', 'type', 'VariableDefinition'], + ['enter', 'EnumValue', 'defaultValue', 'VariableDefinition'], + ['leave', 'EnumValue', 'defaultValue', 'VariableDefinition'], + ['leave', 'VariableDefinition', 1, undefined], + ['enter', 'Directive', 0, undefined], + ['enter', 'Name', 'name', 'Directive'], + ['leave', 'Name', 'name', 'Directive'], + ['leave', 'Directive', 0, undefined], + ['enter', 'SelectionSet', 'selectionSet', 'OperationDefinition'], + ['enter', 'Field', 0, undefined], + ['enter', 'Name', 'alias', 'Field'], + ['leave', 'Name', 'alias', 'Field'], + ['enter', 'Name', 'name', 'Field'], + ['leave', 'Name', 'name', 'Field'], + ['enter', 'Argument', 0, undefined], + ['enter', 'Name', 'name', 'Argument'], + ['leave', 'Name', 'name', 'Argument'], + ['enter', 'ListValue', 'value', 'Argument'], + ['enter', 'IntValue', 0, undefined], + ['leave', 'IntValue', 0, undefined], + ['enter', 'IntValue', 1, undefined], + ['leave', 'IntValue', 1, undefined], + ['leave', 'ListValue', 'value', 'Argument'], + ['leave', 'Argument', 0, undefined], + ['enter', 'SelectionSet', 'selectionSet', 'Field'], + ['enter', 'Field', 0, undefined], + ['enter', 'Name', 'name', 'Field'], + ['leave', 'Name', 'name', 'Field'], + ['leave', 'Field', 0, undefined], + ['enter', 'InlineFragment', 1, undefined], + ['enter', 'NamedType', 'typeCondition', 'InlineFragment'], + ['enter', 'Name', 'name', 'NamedType'], + ['leave', 'Name', 'name', 'NamedType'], + ['leave', 'NamedType', 'typeCondition', 'InlineFragment'], + ['enter', 'Directive', 0, undefined], + ['enter', 'Name', 'name', 'Directive'], + ['leave', 'Name', 'name', 'Directive'], + ['leave', 'Directive', 0, undefined], + ['enter', 'SelectionSet', 'selectionSet', 'InlineFragment'], + ['enter', 'Field', 0, undefined], + ['enter', 'Name', 'name', 'Field'], + ['leave', 'Name', 'name', 'Field'], + ['enter', 'SelectionSet', 'selectionSet', 'Field'], + ['enter', 'Field', 0, undefined], + ['enter', 'Name', 'name', 'Field'], + ['leave', 'Name', 'name', 'Field'], + ['leave', 'Field', 0, undefined], + ['enter', 'Field', 1, undefined], + ['enter', 'Name', 'alias', 'Field'], + ['leave', 'Name', 'alias', 'Field'], + ['enter', 'Name', 'name', 'Field'], + ['leave', 'Name', 'name', 'Field'], + ['enter', 'Argument', 0, undefined], + ['enter', 'Name', 'name', 'Argument'], + ['leave', 'Name', 'name', 'Argument'], + ['enter', 'IntValue', 'value', 'Argument'], + ['leave', 'IntValue', 'value', 'Argument'], + ['leave', 'Argument', 0, undefined], + ['enter', 'Argument', 1, undefined], + ['enter', 'Name', 'name', 'Argument'], + ['leave', 'Name', 'name', 'Argument'], + ['enter', 'Variable', 'value', 'Argument'], + ['enter', 'Name', 'name', 'Variable'], + ['leave', 'Name', 'name', 'Variable'], + ['leave', 'Variable', 'value', 'Argument'], + ['leave', 'Argument', 1, undefined], + ['enter', 'Directive', 0, undefined], + ['enter', 'Name', 'name', 'Directive'], + ['leave', 'Name', 'name', 'Directive'], + ['enter', 'Argument', 0, undefined], + ['enter', 'Name', 'name', 'Argument'], + ['leave', 'Name', 'name', 'Argument'], + ['enter', 'Variable', 'value', 'Argument'], + ['enter', 'Name', 'name', 'Variable'], + ['leave', 'Name', 'name', 'Variable'], + ['leave', 'Variable', 'value', 'Argument'], + ['leave', 'Argument', 0, undefined], + ['leave', 'Directive', 0, undefined], + ['enter', 'SelectionSet', 'selectionSet', 'Field'], + ['enter', 'Field', 0, undefined], + ['enter', 'Name', 'name', 'Field'], + ['leave', 'Name', 'name', 'Field'], + ['leave', 'Field', 0, undefined], + ['enter', 'FragmentSpread', 1, undefined], + ['enter', 'Name', 'name', 'FragmentSpread'], + ['leave', 'Name', 'name', 'FragmentSpread'], + ['enter', 'Directive', 0, undefined], + ['enter', 'Name', 'name', 'Directive'], + ['leave', 'Name', 'name', 'Directive'], + ['leave', 'Directive', 0, undefined], + ['leave', 'FragmentSpread', 1, undefined], + ['leave', 'SelectionSet', 'selectionSet', 'Field'], + ['leave', 'Field', 1, undefined], + ['leave', 'SelectionSet', 'selectionSet', 'Field'], + ['leave', 'Field', 0, undefined], + ['leave', 'SelectionSet', 'selectionSet', 'InlineFragment'], + ['leave', 'InlineFragment', 1, undefined], + ['enter', 'InlineFragment', 2, undefined], + ['enter', 'Directive', 0, undefined], + ['enter', 'Name', 'name', 'Directive'], + ['leave', 'Name', 'name', 'Directive'], + ['enter', 'Argument', 0, undefined], + ['enter', 'Name', 'name', 'Argument'], + ['leave', 'Name', 'name', 'Argument'], + ['enter', 'Variable', 'value', 'Argument'], + ['enter', 'Name', 'name', 'Variable'], + ['leave', 'Name', 'name', 'Variable'], + ['leave', 'Variable', 'value', 'Argument'], + ['leave', 'Argument', 0, undefined], + ['leave', 'Directive', 0, undefined], + ['enter', 'SelectionSet', 'selectionSet', 'InlineFragment'], + ['enter', 'Field', 0, undefined], + ['enter', 'Name', 'name', 'Field'], + ['leave', 'Name', 'name', 'Field'], + ['leave', 'Field', 0, undefined], + ['leave', 'SelectionSet', 'selectionSet', 'InlineFragment'], + ['leave', 'InlineFragment', 2, undefined], + ['enter', 'InlineFragment', 3, undefined], + ['enter', 'SelectionSet', 'selectionSet', 'InlineFragment'], + ['enter', 'Field', 0, undefined], + ['enter', 'Name', 'name', 'Field'], + ['leave', 'Name', 'name', 'Field'], + ['leave', 'Field', 0, undefined], + ['leave', 'SelectionSet', 'selectionSet', 'InlineFragment'], + ['leave', 'InlineFragment', 3, undefined], + ['leave', 'SelectionSet', 'selectionSet', 'Field'], + ['leave', 'Field', 0, undefined], + ['leave', 'SelectionSet', 'selectionSet', 'OperationDefinition'], + ['leave', 'OperationDefinition', 0, undefined], + ['enter', 'OperationDefinition', 1, undefined], + ['enter', 'Name', 'name', 'OperationDefinition'], + ['leave', 'Name', 'name', 'OperationDefinition'], + ['enter', 'Directive', 0, undefined], + ['enter', 'Name', 'name', 'Directive'], + ['leave', 'Name', 'name', 'Directive'], + ['leave', 'Directive', 0, undefined], + ['enter', 'SelectionSet', 'selectionSet', 'OperationDefinition'], + ['enter', 'Field', 0, undefined], + ['enter', 'Name', 'name', 'Field'], + ['leave', 'Name', 'name', 'Field'], + ['enter', 'Argument', 0, undefined], + ['enter', 'Name', 'name', 'Argument'], + ['leave', 'Name', 'name', 'Argument'], + ['enter', 'IntValue', 'value', 'Argument'], + ['leave', 'IntValue', 'value', 'Argument'], + ['leave', 'Argument', 0, undefined], + ['enter', 'Directive', 0, undefined], + ['enter', 'Name', 'name', 'Directive'], + ['leave', 'Name', 'name', 'Directive'], + ['leave', 'Directive', 0, undefined], + ['enter', 'SelectionSet', 'selectionSet', 'Field'], + ['enter', 'Field', 0, undefined], + ['enter', 'Name', 'name', 'Field'], + ['leave', 'Name', 'name', 'Field'], + ['enter', 'SelectionSet', 'selectionSet', 'Field'], + ['enter', 'Field', 0, undefined], + ['enter', 'Name', 'name', 'Field'], + ['leave', 'Name', 'name', 'Field'], + ['enter', 'Directive', 0, undefined], + ['enter', 'Name', 'name', 'Directive'], + ['leave', 'Name', 'name', 'Directive'], + ['leave', 'Directive', 0, undefined], + ['leave', 'Field', 0, undefined], + ['leave', 'SelectionSet', 'selectionSet', 'Field'], + ['leave', 'Field', 0, undefined], + ['leave', 'SelectionSet', 'selectionSet', 'Field'], + ['leave', 'Field', 0, undefined], + ['leave', 'SelectionSet', 'selectionSet', 'OperationDefinition'], + ['leave', 'OperationDefinition', 1, undefined], + ['enter', 'OperationDefinition', 2, undefined], + ['enter', 'Name', 'name', 'OperationDefinition'], + ['leave', 'Name', 'name', 'OperationDefinition'], + ['enter', 'VariableDefinition', 0, undefined], + ['enter', 'Variable', 'variable', 'VariableDefinition'], + ['enter', 'Name', 'name', 'Variable'], + ['leave', 'Name', 'name', 'Variable'], + ['leave', 'Variable', 'variable', 'VariableDefinition'], + ['enter', 'NamedType', 'type', 'VariableDefinition'], + ['enter', 'Name', 'name', 'NamedType'], + ['leave', 'Name', 'name', 'NamedType'], + ['leave', 'NamedType', 'type', 'VariableDefinition'], + ['enter', 'Directive', 0, undefined], + ['enter', 'Name', 'name', 'Directive'], + ['leave', 'Name', 'name', 'Directive'], + ['leave', 'Directive', 0, undefined], + ['leave', 'VariableDefinition', 0, undefined], + ['enter', 'Directive', 0, undefined], + ['enter', 'Name', 'name', 'Directive'], + ['leave', 'Name', 'name', 'Directive'], + ['leave', 'Directive', 0, undefined], + ['enter', 'SelectionSet', 'selectionSet', 'OperationDefinition'], + ['enter', 'Field', 0, undefined], + ['enter', 'Name', 'name', 'Field'], + ['leave', 'Name', 'name', 'Field'], + ['enter', 'Argument', 0, undefined], + ['enter', 'Name', 'name', 'Argument'], + ['leave', 'Name', 'name', 'Argument'], + ['enter', 'Variable', 'value', 'Argument'], + ['enter', 'Name', 'name', 'Variable'], + ['leave', 'Name', 'name', 'Variable'], + ['leave', 'Variable', 'value', 'Argument'], + ['leave', 'Argument', 0, undefined], + ['enter', 'SelectionSet', 'selectionSet', 'Field'], + ['enter', 'Field', 0, undefined], + ['enter', 'Name', 'name', 'Field'], + ['leave', 'Name', 'name', 'Field'], + ['enter', 'SelectionSet', 'selectionSet', 'Field'], + ['enter', 'Field', 0, undefined], + ['enter', 'Name', 'name', 'Field'], + ['leave', 'Name', 'name', 'Field'], + ['enter', 'SelectionSet', 'selectionSet', 'Field'], + ['enter', 'Field', 0, undefined], + ['enter', 'Name', 'name', 'Field'], + ['leave', 'Name', 'name', 'Field'], + ['leave', 'Field', 0, undefined], + ['leave', 'SelectionSet', 'selectionSet', 'Field'], + ['leave', 'Field', 0, undefined], + ['enter', 'Field', 1, undefined], + ['enter', 'Name', 'name', 'Field'], + ['leave', 'Name', 'name', 'Field'], + ['enter', 'SelectionSet', 'selectionSet', 'Field'], + ['enter', 'Field', 0, undefined], + ['enter', 'Name', 'name', 'Field'], + ['leave', 'Name', 'name', 'Field'], + ['leave', 'Field', 0, undefined], + ['leave', 'SelectionSet', 'selectionSet', 'Field'], + ['leave', 'Field', 1, undefined], + ['leave', 'SelectionSet', 'selectionSet', 'Field'], + ['leave', 'Field', 0, undefined], + ['leave', 'SelectionSet', 'selectionSet', 'Field'], + ['leave', 'Field', 0, undefined], + ['leave', 'SelectionSet', 'selectionSet', 'OperationDefinition'], + ['leave', 'OperationDefinition', 2, undefined], + ['enter', 'FragmentDefinition', 3, undefined], + ['enter', 'Name', 'name', 'FragmentDefinition'], + ['leave', 'Name', 'name', 'FragmentDefinition'], + ['enter', 'NamedType', 'typeCondition', 'FragmentDefinition'], + ['enter', 'Name', 'name', 'NamedType'], + ['leave', 'Name', 'name', 'NamedType'], + ['leave', 'NamedType', 'typeCondition', 'FragmentDefinition'], + ['enter', 'Directive', 0, undefined], + ['enter', 'Name', 'name', 'Directive'], + ['leave', 'Name', 'name', 'Directive'], + ['leave', 'Directive', 0, undefined], + ['enter', 'SelectionSet', 'selectionSet', 'FragmentDefinition'], + ['enter', 'Field', 0, undefined], + ['enter', 'Name', 'name', 'Field'], + ['leave', 'Name', 'name', 'Field'], + ['enter', 'Argument', 0, undefined], + ['enter', 'Name', 'name', 'Argument'], + ['leave', 'Name', 'name', 'Argument'], + ['enter', 'Variable', 'value', 'Argument'], + ['enter', 'Name', 'name', 'Variable'], + ['leave', 'Name', 'name', 'Variable'], + ['leave', 'Variable', 'value', 'Argument'], + ['leave', 'Argument', 0, undefined], + ['enter', 'Argument', 1, undefined], + ['enter', 'Name', 'name', 'Argument'], + ['leave', 'Name', 'name', 'Argument'], + ['enter', 'Variable', 'value', 'Argument'], + ['enter', 'Name', 'name', 'Variable'], + ['leave', 'Name', 'name', 'Variable'], + ['leave', 'Variable', 'value', 'Argument'], + ['leave', 'Argument', 1, undefined], + ['enter', 'Argument', 2, undefined], + ['enter', 'Name', 'name', 'Argument'], + ['leave', 'Name', 'name', 'Argument'], + ['enter', 'ObjectValue', 'value', 'Argument'], + ['enter', 'ObjectField', 0, undefined], + ['enter', 'Name', 'name', 'ObjectField'], + ['leave', 'Name', 'name', 'ObjectField'], + ['enter', 'StringValue', 'value', 'ObjectField'], + ['leave', 'StringValue', 'value', 'ObjectField'], + ['leave', 'ObjectField', 0, undefined], + ['enter', 'ObjectField', 1, undefined], + ['enter', 'Name', 'name', 'ObjectField'], + ['leave', 'Name', 'name', 'ObjectField'], + ['enter', 'StringValue', 'value', 'ObjectField'], + ['leave', 'StringValue', 'value', 'ObjectField'], + ['leave', 'ObjectField', 1, undefined], + ['leave', 'ObjectValue', 'value', 'Argument'], + ['leave', 'Argument', 2, undefined], + ['leave', 'Field', 0, undefined], + ['leave', 'SelectionSet', 'selectionSet', 'FragmentDefinition'], + ['leave', 'FragmentDefinition', 3, undefined], + ['enter', 'OperationDefinition', 4, undefined], + ['enter', 'SelectionSet', 'selectionSet', 'OperationDefinition'], + ['enter', 'Field', 0, undefined], + ['enter', 'Name', 'name', 'Field'], + ['leave', 'Name', 'name', 'Field'], + ['enter', 'Argument', 0, undefined], + ['enter', 'Name', 'name', 'Argument'], + ['leave', 'Name', 'name', 'Argument'], + ['enter', 'BooleanValue', 'value', 'Argument'], + ['leave', 'BooleanValue', 'value', 'Argument'], + ['leave', 'Argument', 0, undefined], + ['enter', 'Argument', 1, undefined], + ['enter', 'Name', 'name', 'Argument'], + ['leave', 'Name', 'name', 'Argument'], + ['enter', 'BooleanValue', 'value', 'Argument'], + ['leave', 'BooleanValue', 'value', 'Argument'], + ['leave', 'Argument', 1, undefined], + ['enter', 'Argument', 2, undefined], + ['enter', 'Name', 'name', 'Argument'], + ['leave', 'Name', 'name', 'Argument'], + ['enter', 'NullValue', 'value', 'Argument'], + ['leave', 'NullValue', 'value', 'Argument'], + ['leave', 'Argument', 2, undefined], + ['leave', 'Field', 0, undefined], + ['enter', 'Field', 1, undefined], + ['enter', 'Name', 'name', 'Field'], + ['leave', 'Name', 'name', 'Field'], + ['leave', 'Field', 1, undefined], + ['leave', 'SelectionSet', 'selectionSet', 'OperationDefinition'], + ['leave', 'OperationDefinition', 4, undefined], + ['enter', 'OperationDefinition', 5, undefined], + ['enter', 'SelectionSet', 'selectionSet', 'OperationDefinition'], + ['enter', 'Field', 0, undefined], + ['enter', 'Name', 'name', 'Field'], + ['leave', 'Name', 'name', 'Field'], + ['leave', 'Field', 0, undefined], + ['leave', 'SelectionSet', 'selectionSet', 'OperationDefinition'], + ['leave', 'OperationDefinition', 5, undefined], + ['leave', 'Document', undefined, undefined], + ]); + }); + + describe('visitInParallel', () => { + // Note: nearly identical to the above test of the same test but + // using visitInParallel. + it('allows skipping a sub-tree', () => { + const visited: Array = []; + + const ast = parse('{ a, b { x }, c }'); + visit( + ast, + visitInParallel([ + { + enter(node) { + checkVisitorFnArgs(ast, arguments); + visited.push(['enter', node.kind, getValue(node)]); + if (node.kind === 'Field' && node.name.value === 'b') { + return false; + } + }, + + leave(node) { + checkVisitorFnArgs(ast, arguments); + visited.push(['leave', node.kind, getValue(node)]); + }, + }, + ]), + ); + + expect(visited).to.deep.equal([ + ['enter', 'Document', undefined], + ['enter', 'OperationDefinition', undefined], + ['enter', 'SelectionSet', undefined], + ['enter', 'Field', undefined], + ['enter', 'Name', 'a'], + ['leave', 'Name', 'a'], + ['leave', 'Field', undefined], + ['enter', 'Field', undefined], + ['enter', 'Field', undefined], + ['enter', 'Name', 'c'], + ['leave', 'Name', 'c'], + ['leave', 'Field', undefined], + ['leave', 'SelectionSet', undefined], + ['leave', 'OperationDefinition', undefined], + ['leave', 'Document', undefined], + ]); + }); + + it('allows skipping different sub-trees', () => { + const visited: Array = []; + + const ast = parse('{ a { x }, b { y} }'); + visit( + ast, + visitInParallel([ + { + enter(node) { + checkVisitorFnArgs(ast, arguments); + visited.push(['no-a', 'enter', node.kind, getValue(node)]); + if (node.kind === 'Field' && node.name.value === 'a') { + return false; + } + }, + leave(node) { + checkVisitorFnArgs(ast, arguments); + visited.push(['no-a', 'leave', node.kind, getValue(node)]); + }, + }, + { + enter(node) { + checkVisitorFnArgs(ast, arguments); + visited.push(['no-b', 'enter', node.kind, getValue(node)]); + if (node.kind === 'Field' && node.name.value === 'b') { + return false; + } + }, + leave(node) { + checkVisitorFnArgs(ast, arguments); + visited.push(['no-b', 'leave', node.kind, getValue(node)]); + }, + }, + ]), + ); + + expect(visited).to.deep.equal([ + ['no-a', 'enter', 'Document', undefined], + ['no-b', 'enter', 'Document', undefined], + ['no-a', 'enter', 'OperationDefinition', undefined], + ['no-b', 'enter', 'OperationDefinition', undefined], + ['no-a', 'enter', 'SelectionSet', undefined], + ['no-b', 'enter', 'SelectionSet', undefined], + ['no-a', 'enter', 'Field', undefined], + ['no-b', 'enter', 'Field', undefined], + ['no-b', 'enter', 'Name', 'a'], + ['no-b', 'leave', 'Name', 'a'], + ['no-b', 'enter', 'SelectionSet', undefined], + ['no-b', 'enter', 'Field', undefined], + ['no-b', 'enter', 'Name', 'x'], + ['no-b', 'leave', 'Name', 'x'], + ['no-b', 'leave', 'Field', undefined], + ['no-b', 'leave', 'SelectionSet', undefined], + ['no-b', 'leave', 'Field', undefined], + ['no-a', 'enter', 'Field', undefined], + ['no-b', 'enter', 'Field', undefined], + ['no-a', 'enter', 'Name', 'b'], + ['no-a', 'leave', 'Name', 'b'], + ['no-a', 'enter', 'SelectionSet', undefined], + ['no-a', 'enter', 'Field', undefined], + ['no-a', 'enter', 'Name', 'y'], + ['no-a', 'leave', 'Name', 'y'], + ['no-a', 'leave', 'Field', undefined], + ['no-a', 'leave', 'SelectionSet', undefined], + ['no-a', 'leave', 'Field', undefined], + ['no-a', 'leave', 'SelectionSet', undefined], + ['no-b', 'leave', 'SelectionSet', undefined], + ['no-a', 'leave', 'OperationDefinition', undefined], + ['no-b', 'leave', 'OperationDefinition', undefined], + ['no-a', 'leave', 'Document', undefined], + ['no-b', 'leave', 'Document', undefined], + ]); + }); + + // Note: nearly identical to the above test of the same test but + // using visitInParallel. + it('allows early exit while visiting', () => { + const visited: Array = []; + + const ast = parse('{ a, b { x }, c }'); + visit( + ast, + visitInParallel([ + { + enter(node) { + checkVisitorFnArgs(ast, arguments); + visited.push(['enter', node.kind, getValue(node)]); + if (node.kind === 'Name' && node.value === 'x') { + return BREAK; + } + }, + leave(node) { + checkVisitorFnArgs(ast, arguments); + visited.push(['leave', node.kind, getValue(node)]); + }, + }, + ]), + ); + + expect(visited).to.deep.equal([ + ['enter', 'Document', undefined], + ['enter', 'OperationDefinition', undefined], + ['enter', 'SelectionSet', undefined], + ['enter', 'Field', undefined], + ['enter', 'Name', 'a'], + ['leave', 'Name', 'a'], + ['leave', 'Field', undefined], + ['enter', 'Field', undefined], + ['enter', 'Name', 'b'], + ['leave', 'Name', 'b'], + ['enter', 'SelectionSet', undefined], + ['enter', 'Field', undefined], + ['enter', 'Name', 'x'], + ]); + }); + + it('allows early exit from different points', () => { + const visited: Array = []; + + const ast = parse('{ a { y }, b { x } }'); + visit( + ast, + visitInParallel([ + { + enter(node) { + checkVisitorFnArgs(ast, arguments); + visited.push(['break-a', 'enter', node.kind, getValue(node)]); + if (node.kind === 'Name' && node.value === 'a') { + return BREAK; + } + }, + /* c8 ignore next 3 */ + leave() { + expect.fail('Should not be called'); + }, + }, + { + enter(node) { + checkVisitorFnArgs(ast, arguments); + visited.push(['break-b', 'enter', node.kind, getValue(node)]); + if (node.kind === 'Name' && node.value === 'b') { + return BREAK; + } + }, + leave(node) { + checkVisitorFnArgs(ast, arguments); + visited.push(['break-b', 'leave', node.kind, getValue(node)]); + }, + }, + ]), + ); + + expect(visited).to.deep.equal([ + ['break-a', 'enter', 'Document', undefined], + ['break-b', 'enter', 'Document', undefined], + ['break-a', 'enter', 'OperationDefinition', undefined], + ['break-b', 'enter', 'OperationDefinition', undefined], + ['break-a', 'enter', 'SelectionSet', undefined], + ['break-b', 'enter', 'SelectionSet', undefined], + ['break-a', 'enter', 'Field', undefined], + ['break-b', 'enter', 'Field', undefined], + ['break-a', 'enter', 'Name', 'a'], + ['break-b', 'enter', 'Name', 'a'], + ['break-b', 'leave', 'Name', 'a'], + ['break-b', 'enter', 'SelectionSet', undefined], + ['break-b', 'enter', 'Field', undefined], + ['break-b', 'enter', 'Name', 'y'], + ['break-b', 'leave', 'Name', 'y'], + ['break-b', 'leave', 'Field', undefined], + ['break-b', 'leave', 'SelectionSet', undefined], + ['break-b', 'leave', 'Field', undefined], + ['break-b', 'enter', 'Field', undefined], + ['break-b', 'enter', 'Name', 'b'], + ]); + }); + + // Note: nearly identical to the above test of the same test but + // using visitInParallel. + it('allows early exit while leaving', () => { + const visited: Array = []; + + const ast = parse('{ a, b { x }, c }'); + visit( + ast, + visitInParallel([ + { + enter(node) { + checkVisitorFnArgs(ast, arguments); + visited.push(['enter', node.kind, getValue(node)]); + }, + leave(node) { + checkVisitorFnArgs(ast, arguments); + visited.push(['leave', node.kind, getValue(node)]); + if (node.kind === 'Name' && node.value === 'x') { + return BREAK; + } + }, + }, + ]), + ); + + expect(visited).to.deep.equal([ + ['enter', 'Document', undefined], + ['enter', 'OperationDefinition', undefined], + ['enter', 'SelectionSet', undefined], + ['enter', 'Field', undefined], + ['enter', 'Name', 'a'], + ['leave', 'Name', 'a'], + ['leave', 'Field', undefined], + ['enter', 'Field', undefined], + ['enter', 'Name', 'b'], + ['leave', 'Name', 'b'], + ['enter', 'SelectionSet', undefined], + ['enter', 'Field', undefined], + ['enter', 'Name', 'x'], + ['leave', 'Name', 'x'], + ]); + }); + + it('allows early exit from leaving different points', () => { + const visited: Array = []; + + const ast = parse('{ a { y }, b { x } }'); + visit( + ast, + visitInParallel([ + { + enter(node) { + checkVisitorFnArgs(ast, arguments); + visited.push(['break-a', 'enter', node.kind, getValue(node)]); + }, + leave(node) { + checkVisitorFnArgs(ast, arguments); + visited.push(['break-a', 'leave', node.kind, getValue(node)]); + if (node.kind === 'Field' && node.name.value === 'a') { + return BREAK; + } + }, + }, + { + enter(node) { + checkVisitorFnArgs(ast, arguments); + visited.push(['break-b', 'enter', node.kind, getValue(node)]); + }, + leave(node) { + checkVisitorFnArgs(ast, arguments); + visited.push(['break-b', 'leave', node.kind, getValue(node)]); + if (node.kind === 'Field' && node.name.value === 'b') { + return BREAK; + } + }, + }, + ]), + ); + + expect(visited).to.deep.equal([ + ['break-a', 'enter', 'Document', undefined], + ['break-b', 'enter', 'Document', undefined], + ['break-a', 'enter', 'OperationDefinition', undefined], + ['break-b', 'enter', 'OperationDefinition', undefined], + ['break-a', 'enter', 'SelectionSet', undefined], + ['break-b', 'enter', 'SelectionSet', undefined], + ['break-a', 'enter', 'Field', undefined], + ['break-b', 'enter', 'Field', undefined], + ['break-a', 'enter', 'Name', 'a'], + ['break-b', 'enter', 'Name', 'a'], + ['break-a', 'leave', 'Name', 'a'], + ['break-b', 'leave', 'Name', 'a'], + ['break-a', 'enter', 'SelectionSet', undefined], + ['break-b', 'enter', 'SelectionSet', undefined], + ['break-a', 'enter', 'Field', undefined], + ['break-b', 'enter', 'Field', undefined], + ['break-a', 'enter', 'Name', 'y'], + ['break-b', 'enter', 'Name', 'y'], + ['break-a', 'leave', 'Name', 'y'], + ['break-b', 'leave', 'Name', 'y'], + ['break-a', 'leave', 'Field', undefined], + ['break-b', 'leave', 'Field', undefined], + ['break-a', 'leave', 'SelectionSet', undefined], + ['break-b', 'leave', 'SelectionSet', undefined], + ['break-a', 'leave', 'Field', undefined], + ['break-b', 'leave', 'Field', undefined], + ['break-b', 'enter', 'Field', undefined], + ['break-b', 'enter', 'Name', 'b'], + ['break-b', 'leave', 'Name', 'b'], + ['break-b', 'enter', 'SelectionSet', undefined], + ['break-b', 'enter', 'Field', undefined], + ['break-b', 'enter', 'Name', 'x'], + ['break-b', 'leave', 'Name', 'x'], + ['break-b', 'leave', 'Field', undefined], + ['break-b', 'leave', 'SelectionSet', undefined], + ['break-b', 'leave', 'Field', undefined], + ]); + }); + + it('allows for editing on enter', () => { + const visited: Array = []; + + const ast = parse('{ a, b, c { a, b, c } }', { noLocation: true }); + const editedAST = visit( + ast, + visitInParallel([ + { + enter(node) { + checkVisitorFnArgs(ast, arguments); + if (node.kind === 'Field' && node.name.value === 'b') { + return null; + } + }, + }, + { + enter(node) { + checkVisitorFnArgs(ast, arguments); + visited.push(['enter', node.kind, getValue(node)]); + }, + leave(node) { + checkVisitorFnArgs(ast, arguments, /* isEdited */ true); + visited.push(['leave', node.kind, getValue(node)]); + }, + }, + ]), + ); + + expect(ast).to.deep.equal( + parse('{ a, b, c { a, b, c } }', { noLocation: true }), + ); + + expect(editedAST).to.deep.equal( + parse('{ a, c { a, c } }', { noLocation: true }), + ); + + expect(visited).to.deep.equal([ + ['enter', 'Document', undefined], + ['enter', 'OperationDefinition', undefined], + ['enter', 'SelectionSet', undefined], + ['enter', 'Field', undefined], + ['enter', 'Name', 'a'], + ['leave', 'Name', 'a'], + ['leave', 'Field', undefined], + ['enter', 'Field', undefined], + ['enter', 'Name', 'c'], + ['leave', 'Name', 'c'], + ['enter', 'SelectionSet', undefined], + ['enter', 'Field', undefined], + ['enter', 'Name', 'a'], + ['leave', 'Name', 'a'], + ['leave', 'Field', undefined], + ['enter', 'Field', undefined], + ['enter', 'Name', 'c'], + ['leave', 'Name', 'c'], + ['leave', 'Field', undefined], + ['leave', 'SelectionSet', undefined], + ['leave', 'Field', undefined], + ['leave', 'SelectionSet', undefined], + ['leave', 'OperationDefinition', undefined], + ['leave', 'Document', undefined], + ]); + }); + + it('allows for editing on leave', () => { + const visited: Array = []; + + const ast = parse('{ a, b, c { a, b, c } }', { noLocation: true }); + const editedAST = visit( + ast, + visitInParallel([ + { + leave(node) { + checkVisitorFnArgs(ast, arguments, /* isEdited */ true); + if (node.kind === 'Field' && node.name.value === 'b') { + return null; + } + }, + }, + { + enter(node) { + checkVisitorFnArgs(ast, arguments); + visited.push(['enter', node.kind, getValue(node)]); + }, + leave(node) { + checkVisitorFnArgs(ast, arguments, /* isEdited */ true); + visited.push(['leave', node.kind, getValue(node)]); + }, + }, + ]), + ); + + expect(ast).to.deep.equal( + parse('{ a, b, c { a, b, c } }', { noLocation: true }), + ); + + expect(editedAST).to.deep.equal( + parse('{ a, c { a, c } }', { noLocation: true }), + ); + + expect(visited).to.deep.equal([ + ['enter', 'Document', undefined], + ['enter', 'OperationDefinition', undefined], + ['enter', 'SelectionSet', undefined], + ['enter', 'Field', undefined], + ['enter', 'Name', 'a'], + ['leave', 'Name', 'a'], + ['leave', 'Field', undefined], + ['enter', 'Field', undefined], + ['enter', 'Name', 'b'], + ['leave', 'Name', 'b'], + ['enter', 'Field', undefined], + ['enter', 'Name', 'c'], + ['leave', 'Name', 'c'], + ['enter', 'SelectionSet', undefined], + ['enter', 'Field', undefined], + ['enter', 'Name', 'a'], + ['leave', 'Name', 'a'], + ['leave', 'Field', undefined], + ['enter', 'Field', undefined], + ['enter', 'Name', 'b'], + ['leave', 'Name', 'b'], + ['enter', 'Field', undefined], + ['enter', 'Name', 'c'], + ['leave', 'Name', 'c'], + ['leave', 'Field', undefined], + ['leave', 'SelectionSet', undefined], + ['leave', 'Field', undefined], + ['leave', 'SelectionSet', undefined], + ['leave', 'OperationDefinition', undefined], + ['leave', 'Document', undefined], + ]); + }); + }); +}); diff --git a/src/language/ast.ts b/src/language/ast.ts new file mode 100644 index 00000000..0b30366d --- /dev/null +++ b/src/language/ast.ts @@ -0,0 +1,737 @@ +import type { Kind } from './kinds'; +import type { Source } from './source'; +import type { TokenKind } from './tokenKind'; + +/** + * Contains a range of UTF-8 character offsets and token references that + * identify the region of the source from which the AST derived. + */ +export class Location { + /** + * The character offset at which this Node begins. + */ + readonly start: number; + + /** + * The character offset at which this Node ends. + */ + readonly end: number; + + /** + * The Token at which this Node begins. + */ + readonly startToken: Token; + + /** + * The Token at which this Node ends. + */ + readonly endToken: Token; + + /** + * The Source document the AST represents. + */ + readonly source: Source; + + constructor(startToken: Token, endToken: Token, source: Source) { + this.start = startToken.start; + this.end = endToken.end; + this.startToken = startToken; + this.endToken = endToken; + this.source = source; + } + + get [Symbol.toStringTag]() { + return 'Location'; + } + + toJSON(): { start: number; end: number } { + return { start: this.start, end: this.end }; + } +} + +/** + * Represents a range of characters represented by a lexical token + * within a Source. + */ +export class Token { + /** + * The kind of Token. + */ + readonly kind: TokenKind; + + /** + * The character offset at which this Node begins. + */ + readonly start: number; + + /** + * The character offset at which this Node ends. + */ + readonly end: number; + + /** + * The 1-indexed line number on which this Token appears. + */ + readonly line: number; + + /** + * The 1-indexed column number at which this Token begins. + */ + readonly column: number; + + /** + * For non-punctuation tokens, represents the interpreted value of the token. + * + * Note: is undefined for punctuation tokens, but typed as string for + * convenience in the parser. + */ + readonly value: string; + + /** + * Tokens exist as nodes in a double-linked-list amongst all tokens + * including ignored tokens. is always the first node and + * the last. + */ + readonly prev: Token | null; + readonly next: Token | null; + + constructor( + kind: TokenKind, + start: number, + end: number, + line: number, + column: number, + value?: string, + ) { + this.kind = kind; + this.start = start; + this.end = end; + this.line = line; + this.column = column; + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + this.value = value!; + this.prev = null; + this.next = null; + } + + get [Symbol.toStringTag]() { + return 'Token'; + } + + toJSON(): { + kind: TokenKind; + value?: string; + line: number; + column: number; + } { + return { + kind: this.kind, + value: this.value, + line: this.line, + column: this.column, + }; + } +} + +/** + * The list of all possible AST node types. + */ +export type ASTNode = + | NameNode + | DocumentNode + | OperationDefinitionNode + | VariableDefinitionNode + | VariableNode + | SelectionSetNode + | FieldNode + | ArgumentNode + | FragmentSpreadNode + | InlineFragmentNode + | FragmentDefinitionNode + | IntValueNode + | FloatValueNode + | StringValueNode + | BooleanValueNode + | NullValueNode + | EnumValueNode + | ListValueNode + | ObjectValueNode + | ObjectFieldNode + | DirectiveNode + | NamedTypeNode + | ListTypeNode + | NonNullTypeNode + | SchemaDefinitionNode + | OperationTypeDefinitionNode + | ScalarTypeDefinitionNode + | ObjectTypeDefinitionNode + | FieldDefinitionNode + | InputValueDefinitionNode + | InterfaceTypeDefinitionNode + | UnionTypeDefinitionNode + | EnumTypeDefinitionNode + | EnumValueDefinitionNode + | InputObjectTypeDefinitionNode + | DirectiveDefinitionNode + | SchemaExtensionNode + | ScalarTypeExtensionNode + | ObjectTypeExtensionNode + | InterfaceTypeExtensionNode + | UnionTypeExtensionNode + | EnumTypeExtensionNode + | InputObjectTypeExtensionNode; + +/** + * Utility type listing all nodes indexed by their kind. + */ +export type ASTKindToNode = { + [NodeT in ASTNode as NodeT['kind']]: NodeT; +}; + +/** + * @internal + */ +export const QueryDocumentKeys: { + [NodeT in ASTNode as NodeT['kind']]: ReadonlyArray; +} = { + Name: [], + + Document: ['definitions'], + OperationDefinition: [ + 'name', + 'variableDefinitions', + 'directives', + 'selectionSet', + ], + VariableDefinition: ['variable', 'type', 'defaultValue', 'directives'], + Variable: ['name'], + SelectionSet: ['selections'], + Field: ['alias', 'name', 'arguments', 'directives', 'selectionSet'], + Argument: ['name', 'value'], + + FragmentSpread: ['name', 'directives'], + InlineFragment: ['typeCondition', 'directives', 'selectionSet'], + FragmentDefinition: [ + 'name', + // Note: fragment variable definitions are deprecated and will removed in v17.0.0 + 'variableDefinitions', + 'typeCondition', + 'directives', + 'selectionSet', + ], + + IntValue: [], + FloatValue: [], + StringValue: [], + BooleanValue: [], + NullValue: [], + EnumValue: [], + ListValue: ['values'], + ObjectValue: ['fields'], + ObjectField: ['name', 'value'], + + Directive: ['name', 'arguments'], + + NamedType: ['name'], + ListType: ['type'], + NonNullType: ['type'], + + SchemaDefinition: ['description', 'directives', 'operationTypes'], + OperationTypeDefinition: ['type'], + + ScalarTypeDefinition: ['description', 'name', 'directives'], + ObjectTypeDefinition: [ + 'description', + 'name', + 'interfaces', + 'directives', + 'fields', + ], + FieldDefinition: ['description', 'name', 'arguments', 'type', 'directives'], + InputValueDefinition: [ + 'description', + 'name', + 'type', + 'defaultValue', + 'directives', + ], + InterfaceTypeDefinition: [ + 'description', + 'name', + 'interfaces', + 'directives', + 'fields', + ], + UnionTypeDefinition: ['description', 'name', 'directives', 'types'], + EnumTypeDefinition: ['description', 'name', 'directives', 'values'], + EnumValueDefinition: ['description', 'name', 'directives'], + InputObjectTypeDefinition: ['description', 'name', 'directives', 'fields'], + + DirectiveDefinition: ['description', 'name', 'arguments', 'locations'], + + SchemaExtension: ['directives', 'operationTypes'], + + ScalarTypeExtension: ['name', 'directives'], + ObjectTypeExtension: ['name', 'interfaces', 'directives', 'fields'], + InterfaceTypeExtension: ['name', 'interfaces', 'directives', 'fields'], + UnionTypeExtension: ['name', 'directives', 'types'], + EnumTypeExtension: ['name', 'directives', 'values'], + InputObjectTypeExtension: ['name', 'directives', 'fields'], +}; + +const kindValues = new Set(Object.keys(QueryDocumentKeys)); +/** + * @internal + */ +export function isNode(maybeNode: any): maybeNode is ASTNode { + const maybeKind = maybeNode?.kind; + return typeof maybeKind === 'string' && kindValues.has(maybeKind); +} + +/** Name */ + +export interface NameNode { + readonly kind: Kind.NAME; + readonly loc?: Location; + readonly value: string; +} + +/** Document */ + +export interface DocumentNode { + readonly kind: Kind.DOCUMENT; + readonly loc?: Location; + readonly definitions: ReadonlyArray; +} + +export type DefinitionNode = + | ExecutableDefinitionNode + | TypeSystemDefinitionNode + | TypeSystemExtensionNode; + +export type ExecutableDefinitionNode = + | OperationDefinitionNode + | FragmentDefinitionNode; + +export interface OperationDefinitionNode { + readonly kind: Kind.OPERATION_DEFINITION; + readonly loc?: Location; + readonly operation: OperationTypeNode; + readonly name?: NameNode; + readonly variableDefinitions?: ReadonlyArray; + readonly directives?: ReadonlyArray; + readonly selectionSet: SelectionSetNode; +} + +export enum OperationTypeNode { + QUERY = 'query', + MUTATION = 'mutation', + SUBSCRIPTION = 'subscription', +} + +export interface VariableDefinitionNode { + readonly kind: Kind.VARIABLE_DEFINITION; + readonly loc?: Location; + readonly variable: VariableNode; + readonly type: TypeNode; + readonly defaultValue?: ConstValueNode; + readonly directives?: ReadonlyArray; +} + +export interface VariableNode { + readonly kind: Kind.VARIABLE; + readonly loc?: Location; + readonly name: NameNode; +} + +export interface SelectionSetNode { + kind: Kind.SELECTION_SET; + loc?: Location; + selections: ReadonlyArray; +} + +export type SelectionNode = FieldNode | FragmentSpreadNode | InlineFragmentNode; + +export interface FieldNode { + readonly kind: Kind.FIELD; + readonly loc?: Location; + readonly alias?: NameNode; + readonly name: NameNode; + readonly arguments?: ReadonlyArray; + readonly directives?: ReadonlyArray; + readonly selectionSet?: SelectionSetNode; +} + +export interface ArgumentNode { + readonly kind: Kind.ARGUMENT; + readonly loc?: Location; + readonly name: NameNode; + readonly value: ValueNode; +} + +export interface ConstArgumentNode { + readonly kind: Kind.ARGUMENT; + readonly loc?: Location; + readonly name: NameNode; + readonly value: ConstValueNode; +} + +/** Fragments */ + +export interface FragmentSpreadNode { + readonly kind: Kind.FRAGMENT_SPREAD; + readonly loc?: Location; + readonly name: NameNode; + readonly directives?: ReadonlyArray; +} + +export interface InlineFragmentNode { + readonly kind: Kind.INLINE_FRAGMENT; + readonly loc?: Location; + readonly typeCondition?: NamedTypeNode; + readonly directives?: ReadonlyArray; + readonly selectionSet: SelectionSetNode; +} + +export interface FragmentDefinitionNode { + readonly kind: Kind.FRAGMENT_DEFINITION; + readonly loc?: Location; + readonly name: NameNode; + /** @deprecated variableDefinitions will be removed in v17.0.0 */ + readonly variableDefinitions?: ReadonlyArray; + readonly typeCondition: NamedTypeNode; + readonly directives?: ReadonlyArray; + readonly selectionSet: SelectionSetNode; +} + +/** Values */ + +export type ValueNode = + | VariableNode + | IntValueNode + | FloatValueNode + | StringValueNode + | BooleanValueNode + | NullValueNode + | EnumValueNode + | ListValueNode + | ObjectValueNode; + +export type ConstValueNode = + | IntValueNode + | FloatValueNode + | StringValueNode + | BooleanValueNode + | NullValueNode + | EnumValueNode + | ConstListValueNode + | ConstObjectValueNode; + +export interface IntValueNode { + readonly kind: Kind.INT; + readonly loc?: Location; + readonly value: string; +} + +export interface FloatValueNode { + readonly kind: Kind.FLOAT; + readonly loc?: Location; + readonly value: string; +} + +export interface StringValueNode { + readonly kind: Kind.STRING; + readonly loc?: Location; + readonly value: string; + readonly block?: boolean; +} + +export interface BooleanValueNode { + readonly kind: Kind.BOOLEAN; + readonly loc?: Location; + readonly value: boolean; +} + +export interface NullValueNode { + readonly kind: Kind.NULL; + readonly loc?: Location; +} + +export interface EnumValueNode { + readonly kind: Kind.ENUM; + readonly loc?: Location; + readonly value: string; +} + +export interface ListValueNode { + readonly kind: Kind.LIST; + readonly loc?: Location; + readonly values: ReadonlyArray; +} + +export interface ConstListValueNode { + readonly kind: Kind.LIST; + readonly loc?: Location; + readonly values: ReadonlyArray; +} + +export interface ObjectValueNode { + readonly kind: Kind.OBJECT; + readonly loc?: Location; + readonly fields: ReadonlyArray; +} + +export interface ConstObjectValueNode { + readonly kind: Kind.OBJECT; + readonly loc?: Location; + readonly fields: ReadonlyArray; +} + +export interface ObjectFieldNode { + readonly kind: Kind.OBJECT_FIELD; + readonly loc?: Location; + readonly name: NameNode; + readonly value: ValueNode; +} + +export interface ConstObjectFieldNode { + readonly kind: Kind.OBJECT_FIELD; + readonly loc?: Location; + readonly name: NameNode; + readonly value: ConstValueNode; +} + +/** Directives */ + +export interface DirectiveNode { + readonly kind: Kind.DIRECTIVE; + readonly loc?: Location; + readonly name: NameNode; + readonly arguments?: ReadonlyArray; +} + +export interface ConstDirectiveNode { + readonly kind: Kind.DIRECTIVE; + readonly loc?: Location; + readonly name: NameNode; + readonly arguments?: ReadonlyArray; +} + +/** Type Reference */ + +export type TypeNode = NamedTypeNode | ListTypeNode | NonNullTypeNode; + +export interface NamedTypeNode { + readonly kind: Kind.NAMED_TYPE; + readonly loc?: Location; + readonly name: NameNode; +} + +export interface ListTypeNode { + readonly kind: Kind.LIST_TYPE; + readonly loc?: Location; + readonly type: TypeNode; +} + +export interface NonNullTypeNode { + readonly kind: Kind.NON_NULL_TYPE; + readonly loc?: Location; + readonly type: NamedTypeNode | ListTypeNode; +} + +/** Type System Definition */ + +export type TypeSystemDefinitionNode = + | SchemaDefinitionNode + | TypeDefinitionNode + | DirectiveDefinitionNode; + +export interface SchemaDefinitionNode { + readonly kind: Kind.SCHEMA_DEFINITION; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly directives?: ReadonlyArray; + readonly operationTypes: ReadonlyArray; +} + +export interface OperationTypeDefinitionNode { + readonly kind: Kind.OPERATION_TYPE_DEFINITION; + readonly loc?: Location; + readonly operation: OperationTypeNode; + readonly type: NamedTypeNode; +} + +/** Type Definition */ + +export type TypeDefinitionNode = + | ScalarTypeDefinitionNode + | ObjectTypeDefinitionNode + | InterfaceTypeDefinitionNode + | UnionTypeDefinitionNode + | EnumTypeDefinitionNode + | InputObjectTypeDefinitionNode; + +export interface ScalarTypeDefinitionNode { + readonly kind: Kind.SCALAR_TYPE_DEFINITION; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly directives?: ReadonlyArray; +} + +export interface ObjectTypeDefinitionNode { + readonly kind: Kind.OBJECT_TYPE_DEFINITION; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly interfaces?: ReadonlyArray; + readonly directives?: ReadonlyArray; + readonly fields?: ReadonlyArray; +} + +export interface FieldDefinitionNode { + readonly kind: Kind.FIELD_DEFINITION; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly arguments?: ReadonlyArray; + readonly type: TypeNode; + readonly directives?: ReadonlyArray; +} + +export interface InputValueDefinitionNode { + readonly kind: Kind.INPUT_VALUE_DEFINITION; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly type: TypeNode; + readonly defaultValue?: ConstValueNode; + readonly directives?: ReadonlyArray; +} + +export interface InterfaceTypeDefinitionNode { + readonly kind: Kind.INTERFACE_TYPE_DEFINITION; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly interfaces?: ReadonlyArray; + readonly directives?: ReadonlyArray; + readonly fields?: ReadonlyArray; +} + +export interface UnionTypeDefinitionNode { + readonly kind: Kind.UNION_TYPE_DEFINITION; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly directives?: ReadonlyArray; + readonly types?: ReadonlyArray; +} + +export interface EnumTypeDefinitionNode { + readonly kind: Kind.ENUM_TYPE_DEFINITION; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly directives?: ReadonlyArray; + readonly values?: ReadonlyArray; +} + +export interface EnumValueDefinitionNode { + readonly kind: Kind.ENUM_VALUE_DEFINITION; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly directives?: ReadonlyArray; +} + +export interface InputObjectTypeDefinitionNode { + readonly kind: Kind.INPUT_OBJECT_TYPE_DEFINITION; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly directives?: ReadonlyArray; + readonly fields?: ReadonlyArray; +} + +/** Directive Definitions */ + +export interface DirectiveDefinitionNode { + readonly kind: Kind.DIRECTIVE_DEFINITION; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly arguments?: ReadonlyArray; + readonly repeatable: boolean; + readonly locations: ReadonlyArray; +} + +/** Type System Extensions */ + +export type TypeSystemExtensionNode = SchemaExtensionNode | TypeExtensionNode; + +export interface SchemaExtensionNode { + readonly kind: Kind.SCHEMA_EXTENSION; + readonly loc?: Location; + readonly directives?: ReadonlyArray; + readonly operationTypes?: ReadonlyArray; +} + +/** Type Extensions */ + +export type TypeExtensionNode = + | ScalarTypeExtensionNode + | ObjectTypeExtensionNode + | InterfaceTypeExtensionNode + | UnionTypeExtensionNode + | EnumTypeExtensionNode + | InputObjectTypeExtensionNode; + +export interface ScalarTypeExtensionNode { + readonly kind: Kind.SCALAR_TYPE_EXTENSION; + readonly loc?: Location; + readonly name: NameNode; + readonly directives?: ReadonlyArray; +} + +export interface ObjectTypeExtensionNode { + readonly kind: Kind.OBJECT_TYPE_EXTENSION; + readonly loc?: Location; + readonly name: NameNode; + readonly interfaces?: ReadonlyArray; + readonly directives?: ReadonlyArray; + readonly fields?: ReadonlyArray; +} + +export interface InterfaceTypeExtensionNode { + readonly kind: Kind.INTERFACE_TYPE_EXTENSION; + readonly loc?: Location; + readonly name: NameNode; + readonly interfaces?: ReadonlyArray; + readonly directives?: ReadonlyArray; + readonly fields?: ReadonlyArray; +} + +export interface UnionTypeExtensionNode { + readonly kind: Kind.UNION_TYPE_EXTENSION; + readonly loc?: Location; + readonly name: NameNode; + readonly directives?: ReadonlyArray; + readonly types?: ReadonlyArray; +} + +export interface EnumTypeExtensionNode { + readonly kind: Kind.ENUM_TYPE_EXTENSION; + readonly loc?: Location; + readonly name: NameNode; + readonly directives?: ReadonlyArray; + readonly values?: ReadonlyArray; +} + +export interface InputObjectTypeExtensionNode { + readonly kind: Kind.INPUT_OBJECT_TYPE_EXTENSION; + readonly loc?: Location; + readonly name: NameNode; + readonly directives?: ReadonlyArray; + readonly fields?: ReadonlyArray; +} diff --git a/src/language/blockString.ts b/src/language/blockString.ts new file mode 100644 index 00000000..1c200c18 --- /dev/null +++ b/src/language/blockString.ts @@ -0,0 +1,169 @@ +import { isWhiteSpace } from './characterClasses'; + +/** + * Produces the value of a block string from its parsed raw value, similar to + * CoffeeScript's block string, Python's docstring trim or Ruby's strip_heredoc. + * + * This implements the GraphQL spec's BlockStringValue() static algorithm. + * + * @internal + */ +export function dedentBlockStringLines( + lines: ReadonlyArray, +): Array { + let commonIndent = Number.MAX_SAFE_INTEGER; + let firstNonEmptyLine = null; + let lastNonEmptyLine = -1; + + for (let i = 0; i < lines.length; ++i) { + const line = lines[i]; + const indent = leadingWhitespace(line); + + if (indent === line.length) { + continue; // skip empty lines + } + + firstNonEmptyLine = firstNonEmptyLine ?? i; + lastNonEmptyLine = i; + + if (i !== 0 && indent < commonIndent) { + commonIndent = indent; + } + } + + return ( + lines + // Remove common indentation from all lines but first. + .map((line, i) => (i === 0 ? line : line.slice(commonIndent))) + // Remove leading and trailing blank lines. + .slice(firstNonEmptyLine ?? 0, lastNonEmptyLine + 1) + ); +} + +function leadingWhitespace(str: string): number { + let i = 0; + while (i < str.length && isWhiteSpace(str.charCodeAt(i))) { + ++i; + } + return i; +} + +/** + * @internal + */ +export function isPrintableAsBlockString(value: string): boolean { + if (value === '') { + return true; // empty string is printable + } + + let isEmptyLine = true; + let hasIndent = false; + let hasCommonIndent = true; + let seenNonEmptyLine = false; + + for (let i = 0; i < value.length; ++i) { + switch (value.codePointAt(i)) { + case 0x0000: + case 0x0001: + case 0x0002: + case 0x0003: + case 0x0004: + case 0x0005: + case 0x0006: + case 0x0007: + case 0x0008: + case 0x000b: + case 0x000c: + case 0x000e: + case 0x000f: + return false; // Has non-printable characters + + case 0x000d: // \r + return false; // Has \r or \r\n which will be replaced as \n + + case 10: // \n + if (isEmptyLine && !seenNonEmptyLine) { + return false; // Has leading new line + } + seenNonEmptyLine = true; + + isEmptyLine = true; + hasIndent = false; + break; + case 9: // \t + case 32: // + hasIndent ||= isEmptyLine; + break; + default: + hasCommonIndent &&= hasIndent; + isEmptyLine = false; + } + } + + if (isEmptyLine) { + return false; // Has trailing empty lines + } + + if (hasCommonIndent && seenNonEmptyLine) { + return false; // Has internal indent + } + + return true; +} + +/** + * Print a block string in the indented block form by adding a leading and + * trailing blank line. However, if a block string starts with whitespace and is + * a single-line, adding a leading blank line would strip that whitespace. + * + * @internal + */ +export function printBlockString( + value: string, + options?: { minimize?: boolean }, +): string { + const escapedValue = value.replace(/"""/g, '\\"""'); + + // Expand a block string's raw value into independent lines. + const lines = escapedValue.split(/\r\n|[\n\r]/g); + const isSingleLine = lines.length === 1; + + // If common indentation is found we can fix some of those cases by adding leading new line + const forceLeadingNewLine = + lines.length > 1 && + lines + .slice(1) + .every((line) => line.length === 0 || isWhiteSpace(line.charCodeAt(0))); + + // Trailing triple quotes just looks confusing but doesn't force trailing new line + const hasTrailingTripleQuotes = escapedValue.endsWith('\\"""'); + + // Trailing quote (single or double) or slash forces trailing new line + const hasTrailingQuote = value.endsWith('"') && !hasTrailingTripleQuotes; + const hasTrailingSlash = value.endsWith('\\'); + const forceTrailingNewline = hasTrailingQuote || hasTrailingSlash; + + const printAsMultipleLines = + !options?.minimize && + // add leading and trailing new lines only if it improves readability + (!isSingleLine || + value.length > 70 || + forceTrailingNewline || + forceLeadingNewLine || + hasTrailingTripleQuotes); + + let result = ''; + + // Format a multi-line block quote to account for leading space. + const skipLeadingNewLine = isSingleLine && isWhiteSpace(value.charCodeAt(0)); + if ((printAsMultipleLines && !skipLeadingNewLine) || forceLeadingNewLine) { + result += '\n'; + } + + result += escapedValue; + if (printAsMultipleLines || forceTrailingNewline) { + result += '\n'; + } + + return '"""' + result + '"""'; +} diff --git a/src/language/characterClasses.ts b/src/language/characterClasses.ts new file mode 100644 index 00000000..c1182d10 --- /dev/null +++ b/src/language/characterClasses.ts @@ -0,0 +1,64 @@ +/** + * ``` + * WhiteSpace :: + * - "Horizontal Tab (U+0009)" + * - "Space (U+0020)" + * ``` + * @internal + */ +export function isWhiteSpace(code: number): boolean { + return code === 0x0009 || code === 0x0020; +} + +/** + * ``` + * Digit :: one of + * - `0` `1` `2` `3` `4` `5` `6` `7` `8` `9` + * ``` + * @internal + */ +export function isDigit(code: number): boolean { + return code >= 0x0030 && code <= 0x0039; +} + +/** + * ``` + * Letter :: one of + * - `A` `B` `C` `D` `E` `F` `G` `H` `I` `J` `K` `L` `M` + * - `N` `O` `P` `Q` `R` `S` `T` `U` `V` `W` `X` `Y` `Z` + * - `a` `b` `c` `d` `e` `f` `g` `h` `i` `j` `k` `l` `m` + * - `n` `o` `p` `q` `r` `s` `t` `u` `v` `w` `x` `y` `z` + * ``` + * @internal + */ +export function isLetter(code: number): boolean { + return ( + (code >= 0x0061 && code <= 0x007a) || // A-Z + (code >= 0x0041 && code <= 0x005a) // a-z + ); +} + +/** + * ``` + * NameStart :: + * - Letter + * - `_` + * ``` + * @internal + */ +export function isNameStart(code: number): boolean { + return isLetter(code) || code === 0x005f; +} + +/** + * ``` + * NameContinue :: + * - Letter + * - Digit + * - `_` + * ``` + * @internal + */ +export function isNameContinue(code: number): boolean { + return isLetter(code) || isDigit(code) || code === 0x005f; +} diff --git a/src/language/directiveLocation.ts b/src/language/directiveLocation.ts new file mode 100644 index 00000000..e98ddf6d --- /dev/null +++ b/src/language/directiveLocation.ts @@ -0,0 +1,33 @@ +/** + * The set of allowed directive location values. + */ +export enum DirectiveLocation { + /** Request Definitions */ + QUERY = 'QUERY', + MUTATION = 'MUTATION', + SUBSCRIPTION = 'SUBSCRIPTION', + FIELD = 'FIELD', + FRAGMENT_DEFINITION = 'FRAGMENT_DEFINITION', + FRAGMENT_SPREAD = 'FRAGMENT_SPREAD', + INLINE_FRAGMENT = 'INLINE_FRAGMENT', + VARIABLE_DEFINITION = 'VARIABLE_DEFINITION', + /** Type System Definitions */ + SCHEMA = 'SCHEMA', + SCALAR = 'SCALAR', + OBJECT = 'OBJECT', + FIELD_DEFINITION = 'FIELD_DEFINITION', + ARGUMENT_DEFINITION = 'ARGUMENT_DEFINITION', + INTERFACE = 'INTERFACE', + UNION = 'UNION', + ENUM = 'ENUM', + ENUM_VALUE = 'ENUM_VALUE', + INPUT_OBJECT = 'INPUT_OBJECT', + INPUT_FIELD_DEFINITION = 'INPUT_FIELD_DEFINITION', +} + +/** + * The enum type representing the directive location values. + * + * @deprecated Please use `DirectiveLocation`. Will be remove in v17. + */ +export type DirectiveLocationEnum = typeof DirectiveLocation; diff --git a/src/language/index.ts b/src/language/index.ts new file mode 100644 index 00000000..ec4d195e --- /dev/null +++ b/src/language/index.ts @@ -0,0 +1,109 @@ +export { Source } from './source'; + +export { getLocation } from './location'; +export type { SourceLocation } from './location'; + +export { printLocation, printSourceLocation } from './printLocation'; + +export { Kind } from './kinds'; +export type { KindEnum } from './kinds'; + +export { TokenKind } from './tokenKind'; +export type { TokenKindEnum } from './tokenKind'; + +export { Lexer } from './lexer'; + +export { parse, parseValue, parseConstValue, parseType } from './parser'; +export type { ParseOptions } from './parser'; + +export { print } from './printer'; + +export { + visit, + visitInParallel, + getVisitFn, + getEnterLeaveForKind, + BREAK, +} from './visitor'; +export type { ASTVisitor, ASTVisitFn, ASTVisitorKeyMap } from './visitor'; + +export { Location, Token, OperationTypeNode } from './ast'; +export type { + ASTNode, + ASTKindToNode, + // Each kind of AST node + NameNode, + DocumentNode, + DefinitionNode, + ExecutableDefinitionNode, + OperationDefinitionNode, + VariableDefinitionNode, + VariableNode, + SelectionSetNode, + SelectionNode, + FieldNode, + ArgumentNode, + ConstArgumentNode, + FragmentSpreadNode, + InlineFragmentNode, + FragmentDefinitionNode, + ValueNode, + ConstValueNode, + IntValueNode, + FloatValueNode, + StringValueNode, + BooleanValueNode, + NullValueNode, + EnumValueNode, + ListValueNode, + ConstListValueNode, + ObjectValueNode, + ConstObjectValueNode, + ObjectFieldNode, + ConstObjectFieldNode, + DirectiveNode, + ConstDirectiveNode, + TypeNode, + NamedTypeNode, + ListTypeNode, + NonNullTypeNode, + TypeSystemDefinitionNode, + SchemaDefinitionNode, + OperationTypeDefinitionNode, + TypeDefinitionNode, + ScalarTypeDefinitionNode, + ObjectTypeDefinitionNode, + FieldDefinitionNode, + InputValueDefinitionNode, + InterfaceTypeDefinitionNode, + UnionTypeDefinitionNode, + EnumTypeDefinitionNode, + EnumValueDefinitionNode, + InputObjectTypeDefinitionNode, + DirectiveDefinitionNode, + TypeSystemExtensionNode, + SchemaExtensionNode, + TypeExtensionNode, + ScalarTypeExtensionNode, + ObjectTypeExtensionNode, + InterfaceTypeExtensionNode, + UnionTypeExtensionNode, + EnumTypeExtensionNode, + InputObjectTypeExtensionNode, +} from './ast'; + +export { + isDefinitionNode, + isExecutableDefinitionNode, + isSelectionNode, + isValueNode, + isConstValueNode, + isTypeNode, + isTypeSystemDefinitionNode, + isTypeDefinitionNode, + isTypeSystemExtensionNode, + isTypeExtensionNode, +} from './predicates'; + +export { DirectiveLocation } from './directiveLocation'; +export type { DirectiveLocationEnum } from './directiveLocation'; diff --git a/src/language/kinds.ts b/src/language/kinds.ts new file mode 100644 index 00000000..39b2a8e6 --- /dev/null +++ b/src/language/kinds.ts @@ -0,0 +1,76 @@ +/** + * The set of allowed kind values for AST nodes. + */ +export enum Kind { + /** Name */ + NAME = 'Name', + + /** Document */ + DOCUMENT = 'Document', + OPERATION_DEFINITION = 'OperationDefinition', + VARIABLE_DEFINITION = 'VariableDefinition', + SELECTION_SET = 'SelectionSet', + FIELD = 'Field', + ARGUMENT = 'Argument', + + /** Fragments */ + FRAGMENT_SPREAD = 'FragmentSpread', + INLINE_FRAGMENT = 'InlineFragment', + FRAGMENT_DEFINITION = 'FragmentDefinition', + + /** Values */ + VARIABLE = 'Variable', + INT = 'IntValue', + FLOAT = 'FloatValue', + STRING = 'StringValue', + BOOLEAN = 'BooleanValue', + NULL = 'NullValue', + ENUM = 'EnumValue', + LIST = 'ListValue', + OBJECT = 'ObjectValue', + OBJECT_FIELD = 'ObjectField', + + /** Directives */ + DIRECTIVE = 'Directive', + + /** Types */ + NAMED_TYPE = 'NamedType', + LIST_TYPE = 'ListType', + NON_NULL_TYPE = 'NonNullType', + + /** Type System Definitions */ + SCHEMA_DEFINITION = 'SchemaDefinition', + OPERATION_TYPE_DEFINITION = 'OperationTypeDefinition', + + /** Type Definitions */ + SCALAR_TYPE_DEFINITION = 'ScalarTypeDefinition', + OBJECT_TYPE_DEFINITION = 'ObjectTypeDefinition', + FIELD_DEFINITION = 'FieldDefinition', + INPUT_VALUE_DEFINITION = 'InputValueDefinition', + INTERFACE_TYPE_DEFINITION = 'InterfaceTypeDefinition', + UNION_TYPE_DEFINITION = 'UnionTypeDefinition', + ENUM_TYPE_DEFINITION = 'EnumTypeDefinition', + ENUM_VALUE_DEFINITION = 'EnumValueDefinition', + INPUT_OBJECT_TYPE_DEFINITION = 'InputObjectTypeDefinition', + + /** Directive Definitions */ + DIRECTIVE_DEFINITION = 'DirectiveDefinition', + + /** Type System Extensions */ + SCHEMA_EXTENSION = 'SchemaExtension', + + /** Type Extensions */ + SCALAR_TYPE_EXTENSION = 'ScalarTypeExtension', + OBJECT_TYPE_EXTENSION = 'ObjectTypeExtension', + INTERFACE_TYPE_EXTENSION = 'InterfaceTypeExtension', + UNION_TYPE_EXTENSION = 'UnionTypeExtension', + ENUM_TYPE_EXTENSION = 'EnumTypeExtension', + INPUT_OBJECT_TYPE_EXTENSION = 'InputObjectTypeExtension', +} + +/** + * The enum type representing the possible kind values of AST nodes. + * + * @deprecated Please use `Kind`. Will be remove in v17. + */ +export type KindEnum = typeof Kind; diff --git a/src/language/lexer.ts b/src/language/lexer.ts new file mode 100644 index 00000000..818f81b2 --- /dev/null +++ b/src/language/lexer.ts @@ -0,0 +1,854 @@ +import { syntaxError } from '../error/syntaxError'; + +import { Token } from './ast'; +import { dedentBlockStringLines } from './blockString'; +import { isDigit, isNameContinue, isNameStart } from './characterClasses'; +import type { Source } from './source'; +import { TokenKind } from './tokenKind'; + +/** + * Given a Source object, creates a Lexer for that source. + * A Lexer is a stateful stream generator in that every time + * it is advanced, it returns the next token in the Source. Assuming the + * source lexes, the final Token emitted by the lexer will be of kind + * EOF, after which the lexer will repeatedly return the same EOF token + * whenever called. + */ +export class Lexer { + source: Source; + + /** + * The previously focused non-ignored token. + */ + lastToken: Token; + + /** + * The currently focused non-ignored token. + */ + token: Token; + + /** + * The (1-indexed) line containing the current token. + */ + line: number; + + /** + * The character offset at which the current line begins. + */ + lineStart: number; + + constructor(source: Source) { + const startOfFileToken = new Token(TokenKind.SOF, 0, 0, 0, 0); + + this.source = source; + this.lastToken = startOfFileToken; + this.token = startOfFileToken; + this.line = 1; + this.lineStart = 0; + } + + get [Symbol.toStringTag]() { + return 'Lexer'; + } + + /** + * Advances the token stream to the next non-ignored token. + */ + advance(): Token { + this.lastToken = this.token; + const token = (this.token = this.lookahead()); + return token; + } + + /** + * Looks ahead and returns the next non-ignored token, but does not change + * the state of Lexer. + */ + lookahead(): Token { + let token = this.token; + if (token.kind !== TokenKind.EOF) { + do { + if (token.next) { + token = token.next; + } else { + // Read the next token and form a link in the token linked-list. + const nextToken = readNextToken(this, token.end); + // @ts-expect-error next is only mutable during parsing. + token.next = nextToken; + // @ts-expect-error prev is only mutable during parsing. + nextToken.prev = token; + token = nextToken; + } + } while (token.kind === TokenKind.COMMENT); + } + return token; + } +} + +/** + * @internal + */ +export function isPunctuatorTokenKind(kind: TokenKind): boolean { + return ( + kind === TokenKind.BANG || + kind === TokenKind.DOLLAR || + kind === TokenKind.AMP || + kind === TokenKind.PAREN_L || + kind === TokenKind.PAREN_R || + kind === TokenKind.SPREAD || + kind === TokenKind.COLON || + kind === TokenKind.EQUALS || + kind === TokenKind.AT || + kind === TokenKind.BRACKET_L || + kind === TokenKind.BRACKET_R || + kind === TokenKind.BRACE_L || + kind === TokenKind.PIPE || + kind === TokenKind.BRACE_R + ); +} + +/** + * A Unicode scalar value is any Unicode code point except surrogate code + * points. In other words, the inclusive ranges of values 0x0000 to 0xD7FF and + * 0xE000 to 0x10FFFF. + * + * SourceCharacter :: + * - "Any Unicode scalar value" + */ +function isUnicodeScalarValue(code: number): boolean { + return ( + (code >= 0x0000 && code <= 0xd7ff) || (code >= 0xe000 && code <= 0x10ffff) + ); +} + +/** + * The GraphQL specification defines source text as a sequence of unicode scalar + * values (which Unicode defines to exclude surrogate code points). However + * JavaScript defines strings as a sequence of UTF-16 code units which may + * include surrogates. A surrogate pair is a valid source character as it + * encodes a supplementary code point (above U+FFFF), but unpaired surrogate + * code points are not valid source characters. + */ +function isSupplementaryCodePoint(body: string, location: number): boolean { + return ( + isLeadingSurrogate(body.charCodeAt(location)) && + isTrailingSurrogate(body.charCodeAt(location + 1)) + ); +} + +function isLeadingSurrogate(code: number): boolean { + return code >= 0xd800 && code <= 0xdbff; +} + +function isTrailingSurrogate(code: number): boolean { + return code >= 0xdc00 && code <= 0xdfff; +} + +/** + * Prints the code point (or end of file reference) at a given location in a + * source for use in error messages. + * + * Printable ASCII is printed quoted, while other points are printed in Unicode + * code point form (ie. U+1234). + */ +function printCodePointAt(lexer: Lexer, location: number): string { + const code = lexer.source.body.codePointAt(location); + + if (code === undefined) { + return TokenKind.EOF; + } else if (code >= 0x0020 && code <= 0x007e) { + // Printable ASCII + const char = String.fromCodePoint(code); + return char === '"' ? "'\"'" : `"${char}"`; + } + + // Unicode code point + return 'U+' + code.toString(16).toUpperCase().padStart(4, '0'); +} + +/** + * Create a token with line and column location information. + */ +function createToken( + lexer: Lexer, + kind: TokenKind, + start: number, + end: number, + value?: string, +): Token { + const line = lexer.line; + const col = 1 + start - lexer.lineStart; + return new Token(kind, start, end, line, col, value); +} + +/** + * Gets the next token from the source starting at the given position. + * + * This skips over whitespace until it finds the next lexable token, then lexes + * punctuators immediately or calls the appropriate helper function for more + * complicated tokens. + */ +function readNextToken(lexer: Lexer, start: number): Token { + const body = lexer.source.body; + const bodyLength = body.length; + let position = start; + + while (position < bodyLength) { + const code = body.charCodeAt(position); + + // SourceCharacter + switch (code) { + // Ignored :: + // - UnicodeBOM + // - WhiteSpace + // - LineTerminator + // - Comment + // - Comma + // + // UnicodeBOM :: "Byte Order Mark (U+FEFF)" + // + // WhiteSpace :: + // - "Horizontal Tab (U+0009)" + // - "Space (U+0020)" + // + // Comma :: , + case 0xfeff: // + case 0x0009: // \t + case 0x0020: // + case 0x002c: // , + ++position; + continue; + // LineTerminator :: + // - "New Line (U+000A)" + // - "Carriage Return (U+000D)" [lookahead != "New Line (U+000A)"] + // - "Carriage Return (U+000D)" "New Line (U+000A)" + case 0x000a: // \n + ++position; + ++lexer.line; + lexer.lineStart = position; + continue; + case 0x000d: // \r + if (body.charCodeAt(position + 1) === 0x000a) { + position += 2; + } else { + ++position; + } + ++lexer.line; + lexer.lineStart = position; + continue; + // Comment + case 0x0023: // # + return readComment(lexer, position); + // Token :: + // - Punctuator + // - Name + // - IntValue + // - FloatValue + // - StringValue + // + // Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | } + case 0x0021: // ! + return createToken(lexer, TokenKind.BANG, position, position + 1); + case 0x0024: // $ + return createToken(lexer, TokenKind.DOLLAR, position, position + 1); + case 0x0026: // & + return createToken(lexer, TokenKind.AMP, position, position + 1); + case 0x0028: // ( + return createToken(lexer, TokenKind.PAREN_L, position, position + 1); + case 0x0029: // ) + return createToken(lexer, TokenKind.PAREN_R, position, position + 1); + case 0x002e: // . + if ( + body.charCodeAt(position + 1) === 0x002e && + body.charCodeAt(position + 2) === 0x002e + ) { + return createToken(lexer, TokenKind.SPREAD, position, position + 3); + } + break; + case 0x003a: // : + return createToken(lexer, TokenKind.COLON, position, position + 1); + case 0x003d: // = + return createToken(lexer, TokenKind.EQUALS, position, position + 1); + case 0x0040: // @ + return createToken(lexer, TokenKind.AT, position, position + 1); + case 0x005b: // [ + return createToken(lexer, TokenKind.BRACKET_L, position, position + 1); + case 0x005d: // ] + return createToken(lexer, TokenKind.BRACKET_R, position, position + 1); + case 0x007b: // { + return createToken(lexer, TokenKind.BRACE_L, position, position + 1); + case 0x007c: // | + return createToken(lexer, TokenKind.PIPE, position, position + 1); + case 0x007d: // } + return createToken(lexer, TokenKind.BRACE_R, position, position + 1); + // StringValue + case 0x0022: // " + if ( + body.charCodeAt(position + 1) === 0x0022 && + body.charCodeAt(position + 2) === 0x0022 + ) { + return readBlockString(lexer, position); + } + return readString(lexer, position); + } + + // IntValue | FloatValue (Digit | -) + if (isDigit(code) || code === 0x002d) { + return readNumber(lexer, position, code); + } + + // Name + if (isNameStart(code)) { + return readName(lexer, position); + } + + throw syntaxError( + lexer.source, + position, + code === 0x0027 + ? 'Unexpected single quote character (\'), did you mean to use a double quote (")?' + : isUnicodeScalarValue(code) || isSupplementaryCodePoint(body, position) + ? `Unexpected character: ${printCodePointAt(lexer, position)}.` + : `Invalid character: ${printCodePointAt(lexer, position)}.`, + ); + } + + return createToken(lexer, TokenKind.EOF, bodyLength, bodyLength); +} + +/** + * Reads a comment token from the source file. + * + * ``` + * Comment :: # CommentChar* [lookahead != CommentChar] + * + * CommentChar :: SourceCharacter but not LineTerminator + * ``` + */ +function readComment(lexer: Lexer, start: number): Token { + const body = lexer.source.body; + const bodyLength = body.length; + let position = start + 1; + + while (position < bodyLength) { + const code = body.charCodeAt(position); + + // LineTerminator (\n | \r) + if (code === 0x000a || code === 0x000d) { + break; + } + + // SourceCharacter + if (isUnicodeScalarValue(code)) { + ++position; + } else if (isSupplementaryCodePoint(body, position)) { + position += 2; + } else { + break; + } + } + + return createToken( + lexer, + TokenKind.COMMENT, + start, + position, + body.slice(start + 1, position), + ); +} + +/** + * Reads a number token from the source file, either a FloatValue or an IntValue + * depending on whether a FractionalPart or ExponentPart is encountered. + * + * ``` + * IntValue :: IntegerPart [lookahead != {Digit, `.`, NameStart}] + * + * IntegerPart :: + * - NegativeSign? 0 + * - NegativeSign? NonZeroDigit Digit* + * + * NegativeSign :: - + * + * NonZeroDigit :: Digit but not `0` + * + * FloatValue :: + * - IntegerPart FractionalPart ExponentPart [lookahead != {Digit, `.`, NameStart}] + * - IntegerPart FractionalPart [lookahead != {Digit, `.`, NameStart}] + * - IntegerPart ExponentPart [lookahead != {Digit, `.`, NameStart}] + * + * FractionalPart :: . Digit+ + * + * ExponentPart :: ExponentIndicator Sign? Digit+ + * + * ExponentIndicator :: one of `e` `E` + * + * Sign :: one of + - + * ``` + */ +function readNumber(lexer: Lexer, start: number, firstCode: number): Token { + const body = lexer.source.body; + let position = start; + let code = firstCode; + let isFloat = false; + + // NegativeSign (-) + if (code === 0x002d) { + code = body.charCodeAt(++position); + } + + // Zero (0) + if (code === 0x0030) { + code = body.charCodeAt(++position); + if (isDigit(code)) { + throw syntaxError( + lexer.source, + position, + `Invalid number, unexpected digit after 0: ${printCodePointAt( + lexer, + position, + )}.`, + ); + } + } else { + position = readDigits(lexer, position, code); + code = body.charCodeAt(position); + } + + // Full stop (.) + if (code === 0x002e) { + isFloat = true; + + code = body.charCodeAt(++position); + position = readDigits(lexer, position, code); + code = body.charCodeAt(position); + } + + // E e + if (code === 0x0045 || code === 0x0065) { + isFloat = true; + + code = body.charCodeAt(++position); + // + - + if (code === 0x002b || code === 0x002d) { + code = body.charCodeAt(++position); + } + position = readDigits(lexer, position, code); + code = body.charCodeAt(position); + } + + // Numbers cannot be followed by . or NameStart + if (code === 0x002e || isNameStart(code)) { + throw syntaxError( + lexer.source, + position, + `Invalid number, expected digit but got: ${printCodePointAt( + lexer, + position, + )}.`, + ); + } + + return createToken( + lexer, + isFloat ? TokenKind.FLOAT : TokenKind.INT, + start, + position, + body.slice(start, position), + ); +} + +/** + * Returns the new position in the source after reading one or more digits. + */ +function readDigits(lexer: Lexer, start: number, firstCode: number): number { + if (!isDigit(firstCode)) { + throw syntaxError( + lexer.source, + start, + `Invalid number, expected digit but got: ${printCodePointAt( + lexer, + start, + )}.`, + ); + } + + const body = lexer.source.body; + let position = start + 1; // +1 to skip first firstCode + + while (isDigit(body.charCodeAt(position))) { + ++position; + } + + return position; +} + +/** + * Reads a single-quote string token from the source file. + * + * ``` + * StringValue :: + * - `""` [lookahead != `"`] + * - `"` StringCharacter+ `"` + * + * StringCharacter :: + * - SourceCharacter but not `"` or `\` or LineTerminator + * - `\u` EscapedUnicode + * - `\` EscapedCharacter + * + * EscapedUnicode :: + * - `{` HexDigit+ `}` + * - HexDigit HexDigit HexDigit HexDigit + * + * EscapedCharacter :: one of `"` `\` `/` `b` `f` `n` `r` `t` + * ``` + */ +function readString(lexer: Lexer, start: number): Token { + const body = lexer.source.body; + const bodyLength = body.length; + let position = start + 1; + let chunkStart = position; + let value = ''; + + while (position < bodyLength) { + const code = body.charCodeAt(position); + + // Closing Quote (") + if (code === 0x0022) { + value += body.slice(chunkStart, position); + return createToken(lexer, TokenKind.STRING, start, position + 1, value); + } + + // Escape Sequence (\) + if (code === 0x005c) { + value += body.slice(chunkStart, position); + const escape = + body.charCodeAt(position + 1) === 0x0075 // u + ? body.charCodeAt(position + 2) === 0x007b // { + ? readEscapedUnicodeVariableWidth(lexer, position) + : readEscapedUnicodeFixedWidth(lexer, position) + : readEscapedCharacter(lexer, position); + value += escape.value; + position += escape.size; + chunkStart = position; + continue; + } + + // LineTerminator (\n | \r) + if (code === 0x000a || code === 0x000d) { + break; + } + + // SourceCharacter + if (isUnicodeScalarValue(code)) { + ++position; + } else if (isSupplementaryCodePoint(body, position)) { + position += 2; + } else { + throw syntaxError( + lexer.source, + position, + `Invalid character within String: ${printCodePointAt( + lexer, + position, + )}.`, + ); + } + } + + throw syntaxError(lexer.source, position, 'Unterminated string.'); +} + +// The string value and lexed size of an escape sequence. +interface EscapeSequence { + value: string; + size: number; +} + +function readEscapedUnicodeVariableWidth( + lexer: Lexer, + position: number, +): EscapeSequence { + const body = lexer.source.body; + let point = 0; + let size = 3; + // Cannot be larger than 12 chars (\u{00000000}). + while (size < 12) { + const code = body.charCodeAt(position + size++); + // Closing Brace (}) + if (code === 0x007d) { + // Must be at least 5 chars (\u{0}) and encode a Unicode scalar value. + if (size < 5 || !isUnicodeScalarValue(point)) { + break; + } + return { value: String.fromCodePoint(point), size }; + } + // Append this hex digit to the code point. + point = (point << 4) | readHexDigit(code); + if (point < 0) { + break; + } + } + + throw syntaxError( + lexer.source, + position, + `Invalid Unicode escape sequence: "${body.slice( + position, + position + size, + )}".`, + ); +} + +function readEscapedUnicodeFixedWidth( + lexer: Lexer, + position: number, +): EscapeSequence { + const body = lexer.source.body; + const code = read16BitHexCode(body, position + 2); + + if (isUnicodeScalarValue(code)) { + return { value: String.fromCodePoint(code), size: 6 }; + } + + // GraphQL allows JSON-style surrogate pair escape sequences, but only when + // a valid pair is formed. + if (isLeadingSurrogate(code)) { + // \u + if ( + body.charCodeAt(position + 6) === 0x005c && + body.charCodeAt(position + 7) === 0x0075 + ) { + const trailingCode = read16BitHexCode(body, position + 8); + if (isTrailingSurrogate(trailingCode)) { + // JavaScript defines strings as a sequence of UTF-16 code units and + // encodes Unicode code points above U+FFFF using a surrogate pair of + // code units. Since this is a surrogate pair escape sequence, just + // include both codes into the JavaScript string value. Had JavaScript + // not been internally based on UTF-16, then this surrogate pair would + // be decoded to retrieve the supplementary code point. + return { value: String.fromCodePoint(code, trailingCode), size: 12 }; + } + } + } + + throw syntaxError( + lexer.source, + position, + `Invalid Unicode escape sequence: "${body.slice(position, position + 6)}".`, + ); +} + +/** + * Reads four hexadecimal characters and returns the positive integer that 16bit + * hexadecimal string represents. For example, "000f" will return 15, and "dead" + * will return 57005. + * + * Returns a negative number if any char was not a valid hexadecimal digit. + */ +function read16BitHexCode(body: string, position: number): number { + // readHexDigit() returns -1 on error. ORing a negative value with any other + // value always produces a negative value. + return ( + (readHexDigit(body.charCodeAt(position)) << 12) | + (readHexDigit(body.charCodeAt(position + 1)) << 8) | + (readHexDigit(body.charCodeAt(position + 2)) << 4) | + readHexDigit(body.charCodeAt(position + 3)) + ); +} + +/** + * Reads a hexadecimal character and returns its positive integer value (0-15). + * + * '0' becomes 0, '9' becomes 9 + * 'A' becomes 10, 'F' becomes 15 + * 'a' becomes 10, 'f' becomes 15 + * + * Returns -1 if the provided character code was not a valid hexadecimal digit. + * + * HexDigit :: one of + * - `0` `1` `2` `3` `4` `5` `6` `7` `8` `9` + * - `A` `B` `C` `D` `E` `F` + * - `a` `b` `c` `d` `e` `f` + */ +function readHexDigit(code: number): number { + return code >= 0x0030 && code <= 0x0039 // 0-9 + ? code - 0x0030 + : code >= 0x0041 && code <= 0x0046 // A-F + ? code - 0x0037 + : code >= 0x0061 && code <= 0x0066 // a-f + ? code - 0x0057 + : -1; +} + +/** + * | Escaped Character | Code Point | Character Name | + * | ----------------- | ---------- | ---------------------------- | + * | `"` | U+0022 | double quote | + * | `\` | U+005C | reverse solidus (back slash) | + * | `/` | U+002F | solidus (forward slash) | + * | `b` | U+0008 | backspace | + * | `f` | U+000C | form feed | + * | `n` | U+000A | line feed (new line) | + * | `r` | U+000D | carriage return | + * | `t` | U+0009 | horizontal tab | + */ +function readEscapedCharacter(lexer: Lexer, position: number): EscapeSequence { + const body = lexer.source.body; + const code = body.charCodeAt(position + 1); + switch (code) { + case 0x0022: // " + return { value: '\u0022', size: 2 }; + case 0x005c: // \ + return { value: '\u005c', size: 2 }; + case 0x002f: // / + return { value: '\u002f', size: 2 }; + case 0x0062: // b + return { value: '\u0008', size: 2 }; + case 0x0066: // f + return { value: '\u000c', size: 2 }; + case 0x006e: // n + return { value: '\u000a', size: 2 }; + case 0x0072: // r + return { value: '\u000d', size: 2 }; + case 0x0074: // t + return { value: '\u0009', size: 2 }; + } + throw syntaxError( + lexer.source, + position, + `Invalid character escape sequence: "${body.slice( + position, + position + 2, + )}".`, + ); +} + +/** + * Reads a block string token from the source file. + * + * ``` + * StringValue :: + * - `"""` BlockStringCharacter* `"""` + * + * BlockStringCharacter :: + * - SourceCharacter but not `"""` or `\"""` + * - `\"""` + * ``` + */ +function readBlockString(lexer: Lexer, start: number): Token { + const body = lexer.source.body; + const bodyLength = body.length; + let lineStart = lexer.lineStart; + + let position = start + 3; + let chunkStart = position; + let currentLine = ''; + + const blockLines = []; + while (position < bodyLength) { + const code = body.charCodeAt(position); + + // Closing Triple-Quote (""") + if ( + code === 0x0022 && + body.charCodeAt(position + 1) === 0x0022 && + body.charCodeAt(position + 2) === 0x0022 + ) { + currentLine += body.slice(chunkStart, position); + blockLines.push(currentLine); + + const token = createToken( + lexer, + TokenKind.BLOCK_STRING, + start, + position + 3, + // Return a string of the lines joined with U+000A. + dedentBlockStringLines(blockLines).join('\n'), + ); + + lexer.line += blockLines.length - 1; + lexer.lineStart = lineStart; + return token; + } + + // Escaped Triple-Quote (\""") + if ( + code === 0x005c && + body.charCodeAt(position + 1) === 0x0022 && + body.charCodeAt(position + 2) === 0x0022 && + body.charCodeAt(position + 3) === 0x0022 + ) { + currentLine += body.slice(chunkStart, position); + chunkStart = position + 1; // skip only slash + position += 4; + continue; + } + + // LineTerminator + if (code === 0x000a || code === 0x000d) { + currentLine += body.slice(chunkStart, position); + blockLines.push(currentLine); + + if (code === 0x000d && body.charCodeAt(position + 1) === 0x000a) { + position += 2; + } else { + ++position; + } + + currentLine = ''; + chunkStart = position; + lineStart = position; + continue; + } + + // SourceCharacter + if (isUnicodeScalarValue(code)) { + ++position; + } else if (isSupplementaryCodePoint(body, position)) { + position += 2; + } else { + throw syntaxError( + lexer.source, + position, + `Invalid character within String: ${printCodePointAt( + lexer, + position, + )}.`, + ); + } + } + + throw syntaxError(lexer.source, position, 'Unterminated string.'); +} + +/** + * Reads an alphanumeric + underscore name from the source. + * + * ``` + * Name :: + * - NameStart NameContinue* [lookahead != NameContinue] + * ``` + */ +function readName(lexer: Lexer, start: number): Token { + const body = lexer.source.body; + const bodyLength = body.length; + let position = start + 1; + + while (position < bodyLength) { + const code = body.charCodeAt(position); + if (isNameContinue(code)) { + ++position; + } else { + break; + } + } + + return createToken( + lexer, + TokenKind.NAME, + start, + position, + body.slice(start, position), + ); +} diff --git a/src/language/location.ts b/src/language/location.ts new file mode 100644 index 00000000..36d97f3c --- /dev/null +++ b/src/language/location.ts @@ -0,0 +1,33 @@ +import { invariant } from '../jsutils/invariant'; + +import type { Source } from './source'; + +const LineRegExp = /\r\n|[\n\r]/g; + +/** + * Represents a location in a Source. + */ +export interface SourceLocation { + readonly line: number; + readonly column: number; +} + +/** + * Takes a Source and a UTF-8 character offset, and returns the corresponding + * line and column as a SourceLocation. + */ +export function getLocation(source: Source, position: number): SourceLocation { + let lastLineStart = 0; + let line = 1; + + for (const match of source.body.matchAll(LineRegExp)) { + invariant(typeof match.index === 'number'); + if (match.index >= position) { + break; + } + lastLineStart = match.index + match[0].length; + line += 1; + } + + return { line, column: position + 1 - lastLineStart }; +} diff --git a/src/language/parser.ts b/src/language/parser.ts new file mode 100644 index 00000000..282ee168 --- /dev/null +++ b/src/language/parser.ts @@ -0,0 +1,1566 @@ +import type { Maybe } from '../jsutils/Maybe'; + +import type { GraphQLError } from '../error/GraphQLError'; +import { syntaxError } from '../error/syntaxError'; + +import type { + ArgumentNode, + BooleanValueNode, + ConstArgumentNode, + ConstDirectiveNode, + ConstListValueNode, + ConstObjectFieldNode, + ConstObjectValueNode, + ConstValueNode, + DefinitionNode, + DirectiveDefinitionNode, + DirectiveNode, + DocumentNode, + EnumTypeDefinitionNode, + EnumTypeExtensionNode, + EnumValueDefinitionNode, + EnumValueNode, + FieldDefinitionNode, + FieldNode, + FloatValueNode, + FragmentDefinitionNode, + FragmentSpreadNode, + InlineFragmentNode, + InputObjectTypeDefinitionNode, + InputObjectTypeExtensionNode, + InputValueDefinitionNode, + InterfaceTypeDefinitionNode, + InterfaceTypeExtensionNode, + IntValueNode, + ListTypeNode, + ListValueNode, + NamedTypeNode, + NameNode, + NonNullTypeNode, + NullValueNode, + ObjectFieldNode, + ObjectTypeDefinitionNode, + ObjectTypeExtensionNode, + ObjectValueNode, + OperationDefinitionNode, + OperationTypeDefinitionNode, + ScalarTypeDefinitionNode, + ScalarTypeExtensionNode, + SchemaDefinitionNode, + SchemaExtensionNode, + SelectionNode, + SelectionSetNode, + StringValueNode, + Token, + TypeNode, + TypeSystemExtensionNode, + UnionTypeDefinitionNode, + UnionTypeExtensionNode, + ValueNode, + VariableDefinitionNode, + VariableNode, +} from './ast'; +import { Location, OperationTypeNode } from './ast'; +import { DirectiveLocation } from './directiveLocation'; +import { Kind } from './kinds'; +import { isPunctuatorTokenKind, Lexer } from './lexer'; +import { isSource, Source } from './source'; +import { TokenKind } from './tokenKind'; + +/** + * Configuration options to control parser behavior + */ +export interface ParseOptions { + /** + * By default, the parser creates AST nodes that know the location + * in the source that they correspond to. This configuration flag + * disables that behavior for performance or testing. + */ + noLocation?: boolean; + + /** + * @deprecated will be removed in the v17.0.0 + * + * If enabled, the parser will understand and parse variable definitions + * contained in a fragment definition. They'll be represented in the + * `variableDefinitions` field of the FragmentDefinitionNode. + * + * The syntax is identical to normal, query-defined variables. For example: + * + * ```graphql + * fragment A($var: Boolean = false) on T { + * ... + * } + * ``` + */ + allowLegacyFragmentVariables?: boolean; +} + +/** + * Given a GraphQL source, parses it into a Document. + * Throws GraphQLError if a syntax error is encountered. + */ +export function parse( + source: string | Source, + options?: ParseOptions, +): DocumentNode { + const parser = new Parser(source, options); + return parser.parseDocument(); +} + +/** + * Given a string containing a GraphQL value (ex. `[42]`), parse the AST for + * that value. + * Throws GraphQLError if a syntax error is encountered. + * + * This is useful within tools that operate upon GraphQL Values directly and + * in isolation of complete GraphQL documents. + * + * Consider providing the results to the utility function: valueFromAST(). + */ +export function parseValue( + source: string | Source, + options?: ParseOptions, +): ValueNode { + const parser = new Parser(source, options); + parser.expectToken(TokenKind.SOF); + const value = parser.parseValueLiteral(false); + parser.expectToken(TokenKind.EOF); + return value; +} + +/** + * Similar to parseValue(), but raises a parse error if it encounters a + * variable. The return type will be a constant value. + */ +export function parseConstValue( + source: string | Source, + options?: ParseOptions, +): ConstValueNode { + const parser = new Parser(source, options); + parser.expectToken(TokenKind.SOF); + const value = parser.parseConstValueLiteral(); + parser.expectToken(TokenKind.EOF); + return value; +} + +/** + * Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for + * that type. + * Throws GraphQLError if a syntax error is encountered. + * + * This is useful within tools that operate upon GraphQL Types directly and + * in isolation of complete GraphQL documents. + * + * Consider providing the results to the utility function: typeFromAST(). + */ +export function parseType( + source: string | Source, + options?: ParseOptions, +): TypeNode { + const parser = new Parser(source, options); + parser.expectToken(TokenKind.SOF); + const type = parser.parseTypeReference(); + parser.expectToken(TokenKind.EOF); + return type; +} + +/** + * This class is exported only to assist people in implementing their own parsers + * without duplicating too much code and should be used only as last resort for cases + * such as experimental syntax or if certain features could not be contributed upstream. + * + * It is still part of the internal API and is versioned, so any changes to it are never + * considered breaking changes. If you still need to support multiple versions of the + * library, please use the `versionInfo` variable for version detection. + * + * @internal + */ +export class Parser { + protected _options: Maybe; + protected _lexer: Lexer; + + constructor(source: string | Source, options?: ParseOptions) { + const sourceObj = isSource(source) ? source : new Source(source); + + this._lexer = new Lexer(sourceObj); + this._options = options; + } + + /** + * Converts a name lex token into a name parse node. + */ + parseName(): NameNode { + const token = this.expectToken(TokenKind.NAME); + return this.node(token, { + kind: Kind.NAME, + value: token.value, + }); + } + + // Implements the parsing rules in the Document section. + + /** + * Document : Definition+ + */ + parseDocument(): DocumentNode { + return this.node(this._lexer.token, { + kind: Kind.DOCUMENT, + definitions: this.many( + TokenKind.SOF, + this.parseDefinition, + TokenKind.EOF, + ), + }); + } + + /** + * Definition : + * - ExecutableDefinition + * - TypeSystemDefinition + * - TypeSystemExtension + * + * ExecutableDefinition : + * - OperationDefinition + * - FragmentDefinition + * + * TypeSystemDefinition : + * - SchemaDefinition + * - TypeDefinition + * - DirectiveDefinition + * + * TypeDefinition : + * - ScalarTypeDefinition + * - ObjectTypeDefinition + * - InterfaceTypeDefinition + * - UnionTypeDefinition + * - EnumTypeDefinition + * - InputObjectTypeDefinition + */ + parseDefinition(): DefinitionNode { + if (this.peek(TokenKind.BRACE_L)) { + return this.parseOperationDefinition(); + } + + // Many definitions begin with a description and require a lookahead. + const hasDescription = this.peekDescription(); + const keywordToken = hasDescription + ? this._lexer.lookahead() + : this._lexer.token; + + if (keywordToken.kind === TokenKind.NAME) { + switch (keywordToken.value) { + case 'schema': + return this.parseSchemaDefinition(); + case 'scalar': + return this.parseScalarTypeDefinition(); + case 'type': + return this.parseObjectTypeDefinition(); + case 'interface': + return this.parseInterfaceTypeDefinition(); + case 'union': + return this.parseUnionTypeDefinition(); + case 'enum': + return this.parseEnumTypeDefinition(); + case 'input': + return this.parseInputObjectTypeDefinition(); + case 'directive': + return this.parseDirectiveDefinition(); + } + + if (hasDescription) { + throw syntaxError( + this._lexer.source, + this._lexer.token.start, + 'Unexpected description, descriptions are supported only on type definitions.', + ); + } + + switch (keywordToken.value) { + case 'query': + case 'mutation': + case 'subscription': + return this.parseOperationDefinition(); + case 'fragment': + return this.parseFragmentDefinition(); + case 'extend': + return this.parseTypeSystemExtension(); + } + } + + throw this.unexpected(keywordToken); + } + + // Implements the parsing rules in the Operations section. + + /** + * OperationDefinition : + * - SelectionSet + * - OperationType Name? VariableDefinitions? Directives? SelectionSet + */ + parseOperationDefinition(): OperationDefinitionNode { + const start = this._lexer.token; + if (this.peek(TokenKind.BRACE_L)) { + return this.node(start, { + kind: Kind.OPERATION_DEFINITION, + operation: OperationTypeNode.QUERY, + name: undefined, + variableDefinitions: [], + directives: [], + selectionSet: this.parseSelectionSet(), + }); + } + const operation = this.parseOperationType(); + let name; + if (this.peek(TokenKind.NAME)) { + name = this.parseName(); + } + return this.node(start, { + kind: Kind.OPERATION_DEFINITION, + operation, + name, + variableDefinitions: this.parseVariableDefinitions(), + directives: this.parseDirectives(false), + selectionSet: this.parseSelectionSet(), + }); + } + + /** + * OperationType : one of query mutation subscription + */ + parseOperationType(): OperationTypeNode { + const operationToken = this.expectToken(TokenKind.NAME); + switch (operationToken.value) { + case 'query': + return OperationTypeNode.QUERY; + case 'mutation': + return OperationTypeNode.MUTATION; + case 'subscription': + return OperationTypeNode.SUBSCRIPTION; + } + + throw this.unexpected(operationToken); + } + + /** + * VariableDefinitions : ( VariableDefinition+ ) + */ + parseVariableDefinitions(): Array { + return this.optionalMany( + TokenKind.PAREN_L, + this.parseVariableDefinition, + TokenKind.PAREN_R, + ); + } + + /** + * VariableDefinition : Variable : Type DefaultValue? Directives[Const]? + */ + parseVariableDefinition(): VariableDefinitionNode { + return this.node(this._lexer.token, { + kind: Kind.VARIABLE_DEFINITION, + variable: this.parseVariable(), + type: (this.expectToken(TokenKind.COLON), this.parseTypeReference()), + defaultValue: this.expectOptionalToken(TokenKind.EQUALS) + ? this.parseConstValueLiteral() + : undefined, + directives: this.parseConstDirectives(), + }); + } + + /** + * Variable : $ Name + */ + parseVariable(): VariableNode { + const start = this._lexer.token; + this.expectToken(TokenKind.DOLLAR); + return this.node(start, { + kind: Kind.VARIABLE, + name: this.parseName(), + }); + } + + /** + * ``` + * SelectionSet : { Selection+ } + * ``` + */ + parseSelectionSet(): SelectionSetNode { + return this.node(this._lexer.token, { + kind: Kind.SELECTION_SET, + selections: this.many( + TokenKind.BRACE_L, + this.parseSelection, + TokenKind.BRACE_R, + ), + }); + } + + /** + * Selection : + * - Field + * - FragmentSpread + * - InlineFragment + */ + parseSelection(): SelectionNode { + return this.peek(TokenKind.SPREAD) + ? this.parseFragment() + : this.parseField(); + } + + /** + * Field : Alias? Name Arguments? Directives? SelectionSet? + * + * Alias : Name : + */ + parseField(): FieldNode { + const start = this._lexer.token; + + const nameOrAlias = this.parseName(); + let alias; + let name; + if (this.expectOptionalToken(TokenKind.COLON)) { + alias = nameOrAlias; + name = this.parseName(); + } else { + name = nameOrAlias; + } + + return this.node(start, { + kind: Kind.FIELD, + alias, + name, + arguments: this.parseArguments(false), + directives: this.parseDirectives(false), + selectionSet: this.peek(TokenKind.BRACE_L) + ? this.parseSelectionSet() + : undefined, + }); + } + + /** + * Arguments[Const] : ( Argument[?Const]+ ) + */ + parseArguments(isConst: true): Array; + parseArguments(isConst: boolean): Array; + parseArguments(isConst: boolean): Array { + const item = isConst ? this.parseConstArgument : this.parseArgument; + return this.optionalMany(TokenKind.PAREN_L, item, TokenKind.PAREN_R); + } + + /** + * Argument[Const] : Name : Value[?Const] + */ + parseArgument(isConst: true): ConstArgumentNode; + parseArgument(isConst?: boolean): ArgumentNode; + parseArgument(isConst: boolean = false): ArgumentNode { + const start = this._lexer.token; + const name = this.parseName(); + + this.expectToken(TokenKind.COLON); + return this.node(start, { + kind: Kind.ARGUMENT, + name, + value: this.parseValueLiteral(isConst), + }); + } + + parseConstArgument(): ConstArgumentNode { + return this.parseArgument(true); + } + + // Implements the parsing rules in the Fragments section. + + /** + * Corresponds to both FragmentSpread and InlineFragment in the spec. + * + * FragmentSpread : ... FragmentName Directives? + * + * InlineFragment : ... TypeCondition? Directives? SelectionSet + */ + parseFragment(): FragmentSpreadNode | InlineFragmentNode { + const start = this._lexer.token; + this.expectToken(TokenKind.SPREAD); + + const hasTypeCondition = this.expectOptionalKeyword('on'); + if (!hasTypeCondition && this.peek(TokenKind.NAME)) { + return this.node(start, { + kind: Kind.FRAGMENT_SPREAD, + name: this.parseFragmentName(), + directives: this.parseDirectives(false), + }); + } + return this.node(start, { + kind: Kind.INLINE_FRAGMENT, + typeCondition: hasTypeCondition ? this.parseNamedType() : undefined, + directives: this.parseDirectives(false), + selectionSet: this.parseSelectionSet(), + }); + } + + /** + * FragmentDefinition : + * - fragment FragmentName on TypeCondition Directives? SelectionSet + * + * TypeCondition : NamedType + */ + parseFragmentDefinition(): FragmentDefinitionNode { + const start = this._lexer.token; + this.expectKeyword('fragment'); + // Legacy support for defining variables within fragments changes + // the grammar of FragmentDefinition: + // - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet + if (this._options?.allowLegacyFragmentVariables === true) { + return this.node(start, { + kind: Kind.FRAGMENT_DEFINITION, + name: this.parseFragmentName(), + variableDefinitions: this.parseVariableDefinitions(), + typeCondition: (this.expectKeyword('on'), this.parseNamedType()), + directives: this.parseDirectives(false), + selectionSet: this.parseSelectionSet(), + }); + } + return this.node(start, { + kind: Kind.FRAGMENT_DEFINITION, + name: this.parseFragmentName(), + typeCondition: (this.expectKeyword('on'), this.parseNamedType()), + directives: this.parseDirectives(false), + selectionSet: this.parseSelectionSet(), + }); + } + + /** + * FragmentName : Name but not `on` + */ + parseFragmentName(): NameNode { + if (this._lexer.token.value === 'on') { + throw this.unexpected(); + } + return this.parseName(); + } + + // Implements the parsing rules in the Values section. + + /** + * Value[Const] : + * - [~Const] Variable + * - IntValue + * - FloatValue + * - StringValue + * - BooleanValue + * - NullValue + * - EnumValue + * - ListValue[?Const] + * - ObjectValue[?Const] + * + * BooleanValue : one of `true` `false` + * + * NullValue : `null` + * + * EnumValue : Name but not `true`, `false` or `null` + */ + parseValueLiteral(isConst: true): ConstValueNode; + parseValueLiteral(isConst: boolean): ValueNode; + parseValueLiteral(isConst: boolean): ValueNode { + const token = this._lexer.token; + switch (token.kind) { + case TokenKind.BRACKET_L: + return this.parseList(isConst); + case TokenKind.BRACE_L: + return this.parseObject(isConst); + case TokenKind.INT: + this._lexer.advance(); + return this.node(token, { + kind: Kind.INT, + value: token.value, + }); + case TokenKind.FLOAT: + this._lexer.advance(); + return this.node(token, { + kind: Kind.FLOAT, + value: token.value, + }); + case TokenKind.STRING: + case TokenKind.BLOCK_STRING: + return this.parseStringLiteral(); + case TokenKind.NAME: + this._lexer.advance(); + switch (token.value) { + case 'true': + return this.node(token, { + kind: Kind.BOOLEAN, + value: true, + }); + case 'false': + return this.node(token, { + kind: Kind.BOOLEAN, + value: false, + }); + case 'null': + return this.node(token, { kind: Kind.NULL }); + default: + return this.node(token, { + kind: Kind.ENUM, + value: token.value, + }); + } + case TokenKind.DOLLAR: + if (isConst) { + this.expectToken(TokenKind.DOLLAR); + if (this._lexer.token.kind === TokenKind.NAME) { + const varName = this._lexer.token.value; + throw syntaxError( + this._lexer.source, + token.start, + `Unexpected variable "$${varName}" in constant value.`, + ); + } else { + throw this.unexpected(token); + } + } + return this.parseVariable(); + default: + throw this.unexpected(); + } + } + + parseConstValueLiteral(): ConstValueNode { + return this.parseValueLiteral(true); + } + + parseStringLiteral(): StringValueNode { + const token = this._lexer.token; + this._lexer.advance(); + return this.node(token, { + kind: Kind.STRING, + value: token.value, + block: token.kind === TokenKind.BLOCK_STRING, + }); + } + + /** + * ListValue[Const] : + * - [ ] + * - [ Value[?Const]+ ] + */ + parseList(isConst: true): ConstListValueNode; + parseList(isConst: boolean): ListValueNode; + parseList(isConst: boolean): ListValueNode { + const item = () => this.parseValueLiteral(isConst); + return this.node(this._lexer.token, { + kind: Kind.LIST, + values: this.any(TokenKind.BRACKET_L, item, TokenKind.BRACKET_R), + }); + } + + /** + * ``` + * ObjectValue[Const] : + * - { } + * - { ObjectField[?Const]+ } + * ``` + */ + parseObject(isConst: true): ConstObjectValueNode; + parseObject(isConst: boolean): ObjectValueNode; + parseObject(isConst: boolean): ObjectValueNode { + const item = () => this.parseObjectField(isConst); + return this.node(this._lexer.token, { + kind: Kind.OBJECT, + fields: this.any(TokenKind.BRACE_L, item, TokenKind.BRACE_R), + }); + } + + /** + * ObjectField[Const] : Name : Value[?Const] + */ + parseObjectField(isConst: true): ConstObjectFieldNode; + parseObjectField(isConst: boolean): ObjectFieldNode; + parseObjectField(isConst: boolean): ObjectFieldNode { + const start = this._lexer.token; + const name = this.parseName(); + this.expectToken(TokenKind.COLON); + return this.node(start, { + kind: Kind.OBJECT_FIELD, + name, + value: this.parseValueLiteral(isConst), + }); + } + + // Implements the parsing rules in the Directives section. + + /** + * Directives[Const] : Directive[?Const]+ + */ + parseDirectives(isConst: true): Array; + parseDirectives(isConst: boolean): Array; + parseDirectives(isConst: boolean): Array { + const directives = []; + while (this.peek(TokenKind.AT)) { + directives.push(this.parseDirective(isConst)); + } + return directives; + } + + parseConstDirectives(): Array { + return this.parseDirectives(true); + } + + /** + * ``` + * Directive[Const] : @ Name Arguments[?Const]? + * ``` + */ + parseDirective(isConst: true): ConstDirectiveNode; + parseDirective(isConst: boolean): DirectiveNode; + parseDirective(isConst: boolean): DirectiveNode { + const start = this._lexer.token; + this.expectToken(TokenKind.AT); + return this.node(start, { + kind: Kind.DIRECTIVE, + name: this.parseName(), + arguments: this.parseArguments(isConst), + }); + } + + // Implements the parsing rules in the Types section. + + /** + * Type : + * - NamedType + * - ListType + * - NonNullType + */ + parseTypeReference(): TypeNode { + const start = this._lexer.token; + let type; + if (this.expectOptionalToken(TokenKind.BRACKET_L)) { + const innerType = this.parseTypeReference(); + this.expectToken(TokenKind.BRACKET_R); + type = this.node(start, { + kind: Kind.LIST_TYPE, + type: innerType, + }); + } else { + type = this.parseNamedType(); + } + + if (this.expectOptionalToken(TokenKind.BANG)) { + return this.node(start, { + kind: Kind.NON_NULL_TYPE, + type, + }); + } + + return type; + } + + /** + * NamedType : Name + */ + parseNamedType(): NamedTypeNode { + return this.node(this._lexer.token, { + kind: Kind.NAMED_TYPE, + name: this.parseName(), + }); + } + + // Implements the parsing rules in the Type Definition section. + + peekDescription(): boolean { + return this.peek(TokenKind.STRING) || this.peek(TokenKind.BLOCK_STRING); + } + + /** + * Description : StringValue + */ + parseDescription(): undefined | StringValueNode { + if (this.peekDescription()) { + return this.parseStringLiteral(); + } + } + + /** + * ``` + * SchemaDefinition : Description? schema Directives[Const]? { OperationTypeDefinition+ } + * ``` + */ + parseSchemaDefinition(): SchemaDefinitionNode { + const start = this._lexer.token; + const description = this.parseDescription(); + this.expectKeyword('schema'); + const directives = this.parseConstDirectives(); + const operationTypes = this.many( + TokenKind.BRACE_L, + this.parseOperationTypeDefinition, + TokenKind.BRACE_R, + ); + return this.node(start, { + kind: Kind.SCHEMA_DEFINITION, + description, + directives, + operationTypes, + }); + } + + /** + * OperationTypeDefinition : OperationType : NamedType + */ + parseOperationTypeDefinition(): OperationTypeDefinitionNode { + const start = this._lexer.token; + const operation = this.parseOperationType(); + this.expectToken(TokenKind.COLON); + const type = this.parseNamedType(); + return this.node(start, { + kind: Kind.OPERATION_TYPE_DEFINITION, + operation, + type, + }); + } + + /** + * ScalarTypeDefinition : Description? scalar Name Directives[Const]? + */ + parseScalarTypeDefinition(): ScalarTypeDefinitionNode { + const start = this._lexer.token; + const description = this.parseDescription(); + this.expectKeyword('scalar'); + const name = this.parseName(); + const directives = this.parseConstDirectives(); + return this.node(start, { + kind: Kind.SCALAR_TYPE_DEFINITION, + description, + name, + directives, + }); + } + + /** + * ObjectTypeDefinition : + * Description? + * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition? + */ + parseObjectTypeDefinition(): ObjectTypeDefinitionNode { + const start = this._lexer.token; + const description = this.parseDescription(); + this.expectKeyword('type'); + const name = this.parseName(); + const interfaces = this.parseImplementsInterfaces(); + const directives = this.parseConstDirectives(); + const fields = this.parseFieldsDefinition(); + return this.node(start, { + kind: Kind.OBJECT_TYPE_DEFINITION, + description, + name, + interfaces, + directives, + fields, + }); + } + + /** + * ImplementsInterfaces : + * - implements `&`? NamedType + * - ImplementsInterfaces & NamedType + */ + parseImplementsInterfaces(): Array { + return this.expectOptionalKeyword('implements') + ? this.delimitedMany(TokenKind.AMP, this.parseNamedType) + : []; + } + + /** + * ``` + * FieldsDefinition : { FieldDefinition+ } + * ``` + */ + parseFieldsDefinition(): Array { + return this.optionalMany( + TokenKind.BRACE_L, + this.parseFieldDefinition, + TokenKind.BRACE_R, + ); + } + + /** + * FieldDefinition : + * - Description? Name ArgumentsDefinition? : Type Directives[Const]? + */ + parseFieldDefinition(): FieldDefinitionNode { + const start = this._lexer.token; + const description = this.parseDescription(); + const name = this.parseName(); + const args = this.parseArgumentDefs(); + this.expectToken(TokenKind.COLON); + const type = this.parseTypeReference(); + const directives = this.parseConstDirectives(); + return this.node(start, { + kind: Kind.FIELD_DEFINITION, + description, + name, + arguments: args, + type, + directives, + }); + } + + /** + * ArgumentsDefinition : ( InputValueDefinition+ ) + */ + parseArgumentDefs(): Array { + return this.optionalMany( + TokenKind.PAREN_L, + this.parseInputValueDef, + TokenKind.PAREN_R, + ); + } + + /** + * InputValueDefinition : + * - Description? Name : Type DefaultValue? Directives[Const]? + */ + parseInputValueDef(): InputValueDefinitionNode { + const start = this._lexer.token; + const description = this.parseDescription(); + const name = this.parseName(); + this.expectToken(TokenKind.COLON); + const type = this.parseTypeReference(); + let defaultValue; + if (this.expectOptionalToken(TokenKind.EQUALS)) { + defaultValue = this.parseConstValueLiteral(); + } + const directives = this.parseConstDirectives(); + return this.node(start, { + kind: Kind.INPUT_VALUE_DEFINITION, + description, + name, + type, + defaultValue, + directives, + }); + } + + /** + * InterfaceTypeDefinition : + * - Description? interface Name Directives[Const]? FieldsDefinition? + */ + parseInterfaceTypeDefinition(): InterfaceTypeDefinitionNode { + const start = this._lexer.token; + const description = this.parseDescription(); + this.expectKeyword('interface'); + const name = this.parseName(); + const interfaces = this.parseImplementsInterfaces(); + const directives = this.parseConstDirectives(); + const fields = this.parseFieldsDefinition(); + return this.node(start, { + kind: Kind.INTERFACE_TYPE_DEFINITION, + description, + name, + interfaces, + directives, + fields, + }); + } + + /** + * UnionTypeDefinition : + * - Description? union Name Directives[Const]? UnionMemberTypes? + */ + parseUnionTypeDefinition(): UnionTypeDefinitionNode { + const start = this._lexer.token; + const description = this.parseDescription(); + this.expectKeyword('union'); + const name = this.parseName(); + const directives = this.parseConstDirectives(); + const types = this.parseUnionMemberTypes(); + return this.node(start, { + kind: Kind.UNION_TYPE_DEFINITION, + description, + name, + directives, + types, + }); + } + + /** + * UnionMemberTypes : + * - = `|`? NamedType + * - UnionMemberTypes | NamedType + */ + parseUnionMemberTypes(): Array { + return this.expectOptionalToken(TokenKind.EQUALS) + ? this.delimitedMany(TokenKind.PIPE, this.parseNamedType) + : []; + } + + /** + * EnumTypeDefinition : + * - Description? enum Name Directives[Const]? EnumValuesDefinition? + */ + parseEnumTypeDefinition(): EnumTypeDefinitionNode { + const start = this._lexer.token; + const description = this.parseDescription(); + this.expectKeyword('enum'); + const name = this.parseName(); + const directives = this.parseConstDirectives(); + const values = this.parseEnumValuesDefinition(); + return this.node(start, { + kind: Kind.ENUM_TYPE_DEFINITION, + description, + name, + directives, + values, + }); + } + + /** + * ``` + * EnumValuesDefinition : { EnumValueDefinition+ } + * ``` + */ + parseEnumValuesDefinition(): Array { + return this.optionalMany( + TokenKind.BRACE_L, + this.parseEnumValueDefinition, + TokenKind.BRACE_R, + ); + } + + /** + * EnumValueDefinition : Description? EnumValue Directives[Const]? + */ + parseEnumValueDefinition(): EnumValueDefinitionNode { + const start = this._lexer.token; + const description = this.parseDescription(); + const name = this.parseEnumValueName(); + const directives = this.parseConstDirectives(); + return this.node(start, { + kind: Kind.ENUM_VALUE_DEFINITION, + description, + name, + directives, + }); + } + + /** + * EnumValue : Name but not `true`, `false` or `null` + */ + parseEnumValueName(): NameNode { + if ( + this._lexer.token.value === 'true' || + this._lexer.token.value === 'false' || + this._lexer.token.value === 'null' + ) { + throw syntaxError( + this._lexer.source, + this._lexer.token.start, + `${getTokenDesc( + this._lexer.token, + )} is reserved and cannot be used for an enum value.`, + ); + } + return this.parseName(); + } + + /** + * InputObjectTypeDefinition : + * - Description? input Name Directives[Const]? InputFieldsDefinition? + */ + parseInputObjectTypeDefinition(): InputObjectTypeDefinitionNode { + const start = this._lexer.token; + const description = this.parseDescription(); + this.expectKeyword('input'); + const name = this.parseName(); + const directives = this.parseConstDirectives(); + const fields = this.parseInputFieldsDefinition(); + return this.node(start, { + kind: Kind.INPUT_OBJECT_TYPE_DEFINITION, + description, + name, + directives, + fields, + }); + } + + /** + * ``` + * InputFieldsDefinition : { InputValueDefinition+ } + * ``` + */ + parseInputFieldsDefinition(): Array { + return this.optionalMany( + TokenKind.BRACE_L, + this.parseInputValueDef, + TokenKind.BRACE_R, + ); + } + + /** + * TypeSystemExtension : + * - SchemaExtension + * - TypeExtension + * + * TypeExtension : + * - ScalarTypeExtension + * - ObjectTypeExtension + * - InterfaceTypeExtension + * - UnionTypeExtension + * - EnumTypeExtension + * - InputObjectTypeDefinition + */ + parseTypeSystemExtension(): TypeSystemExtensionNode { + const keywordToken = this._lexer.lookahead(); + + if (keywordToken.kind === TokenKind.NAME) { + switch (keywordToken.value) { + case 'schema': + return this.parseSchemaExtension(); + case 'scalar': + return this.parseScalarTypeExtension(); + case 'type': + return this.parseObjectTypeExtension(); + case 'interface': + return this.parseInterfaceTypeExtension(); + case 'union': + return this.parseUnionTypeExtension(); + case 'enum': + return this.parseEnumTypeExtension(); + case 'input': + return this.parseInputObjectTypeExtension(); + } + } + + throw this.unexpected(keywordToken); + } + + /** + * ``` + * SchemaExtension : + * - extend schema Directives[Const]? { OperationTypeDefinition+ } + * - extend schema Directives[Const] + * ``` + */ + parseSchemaExtension(): SchemaExtensionNode { + const start = this._lexer.token; + this.expectKeyword('extend'); + this.expectKeyword('schema'); + const directives = this.parseConstDirectives(); + const operationTypes = this.optionalMany( + TokenKind.BRACE_L, + this.parseOperationTypeDefinition, + TokenKind.BRACE_R, + ); + if (directives.length === 0 && operationTypes.length === 0) { + throw this.unexpected(); + } + return this.node(start, { + kind: Kind.SCHEMA_EXTENSION, + directives, + operationTypes, + }); + } + + /** + * ScalarTypeExtension : + * - extend scalar Name Directives[Const] + */ + parseScalarTypeExtension(): ScalarTypeExtensionNode { + const start = this._lexer.token; + this.expectKeyword('extend'); + this.expectKeyword('scalar'); + const name = this.parseName(); + const directives = this.parseConstDirectives(); + if (directives.length === 0) { + throw this.unexpected(); + } + return this.node(start, { + kind: Kind.SCALAR_TYPE_EXTENSION, + name, + directives, + }); + } + + /** + * ObjectTypeExtension : + * - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition + * - extend type Name ImplementsInterfaces? Directives[Const] + * - extend type Name ImplementsInterfaces + */ + parseObjectTypeExtension(): ObjectTypeExtensionNode { + const start = this._lexer.token; + this.expectKeyword('extend'); + this.expectKeyword('type'); + const name = this.parseName(); + const interfaces = this.parseImplementsInterfaces(); + const directives = this.parseConstDirectives(); + const fields = this.parseFieldsDefinition(); + if ( + interfaces.length === 0 && + directives.length === 0 && + fields.length === 0 + ) { + throw this.unexpected(); + } + return this.node(start, { + kind: Kind.OBJECT_TYPE_EXTENSION, + name, + interfaces, + directives, + fields, + }); + } + + /** + * InterfaceTypeExtension : + * - extend interface Name ImplementsInterfaces? Directives[Const]? FieldsDefinition + * - extend interface Name ImplementsInterfaces? Directives[Const] + * - extend interface Name ImplementsInterfaces + */ + parseInterfaceTypeExtension(): InterfaceTypeExtensionNode { + const start = this._lexer.token; + this.expectKeyword('extend'); + this.expectKeyword('interface'); + const name = this.parseName(); + const interfaces = this.parseImplementsInterfaces(); + const directives = this.parseConstDirectives(); + const fields = this.parseFieldsDefinition(); + if ( + interfaces.length === 0 && + directives.length === 0 && + fields.length === 0 + ) { + throw this.unexpected(); + } + return this.node(start, { + kind: Kind.INTERFACE_TYPE_EXTENSION, + name, + interfaces, + directives, + fields, + }); + } + + /** + * UnionTypeExtension : + * - extend union Name Directives[Const]? UnionMemberTypes + * - extend union Name Directives[Const] + */ + parseUnionTypeExtension(): UnionTypeExtensionNode { + const start = this._lexer.token; + this.expectKeyword('extend'); + this.expectKeyword('union'); + const name = this.parseName(); + const directives = this.parseConstDirectives(); + const types = this.parseUnionMemberTypes(); + if (directives.length === 0 && types.length === 0) { + throw this.unexpected(); + } + return this.node(start, { + kind: Kind.UNION_TYPE_EXTENSION, + name, + directives, + types, + }); + } + + /** + * EnumTypeExtension : + * - extend enum Name Directives[Const]? EnumValuesDefinition + * - extend enum Name Directives[Const] + */ + parseEnumTypeExtension(): EnumTypeExtensionNode { + const start = this._lexer.token; + this.expectKeyword('extend'); + this.expectKeyword('enum'); + const name = this.parseName(); + const directives = this.parseConstDirectives(); + const values = this.parseEnumValuesDefinition(); + if (directives.length === 0 && values.length === 0) { + throw this.unexpected(); + } + return this.node(start, { + kind: Kind.ENUM_TYPE_EXTENSION, + name, + directives, + values, + }); + } + + /** + * InputObjectTypeExtension : + * - extend input Name Directives[Const]? InputFieldsDefinition + * - extend input Name Directives[Const] + */ + parseInputObjectTypeExtension(): InputObjectTypeExtensionNode { + const start = this._lexer.token; + this.expectKeyword('extend'); + this.expectKeyword('input'); + const name = this.parseName(); + const directives = this.parseConstDirectives(); + const fields = this.parseInputFieldsDefinition(); + if (directives.length === 0 && fields.length === 0) { + throw this.unexpected(); + } + return this.node(start, { + kind: Kind.INPUT_OBJECT_TYPE_EXTENSION, + name, + directives, + fields, + }); + } + + /** + * ``` + * DirectiveDefinition : + * - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations + * ``` + */ + parseDirectiveDefinition(): DirectiveDefinitionNode { + const start = this._lexer.token; + const description = this.parseDescription(); + this.expectKeyword('directive'); + this.expectToken(TokenKind.AT); + const name = this.parseName(); + const args = this.parseArgumentDefs(); + const repeatable = this.expectOptionalKeyword('repeatable'); + this.expectKeyword('on'); + const locations = this.parseDirectiveLocations(); + return this.node(start, { + kind: Kind.DIRECTIVE_DEFINITION, + description, + name, + arguments: args, + repeatable, + locations, + }); + } + + /** + * DirectiveLocations : + * - `|`? DirectiveLocation + * - DirectiveLocations | DirectiveLocation + */ + parseDirectiveLocations(): Array { + return this.delimitedMany(TokenKind.PIPE, this.parseDirectiveLocation); + } + + /* + * DirectiveLocation : + * - ExecutableDirectiveLocation + * - TypeSystemDirectiveLocation + * + * ExecutableDirectiveLocation : one of + * `QUERY` + * `MUTATION` + * `SUBSCRIPTION` + * `FIELD` + * `FRAGMENT_DEFINITION` + * `FRAGMENT_SPREAD` + * `INLINE_FRAGMENT` + * + * TypeSystemDirectiveLocation : one of + * `SCHEMA` + * `SCALAR` + * `OBJECT` + * `FIELD_DEFINITION` + * `ARGUMENT_DEFINITION` + * `INTERFACE` + * `UNION` + * `ENUM` + * `ENUM_VALUE` + * `INPUT_OBJECT` + * `INPUT_FIELD_DEFINITION` + */ + parseDirectiveLocation(): NameNode { + const start = this._lexer.token; + const name = this.parseName(); + if (Object.prototype.hasOwnProperty.call(DirectiveLocation, name.value)) { + return name; + } + throw this.unexpected(start); + } + + // Core parsing utility functions + + /** + * Returns a node that, if configured to do so, sets a "loc" field as a + * location object, used to identify the place in the source that created a + * given parsed object. + */ + node(startToken: Token, node: T): T { + if (this._options?.noLocation !== true) { + node.loc = new Location( + startToken, + this._lexer.lastToken, + this._lexer.source, + ); + } + return node; + } + + /** + * Determines if the next token is of a given kind + */ + peek(kind: TokenKind): boolean { + return this._lexer.token.kind === kind; + } + + /** + * If the next token is of the given kind, return that token after advancing the lexer. + * Otherwise, do not change the parser state and throw an error. + */ + expectToken(kind: TokenKind): Token { + const token = this._lexer.token; + if (token.kind === kind) { + this._lexer.advance(); + return token; + } + + throw syntaxError( + this._lexer.source, + token.start, + `Expected ${getTokenKindDesc(kind)}, found ${getTokenDesc(token)}.`, + ); + } + + /** + * If the next token is of the given kind, return "true" after advancing the lexer. + * Otherwise, do not change the parser state and return "false". + */ + expectOptionalToken(kind: TokenKind): boolean { + const token = this._lexer.token; + if (token.kind === kind) { + this._lexer.advance(); + return true; + } + return false; + } + + /** + * If the next token is a given keyword, advance the lexer. + * Otherwise, do not change the parser state and throw an error. + */ + expectKeyword(value: string): void { + const token = this._lexer.token; + if (token.kind === TokenKind.NAME && token.value === value) { + this._lexer.advance(); + } else { + throw syntaxError( + this._lexer.source, + token.start, + `Expected "${value}", found ${getTokenDesc(token)}.`, + ); + } + } + + /** + * If the next token is a given keyword, return "true" after advancing the lexer. + * Otherwise, do not change the parser state and return "false". + */ + expectOptionalKeyword(value: string): boolean { + const token = this._lexer.token; + if (token.kind === TokenKind.NAME && token.value === value) { + this._lexer.advance(); + return true; + } + return false; + } + + /** + * Helper function for creating an error when an unexpected lexed token is encountered. + */ + unexpected(atToken?: Maybe): GraphQLError { + const token = atToken ?? this._lexer.token; + return syntaxError( + this._lexer.source, + token.start, + `Unexpected ${getTokenDesc(token)}.`, + ); + } + + /** + * Returns a possibly empty list of parse nodes, determined by the parseFn. + * This list begins with a lex token of openKind and ends with a lex token of closeKind. + * Advances the parser to the next lex token after the closing token. + */ + any( + openKind: TokenKind, + parseFn: () => T, + closeKind: TokenKind, + ): Array { + this.expectToken(openKind); + const nodes = []; + while (!this.expectOptionalToken(closeKind)) { + nodes.push(parseFn.call(this)); + } + return nodes; + } + + /** + * Returns a list of parse nodes, determined by the parseFn. + * It can be empty only if open token is missing otherwise it will always return non-empty list + * that begins with a lex token of openKind and ends with a lex token of closeKind. + * Advances the parser to the next lex token after the closing token. + */ + optionalMany( + openKind: TokenKind, + parseFn: () => T, + closeKind: TokenKind, + ): Array { + if (this.expectOptionalToken(openKind)) { + const nodes = []; + do { + nodes.push(parseFn.call(this)); + } while (!this.expectOptionalToken(closeKind)); + return nodes; + } + return []; + } + + /** + * Returns a non-empty list of parse nodes, determined by the parseFn. + * This list begins with a lex token of openKind and ends with a lex token of closeKind. + * Advances the parser to the next lex token after the closing token. + */ + many( + openKind: TokenKind, + parseFn: () => T, + closeKind: TokenKind, + ): Array { + this.expectToken(openKind); + const nodes = []; + do { + nodes.push(parseFn.call(this)); + } while (!this.expectOptionalToken(closeKind)); + return nodes; + } + + /** + * Returns a non-empty list of parse nodes, determined by the parseFn. + * This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind. + * Advances the parser to the next lex token after last item in the list. + */ + delimitedMany(delimiterKind: TokenKind, parseFn: () => T): Array { + this.expectOptionalToken(delimiterKind); + + const nodes = []; + do { + nodes.push(parseFn.call(this)); + } while (this.expectOptionalToken(delimiterKind)); + return nodes; + } +} + +/** + * A helper function to describe a token as a string for debugging. + */ +function getTokenDesc(token: Token): string { + const value = token.value; + return getTokenKindDesc(token.kind) + (value != null ? ` "${value}"` : ''); +} + +/** + * A helper function to describe a token kind as a string for debugging. + */ +function getTokenKindDesc(kind: TokenKind): string { + return isPunctuatorTokenKind(kind) ? `"${kind}"` : kind; +} diff --git a/src/language/predicates.ts b/src/language/predicates.ts new file mode 100644 index 00000000..a390f4ee --- /dev/null +++ b/src/language/predicates.ts @@ -0,0 +1,112 @@ +import type { + ASTNode, + ConstValueNode, + DefinitionNode, + ExecutableDefinitionNode, + SelectionNode, + TypeDefinitionNode, + TypeExtensionNode, + TypeNode, + TypeSystemDefinitionNode, + TypeSystemExtensionNode, + ValueNode, +} from './ast'; +import { Kind } from './kinds'; + +export function isDefinitionNode(node: ASTNode): node is DefinitionNode { + return ( + isExecutableDefinitionNode(node) || + isTypeSystemDefinitionNode(node) || + isTypeSystemExtensionNode(node) + ); +} + +export function isExecutableDefinitionNode( + node: ASTNode, +): node is ExecutableDefinitionNode { + return ( + node.kind === Kind.OPERATION_DEFINITION || + node.kind === Kind.FRAGMENT_DEFINITION + ); +} + +export function isSelectionNode(node: ASTNode): node is SelectionNode { + return ( + node.kind === Kind.FIELD || + node.kind === Kind.FRAGMENT_SPREAD || + node.kind === Kind.INLINE_FRAGMENT + ); +} + +export function isValueNode(node: ASTNode): node is ValueNode { + return ( + node.kind === Kind.VARIABLE || + node.kind === Kind.INT || + node.kind === Kind.FLOAT || + node.kind === Kind.STRING || + node.kind === Kind.BOOLEAN || + node.kind === Kind.NULL || + node.kind === Kind.ENUM || + node.kind === Kind.LIST || + node.kind === Kind.OBJECT + ); +} + +export function isConstValueNode(node: ASTNode): node is ConstValueNode { + return ( + isValueNode(node) && + (node.kind === Kind.LIST + ? node.values.some(isConstValueNode) + : node.kind === Kind.OBJECT + ? node.fields.some((field) => isConstValueNode(field.value)) + : node.kind !== Kind.VARIABLE) + ); +} + +export function isTypeNode(node: ASTNode): node is TypeNode { + return ( + node.kind === Kind.NAMED_TYPE || + node.kind === Kind.LIST_TYPE || + node.kind === Kind.NON_NULL_TYPE + ); +} + +export function isTypeSystemDefinitionNode( + node: ASTNode, +): node is TypeSystemDefinitionNode { + return ( + node.kind === Kind.SCHEMA_DEFINITION || + isTypeDefinitionNode(node) || + node.kind === Kind.DIRECTIVE_DEFINITION + ); +} + +export function isTypeDefinitionNode( + node: ASTNode, +): node is TypeDefinitionNode { + return ( + node.kind === Kind.SCALAR_TYPE_DEFINITION || + node.kind === Kind.OBJECT_TYPE_DEFINITION || + node.kind === Kind.INTERFACE_TYPE_DEFINITION || + node.kind === Kind.UNION_TYPE_DEFINITION || + node.kind === Kind.ENUM_TYPE_DEFINITION || + node.kind === Kind.INPUT_OBJECT_TYPE_DEFINITION + ); +} + +export function isTypeSystemExtensionNode( + node: ASTNode, +): node is TypeSystemExtensionNode { + return node.kind === Kind.SCHEMA_EXTENSION || isTypeExtensionNode(node); +} + +export function isTypeExtensionNode(node: ASTNode): node is TypeExtensionNode { + return ( + node.kind === Kind.SCALAR_TYPE_EXTENSION || + node.kind === Kind.OBJECT_TYPE_EXTENSION || + node.kind === Kind.INTERFACE_TYPE_EXTENSION || + node.kind === Kind.UNION_TYPE_EXTENSION || + node.kind === Kind.ENUM_TYPE_EXTENSION || + node.kind === Kind.INPUT_OBJECT_TYPE_EXTENSION + ); +} diff --git a/src/language/printLocation.ts b/src/language/printLocation.ts new file mode 100644 index 00000000..3d44f5ce --- /dev/null +++ b/src/language/printLocation.ts @@ -0,0 +1,80 @@ +import type { Location } from './ast'; +import type { SourceLocation } from './location'; +import { getLocation } from './location'; +import type { Source } from './source'; + +/** + * Render a helpful description of the location in the GraphQL Source document. + */ +export function printLocation(location: Location): string { + return printSourceLocation( + location.source, + getLocation(location.source, location.start), + ); +} + +/** + * Render a helpful description of the location in the GraphQL Source document. + */ +export function printSourceLocation( + source: Source, + sourceLocation: SourceLocation, +): string { + const firstLineColumnOffset = source.locationOffset.column - 1; + const body = ''.padStart(firstLineColumnOffset) + source.body; + + const lineIndex = sourceLocation.line - 1; + const lineOffset = source.locationOffset.line - 1; + const lineNum = sourceLocation.line + lineOffset; + + const columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0; + const columnNum = sourceLocation.column + columnOffset; + const locationStr = `${source.name}:${lineNum}:${columnNum}\n`; + + const lines = body.split(/\r\n|[\n\r]/g); + const locationLine = lines[lineIndex]; + + // Special case for minified documents + if (locationLine.length > 120) { + const subLineIndex = Math.floor(columnNum / 80); + const subLineColumnNum = columnNum % 80; + const subLines: Array = []; + for (let i = 0; i < locationLine.length; i += 80) { + subLines.push(locationLine.slice(i, i + 80)); + } + + return ( + locationStr + + printPrefixedLines([ + [`${lineNum} |`, subLines[0]], + ...subLines + .slice(1, subLineIndex + 1) + .map((subLine) => ['|', subLine] as const), + ['|', '^'.padStart(subLineColumnNum)], + ['|', subLines[subLineIndex + 1]], + ]) + ); + } + + return ( + locationStr + + printPrefixedLines([ + // Lines specified like this: ["prefix", "string"], + [`${lineNum - 1} |`, lines[lineIndex - 1]], + [`${lineNum} |`, locationLine], + ['|', '^'.padStart(columnNum)], + [`${lineNum + 1} |`, lines[lineIndex + 1]], + ]) + ); +} + +function printPrefixedLines( + lines: ReadonlyArray, +): string { + const existingLines = lines.filter(([_, line]) => line !== undefined); + + const padLen = Math.max(...existingLines.map(([prefix]) => prefix.length)); + return existingLines + .map(([prefix, line]) => prefix.padStart(padLen) + (line ? ' ' + line : '')) + .join('\n'); +} diff --git a/src/language/printString.ts b/src/language/printString.ts new file mode 100644 index 00000000..b091bcc2 --- /dev/null +++ b/src/language/printString.ts @@ -0,0 +1,38 @@ +/** + * Prints a string as a GraphQL StringValue literal. Replaces control characters + * and excluded characters (" U+0022 and \\ U+005C) with escape sequences. + */ +export function printString(str: string): string { + return `"${str.replace(escapedRegExp, escapedReplacer)}"`; +} + +// eslint-disable-next-line no-control-regex +const escapedRegExp = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g; + +function escapedReplacer(str: string): string { + return escapeSequences[str.charCodeAt(0)]; +} + +// prettier-ignore +const escapeSequences = [ + '\\u0000', '\\u0001', '\\u0002', '\\u0003', '\\u0004', '\\u0005', '\\u0006', '\\u0007', + '\\b', '\\t', '\\n', '\\u000B', '\\f', '\\r', '\\u000E', '\\u000F', + '\\u0010', '\\u0011', '\\u0012', '\\u0013', '\\u0014', '\\u0015', '\\u0016', '\\u0017', + '\\u0018', '\\u0019', '\\u001A', '\\u001B', '\\u001C', '\\u001D', '\\u001E', '\\u001F', + '', '', '\\"', '', '', '', '', '', + '', '', '', '', '', '', '', '', // 2F + '', '', '', '', '', '', '', '', + '', '', '', '', '', '', '', '', // 3F + '', '', '', '', '', '', '', '', + '', '', '', '', '', '', '', '', // 4F + '', '', '', '', '', '', '', '', + '', '', '', '', '\\\\', '', '', '', // 5F + '', '', '', '', '', '', '', '', + '', '', '', '', '', '', '', '', // 6F + '', '', '', '', '', '', '', '', + '', '', '', '', '', '', '', '\\u007F', + '\\u0080', '\\u0081', '\\u0082', '\\u0083', '\\u0084', '\\u0085', '\\u0086', '\\u0087', + '\\u0088', '\\u0089', '\\u008A', '\\u008B', '\\u008C', '\\u008D', '\\u008E', '\\u008F', + '\\u0090', '\\u0091', '\\u0092', '\\u0093', '\\u0094', '\\u0095', '\\u0096', '\\u0097', + '\\u0098', '\\u0099', '\\u009A', '\\u009B', '\\u009C', '\\u009D', '\\u009E', '\\u009F', +]; diff --git a/src/language/printer.ts b/src/language/printer.ts new file mode 100644 index 00000000..e95c118d --- /dev/null +++ b/src/language/printer.ts @@ -0,0 +1,347 @@ +import type { Maybe } from '../jsutils/Maybe'; + +import type { ASTNode } from './ast'; +import { printBlockString } from './blockString'; +import { printString } from './printString'; +import type { ASTReducer } from './visitor'; +import { visit } from './visitor'; + +/** + * Converts an AST into a string, using one set of reasonable + * formatting rules. + */ +export function print(ast: ASTNode): string { + return visit(ast, printDocASTReducer); +} + +const MAX_LINE_LENGTH = 80; + +const printDocASTReducer: ASTReducer = { + Name: { leave: (node) => node.value }, + Variable: { leave: (node) => '$' + node.name }, + + // Document + + Document: { + leave: (node) => join(node.definitions, '\n\n'), + }, + + OperationDefinition: { + leave(node) { + const varDefs = wrap('(', join(node.variableDefinitions, ', '), ')'); + const prefix = join( + [ + node.operation, + join([node.name, varDefs]), + join(node.directives, ' '), + ], + ' ', + ); + + // Anonymous queries with no directives or variable definitions can use + // the query short form. + return (prefix === 'query' ? '' : prefix + ' ') + node.selectionSet; + }, + }, + + VariableDefinition: { + leave: ({ variable, type, defaultValue, directives }) => + variable + + ': ' + + type + + wrap(' = ', defaultValue) + + wrap(' ', join(directives, ' ')), + }, + SelectionSet: { leave: ({ selections }) => block(selections) }, + + Field: { + leave({ alias, name, arguments: args, directives, selectionSet }) { + const prefix = wrap('', alias, ': ') + name; + let argsLine = prefix + wrap('(', join(args, ', '), ')'); + + if (argsLine.length > MAX_LINE_LENGTH) { + argsLine = prefix + wrap('(\n', indent(join(args, '\n')), '\n)'); + } + + return join([argsLine, join(directives, ' '), selectionSet], ' '); + }, + }, + + Argument: { leave: ({ name, value }) => name + ': ' + value }, + + // Fragments + + FragmentSpread: { + leave: ({ name, directives }) => + '...' + name + wrap(' ', join(directives, ' ')), + }, + + InlineFragment: { + leave: ({ typeCondition, directives, selectionSet }) => + join( + [ + '...', + wrap('on ', typeCondition), + join(directives, ' '), + selectionSet, + ], + ' ', + ), + }, + + FragmentDefinition: { + leave: ({ + name, + typeCondition, + variableDefinitions, + directives, + selectionSet, + }) => + // Note: fragment variable definitions are experimental and may be changed + // or removed in the future. + `fragment ${name}${wrap('(', join(variableDefinitions, ', '), ')')} ` + + `on ${typeCondition} ${wrap('', join(directives, ' '), ' ')}` + + selectionSet, + }, + + // Value + + IntValue: { leave: ({ value }) => value }, + FloatValue: { leave: ({ value }) => value }, + StringValue: { + leave: ({ value, block: isBlockString }) => + isBlockString ? printBlockString(value) : printString(value), + }, + BooleanValue: { leave: ({ value }) => (value ? 'true' : 'false') }, + NullValue: { leave: () => 'null' }, + EnumValue: { leave: ({ value }) => value }, + ListValue: { leave: ({ values }) => '[' + join(values, ', ') + ']' }, + ObjectValue: { leave: ({ fields }) => '{' + join(fields, ', ') + '}' }, + ObjectField: { leave: ({ name, value }) => name + ': ' + value }, + + // Directive + + Directive: { + leave: ({ name, arguments: args }) => + '@' + name + wrap('(', join(args, ', '), ')'), + }, + + // Type + + NamedType: { leave: ({ name }) => name }, + ListType: { leave: ({ type }) => '[' + type + ']' }, + NonNullType: { leave: ({ type }) => type + '!' }, + + // Type System Definitions + + SchemaDefinition: { + leave: ({ description, directives, operationTypes }) => + wrap('', description, '\n') + + join(['schema', join(directives, ' '), block(operationTypes)], ' '), + }, + + OperationTypeDefinition: { + leave: ({ operation, type }) => operation + ': ' + type, + }, + + ScalarTypeDefinition: { + leave: ({ description, name, directives }) => + wrap('', description, '\n') + + join(['scalar', name, join(directives, ' ')], ' '), + }, + + ObjectTypeDefinition: { + leave: ({ description, name, interfaces, directives, fields }) => + wrap('', description, '\n') + + join( + [ + 'type', + name, + wrap('implements ', join(interfaces, ' & ')), + join(directives, ' '), + block(fields), + ], + ' ', + ), + }, + + FieldDefinition: { + leave: ({ description, name, arguments: args, type, directives }) => + wrap('', description, '\n') + + name + + (hasMultilineItems(args) + ? wrap('(\n', indent(join(args, '\n')), '\n)') + : wrap('(', join(args, ', '), ')')) + + ': ' + + type + + wrap(' ', join(directives, ' ')), + }, + + InputValueDefinition: { + leave: ({ description, name, type, defaultValue, directives }) => + wrap('', description, '\n') + + join( + [name + ': ' + type, wrap('= ', defaultValue), join(directives, ' ')], + ' ', + ), + }, + + InterfaceTypeDefinition: { + leave: ({ description, name, interfaces, directives, fields }) => + wrap('', description, '\n') + + join( + [ + 'interface', + name, + wrap('implements ', join(interfaces, ' & ')), + join(directives, ' '), + block(fields), + ], + ' ', + ), + }, + + UnionTypeDefinition: { + leave: ({ description, name, directives, types }) => + wrap('', description, '\n') + + join( + ['union', name, join(directives, ' '), wrap('= ', join(types, ' | '))], + ' ', + ), + }, + + EnumTypeDefinition: { + leave: ({ description, name, directives, values }) => + wrap('', description, '\n') + + join(['enum', name, join(directives, ' '), block(values)], ' '), + }, + + EnumValueDefinition: { + leave: ({ description, name, directives }) => + wrap('', description, '\n') + join([name, join(directives, ' ')], ' '), + }, + + InputObjectTypeDefinition: { + leave: ({ description, name, directives, fields }) => + wrap('', description, '\n') + + join(['input', name, join(directives, ' '), block(fields)], ' '), + }, + + DirectiveDefinition: { + leave: ({ description, name, arguments: args, repeatable, locations }) => + wrap('', description, '\n') + + 'directive @' + + name + + (hasMultilineItems(args) + ? wrap('(\n', indent(join(args, '\n')), '\n)') + : wrap('(', join(args, ', '), ')')) + + (repeatable ? ' repeatable' : '') + + ' on ' + + join(locations, ' | '), + }, + + SchemaExtension: { + leave: ({ directives, operationTypes }) => + join( + ['extend schema', join(directives, ' '), block(operationTypes)], + ' ', + ), + }, + + ScalarTypeExtension: { + leave: ({ name, directives }) => + join(['extend scalar', name, join(directives, ' ')], ' '), + }, + + ObjectTypeExtension: { + leave: ({ name, interfaces, directives, fields }) => + join( + [ + 'extend type', + name, + wrap('implements ', join(interfaces, ' & ')), + join(directives, ' '), + block(fields), + ], + ' ', + ), + }, + + InterfaceTypeExtension: { + leave: ({ name, interfaces, directives, fields }) => + join( + [ + 'extend interface', + name, + wrap('implements ', join(interfaces, ' & ')), + join(directives, ' '), + block(fields), + ], + ' ', + ), + }, + + UnionTypeExtension: { + leave: ({ name, directives, types }) => + join( + [ + 'extend union', + name, + join(directives, ' '), + wrap('= ', join(types, ' | ')), + ], + ' ', + ), + }, + + EnumTypeExtension: { + leave: ({ name, directives, values }) => + join(['extend enum', name, join(directives, ' '), block(values)], ' '), + }, + + InputObjectTypeExtension: { + leave: ({ name, directives, fields }) => + join(['extend input', name, join(directives, ' '), block(fields)], ' '), + }, +}; + +/** + * Given maybeArray, print an empty string if it is null or empty, otherwise + * print all items together separated by separator if provided + */ +function join( + maybeArray: Maybe>, + separator = '', +): string { + return maybeArray?.filter((x) => x).join(separator) ?? ''; +} + +/** + * Given array, print each item on its own line, wrapped in an indented `{ }` block. + */ +function block(array: Maybe>): string { + return wrap('{\n', indent(join(array, '\n')), '\n}'); +} + +/** + * If maybeString is not null or empty, then wrap with start and end, otherwise print an empty string. + */ +function wrap( + start: string, + maybeString: Maybe, + end: string = '', +): string { + return maybeString != null && maybeString !== '' + ? start + maybeString + end + : ''; +} + +function indent(str: string): string { + return wrap(' ', str.replace(/\n/g, '\n ')); +} + +function hasMultilineItems(maybeArray: Maybe>): boolean { + // FIXME: https://github.com/graphql/graphql-js/issues/2203 + /* c8 ignore next */ + return maybeArray?.some((str) => str.includes('\n')) ?? false; +} diff --git a/src/language/source.ts b/src/language/source.ts new file mode 100644 index 00000000..15f65fce --- /dev/null +++ b/src/language/source.ts @@ -0,0 +1,57 @@ +import { devAssert } from '../jsutils/devAssert'; +import { inspect } from '../jsutils/inspect'; +import { instanceOf } from '../jsutils/instanceOf'; + +interface Location { + line: number; + column: number; +} + +/** + * A representation of source input to GraphQL. The `name` and `locationOffset` parameters are + * optional, but they are useful for clients who store GraphQL documents in source files. + * For example, if the GraphQL input starts at line 40 in a file named `Foo.graphql`, it might + * be useful for `name` to be `"Foo.graphql"` and location to be `{ line: 40, column: 1 }`. + * The `line` and `column` properties in `locationOffset` are 1-indexed. + */ +export class Source { + body: string; + name: string; + locationOffset: Location; + + constructor( + body: string, + name: string = 'GraphQL request', + locationOffset: Location = { line: 1, column: 1 }, + ) { + devAssert( + typeof body === 'string', + `Body must be a string. Received: ${inspect(body)}.`, + ); + + this.body = body; + this.name = name; + this.locationOffset = locationOffset; + devAssert( + this.locationOffset.line > 0, + 'line in locationOffset is 1-indexed and must be positive.', + ); + devAssert( + this.locationOffset.column > 0, + 'column in locationOffset is 1-indexed and must be positive.', + ); + } + + get [Symbol.toStringTag]() { + return 'Source'; + } +} + +/** + * Test if the given value is a Source object. + * + * @internal + */ +export function isSource(source: unknown): source is Source { + return instanceOf(source, Source); +} diff --git a/src/language/tokenKind.ts b/src/language/tokenKind.ts new file mode 100644 index 00000000..4878d697 --- /dev/null +++ b/src/language/tokenKind.ts @@ -0,0 +1,35 @@ +/** + * An exported enum describing the different kinds of tokens that the + * lexer emits. + */ +export enum TokenKind { + SOF = '', + EOF = '', + BANG = '!', + DOLLAR = '$', + AMP = '&', + PAREN_L = '(', + PAREN_R = ')', + SPREAD = '...', + COLON = ':', + EQUALS = '=', + AT = '@', + BRACKET_L = '[', + BRACKET_R = ']', + BRACE_L = '{', + PIPE = '|', + BRACE_R = '}', + NAME = 'Name', + INT = 'Int', + FLOAT = 'Float', + STRING = 'String', + BLOCK_STRING = 'BlockString', + COMMENT = 'Comment', +} + +/** + * The enum type representing the token kinds values. + * + * @deprecated Please use `TokenKind`. Will be remove in v17. + */ +export type TokenKindEnum = typeof TokenKind; diff --git a/src/language/visitor.ts b/src/language/visitor.ts new file mode 100644 index 00000000..821c9cb3 --- /dev/null +++ b/src/language/visitor.ts @@ -0,0 +1,414 @@ +import { devAssert } from '../jsutils/devAssert'; +import { inspect } from '../jsutils/inspect'; + +import type { ASTNode } from './ast'; +import { isNode, QueryDocumentKeys } from './ast'; +import { Kind } from './kinds'; + +/** + * A visitor is provided to visit, it contains the collection of + * relevant functions to be called during the visitor's traversal. + */ +export type ASTVisitor = EnterLeaveVisitor | KindVisitor; + +type KindVisitor = { + readonly [NodeT in ASTNode as NodeT['kind']]?: + | ASTVisitFn + | EnterLeaveVisitor; +}; + +interface EnterLeaveVisitor { + readonly enter?: ASTVisitFn; + readonly leave?: ASTVisitFn; +} + +/** + * A visitor is comprised of visit functions, which are called on each node + * during the visitor's traversal. + */ +export type ASTVisitFn = ( + /** The current node being visiting. */ + node: TVisitedNode, + /** The index or key to this node from the parent node or Array. */ + key: string | number | undefined, + /** The parent immediately above this node, which may be an Array. */ + parent: ASTNode | ReadonlyArray | undefined, + /** The key path to get to this node from the root node. */ + path: ReadonlyArray, + /** + * All nodes and Arrays visited before reaching parent of this node. + * These correspond to array indices in `path`. + * Note: ancestors includes arrays which contain the parent of visited node. + */ + ancestors: ReadonlyArray>, +) => any; + +/** + * A reducer is comprised of reducer functions which convert AST nodes into + * another form. + */ +export type ASTReducer = { + readonly [NodeT in ASTNode as NodeT['kind']]?: { + readonly enter?: ASTVisitFn; + readonly leave: ASTReducerFn; + }; +}; + +type ASTReducerFn = ( + /** The current node being visiting. */ + node: { [K in keyof TReducedNode]: ReducedField }, + /** The index or key to this node from the parent node or Array. */ + key: string | number | undefined, + /** The parent immediately above this node, which may be an Array. */ + parent: ASTNode | ReadonlyArray | undefined, + /** The key path to get to this node from the root node. */ + path: ReadonlyArray, + /** + * All nodes and Arrays visited before reaching parent of this node. + * These correspond to array indices in `path`. + * Note: ancestors includes arrays which contain the parent of visited node. + */ + ancestors: ReadonlyArray>, +) => R; + +type ReducedField = T extends null | undefined + ? T + : T extends ReadonlyArray + ? ReadonlyArray + : R; + +/** + * A KeyMap describes each the traversable properties of each kind of node. + * + * @deprecated Please inline it. Will be removed in v17 + */ +export type ASTVisitorKeyMap = { + [NodeT in ASTNode as NodeT['kind']]?: ReadonlyArray; +}; + +export const BREAK: unknown = Object.freeze({}); + +/** + * visit() will walk through an AST using a depth-first traversal, calling + * the visitor's enter function at each node in the traversal, and calling the + * leave function after visiting that node and all of its child nodes. + * + * By returning different values from the enter and leave functions, the + * behavior of the visitor can be altered, including skipping over a sub-tree of + * the AST (by returning false), editing the AST by returning a value or null + * to remove the value, or to stop the whole traversal by returning BREAK. + * + * When using visit() to edit an AST, the original AST will not be modified, and + * a new version of the AST with the changes applied will be returned from the + * visit function. + * + * ```ts + * const editedAST = visit(ast, { + * enter(node, key, parent, path, ancestors) { + * // @return + * // undefined: no action + * // false: skip visiting this node + * // visitor.BREAK: stop visiting altogether + * // null: delete this node + * // any value: replace this node with the returned value + * }, + * leave(node, key, parent, path, ancestors) { + * // @return + * // undefined: no action + * // false: no action + * // visitor.BREAK: stop visiting altogether + * // null: delete this node + * // any value: replace this node with the returned value + * } + * }); + * ``` + * + * Alternatively to providing enter() and leave() functions, a visitor can + * instead provide functions named the same as the kinds of AST nodes, or + * enter/leave visitors at a named key, leading to three permutations of the + * visitor API: + * + * 1) Named visitors triggered when entering a node of a specific kind. + * + * ```ts + * visit(ast, { + * Kind(node) { + * // enter the "Kind" node + * } + * }) + * ``` + * + * 2) Named visitors that trigger upon entering and leaving a node of a specific kind. + * + * ```ts + * visit(ast, { + * Kind: { + * enter(node) { + * // enter the "Kind" node + * } + * leave(node) { + * // leave the "Kind" node + * } + * } + * }) + * ``` + * + * 3) Generic visitors that trigger upon entering and leaving any node. + * + * ```ts + * visit(ast, { + * enter(node) { + * // enter any node + * }, + * leave(node) { + * // leave any node + * } + * }) + * ``` + */ +export function visit( + root: N, + visitor: ASTVisitor, + visitorKeys?: ASTVisitorKeyMap, +): N; +export function visit( + root: ASTNode, + visitor: ASTReducer, + visitorKeys?: ASTVisitorKeyMap, +): R; +export function visit( + root: ASTNode, + visitor: ASTVisitor | ASTReducer, + visitorKeys: ASTVisitorKeyMap = QueryDocumentKeys, +): any { + const enterLeaveMap = new Map>(); + for (const kind of Object.values(Kind)) { + enterLeaveMap.set(kind, getEnterLeaveForKind(visitor, kind)); + } + + /* eslint-disable no-undef-init */ + let stack: any = undefined; + let inArray = Array.isArray(root); + let keys: any = [root]; + let index = -1; + let edits = []; + let node: any = undefined; + let key: any = undefined; + let parent: any = undefined; + const path: any = []; + const ancestors = []; + let newRoot = root; + /* eslint-enable no-undef-init */ + + do { + index++; + const isLeaving = index === keys.length; + const isEdited = isLeaving && edits.length !== 0; + if (isLeaving) { + key = ancestors.length === 0 ? undefined : path[path.length - 1]; + node = parent; + parent = ancestors.pop(); + if (isEdited) { + if (inArray) { + node = node.slice(); + + let editOffset = 0; + for (const [editKey, editValue] of edits) { + const arrayKey = editKey - editOffset; + if (editValue === null) { + node.splice(arrayKey, 1); + editOffset++; + } else { + node[arrayKey] = editValue; + } + } + } else { + node = Object.defineProperties( + {}, + Object.getOwnPropertyDescriptors(node), + ); + for (const [editKey, editValue] of edits) { + node[editKey] = editValue; + } + } + } + index = stack.index; + keys = stack.keys; + edits = stack.edits; + inArray = stack.inArray; + stack = stack.prev; + } else { + key = parent ? (inArray ? index : keys[index]) : undefined; + node = parent ? parent[key] : newRoot; + if (node === null || node === undefined) { + continue; + } + if (parent) { + path.push(key); + } + } + + let result; + if (!Array.isArray(node)) { + devAssert(isNode(node), `Invalid AST Node: ${inspect(node)}.`); + + const visitFn = isLeaving + ? enterLeaveMap.get(node.kind)?.leave + : enterLeaveMap.get(node.kind)?.enter; + + result = visitFn?.call(visitor, node, key, parent, path, ancestors); + + if (result === BREAK) { + break; + } + + if (result === false) { + if (!isLeaving) { + path.pop(); + continue; + } + } else if (result !== undefined) { + edits.push([key, result]); + if (!isLeaving) { + if (isNode(result)) { + node = result; + } else { + path.pop(); + continue; + } + } + } + } + + if (result === undefined && isEdited) { + edits.push([key, node]); + } + + if (isLeaving) { + path.pop(); + } else { + stack = { inArray, index, keys, edits, prev: stack }; + inArray = Array.isArray(node); + keys = inArray ? node : (visitorKeys as any)[node.kind] ?? []; + index = -1; + edits = []; + if (parent) { + ancestors.push(parent); + } + parent = node; + } + } while (stack !== undefined); + + if (edits.length !== 0) { + newRoot = edits[edits.length - 1][1]; + } + + return newRoot; +} + +/** + * Creates a new visitor instance which delegates to many visitors to run in + * parallel. Each visitor will be visited for each node before moving on. + * + * If a prior visitor edits a node, no following visitors will see that node. + */ +export function visitInParallel( + visitors: ReadonlyArray, +): ASTVisitor { + const skipping = new Array(visitors.length).fill(null); + const mergedVisitor = Object.create(null); + + for (const kind of Object.values(Kind)) { + let hasVisitor = false; + const enterList = new Array(visitors.length).fill(undefined); + const leaveList = new Array(visitors.length).fill(undefined); + + for (let i = 0; i < visitors.length; ++i) { + const { enter, leave } = getEnterLeaveForKind(visitors[i], kind); + hasVisitor ||= enter != null || leave != null; + enterList[i] = enter; + leaveList[i] = leave; + } + + if (!hasVisitor) { + continue; + } + + const mergedEnterLeave: EnterLeaveVisitor = { + enter(...args) { + const node = args[0]; + for (let i = 0; i < visitors.length; i++) { + if (skipping[i] === null) { + const result = enterList[i]?.apply(visitors[i], args); + if (result === false) { + skipping[i] = node; + } else if (result === BREAK) { + skipping[i] = BREAK; + } else if (result !== undefined) { + return result; + } + } + } + }, + leave(...args) { + const node = args[0]; + for (let i = 0; i < visitors.length; i++) { + if (skipping[i] === null) { + const result = leaveList[i]?.apply(visitors[i], args); + if (result === BREAK) { + skipping[i] = BREAK; + } else if (result !== undefined && result !== false) { + return result; + } + } else if (skipping[i] === node) { + skipping[i] = null; + } + } + }, + }; + + mergedVisitor[kind] = mergedEnterLeave; + } + + return mergedVisitor; +} + +/** + * Given a visitor instance and a node kind, return EnterLeaveVisitor for that kind. + */ +export function getEnterLeaveForKind( + visitor: ASTVisitor, + kind: Kind, +): EnterLeaveVisitor { + const kindVisitor: + | ASTVisitFn + | EnterLeaveVisitor + | undefined = (visitor as any)[kind]; + + if (typeof kindVisitor === 'object') { + // { Kind: { enter() {}, leave() {} } } + return kindVisitor; + } else if (typeof kindVisitor === 'function') { + // { Kind() {} } + return { enter: kindVisitor, leave: undefined }; + } + + // { enter() {}, leave() {} } + return { enter: (visitor as any).enter, leave: (visitor as any).leave }; +} + +/** + * Given a visitor instance, if it is leaving or not, and a node kind, return + * the function the visitor runtime should call. + * + * @deprecated Please use `getEnterLeaveForKind` instead. Will be removed in v17 + */ +/* c8 ignore next 8 */ +export function getVisitFn( + visitor: ASTVisitor, + kind: Kind, + isLeaving: boolean, +): ASTVisitFn | undefined { + const { enter, leave } = getEnterLeaveForKind(visitor, kind); + return isLeaving ? leave : enter; +} diff --git a/src/subscription/README.md b/src/subscription/README.md new file mode 100644 index 00000000..7e099d2c --- /dev/null +++ b/src/subscription/README.md @@ -0,0 +1,10 @@ +## GraphQL Subscription + +NOTE: the `graphql/subscription` module has been deprecated with its exported functions integrated into the `graphql/execution` module, to better conform with the terminology of the GraphQL specification. For backwards compatibility, the `graphql/subscription` module currently re-exports the moved functions from the `graphql/execution` module. In the next major release, the `graphql/subscription` module will be dropped entirely. + +The `graphql/subscription` module is responsible for subscribing to updates on specific data. + +```js +import { subscribe, createSourceEventStream } from 'graphql/subscription'; // ES6 +var GraphQLSubscription = require('graphql/subscription'); // CommonJS +``` diff --git a/src/subscription/index.ts b/src/subscription/index.ts new file mode 100644 index 00000000..9de1b869 --- /dev/null +++ b/src/subscription/index.ts @@ -0,0 +1,23 @@ +/** + * NOTE: the `graphql/subscription` module has been deprecated with its + * exported functions integrated into the `graphql/execution` module, to + * better conform with the terminology of the GraphQL specification. + * + * For backwards compatibility, the `graphql/subscription` module + * currently re-exports the moved functions from the `graphql/execution` + * module. In the next major release, the `graphql/subscription` module + * will be dropped entirely. + */ + +import type { ExecutionArgs } from '../execution/execute'; + +/** + * @deprecated use ExecutionArgs instead. Will be removed in v17 + * + * ExecutionArgs has been broadened to include all properties within SubscriptionArgs. + * The SubscriptionArgs type is retained for backwards compatibility. + */ +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface SubscriptionArgs extends ExecutionArgs {} + +export { subscribe, createSourceEventStream } from '../execution/subscribe'; diff --git a/src/type/README.md b/src/type/README.md new file mode 100644 index 00000000..1c03491a --- /dev/null +++ b/src/type/README.md @@ -0,0 +1,8 @@ +## GraphQL Type System + +The `graphql/type` module is responsible for defining GraphQL types and schema. + +```js +import { ... } from 'graphql/type'; // ES6 +var GraphQLType = require('graphql/type'); // CommonJS +``` diff --git a/src/type/__tests__/assertName-test.ts b/src/type/__tests__/assertName-test.ts new file mode 100644 index 00000000..268b1c6e --- /dev/null +++ b/src/type/__tests__/assertName-test.ts @@ -0,0 +1,69 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { assertEnumValueName, assertName } from '../assertName'; + +describe('assertName', () => { + it('passthrough valid name', () => { + expect(assertName('_ValidName123')).to.equal('_ValidName123'); + }); + + it('throws for non-strings', () => { + // @ts-expect-error + expect(() => assertName({})).to.throw('Expected name to be a string.'); + }); + + it('throws on empty strings', () => { + expect(() => assertName('')).to.throw( + 'Expected name to be a non-empty string.', + ); + }); + + it('throws for names with invalid characters', () => { + expect(() => assertName('>--()-->')).to.throw( + 'Names must only contain [_a-zA-Z0-9] but ">--()-->" does not.', + ); + }); + + it('throws for names starting with invalid characters', () => { + expect(() => assertName('42MeaningsOfLife')).to.throw( + 'Names must start with [_a-zA-Z] but "42MeaningsOfLife" does not.', + ); + }); +}); + +describe('assertEnumValueName', () => { + it('passthrough valid name', () => { + expect(assertEnumValueName('_ValidName123')).to.equal('_ValidName123'); + }); + + it('throws on empty strings', () => { + expect(() => assertEnumValueName('')).to.throw( + 'Expected name to be a non-empty string.', + ); + }); + + it('throws for names with invalid characters', () => { + expect(() => assertEnumValueName('>--()-->')).to.throw( + 'Names must only contain [_a-zA-Z0-9] but ">--()-->" does not.', + ); + }); + + it('throws for names starting with invalid characters', () => { + expect(() => assertEnumValueName('42MeaningsOfLife')).to.throw( + 'Names must start with [_a-zA-Z] but "42MeaningsOfLife" does not.', + ); + }); + + it('throws for restricted names', () => { + expect(() => assertEnumValueName('true')).to.throw( + 'Enum values cannot be named: true', + ); + expect(() => assertEnumValueName('false')).to.throw( + 'Enum values cannot be named: false', + ); + expect(() => assertEnumValueName('null')).to.throw( + 'Enum values cannot be named: null', + ); + }); +}); diff --git a/src/type/__tests__/definition-test.ts b/src/type/__tests__/definition-test.ts new file mode 100644 index 00000000..19d48291 --- /dev/null +++ b/src/type/__tests__/definition-test.ts @@ -0,0 +1,1009 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { identityFunc } from '../../jsutils/identityFunc'; +import { inspect } from '../../jsutils/inspect'; + +import { parseValue } from '../../language/parser'; + +import type { GraphQLNullableType, GraphQLType } from '../definition'; +import { + GraphQLEnumType, + GraphQLInputObjectType, + GraphQLInterfaceType, + GraphQLList, + GraphQLNonNull, + GraphQLObjectType, + GraphQLScalarType, + GraphQLUnionType, +} from '../definition'; + +const ScalarType = new GraphQLScalarType({ name: 'Scalar' }); +const ObjectType = new GraphQLObjectType({ name: 'Object', fields: {} }); +const InterfaceType = new GraphQLInterfaceType({ + name: 'Interface', + fields: {}, +}); +const UnionType = new GraphQLUnionType({ name: 'Union', types: [ObjectType] }); +const EnumType = new GraphQLEnumType({ name: 'Enum', values: { foo: {} } }); +const InputObjectType = new GraphQLInputObjectType({ + name: 'InputObject', + fields: {}, +}); + +const ListOfScalarsType = new GraphQLList(ScalarType); +const NonNullScalarType = new GraphQLNonNull(ScalarType); +const ListOfNonNullScalarsType = new GraphQLList(NonNullScalarType); +const NonNullListOfScalars = new GraphQLNonNull(ListOfScalarsType); + +/* c8 ignore next */ +const dummyFunc = () => expect.fail('Never called and used as a placeholder'); + +describe('Type System: Scalars', () => { + it('accepts a Scalar type defining serialize', () => { + expect(() => new GraphQLScalarType({ name: 'SomeScalar' })).to.not.throw(); + }); + + it('accepts a Scalar type defining specifiedByURL', () => { + expect( + () => + new GraphQLScalarType({ + name: 'SomeScalar', + specifiedByURL: 'https://example.com/foo_spec', + }), + ).not.to.throw(); + }); + + it('accepts a Scalar type defining parseValue and parseLiteral', () => { + expect( + () => + new GraphQLScalarType({ + name: 'SomeScalar', + parseValue: dummyFunc, + parseLiteral: dummyFunc, + }), + ).to.not.throw(); + }); + + it('provides default methods if omitted', () => { + const scalar = new GraphQLScalarType({ name: 'Foo' }); + + expect(scalar.serialize).to.equal(identityFunc); + expect(scalar.parseValue).to.equal(identityFunc); + expect(scalar.parseLiteral).to.be.a('function'); + }); + + it('use parseValue for parsing literals if parseLiteral omitted', () => { + const scalar = new GraphQLScalarType({ + name: 'Foo', + parseValue(value) { + return 'parseValue: ' + inspect(value); + }, + }); + + expect(scalar.parseLiteral(parseValue('null'))).to.equal( + 'parseValue: null', + ); + expect(scalar.parseLiteral(parseValue('{ foo: "bar" }'))).to.equal( + 'parseValue: { foo: "bar" }', + ); + expect( + scalar.parseLiteral(parseValue('{ foo: { bar: $var } }'), { var: 'baz' }), + ).to.equal('parseValue: { foo: { bar: "baz" } }'); + }); + + it('rejects a Scalar type without name', () => { + // @ts-expect-error + expect(() => new GraphQLScalarType({})).to.throw('Must provide name.'); + }); + + it('rejects a Scalar type defining serialize with an incorrect type', () => { + expect( + () => + new GraphQLScalarType({ + name: 'SomeScalar', + // @ts-expect-error + serialize: {}, + }), + ).to.throw( + 'SomeScalar must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.', + ); + }); + + it('rejects a Scalar type defining parseLiteral but not parseValue', () => { + expect( + () => + new GraphQLScalarType({ + name: 'SomeScalar', + parseLiteral: dummyFunc, + }), + ).to.throw( + 'SomeScalar must provide both "parseValue" and "parseLiteral" functions.', + ); + }); + + it('rejects a Scalar type defining parseValue and parseLiteral with an incorrect type', () => { + expect( + () => + new GraphQLScalarType({ + name: 'SomeScalar', + // @ts-expect-error + parseValue: {}, + // @ts-expect-error + parseLiteral: {}, + }), + ).to.throw( + 'SomeScalar must provide both "parseValue" and "parseLiteral" functions.', + ); + }); + + it('rejects a Scalar type defining specifiedByURL with an incorrect type', () => { + expect( + () => + new GraphQLScalarType({ + name: 'SomeScalar', + // @ts-expect-error + specifiedByURL: {}, + }), + ).to.throw( + 'SomeScalar must provide "specifiedByURL" as a string, but got: {}.', + ); + }); +}); + +describe('Type System: Objects', () => { + it('does not mutate passed field definitions', () => { + const outputFields = { + field1: { type: ScalarType }, + field2: { + type: ScalarType, + args: { + id: { type: ScalarType }, + }, + }, + }; + const testObject1 = new GraphQLObjectType({ + name: 'Test1', + fields: outputFields, + }); + const testObject2 = new GraphQLObjectType({ + name: 'Test2', + fields: outputFields, + }); + + expect(testObject1.getFields()).to.deep.equal(testObject2.getFields()); + expect(outputFields).to.deep.equal({ + field1: { + type: ScalarType, + }, + field2: { + type: ScalarType, + args: { + id: { type: ScalarType }, + }, + }, + }); + + const inputFields = { + field1: { type: ScalarType }, + field2: { type: ScalarType }, + }; + const testInputObject1 = new GraphQLInputObjectType({ + name: 'Test1', + fields: inputFields, + }); + const testInputObject2 = new GraphQLInputObjectType({ + name: 'Test2', + fields: inputFields, + }); + + expect(testInputObject1.getFields()).to.deep.equal( + testInputObject2.getFields(), + ); + expect(inputFields).to.deep.equal({ + field1: { type: ScalarType }, + field2: { type: ScalarType }, + }); + }); + + it('defines an object type with deprecated field', () => { + const TypeWithDeprecatedField = new GraphQLObjectType({ + name: 'foo', + fields: { + bar: { + type: ScalarType, + deprecationReason: 'A terrible reason', + }, + baz: { + type: ScalarType, + deprecationReason: '', + }, + }, + }); + + expect(TypeWithDeprecatedField.getFields().bar).to.include({ + name: 'bar', + deprecationReason: 'A terrible reason', + }); + + expect(TypeWithDeprecatedField.getFields().baz).to.include({ + name: 'baz', + deprecationReason: '', + }); + }); + + it('accepts an Object type with a field function', () => { + const objType = new GraphQLObjectType({ + name: 'SomeObject', + fields: () => ({ + f: { type: ScalarType }, + }), + }); + expect(objType.getFields()).to.deep.equal({ + f: { + name: 'f', + description: undefined, + type: ScalarType, + args: [], + resolve: undefined, + subscribe: undefined, + deprecationReason: undefined, + extensions: {}, + astNode: undefined, + }, + }); + }); + + it('accepts an Object type with field args', () => { + const objType = new GraphQLObjectType({ + name: 'SomeObject', + fields: { + f: { + type: ScalarType, + args: { + arg: { type: ScalarType }, + }, + }, + }, + }); + expect(objType.getFields()).to.deep.equal({ + f: { + name: 'f', + description: undefined, + type: ScalarType, + args: [ + { + name: 'arg', + description: undefined, + type: ScalarType, + defaultValue: undefined, + deprecationReason: undefined, + extensions: {}, + astNode: undefined, + }, + ], + resolve: undefined, + subscribe: undefined, + deprecationReason: undefined, + extensions: {}, + astNode: undefined, + }, + }); + }); + + it('accepts an Object type with array interfaces', () => { + const objType = new GraphQLObjectType({ + name: 'SomeObject', + fields: {}, + interfaces: [InterfaceType], + }); + expect(objType.getInterfaces()).to.deep.equal([InterfaceType]); + }); + + it('accepts an Object type with interfaces as a function returning an array', () => { + const objType = new GraphQLObjectType({ + name: 'SomeObject', + fields: {}, + interfaces: () => [InterfaceType], + }); + expect(objType.getInterfaces()).to.deep.equal([InterfaceType]); + }); + + it('accepts a lambda as an Object field resolver', () => { + const objType = new GraphQLObjectType({ + name: 'SomeObject', + fields: { + f: { + type: ScalarType, + resolve: dummyFunc, + }, + }, + }); + expect(() => objType.getFields()).to.not.throw(); + }); + + it('rejects an Object type with invalid name', () => { + expect( + () => new GraphQLObjectType({ name: 'bad-name', fields: {} }), + ).to.throw('Names must only contain [_a-zA-Z0-9] but "bad-name" does not.'); + }); + + it('rejects an Object type field with undefined config', () => { + const objType = new GraphQLObjectType({ + name: 'SomeObject', + fields: { + // @ts-expect-error (must not be undefined) + f: undefined, + }, + }); + expect(() => objType.getFields()).to.throw( + 'SomeObject.f field config must be an object.', + ); + }); + + it('rejects an Object type with incorrectly typed fields', () => { + const objType = new GraphQLObjectType({ + name: 'SomeObject', + // @ts-expect-error + fields: [{ field: ScalarType }], + }); + expect(() => objType.getFields()).to.throw( + 'SomeObject fields must be an object with field names as keys or a function which returns such an object.', + ); + }); + + it('rejects an Object type with incorrectly named fields', () => { + const objType = new GraphQLObjectType({ + name: 'SomeObject', + fields: { + 'bad-name': { type: ScalarType }, + }, + }); + expect(() => objType.getFields()).to.throw( + 'Names must only contain [_a-zA-Z0-9] but "bad-name" does not.', + ); + }); + + it('rejects an Object type with a field function that returns incorrect type', () => { + const objType = new GraphQLObjectType({ + name: 'SomeObject', + // @ts-expect-error (Wrong type of return) + fields() { + return [{ field: ScalarType }]; + }, + }); + expect(() => objType.getFields()).to.throw(); + }); + + it('rejects an Object type with incorrectly typed field args', () => { + const objType = new GraphQLObjectType({ + name: 'SomeObject', + fields: { + badField: { + type: ScalarType, + // @ts-expect-error + args: [{ badArg: ScalarType }], + }, + }, + }); + expect(() => objType.getFields()).to.throw( + 'SomeObject.badField args must be an object with argument names as keys.', + ); + }); + + it('rejects an Object type with incorrectly named field args', () => { + const objType = new GraphQLObjectType({ + name: 'SomeObject', + fields: { + badField: { + type: ScalarType, + args: { + 'bad-name': { type: ScalarType }, + }, + }, + }, + }); + expect(() => objType.getFields()).to.throw( + 'Names must only contain [_a-zA-Z0-9] but "bad-name" does not.', + ); + }); + + it('rejects an Object type with incorrectly typed interfaces', () => { + const objType = new GraphQLObjectType({ + name: 'SomeObject', + fields: {}, + // @ts-expect-error + interfaces: {}, + }); + expect(() => objType.getInterfaces()).to.throw( + 'SomeObject interfaces must be an Array or a function which returns an Array.', + ); + }); + + it('rejects an Object type with interfaces as a function returning an incorrect type', () => { + const objType = new GraphQLObjectType({ + name: 'SomeObject', + fields: {}, + // @ts-expect-error (Expected interfaces to return array) + interfaces() { + return {}; + }, + }); + expect(() => objType.getInterfaces()).to.throw( + 'SomeObject interfaces must be an Array or a function which returns an Array.', + ); + }); + + it('rejects an empty Object field resolver', () => { + const objType = new GraphQLObjectType({ + name: 'SomeObject', + fields: { + // @ts-expect-error (Expected resolve to be a function) + field: { type: ScalarType, resolve: {} }, + }, + }); + + expect(() => objType.getFields()).to.throw( + 'SomeObject.field field resolver must be a function if provided, but got: {}.', + ); + }); + + it('rejects a constant scalar value resolver', () => { + const objType = new GraphQLObjectType({ + name: 'SomeObject', + fields: { + // @ts-expect-error (Expected resolve to be a function) + field: { type: ScalarType, resolve: 0 }, + }, + }); + + expect(() => objType.getFields()).to.throw( + 'SomeObject.field field resolver must be a function if provided, but got: 0.', + ); + }); + + it('rejects an Object type with an incorrect type for isTypeOf', () => { + expect( + () => + new GraphQLObjectType({ + name: 'AnotherObject', + fields: {}, + // @ts-expect-error + isTypeOf: {}, + }), + ).to.throw( + 'AnotherObject must provide "isTypeOf" as a function, but got: {}.', + ); + }); +}); + +describe('Type System: Interfaces', () => { + it('accepts an Interface type defining resolveType', () => { + expect( + () => + new GraphQLInterfaceType({ + name: 'AnotherInterface', + fields: { f: { type: ScalarType } }, + }), + ).to.not.throw(); + }); + + it('accepts an Interface type with an array of interfaces', () => { + const implementing = new GraphQLInterfaceType({ + name: 'AnotherInterface', + fields: {}, + interfaces: [InterfaceType], + }); + expect(implementing.getInterfaces()).to.deep.equal([InterfaceType]); + }); + + it('accepts an Interface type with interfaces as a function returning an array', () => { + const implementing = new GraphQLInterfaceType({ + name: 'AnotherInterface', + fields: {}, + interfaces: () => [InterfaceType], + }); + expect(implementing.getInterfaces()).to.deep.equal([InterfaceType]); + }); + + it('rejects an Interface type with invalid name', () => { + expect( + () => new GraphQLInterfaceType({ name: 'bad-name', fields: {} }), + ).to.throw('Names must only contain [_a-zA-Z0-9] but "bad-name" does not.'); + }); + + it('rejects an Interface type with incorrectly typed interfaces', () => { + const objType = new GraphQLInterfaceType({ + name: 'AnotherInterface', + fields: {}, + // @ts-expect-error + interfaces: {}, + }); + expect(() => objType.getInterfaces()).to.throw( + 'AnotherInterface interfaces must be an Array or a function which returns an Array.', + ); + }); + + it('rejects an Interface type with interfaces as a function returning an incorrect type', () => { + const objType = new GraphQLInterfaceType({ + name: 'AnotherInterface', + fields: {}, + // @ts-expect-error (Expected Array return) + interfaces() { + return {}; + }, + }); + expect(() => objType.getInterfaces()).to.throw( + 'AnotherInterface interfaces must be an Array or a function which returns an Array.', + ); + }); + + it('rejects an Interface type with an incorrect type for resolveType', () => { + expect( + () => + new GraphQLInterfaceType({ + name: 'AnotherInterface', + fields: {}, + // @ts-expect-error + resolveType: {}, + }), + ).to.throw( + 'AnotherInterface must provide "resolveType" as a function, but got: {}.', + ); + }); +}); + +describe('Type System: Unions', () => { + it('accepts a Union type defining resolveType', () => { + expect( + () => + new GraphQLUnionType({ + name: 'SomeUnion', + types: [ObjectType], + }), + ).to.not.throw(); + }); + + it('accepts a Union type with array types', () => { + const unionType = new GraphQLUnionType({ + name: 'SomeUnion', + types: [ObjectType], + }); + expect(unionType.getTypes()).to.deep.equal([ObjectType]); + }); + + it('accepts a Union type with function returning an array of types', () => { + const unionType = new GraphQLUnionType({ + name: 'SomeUnion', + types: () => [ObjectType], + }); + expect(unionType.getTypes()).to.deep.equal([ObjectType]); + }); + + it('accepts a Union type without types', () => { + const unionType = new GraphQLUnionType({ + name: 'SomeUnion', + types: [], + }); + expect(unionType.getTypes()).to.deep.equal([]); + }); + + it('rejects an Union type with invalid name', () => { + expect( + () => new GraphQLUnionType({ name: 'bad-name', types: [] }), + ).to.throw('Names must only contain [_a-zA-Z0-9] but "bad-name" does not.'); + }); + + it('rejects an Union type with an incorrect type for resolveType', () => { + expect( + () => + new GraphQLUnionType({ + name: 'SomeUnion', + types: [], + // @ts-expect-error + resolveType: {}, + }), + ).to.throw( + 'SomeUnion must provide "resolveType" as a function, but got: {}.', + ); + }); + + it('rejects a Union type with incorrectly typed types', () => { + const unionType = new GraphQLUnionType({ + name: 'SomeUnion', + // @ts-expect-error + types: { ObjectType }, + }); + + expect(() => unionType.getTypes()).to.throw( + 'Must provide Array of types or a function which returns such an array for Union SomeUnion.', + ); + }); +}); + +describe('Type System: Enums', () => { + it('defines an enum type with deprecated value', () => { + const EnumTypeWithDeprecatedValue = new GraphQLEnumType({ + name: 'EnumWithDeprecatedValue', + values: { + foo: { deprecationReason: 'Just because' }, + bar: { deprecationReason: '' }, + }, + }); + + expect(EnumTypeWithDeprecatedValue.getValues()[0]).to.include({ + name: 'foo', + deprecationReason: 'Just because', + }); + + expect(EnumTypeWithDeprecatedValue.getValues()[1]).to.include({ + name: 'bar', + deprecationReason: '', + }); + }); + + it('defines an enum type with a value of `null` and `undefined`', () => { + const EnumTypeWithNullishValue = new GraphQLEnumType({ + name: 'EnumWithNullishValue', + values: { + NULL: { value: null }, + NAN: { value: NaN }, + NO_CUSTOM_VALUE: { value: undefined }, + }, + }); + + expect(EnumTypeWithNullishValue.getValues()).to.deep.equal([ + { + name: 'NULL', + description: undefined, + value: null, + deprecationReason: undefined, + extensions: {}, + astNode: undefined, + }, + { + name: 'NAN', + description: undefined, + value: NaN, + deprecationReason: undefined, + extensions: {}, + astNode: undefined, + }, + { + name: 'NO_CUSTOM_VALUE', + description: undefined, + value: 'NO_CUSTOM_VALUE', + deprecationReason: undefined, + extensions: {}, + astNode: undefined, + }, + ]); + }); + + it('accepts a well defined Enum type with empty value definition', () => { + const enumType = new GraphQLEnumType({ + name: 'SomeEnum', + values: { + FOO: {}, + BAR: {}, + }, + }); + expect(enumType.getValue('FOO')).has.property('value', 'FOO'); + expect(enumType.getValue('BAR')).has.property('value', 'BAR'); + }); + + it('accepts a well defined Enum type with internal value definition', () => { + const enumType = new GraphQLEnumType({ + name: 'SomeEnum', + values: { + FOO: { value: 10 }, + BAR: { value: 20 }, + }, + }); + expect(enumType.getValue('FOO')).has.property('value', 10); + expect(enumType.getValue('BAR')).has.property('value', 20); + }); + + it('rejects an Enum type with invalid name', () => { + expect( + () => new GraphQLEnumType({ name: 'bad-name', values: {} }), + ).to.throw('Names must only contain [_a-zA-Z0-9] but "bad-name" does not.'); + }); + + it('rejects an Enum type with incorrectly typed values', () => { + expect( + () => + new GraphQLEnumType({ + name: 'SomeEnum', + // @ts-expect-error + values: [{ FOO: 10 }], + }), + ).to.throw('SomeEnum values must be an object with value names as keys.'); + }); + + it('rejects an Enum type with incorrectly named values', () => { + expect( + () => + new GraphQLEnumType({ + name: 'SomeEnum', + values: { + 'bad-name': {}, + }, + }), + ).to.throw('Names must only contain [_a-zA-Z0-9] but "bad-name" does not.'); + }); + + it('rejects an Enum type with missing value definition', () => { + expect( + () => + new GraphQLEnumType({ + name: 'SomeEnum', + // @ts-expect-error (must not be null) + values: { FOO: null }, + }), + ).to.throw( + 'SomeEnum.FOO must refer to an object with a "value" key representing an internal value but got: null.', + ); + }); + + it('rejects an Enum type with incorrectly typed value definition', () => { + expect( + () => + new GraphQLEnumType({ + name: 'SomeEnum', + // @ts-expect-error + values: { FOO: 10 }, + }), + ).to.throw( + 'SomeEnum.FOO must refer to an object with a "value" key representing an internal value but got: 10.', + ); + }); +}); + +describe('Type System: Input Objects', () => { + describe('Input Objects must have fields', () => { + it('accepts an Input Object type with fields', () => { + const inputObjType = new GraphQLInputObjectType({ + name: 'SomeInputObject', + fields: { + f: { type: ScalarType }, + }, + }); + expect(inputObjType.getFields()).to.deep.equal({ + f: { + name: 'f', + description: undefined, + type: ScalarType, + defaultValue: undefined, + deprecationReason: undefined, + extensions: {}, + astNode: undefined, + }, + }); + }); + + it('accepts an Input Object type with a field function', () => { + const inputObjType = new GraphQLInputObjectType({ + name: 'SomeInputObject', + fields: () => ({ + f: { type: ScalarType }, + }), + }); + expect(inputObjType.getFields()).to.deep.equal({ + f: { + name: 'f', + description: undefined, + type: ScalarType, + defaultValue: undefined, + extensions: {}, + deprecationReason: undefined, + astNode: undefined, + }, + }); + }); + + it('rejects an Input Object type with invalid name', () => { + expect( + () => new GraphQLInputObjectType({ name: 'bad-name', fields: {} }), + ).to.throw( + 'Names must only contain [_a-zA-Z0-9] but "bad-name" does not.', + ); + }); + + it('rejects an Input Object type with incorrect fields', () => { + const inputObjType = new GraphQLInputObjectType({ + name: 'SomeInputObject', + // @ts-expect-error + fields: [], + }); + expect(() => inputObjType.getFields()).to.throw( + 'SomeInputObject fields must be an object with field names as keys or a function which returns such an object.', + ); + }); + + it('rejects an Input Object type with fields function that returns incorrect type', () => { + const inputObjType = new GraphQLInputObjectType({ + name: 'SomeInputObject', + // @ts-expect-error + fields: () => [], + }); + expect(() => inputObjType.getFields()).to.throw( + 'SomeInputObject fields must be an object with field names as keys or a function which returns such an object.', + ); + }); + + it('rejects an Input Object type with incorrectly named fields', () => { + const inputObjType = new GraphQLInputObjectType({ + name: 'SomeInputObject', + fields: { + 'bad-name': { type: ScalarType }, + }, + }); + expect(() => inputObjType.getFields()).to.throw( + 'Names must only contain [_a-zA-Z0-9] but "bad-name" does not.', + ); + }); + }); + + describe('Input Object fields must not have resolvers', () => { + it('rejects an Input Object type with resolvers', () => { + const inputObjType = new GraphQLInputObjectType({ + name: 'SomeInputObject', + fields: { + // @ts-expect-error (Input fields cannot have resolvers) + f: { type: ScalarType, resolve: dummyFunc }, + }, + }); + expect(() => inputObjType.getFields()).to.throw( + 'SomeInputObject.f field has a resolve property, but Input Types cannot define resolvers.', + ); + }); + + it('rejects an Input Object type with resolver constant', () => { + const inputObjType = new GraphQLInputObjectType({ + name: 'SomeInputObject', + fields: { + // @ts-expect-error (Input fields cannot have resolvers) + f: { type: ScalarType, resolve: {} }, + }, + }); + expect(() => inputObjType.getFields()).to.throw( + 'SomeInputObject.f field has a resolve property, but Input Types cannot define resolvers.', + ); + }); + }); + + it('Deprecation reason is preserved on fields', () => { + const inputObjType = new GraphQLInputObjectType({ + name: 'SomeInputObject', + fields: { + deprecatedField: { + type: ScalarType, + deprecationReason: 'not used anymore', + }, + }, + }); + expect(inputObjType.toConfig()).to.have.nested.property( + 'fields.deprecatedField.deprecationReason', + 'not used anymore', + ); + }); +}); + +describe('Type System: List', () => { + function expectList(type: GraphQLType) { + return expect(() => new GraphQLList(type)); + } + + it('accepts an type as item type of list', () => { + expectList(ScalarType).to.not.throw(); + expectList(ObjectType).to.not.throw(); + expectList(UnionType).to.not.throw(); + expectList(InterfaceType).to.not.throw(); + expectList(EnumType).to.not.throw(); + expectList(InputObjectType).to.not.throw(); + expectList(ListOfScalarsType).to.not.throw(); + expectList(NonNullScalarType).to.not.throw(); + }); + + it('rejects a non-type as item type of list', () => { + // @ts-expect-error + expectList({}).to.throw('Expected {} to be a GraphQL type.'); + // @ts-expect-error + expectList(String).to.throw( + 'Expected [function String] to be a GraphQL type.', + ); + // @ts-expect-error (must provide type) + expectList(null).to.throw('Expected null to be a GraphQL type.'); + // @ts-expect-error (must provide type) + expectList(undefined).to.throw('Expected undefined to be a GraphQL type.'); + }); +}); + +describe('Type System: Non-Null', () => { + function expectNonNull(type: GraphQLNullableType) { + return expect(() => new GraphQLNonNull(type)); + } + + it('accepts an type as nullable type of non-null', () => { + expectNonNull(ScalarType).to.not.throw(); + expectNonNull(ObjectType).to.not.throw(); + expectNonNull(UnionType).to.not.throw(); + expectNonNull(InterfaceType).to.not.throw(); + expectNonNull(EnumType).to.not.throw(); + expectNonNull(InputObjectType).to.not.throw(); + expectNonNull(ListOfScalarsType).to.not.throw(); + expectNonNull(ListOfNonNullScalarsType).to.not.throw(); + }); + + it('rejects a non-type as nullable type of non-null', () => { + expectNonNull(NonNullScalarType).to.throw( + 'Expected Scalar! to be a GraphQL nullable type.', + ); + // @ts-expect-error + expectNonNull({}).to.throw('Expected {} to be a GraphQL nullable type.'); + // @ts-expect-error + expectNonNull(String).to.throw( + 'Expected [function String] to be a GraphQL nullable type.', + ); + // @ts-expect-error (must provide type) + expectNonNull(null).to.throw( + 'Expected null to be a GraphQL nullable type.', + ); + // @ts-expect-error (must provide type) + expectNonNull(undefined).to.throw( + 'Expected undefined to be a GraphQL nullable type.', + ); + }); +}); + +describe('Type System: test utility methods', () => { + it('stringifies types', () => { + expect(String(ScalarType)).to.equal('Scalar'); + expect(String(ObjectType)).to.equal('Object'); + expect(String(InterfaceType)).to.equal('Interface'); + expect(String(UnionType)).to.equal('Union'); + expect(String(EnumType)).to.equal('Enum'); + expect(String(InputObjectType)).to.equal('InputObject'); + + expect(String(NonNullScalarType)).to.equal('Scalar!'); + expect(String(ListOfScalarsType)).to.equal('[Scalar]'); + expect(String(NonNullListOfScalars)).to.equal('[Scalar]!'); + expect(String(ListOfNonNullScalarsType)).to.equal('[Scalar!]'); + expect(String(new GraphQLList(ListOfScalarsType))).to.equal('[[Scalar]]'); + }); + + it('JSON.stringifies types', () => { + expect(JSON.stringify(ScalarType)).to.equal('"Scalar"'); + expect(JSON.stringify(ObjectType)).to.equal('"Object"'); + expect(JSON.stringify(InterfaceType)).to.equal('"Interface"'); + expect(JSON.stringify(UnionType)).to.equal('"Union"'); + expect(JSON.stringify(EnumType)).to.equal('"Enum"'); + expect(JSON.stringify(InputObjectType)).to.equal('"InputObject"'); + + expect(JSON.stringify(NonNullScalarType)).to.equal('"Scalar!"'); + expect(JSON.stringify(ListOfScalarsType)).to.equal('"[Scalar]"'); + expect(JSON.stringify(NonNullListOfScalars)).to.equal('"[Scalar]!"'); + expect(JSON.stringify(ListOfNonNullScalarsType)).to.equal('"[Scalar!]"'); + expect(JSON.stringify(new GraphQLList(ListOfScalarsType))).to.equal( + '"[[Scalar]]"', + ); + }); + + it('Object.toStringifies types', () => { + function toString(obj: unknown): string { + return Object.prototype.toString.call(obj); + } + + expect(toString(ScalarType)).to.equal('[object GraphQLScalarType]'); + expect(toString(ObjectType)).to.equal('[object GraphQLObjectType]'); + expect(toString(InterfaceType)).to.equal('[object GraphQLInterfaceType]'); + expect(toString(UnionType)).to.equal('[object GraphQLUnionType]'); + expect(toString(EnumType)).to.equal('[object GraphQLEnumType]'); + expect(toString(InputObjectType)).to.equal( + '[object GraphQLInputObjectType]', + ); + expect(toString(NonNullScalarType)).to.equal('[object GraphQLNonNull]'); + expect(toString(ListOfScalarsType)).to.equal('[object GraphQLList]'); + }); +}); diff --git a/src/type/__tests__/directive-test.ts b/src/type/__tests__/directive-test.ts new file mode 100644 index 00000000..110a3cc9 --- /dev/null +++ b/src/type/__tests__/directive-test.ts @@ -0,0 +1,137 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { DirectiveLocation } from '../../language/directiveLocation'; + +import { GraphQLDirective } from '../directives'; +import { GraphQLInt, GraphQLString } from '../scalars'; + +describe('Type System: Directive', () => { + it('defines a directive with no args', () => { + const directive = new GraphQLDirective({ + name: 'Foo', + locations: [DirectiveLocation.QUERY], + }); + + expect(directive).to.deep.include({ + name: 'Foo', + args: [], + isRepeatable: false, + locations: ['QUERY'], + }); + }); + + it('defines a directive with multiple args', () => { + const directive = new GraphQLDirective({ + name: 'Foo', + args: { + foo: { type: GraphQLString }, + bar: { type: GraphQLInt }, + }, + locations: [DirectiveLocation.QUERY], + }); + + expect(directive).to.deep.include({ + name: 'Foo', + args: [ + { + name: 'foo', + description: undefined, + type: GraphQLString, + defaultValue: undefined, + deprecationReason: undefined, + extensions: {}, + astNode: undefined, + }, + { + name: 'bar', + description: undefined, + type: GraphQLInt, + defaultValue: undefined, + deprecationReason: undefined, + extensions: {}, + astNode: undefined, + }, + ], + isRepeatable: false, + locations: ['QUERY'], + }); + }); + + it('defines a repeatable directive', () => { + const directive = new GraphQLDirective({ + name: 'Foo', + isRepeatable: true, + locations: [DirectiveLocation.QUERY], + }); + + expect(directive).to.deep.include({ + name: 'Foo', + args: [], + isRepeatable: true, + locations: ['QUERY'], + }); + }); + + it('can be stringified, JSON.stringified and Object.toStringified', () => { + const directive = new GraphQLDirective({ + name: 'Foo', + locations: [DirectiveLocation.QUERY], + }); + + expect(String(directive)).to.equal('@Foo'); + expect(JSON.stringify(directive)).to.equal('"@Foo"'); + expect(Object.prototype.toString.call(directive)).to.equal( + '[object GraphQLDirective]', + ); + }); + + it('rejects a directive with invalid name', () => { + expect( + () => + new GraphQLDirective({ + name: 'bad-name', + locations: [DirectiveLocation.QUERY], + }), + ).to.throw('Names must only contain [_a-zA-Z0-9] but "bad-name" does not.'); + }); + + it('rejects a directive with incorrectly typed args', () => { + expect( + () => + new GraphQLDirective({ + name: 'Foo', + locations: [DirectiveLocation.QUERY], + // @ts-expect-error + args: [], + }), + ).to.throw('@Foo args must be an object with argument names as keys.'); + }); + + it('rejects a directive with incorrectly named arg', () => { + expect( + () => + new GraphQLDirective({ + name: 'Foo', + locations: [DirectiveLocation.QUERY], + args: { + 'bad-name': { type: GraphQLString }, + }, + }), + ).to.throw('Names must only contain [_a-zA-Z0-9] but "bad-name" does not.'); + }); + + it('rejects a directive with undefined locations', () => { + // @ts-expect-error + expect(() => new GraphQLDirective({ name: 'Foo' })).to.throw( + '@Foo locations must be an Array.', + ); + }); + + it('rejects a directive with incorrectly typed locations', () => { + // @ts-expect-error + expect(() => new GraphQLDirective({ name: 'Foo', locations: {} })).to.throw( + '@Foo locations must be an Array.', + ); + }); +}); diff --git a/src/type/__tests__/enumType-test.ts b/src/type/__tests__/enumType-test.ts new file mode 100644 index 00000000..35e9f94b --- /dev/null +++ b/src/type/__tests__/enumType-test.ts @@ -0,0 +1,406 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { expectJSON } from '../../__testUtils__/expectJSON'; + +import { introspectionFromSchema } from '../../utilities/introspectionFromSchema'; + +import { graphqlSync } from '../../graphql'; + +import { GraphQLEnumType, GraphQLObjectType } from '../definition'; +import { GraphQLBoolean, GraphQLInt, GraphQLString } from '../scalars'; +import { GraphQLSchema } from '../schema'; + +const ColorType = new GraphQLEnumType({ + name: 'Color', + values: { + RED: { value: 0 }, + GREEN: { value: 1 }, + BLUE: { value: 2 }, + }, +}); + +const Complex1 = { someRandomObject: new Date() }; +const Complex2 = { someRandomValue: 123 }; + +const ComplexEnum = new GraphQLEnumType({ + name: 'Complex', + values: { + ONE: { value: Complex1 }, + TWO: { value: Complex2 }, + }, +}); + +const QueryType = new GraphQLObjectType({ + name: 'Query', + fields: { + colorEnum: { + type: ColorType, + args: { + fromEnum: { type: ColorType }, + fromInt: { type: GraphQLInt }, + fromString: { type: GraphQLString }, + }, + resolve(_source, { fromEnum, fromInt, fromString }) { + return fromInt !== undefined + ? fromInt + : fromString !== undefined + ? fromString + : fromEnum; + }, + }, + colorInt: { + type: GraphQLInt, + args: { + fromEnum: { type: ColorType }, + }, + resolve(_source, { fromEnum }) { + return fromEnum; + }, + }, + complexEnum: { + type: ComplexEnum, + args: { + fromEnum: { + type: ComplexEnum, + // Note: defaultValue is provided an *internal* representation for + // Enums, rather than the string name. + defaultValue: Complex1, + }, + provideGoodValue: { type: GraphQLBoolean }, + provideBadValue: { type: GraphQLBoolean }, + }, + resolve(_source, { fromEnum, provideGoodValue, provideBadValue }) { + if (provideGoodValue) { + // Note: this is one of the references of the internal values which + // ComplexEnum allows. + return Complex2; + } + if (provideBadValue) { + // Note: similar shape, but not the same *reference* + // as Complex2 above. Enum internal values require === equality. + return { someRandomValue: 123 }; + } + return fromEnum; + }, + }, + }, +}); + +const MutationType = new GraphQLObjectType({ + name: 'Mutation', + fields: { + favoriteEnum: { + type: ColorType, + args: { color: { type: ColorType } }, + resolve: (_source, { color }) => color, + }, + }, +}); + +const SubscriptionType = new GraphQLObjectType({ + name: 'Subscription', + fields: { + subscribeToEnum: { + type: ColorType, + args: { color: { type: ColorType } }, + resolve: (_source, { color }) => color, + }, + }, +}); + +const schema = new GraphQLSchema({ + query: QueryType, + mutation: MutationType, + subscription: SubscriptionType, +}); + +function executeQuery( + source: string, + variableValues?: { readonly [variable: string]: unknown }, +) { + return graphqlSync({ schema, source, variableValues }); +} + +describe('Type System: Enum Values', () => { + it('accepts enum literals as input', () => { + const result = executeQuery('{ colorInt(fromEnum: GREEN) }'); + + expect(result).to.deep.equal({ + data: { colorInt: 1 }, + }); + }); + + it('enum may be output type', () => { + const result = executeQuery('{ colorEnum(fromInt: 1) }'); + + expect(result).to.deep.equal({ + data: { colorEnum: 'GREEN' }, + }); + }); + + it('enum may be both input and output type', () => { + const result = executeQuery('{ colorEnum(fromEnum: GREEN) }'); + + expect(result).to.deep.equal({ + data: { colorEnum: 'GREEN' }, + }); + }); + + it('does not accept string literals', () => { + const result = executeQuery('{ colorEnum(fromEnum: "GREEN") }'); + + expectJSON(result).toDeepEqual({ + errors: [ + { + message: + 'Enum "Color" cannot represent non-enum value: "GREEN". Did you mean the enum value "GREEN"?', + locations: [{ line: 1, column: 23 }], + }, + ], + }); + }); + + it('does not accept values not in the enum', () => { + const result = executeQuery('{ colorEnum(fromEnum: GREENISH) }'); + + expectJSON(result).toDeepEqual({ + errors: [ + { + message: + 'Value "GREENISH" does not exist in "Color" enum. Did you mean the enum value "GREEN"?', + locations: [{ line: 1, column: 23 }], + }, + ], + }); + }); + + it('does not accept values with incorrect casing', () => { + const result = executeQuery('{ colorEnum(fromEnum: green) }'); + + expectJSON(result).toDeepEqual({ + errors: [ + { + message: + 'Value "green" does not exist in "Color" enum. Did you mean the enum value "GREEN" or "RED"?', + locations: [{ line: 1, column: 23 }], + }, + ], + }); + }); + + it('does not accept incorrect internal value', () => { + const result = executeQuery('{ colorEnum(fromString: "GREEN") }'); + + expectJSON(result).toDeepEqual({ + data: { colorEnum: null }, + errors: [ + { + message: 'Enum "Color" cannot represent value: "GREEN"', + locations: [{ line: 1, column: 3 }], + path: ['colorEnum'], + }, + ], + }); + }); + + it('does not accept internal value in place of enum literal', () => { + const result = executeQuery('{ colorEnum(fromEnum: 1) }'); + + expectJSON(result).toDeepEqual({ + errors: [ + { + message: 'Enum "Color" cannot represent non-enum value: 1.', + locations: [{ line: 1, column: 23 }], + }, + ], + }); + }); + + it('does not accept enum literal in place of int', () => { + const result = executeQuery('{ colorEnum(fromInt: GREEN) }'); + + expectJSON(result).toDeepEqual({ + errors: [ + { + message: 'Int cannot represent non-integer value: GREEN', + locations: [{ line: 1, column: 22 }], + }, + ], + }); + }); + + it('accepts JSON string as enum variable', () => { + const doc = 'query ($color: Color!) { colorEnum(fromEnum: $color) }'; + const result = executeQuery(doc, { color: 'BLUE' }); + + expect(result).to.deep.equal({ + data: { colorEnum: 'BLUE' }, + }); + }); + + it('accepts enum literals as input arguments to mutations', () => { + const doc = 'mutation ($color: Color!) { favoriteEnum(color: $color) }'; + const result = executeQuery(doc, { color: 'GREEN' }); + + expect(result).to.deep.equal({ + data: { favoriteEnum: 'GREEN' }, + }); + }); + + it('accepts enum literals as input arguments to subscriptions', () => { + const doc = + 'subscription ($color: Color!) { subscribeToEnum(color: $color) }'; + const result = executeQuery(doc, { color: 'GREEN' }); + + expect(result).to.deep.equal({ + data: { subscribeToEnum: 'GREEN' }, + }); + }); + + it('does not accept internal value as enum variable', () => { + const doc = 'query ($color: Color!) { colorEnum(fromEnum: $color) }'; + const result = executeQuery(doc, { color: 2 }); + + expectJSON(result).toDeepEqual({ + errors: [ + { + message: + 'Variable "$color" got invalid value 2; Enum "Color" cannot represent non-string value: 2.', + locations: [{ line: 1, column: 8 }], + }, + ], + }); + }); + + it('does not accept string variables as enum input', () => { + const doc = 'query ($color: String!) { colorEnum(fromEnum: $color) }'; + const result = executeQuery(doc, { color: 'BLUE' }); + + expectJSON(result).toDeepEqual({ + errors: [ + { + message: + 'Variable "$color" of type "String!" used in position expecting type "Color".', + locations: [ + { line: 1, column: 8 }, + { line: 1, column: 47 }, + ], + }, + ], + }); + }); + + it('does not accept internal value variable as enum input', () => { + const doc = 'query ($color: Int!) { colorEnum(fromEnum: $color) }'; + const result = executeQuery(doc, { color: 2 }); + + expectJSON(result).toDeepEqual({ + errors: [ + { + message: + 'Variable "$color" of type "Int!" used in position expecting type "Color".', + locations: [ + { line: 1, column: 8 }, + { line: 1, column: 44 }, + ], + }, + ], + }); + }); + + it('enum value may have an internal value of 0', () => { + const result = executeQuery(` + { + colorEnum(fromEnum: RED) + colorInt(fromEnum: RED) + } + `); + + expect(result).to.deep.equal({ + data: { + colorEnum: 'RED', + colorInt: 0, + }, + }); + }); + + it('enum inputs may be nullable', () => { + const result = executeQuery(` + { + colorEnum + colorInt + } + `); + + expect(result).to.deep.equal({ + data: { + colorEnum: null, + colorInt: null, + }, + }); + }); + + it('presents a getValues() API for complex enums', () => { + const values = ComplexEnum.getValues(); + expect(values).to.have.deep.ordered.members([ + { + name: 'ONE', + description: undefined, + value: Complex1, + deprecationReason: undefined, + extensions: {}, + astNode: undefined, + }, + { + name: 'TWO', + description: undefined, + value: Complex2, + deprecationReason: undefined, + extensions: {}, + astNode: undefined, + }, + ]); + }); + + it('presents a getValue() API for complex enums', () => { + const oneValue = ComplexEnum.getValue('ONE'); + expect(oneValue).to.include({ name: 'ONE', value: Complex1 }); + + // @ts-expect-error + const badUsage = ComplexEnum.getValue(Complex1); + expect(badUsage).to.equal(undefined); + }); + + it('may be internally represented with complex values', () => { + const result = executeQuery(` + { + first: complexEnum + second: complexEnum(fromEnum: TWO) + good: complexEnum(provideGoodValue: true) + bad: complexEnum(provideBadValue: true) + } + `); + + expectJSON(result).toDeepEqual({ + data: { + first: 'ONE', + second: 'TWO', + good: 'TWO', + bad: null, + }, + errors: [ + { + message: + 'Enum "Complex" cannot represent value: { someRandomValue: 123 }', + locations: [{ line: 6, column: 9 }], + path: ['bad'], + }, + ], + }); + }); + + it('can be introspected without error', () => { + expect(() => introspectionFromSchema(schema)).to.not.throw(); + }); +}); diff --git a/src/type/__tests__/extensions-test.ts b/src/type/__tests__/extensions-test.ts new file mode 100644 index 00000000..4fb08274 --- /dev/null +++ b/src/type/__tests__/extensions-test.ts @@ -0,0 +1,393 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { invariant } from '../../jsutils/invariant'; + +import { + GraphQLEnumType, + GraphQLInputObjectType, + GraphQLInterfaceType, + GraphQLObjectType, + GraphQLScalarType, + GraphQLUnionType, +} from '../definition'; +import { GraphQLDirective } from '../directives'; +import { GraphQLSchema } from '../schema'; + +const dummyType = new GraphQLScalarType({ name: 'DummyScalar' }); + +function expectObjMap(value: unknown) { + invariant(value != null && typeof value === 'object'); + expect(Object.getPrototypeOf(value)).to.equal(null); + return expect(value); +} + +describe('Type System: Extensions', () => { + describe('GraphQLScalarType', () => { + it('without extensions', () => { + const someScalar = new GraphQLScalarType({ name: 'SomeScalar' }); + expect(someScalar.extensions).to.deep.equal({}); + + const config = someScalar.toConfig(); + expect(config.extensions).to.deep.equal({}); + }); + + it('with extensions', () => { + const scalarExtensions = Object.freeze({ SomeScalarExt: 'scalar' }); + const someScalar = new GraphQLScalarType({ + name: 'SomeScalar', + extensions: scalarExtensions, + }); + + expectObjMap(someScalar.extensions).to.deep.equal(scalarExtensions); + + const config = someScalar.toConfig(); + expectObjMap(config.extensions).to.deep.equal(scalarExtensions); + }); + }); + + describe('GraphQLObjectType', () => { + it('without extensions', () => { + const someObject = new GraphQLObjectType({ + name: 'SomeObject', + fields: { + someField: { + type: dummyType, + args: { + someArg: { + type: dummyType, + }, + }, + }, + }, + }); + + expect(someObject.extensions).to.deep.equal({}); + const someField = someObject.getFields().someField; + expect(someField.extensions).to.deep.equal({}); + const someArg = someField.args[0]; + expect(someArg.extensions).to.deep.equal({}); + + const config = someObject.toConfig(); + expect(config.extensions).to.deep.equal({}); + const someFieldConfig = config.fields.someField; + expect(someFieldConfig.extensions).to.deep.equal({}); + invariant(someFieldConfig.args); + const someArgConfig = someFieldConfig.args.someArg; + expect(someArgConfig.extensions).to.deep.equal({}); + }); + + it('with extensions', () => { + const objectExtensions = Object.freeze({ SomeObjectExt: 'object' }); + const fieldExtensions = Object.freeze({ SomeFieldExt: 'field' }); + const argExtensions = Object.freeze({ SomeArgExt: 'arg' }); + + const someObject = new GraphQLObjectType({ + name: 'SomeObject', + fields: { + someField: { + type: dummyType, + args: { + someArg: { + type: dummyType, + extensions: argExtensions, + }, + }, + extensions: fieldExtensions, + }, + }, + extensions: objectExtensions, + }); + + expectObjMap(someObject.extensions).to.deep.equal(objectExtensions); + const someField = someObject.getFields().someField; + expectObjMap(someField.extensions).to.deep.equal(fieldExtensions); + const someArg = someField.args[0]; + expectObjMap(someArg.extensions).to.deep.equal(argExtensions); + + const config = someObject.toConfig(); + expectObjMap(config.extensions).to.deep.equal(objectExtensions); + const someFieldConfig = config.fields.someField; + expectObjMap(someFieldConfig.extensions).to.deep.equal(fieldExtensions); + invariant(someFieldConfig.args); + const someArgConfig = someFieldConfig.args.someArg; + expectObjMap(someArgConfig.extensions).to.deep.equal(argExtensions); + }); + }); + + describe('GraphQLInterfaceType', () => { + it('without extensions', () => { + const someInterface = new GraphQLInterfaceType({ + name: 'SomeInterface', + fields: { + someField: { + type: dummyType, + args: { + someArg: { + type: dummyType, + }, + }, + }, + }, + }); + + expect(someInterface.extensions).to.deep.equal({}); + const someField = someInterface.getFields().someField; + expect(someField.extensions).to.deep.equal({}); + const someArg = someField.args[0]; + expect(someArg.extensions).to.deep.equal({}); + + const config = someInterface.toConfig(); + expect(config.extensions).to.deep.equal({}); + const someFieldConfig = config.fields.someField; + expect(someFieldConfig.extensions).to.deep.equal({}); + invariant(someFieldConfig.args); + const someArgConfig = someFieldConfig.args.someArg; + expect(someArgConfig.extensions).to.deep.equal({}); + }); + + it('with extensions', () => { + const interfaceExtensions = Object.freeze({ + SomeInterfaceExt: 'interface', + }); + const fieldExtensions = Object.freeze({ SomeFieldExt: 'field' }); + const argExtensions = Object.freeze({ SomeArgExt: 'arg' }); + + const someInterface = new GraphQLInterfaceType({ + name: 'SomeInterface', + fields: { + someField: { + type: dummyType, + args: { + someArg: { + type: dummyType, + extensions: argExtensions, + }, + }, + extensions: fieldExtensions, + }, + }, + extensions: interfaceExtensions, + }); + + expectObjMap(someInterface.extensions).to.deep.equal(interfaceExtensions); + const someField = someInterface.getFields().someField; + expectObjMap(someField.extensions).to.deep.equal(fieldExtensions); + const someArg = someField.args[0]; + expectObjMap(someArg.extensions).to.deep.equal(argExtensions); + + const config = someInterface.toConfig(); + expectObjMap(config.extensions).to.deep.equal(interfaceExtensions); + const someFieldConfig = config.fields.someField; + expectObjMap(someFieldConfig.extensions).to.deep.equal(fieldExtensions); + invariant(someFieldConfig.args); + const someArgConfig = someFieldConfig.args.someArg; + expectObjMap(someArgConfig.extensions).to.deep.equal(argExtensions); + }); + }); + + describe('GraphQLUnionType', () => { + it('without extensions', () => { + const someUnion = new GraphQLUnionType({ + name: 'SomeUnion', + types: [], + }); + + expect(someUnion.extensions).to.deep.equal({}); + + const config = someUnion.toConfig(); + expect(config.extensions).to.deep.equal({}); + }); + + it('with extensions', () => { + const unionExtensions = Object.freeze({ SomeUnionExt: 'union' }); + + const someUnion = new GraphQLUnionType({ + name: 'SomeUnion', + types: [], + extensions: unionExtensions, + }); + + expectObjMap(someUnion.extensions).to.deep.equal(unionExtensions); + + const config = someUnion.toConfig(); + expectObjMap(config.extensions).to.deep.equal(unionExtensions); + }); + }); + + describe('GraphQLEnumType', () => { + it('without extensions', () => { + const someEnum = new GraphQLEnumType({ + name: 'SomeEnum', + values: { + SOME_VALUE: {}, + }, + }); + + expect(someEnum.extensions).to.deep.equal({}); + const someValue = someEnum.getValues()[0]; + expect(someValue.extensions).to.deep.equal({}); + + const config = someEnum.toConfig(); + expect(config.extensions).to.deep.equal({}); + const someValueConfig = config.values.SOME_VALUE; + expect(someValueConfig.extensions).to.deep.equal({}); + }); + + it('with extensions', () => { + const enumExtensions = Object.freeze({ SomeEnumExt: 'enum' }); + const valueExtensions = Object.freeze({ SomeValueExt: 'value' }); + + const someEnum = new GraphQLEnumType({ + name: 'SomeEnum', + values: { + SOME_VALUE: { + extensions: valueExtensions, + }, + }, + extensions: enumExtensions, + }); + + expectObjMap(someEnum.extensions).to.deep.equal(enumExtensions); + const someValue = someEnum.getValues()[0]; + expectObjMap(someValue.extensions).to.deep.equal(valueExtensions); + + const config = someEnum.toConfig(); + expectObjMap(config.extensions).to.deep.equal(enumExtensions); + const someValueConfig = config.values.SOME_VALUE; + expectObjMap(someValueConfig.extensions).to.deep.equal(valueExtensions); + }); + }); + + describe('GraphQLInputObjectType', () => { + it('without extensions', () => { + const someInputObject = new GraphQLInputObjectType({ + name: 'SomeInputObject', + fields: { + someInputField: { + type: dummyType, + }, + }, + }); + + expect(someInputObject.extensions).to.deep.equal({}); + const someInputField = someInputObject.getFields().someInputField; + expect(someInputField.extensions).to.deep.equal({}); + + const config = someInputObject.toConfig(); + expect(config.extensions).to.deep.equal({}); + const someInputFieldConfig = config.fields.someInputField; + expect(someInputFieldConfig.extensions).to.deep.equal({}); + }); + + it('with extensions', () => { + const inputObjectExtensions = Object.freeze({ + SomeInputObjectExt: 'inputObject', + }); + const inputFieldExtensions = Object.freeze({ + SomeInputFieldExt: 'inputField', + }); + + const someInputObject = new GraphQLInputObjectType({ + name: 'SomeInputObject', + fields: { + someInputField: { + type: dummyType, + extensions: inputFieldExtensions, + }, + }, + extensions: inputObjectExtensions, + }); + + expectObjMap(someInputObject.extensions).to.deep.equal( + inputObjectExtensions, + ); + const someInputField = someInputObject.getFields().someInputField; + expectObjMap(someInputField.extensions).to.deep.equal( + inputFieldExtensions, + ); + + const config = someInputObject.toConfig(); + expectObjMap(config.extensions).to.deep.equal(inputObjectExtensions); + const someInputFieldConfig = config.fields.someInputField; + expectObjMap(someInputFieldConfig.extensions).to.deep.equal( + inputFieldExtensions, + ); + }); + }); + + describe('GraphQLDirective', () => { + it('without extensions', () => { + const someDirective = new GraphQLDirective({ + name: 'SomeDirective', + args: { + someArg: { + type: dummyType, + }, + }, + locations: [], + }); + + expect(someDirective.extensions).to.deep.equal({}); + const someArg = someDirective.args[0]; + expect(someArg.extensions).to.deep.equal({}); + + const config = someDirective.toConfig(); + expect(config.extensions).to.deep.equal({}); + const someArgConfig = config.args.someArg; + expect(someArgConfig.extensions).to.deep.equal({}); + }); + + it('with extensions', () => { + const directiveExtensions = Object.freeze({ + SomeDirectiveExt: 'directive', + }); + const argExtensions = Object.freeze({ SomeArgExt: 'arg' }); + + const someDirective = new GraphQLDirective({ + name: 'SomeDirective', + args: { + someArg: { + type: dummyType, + extensions: argExtensions, + }, + }, + locations: [], + extensions: directiveExtensions, + }); + + expectObjMap(someDirective.extensions).to.deep.equal(directiveExtensions); + const someArg = someDirective.args[0]; + expectObjMap(someArg.extensions).to.deep.equal(argExtensions); + + const config = someDirective.toConfig(); + expectObjMap(config.extensions).to.deep.equal(directiveExtensions); + const someArgConfig = config.args.someArg; + expectObjMap(someArgConfig.extensions).to.deep.equal(argExtensions); + }); + }); + + describe('GraphQLSchema', () => { + it('without extensions', () => { + const schema = new GraphQLSchema({}); + + expect(schema.extensions).to.deep.equal({}); + + const config = schema.toConfig(); + expect(config.extensions).to.deep.equal({}); + }); + + it('with extensions', () => { + const schemaExtensions = Object.freeze({ + schemaExtension: 'schema', + }); + + const schema = new GraphQLSchema({ extensions: schemaExtensions }); + + expectObjMap(schema.extensions).to.deep.equal(schemaExtensions); + + const config = schema.toConfig(); + expectObjMap(config.extensions).to.deep.equal(schemaExtensions); + }); + }); +}); diff --git a/src/type/__tests__/introspection-test.ts b/src/type/__tests__/introspection-test.ts new file mode 100644 index 00000000..741d9c00 --- /dev/null +++ b/src/type/__tests__/introspection-test.ts @@ -0,0 +1,1651 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { expectJSON } from '../../__testUtils__/expectJSON'; + +import { buildSchema } from '../../utilities/buildASTSchema'; +import { getIntrospectionQuery } from '../../utilities/getIntrospectionQuery'; + +import { graphqlSync } from '../../graphql'; + +import type { GraphQLResolveInfo } from '../definition'; + +describe('Introspection', () => { + it('executes an introspection query', () => { + const schema = buildSchema(` + type SomeObject { + someField: String + } + + schema { + query: SomeObject + } + `); + + const source = getIntrospectionQuery({ + descriptions: false, + specifiedByUrl: true, + directiveIsRepeatable: true, + }); + + const result = graphqlSync({ schema, source }); + expect(result).to.deep.equal({ + data: { + __schema: { + queryType: { name: 'SomeObject' }, + mutationType: null, + subscriptionType: null, + types: [ + { + kind: 'OBJECT', + name: 'SomeObject', + specifiedByURL: null, + fields: [ + { + name: 'someField', + args: [], + type: { + kind: 'SCALAR', + name: 'String', + ofType: null, + }, + isDeprecated: false, + deprecationReason: null, + }, + ], + inputFields: null, + interfaces: [], + enumValues: null, + possibleTypes: null, + }, + { + kind: 'SCALAR', + name: 'String', + specifiedByURL: null, + fields: null, + inputFields: null, + interfaces: null, + enumValues: null, + possibleTypes: null, + }, + { + kind: 'SCALAR', + name: 'Boolean', + specifiedByURL: null, + fields: null, + inputFields: null, + interfaces: null, + enumValues: null, + possibleTypes: null, + }, + { + kind: 'OBJECT', + name: '__Schema', + specifiedByURL: null, + fields: [ + { + name: 'description', + args: [], + type: { + kind: 'SCALAR', + name: 'String', + ofType: null, + }, + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'types', + args: [], + type: { + kind: 'NON_NULL', + name: null, + ofType: { + kind: 'LIST', + name: null, + ofType: { + kind: 'NON_NULL', + name: null, + ofType: { + kind: 'OBJECT', + name: '__Type', + ofType: null, + }, + }, + }, + }, + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'queryType', + args: [], + type: { + kind: 'NON_NULL', + name: null, + ofType: { + kind: 'OBJECT', + name: '__Type', + ofType: null, + }, + }, + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'mutationType', + args: [], + type: { + kind: 'OBJECT', + name: '__Type', + ofType: null, + }, + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'subscriptionType', + args: [], + type: { + kind: 'OBJECT', + name: '__Type', + ofType: null, + }, + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'directives', + args: [], + type: { + kind: 'NON_NULL', + name: null, + ofType: { + kind: 'LIST', + name: null, + ofType: { + kind: 'NON_NULL', + name: null, + ofType: { + kind: 'OBJECT', + name: '__Directive', + ofType: null, + }, + }, + }, + }, + isDeprecated: false, + deprecationReason: null, + }, + ], + inputFields: null, + interfaces: [], + enumValues: null, + possibleTypes: null, + }, + { + kind: 'OBJECT', + name: '__Type', + specifiedByURL: null, + fields: [ + { + name: 'kind', + args: [], + type: { + kind: 'NON_NULL', + name: null, + ofType: { + kind: 'ENUM', + name: '__TypeKind', + ofType: null, + }, + }, + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'name', + args: [], + type: { + kind: 'SCALAR', + name: 'String', + ofType: null, + }, + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'description', + args: [], + type: { + kind: 'SCALAR', + name: 'String', + ofType: null, + }, + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'specifiedByURL', + args: [], + type: { + kind: 'SCALAR', + name: 'String', + ofType: null, + }, + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'fields', + args: [ + { + name: 'includeDeprecated', + type: { + kind: 'SCALAR', + name: 'Boolean', + ofType: null, + }, + defaultValue: 'false', + }, + ], + type: { + kind: 'LIST', + name: null, + ofType: { + kind: 'NON_NULL', + name: null, + ofType: { + kind: 'OBJECT', + name: '__Field', + ofType: null, + }, + }, + }, + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'interfaces', + args: [], + type: { + kind: 'LIST', + name: null, + ofType: { + kind: 'NON_NULL', + name: null, + ofType: { + kind: 'OBJECT', + name: '__Type', + ofType: null, + }, + }, + }, + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'possibleTypes', + args: [], + type: { + kind: 'LIST', + name: null, + ofType: { + kind: 'NON_NULL', + name: null, + ofType: { + kind: 'OBJECT', + name: '__Type', + ofType: null, + }, + }, + }, + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'enumValues', + args: [ + { + name: 'includeDeprecated', + type: { + kind: 'SCALAR', + name: 'Boolean', + ofType: null, + }, + defaultValue: 'false', + }, + ], + type: { + kind: 'LIST', + name: null, + ofType: { + kind: 'NON_NULL', + name: null, + ofType: { + kind: 'OBJECT', + name: '__EnumValue', + ofType: null, + }, + }, + }, + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'inputFields', + args: [ + { + name: 'includeDeprecated', + type: { + kind: 'SCALAR', + name: 'Boolean', + ofType: null, + }, + defaultValue: 'false', + }, + ], + type: { + kind: 'LIST', + name: null, + ofType: { + kind: 'NON_NULL', + name: null, + ofType: { + kind: 'OBJECT', + name: '__InputValue', + ofType: null, + }, + }, + }, + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'ofType', + args: [], + type: { + kind: 'OBJECT', + name: '__Type', + ofType: null, + }, + isDeprecated: false, + deprecationReason: null, + }, + ], + inputFields: null, + interfaces: [], + enumValues: null, + possibleTypes: null, + }, + { + kind: 'ENUM', + name: '__TypeKind', + specifiedByURL: null, + fields: null, + inputFields: null, + interfaces: null, + enumValues: [ + { + name: 'SCALAR', + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'OBJECT', + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'INTERFACE', + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'UNION', + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'ENUM', + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'INPUT_OBJECT', + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'LIST', + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'NON_NULL', + isDeprecated: false, + deprecationReason: null, + }, + ], + possibleTypes: null, + }, + { + kind: 'OBJECT', + name: '__Field', + specifiedByURL: null, + fields: [ + { + name: 'name', + args: [], + type: { + kind: 'NON_NULL', + name: null, + ofType: { + kind: 'SCALAR', + name: 'String', + ofType: null, + }, + }, + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'description', + args: [], + type: { + kind: 'SCALAR', + name: 'String', + ofType: null, + }, + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'args', + args: [ + { + name: 'includeDeprecated', + type: { + kind: 'SCALAR', + name: 'Boolean', + ofType: null, + }, + defaultValue: 'false', + }, + ], + type: { + kind: 'NON_NULL', + name: null, + ofType: { + kind: 'LIST', + name: null, + ofType: { + kind: 'NON_NULL', + name: null, + ofType: { + kind: 'OBJECT', + name: '__InputValue', + ofType: null, + }, + }, + }, + }, + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'type', + args: [], + type: { + kind: 'NON_NULL', + name: null, + ofType: { + kind: 'OBJECT', + name: '__Type', + ofType: null, + }, + }, + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'isDeprecated', + args: [], + type: { + kind: 'NON_NULL', + name: null, + ofType: { + kind: 'SCALAR', + name: 'Boolean', + ofType: null, + }, + }, + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'deprecationReason', + args: [], + type: { + kind: 'SCALAR', + name: 'String', + ofType: null, + }, + isDeprecated: false, + deprecationReason: null, + }, + ], + inputFields: null, + interfaces: [], + enumValues: null, + possibleTypes: null, + }, + { + kind: 'OBJECT', + name: '__InputValue', + specifiedByURL: null, + fields: [ + { + name: 'name', + args: [], + type: { + kind: 'NON_NULL', + name: null, + ofType: { + kind: 'SCALAR', + name: 'String', + ofType: null, + }, + }, + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'description', + args: [], + type: { + kind: 'SCALAR', + name: 'String', + ofType: null, + }, + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'type', + args: [], + type: { + kind: 'NON_NULL', + name: null, + ofType: { + kind: 'OBJECT', + name: '__Type', + ofType: null, + }, + }, + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'defaultValue', + args: [], + type: { + kind: 'SCALAR', + name: 'String', + ofType: null, + }, + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'isDeprecated', + args: [], + type: { + kind: 'NON_NULL', + name: null, + ofType: { + kind: 'SCALAR', + name: 'Boolean', + ofType: null, + }, + }, + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'deprecationReason', + args: [], + type: { + kind: 'SCALAR', + name: 'String', + ofType: null, + }, + isDeprecated: false, + deprecationReason: null, + }, + ], + inputFields: null, + interfaces: [], + enumValues: null, + possibleTypes: null, + }, + { + kind: 'OBJECT', + name: '__EnumValue', + specifiedByURL: null, + fields: [ + { + name: 'name', + args: [], + type: { + kind: 'NON_NULL', + name: null, + ofType: { + kind: 'SCALAR', + name: 'String', + ofType: null, + }, + }, + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'description', + args: [], + type: { + kind: 'SCALAR', + name: 'String', + ofType: null, + }, + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'isDeprecated', + args: [], + type: { + kind: 'NON_NULL', + name: null, + ofType: { + kind: 'SCALAR', + name: 'Boolean', + ofType: null, + }, + }, + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'deprecationReason', + args: [], + type: { + kind: 'SCALAR', + name: 'String', + ofType: null, + }, + isDeprecated: false, + deprecationReason: null, + }, + ], + inputFields: null, + interfaces: [], + enumValues: null, + possibleTypes: null, + }, + { + kind: 'OBJECT', + name: '__Directive', + specifiedByURL: null, + fields: [ + { + name: 'name', + args: [], + type: { + kind: 'NON_NULL', + name: null, + ofType: { + kind: 'SCALAR', + name: 'String', + ofType: null, + }, + }, + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'description', + args: [], + type: { + kind: 'SCALAR', + name: 'String', + ofType: null, + }, + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'isRepeatable', + args: [], + type: { + kind: 'NON_NULL', + name: null, + ofType: { + kind: 'SCALAR', + name: 'Boolean', + ofType: null, + }, + }, + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'locations', + args: [], + type: { + kind: 'NON_NULL', + name: null, + ofType: { + kind: 'LIST', + name: null, + ofType: { + kind: 'NON_NULL', + name: null, + ofType: { + kind: 'ENUM', + name: '__DirectiveLocation', + ofType: null, + }, + }, + }, + }, + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'args', + args: [ + { + name: 'includeDeprecated', + type: { + kind: 'SCALAR', + name: 'Boolean', + ofType: null, + }, + defaultValue: 'false', + }, + ], + type: { + kind: 'NON_NULL', + name: null, + ofType: { + kind: 'LIST', + name: null, + ofType: { + kind: 'NON_NULL', + name: null, + ofType: { + kind: 'OBJECT', + name: '__InputValue', + ofType: null, + }, + }, + }, + }, + isDeprecated: false, + deprecationReason: null, + }, + ], + inputFields: null, + interfaces: [], + enumValues: null, + possibleTypes: null, + }, + { + kind: 'ENUM', + name: '__DirectiveLocation', + specifiedByURL: null, + fields: null, + inputFields: null, + interfaces: null, + enumValues: [ + { + name: 'QUERY', + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'MUTATION', + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'SUBSCRIPTION', + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'FIELD', + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'FRAGMENT_DEFINITION', + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'FRAGMENT_SPREAD', + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'INLINE_FRAGMENT', + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'VARIABLE_DEFINITION', + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'SCHEMA', + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'SCALAR', + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'OBJECT', + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'FIELD_DEFINITION', + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'ARGUMENT_DEFINITION', + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'INTERFACE', + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'UNION', + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'ENUM', + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'ENUM_VALUE', + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'INPUT_OBJECT', + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'INPUT_FIELD_DEFINITION', + isDeprecated: false, + deprecationReason: null, + }, + ], + possibleTypes: null, + }, + ], + directives: [ + { + name: 'include', + isRepeatable: false, + locations: ['FIELD', 'FRAGMENT_SPREAD', 'INLINE_FRAGMENT'], + args: [ + { + defaultValue: null, + name: 'if', + type: { + kind: 'NON_NULL', + name: null, + ofType: { + kind: 'SCALAR', + name: 'Boolean', + ofType: null, + }, + }, + }, + ], + }, + { + name: 'skip', + isRepeatable: false, + locations: ['FIELD', 'FRAGMENT_SPREAD', 'INLINE_FRAGMENT'], + args: [ + { + defaultValue: null, + name: 'if', + type: { + kind: 'NON_NULL', + name: null, + ofType: { + kind: 'SCALAR', + name: 'Boolean', + ofType: null, + }, + }, + }, + ], + }, + { + name: 'deprecated', + isRepeatable: false, + locations: [ + 'FIELD_DEFINITION', + 'ARGUMENT_DEFINITION', + 'INPUT_FIELD_DEFINITION', + 'ENUM_VALUE', + ], + args: [ + { + defaultValue: '"No longer supported"', + name: 'reason', + type: { + kind: 'SCALAR', + name: 'String', + ofType: null, + }, + }, + ], + }, + { + name: 'specifiedBy', + isRepeatable: false, + locations: ['SCALAR'], + args: [ + { + defaultValue: null, + name: 'url', + type: { + kind: 'NON_NULL', + name: null, + ofType: { + kind: 'SCALAR', + name: 'String', + ofType: null, + }, + }, + }, + ], + }, + ], + }, + }, + }); + }); + + it('introspects on input object', () => { + const schema = buildSchema(` + input SomeInputObject { + a: String = "tes\\t de\\fault" + b: [String] + c: String = null + } + + type Query { + someField(someArg: SomeInputObject): String + } + `); + + const source = ` + { + __type(name: "SomeInputObject") { + kind + name + inputFields { + name + type { ...TypeRef } + defaultValue + } + } + } + + fragment TypeRef on __Type { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + } + } + } + } + `; + + expect(graphqlSync({ schema, source })).to.deep.equal({ + data: { + __type: { + kind: 'INPUT_OBJECT', + name: 'SomeInputObject', + inputFields: [ + { + name: 'a', + type: { + kind: 'SCALAR', + name: 'String', + ofType: null, + }, + defaultValue: '"tes\\t de\\fault"', + }, + { + name: 'b', + type: { + kind: 'LIST', + name: null, + ofType: { + kind: 'SCALAR', + name: 'String', + ofType: null, + }, + }, + defaultValue: null, + }, + { + name: 'c', + type: { + kind: 'SCALAR', + name: 'String', + ofType: null, + }, + defaultValue: 'null', + }, + ], + }, + }, + }); + }); + + it('introspects any default value', () => { + const schema = buildSchema(` + input InputObjectWithDefaultValues { + a: String = "Emoji: \\u{1F600}" + b: Complex = {x: ["abc"], y: 123} + } + + input Complex { + x: [String] + y: Int + } + + type Query { + someField(someArg: InputObjectWithDefaultValues): String + } + `); + + const source = ` + { + __type(name: "InputObjectWithDefaultValues") { + inputFields { + name + defaultValue + } + } + } + `; + + expect(graphqlSync({ schema, source })).to.deep.equal({ + data: { + __type: { + inputFields: [ + { + name: 'a', + defaultValue: '"Emoji: \u{1F600}"', + }, + { + name: 'b', + defaultValue: '{x: ["abc"], y: 123}', + }, + ], + }, + }, + }); + }); + + it('supports the __type root field', () => { + const schema = buildSchema(` + type Query { + someField: String + } + `); + + const source = ` + { + __type(name: "Query") { + name + } + } + `; + + expect(graphqlSync({ schema, source })).to.deep.equal({ + data: { + __type: { name: 'Query' }, + }, + }); + }); + + it('identifies deprecated fields', () => { + const schema = buildSchema(` + type Query { + nonDeprecated: String + deprecated: String @deprecated(reason: "Removed in 1.0") + deprecatedWithEmptyReason: String @deprecated(reason: "") + } + `); + + const source = ` + { + __type(name: "Query") { + fields(includeDeprecated: true) { + name + isDeprecated, + deprecationReason + } + } + } + `; + + expect(graphqlSync({ schema, source })).to.deep.equal({ + data: { + __type: { + fields: [ + { + name: 'nonDeprecated', + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'deprecated', + isDeprecated: true, + deprecationReason: 'Removed in 1.0', + }, + { + name: 'deprecatedWithEmptyReason', + isDeprecated: true, + deprecationReason: '', + }, + ], + }, + }, + }); + }); + + it('respects the includeDeprecated parameter for fields', () => { + const schema = buildSchema(` + type Query { + nonDeprecated: String + deprecated: String @deprecated(reason: "Removed in 1.0") + } + `); + + const source = ` + { + __type(name: "Query") { + trueFields: fields(includeDeprecated: true) { + name + } + falseFields: fields(includeDeprecated: false) { + name + } + omittedFields: fields { + name + } + } + } + `; + + expect(graphqlSync({ schema, source })).to.deep.equal({ + data: { + __type: { + trueFields: [{ name: 'nonDeprecated' }, { name: 'deprecated' }], + falseFields: [{ name: 'nonDeprecated' }], + omittedFields: [{ name: 'nonDeprecated' }], + }, + }, + }); + }); + + it('identifies deprecated args', () => { + const schema = buildSchema(` + type Query { + someField( + nonDeprecated: String + deprecated: String @deprecated(reason: "Removed in 1.0") + deprecatedWithEmptyReason: String @deprecated(reason: "") + ): String + } + `); + + const source = ` + { + __type(name: "Query") { + fields { + args(includeDeprecated: true) { + name + isDeprecated, + deprecationReason + } + } + } + } + `; + + expect(graphqlSync({ schema, source })).to.deep.equal({ + data: { + __type: { + fields: [ + { + args: [ + { + name: 'nonDeprecated', + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'deprecated', + isDeprecated: true, + deprecationReason: 'Removed in 1.0', + }, + { + name: 'deprecatedWithEmptyReason', + isDeprecated: true, + deprecationReason: '', + }, + ], + }, + ], + }, + }, + }); + }); + + it('respects the includeDeprecated parameter for args', () => { + const schema = buildSchema(` + type Query { + someField( + nonDeprecated: String + deprecated: String @deprecated(reason: "Removed in 1.0") + ): String + } + `); + + const source = ` + { + __type(name: "Query") { + fields { + trueArgs: args(includeDeprecated: true) { + name + } + falseArgs: args(includeDeprecated: false) { + name + } + omittedArgs: args { + name + } + } + } + } + `; + + expect(graphqlSync({ schema, source })).to.deep.equal({ + data: { + __type: { + fields: [ + { + trueArgs: [{ name: 'nonDeprecated' }, { name: 'deprecated' }], + falseArgs: [{ name: 'nonDeprecated' }], + omittedArgs: [{ name: 'nonDeprecated' }], + }, + ], + }, + }, + }); + }); + + it('identifies deprecated enum values', () => { + const schema = buildSchema(` + enum SomeEnum { + NON_DEPRECATED + DEPRECATED @deprecated(reason: "Removed in 1.0") + ALSO_NON_DEPRECATED + } + + type Query { + someField(someArg: SomeEnum): String + } + `); + + const source = ` + { + __type(name: "SomeEnum") { + enumValues(includeDeprecated: true) { + name + isDeprecated, + deprecationReason + } + } + } + `; + + expect(graphqlSync({ schema, source })).to.deep.equal({ + data: { + __type: { + enumValues: [ + { + name: 'NON_DEPRECATED', + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'DEPRECATED', + isDeprecated: true, + deprecationReason: 'Removed in 1.0', + }, + { + name: 'ALSO_NON_DEPRECATED', + isDeprecated: false, + deprecationReason: null, + }, + ], + }, + }, + }); + }); + + it('respects the includeDeprecated parameter for enum values', () => { + const schema = buildSchema(` + enum SomeEnum { + NON_DEPRECATED + DEPRECATED @deprecated(reason: "Removed in 1.0") + DEPRECATED_WITH_EMPTY_REASON @deprecated(reason: "") + ALSO_NON_DEPRECATED + } + + type Query { + someField(someArg: SomeEnum): String + } + `); + + const source = ` + { + __type(name: "SomeEnum") { + trueValues: enumValues(includeDeprecated: true) { + name + } + falseValues: enumValues(includeDeprecated: false) { + name + } + omittedValues: enumValues { + name + } + } + } + `; + + expect(graphqlSync({ schema, source })).to.deep.equal({ + data: { + __type: { + trueValues: [ + { name: 'NON_DEPRECATED' }, + { name: 'DEPRECATED' }, + { name: 'DEPRECATED_WITH_EMPTY_REASON' }, + { name: 'ALSO_NON_DEPRECATED' }, + ], + falseValues: [ + { name: 'NON_DEPRECATED' }, + { name: 'ALSO_NON_DEPRECATED' }, + ], + omittedValues: [ + { name: 'NON_DEPRECATED' }, + { name: 'ALSO_NON_DEPRECATED' }, + ], + }, + }, + }); + }); + + it('identifies deprecated for input fields', () => { + const schema = buildSchema(` + input SomeInputObject { + nonDeprecated: String + deprecated: String @deprecated(reason: "Removed in 1.0") + deprecatedWithEmptyReason: String @deprecated(reason: "") + } + + type Query { + someField(someArg: SomeInputObject): String + } + `); + + const source = ` + { + __type(name: "SomeInputObject") { + inputFields(includeDeprecated: true) { + name + isDeprecated, + deprecationReason + } + } + } + `; + + expect(graphqlSync({ schema, source })).to.deep.equal({ + data: { + __type: { + inputFields: [ + { + name: 'nonDeprecated', + isDeprecated: false, + deprecationReason: null, + }, + { + name: 'deprecated', + isDeprecated: true, + deprecationReason: 'Removed in 1.0', + }, + { + name: 'deprecatedWithEmptyReason', + isDeprecated: true, + deprecationReason: '', + }, + ], + }, + }, + }); + }); + + it('respects the includeDeprecated parameter for input fields', () => { + const schema = buildSchema(` + input SomeInputObject { + nonDeprecated: String + deprecated: String @deprecated(reason: "Removed in 1.0") + } + + type Query { + someField(someArg: SomeInputObject): String + } + `); + + const source = ` + { + __type(name: "SomeInputObject") { + trueFields: inputFields(includeDeprecated: true) { + name + } + falseFields: inputFields(includeDeprecated: false) { + name + } + omittedFields: inputFields { + name + } + } + } + `; + + expect(graphqlSync({ schema, source })).to.deep.equal({ + data: { + __type: { + trueFields: [{ name: 'nonDeprecated' }, { name: 'deprecated' }], + falseFields: [{ name: 'nonDeprecated' }], + omittedFields: [{ name: 'nonDeprecated' }], + }, + }, + }); + }); + + it('fails as expected on the __type root field without an arg', () => { + const schema = buildSchema(` + type Query { + someField: String + } + `); + + const source = ` + { + __type { + name + } + } + `; + + expectJSON(graphqlSync({ schema, source })).toDeepEqual({ + errors: [ + { + message: + 'Field "__type" argument "name" of type "String!" is required, but it was not provided.', + locations: [{ line: 3, column: 9 }], + }, + ], + }); + }); + + it('exposes descriptions', () => { + const schema = buildSchema(` + """Enum description""" + enum SomeEnum { + """Value description""" + VALUE + } + + """Object description""" + type SomeObject { + """Field description""" + someField(arg: SomeEnum): String + } + + """Schema description""" + schema { + query: SomeObject + } + `); + + const source = ` + { + Schema: __schema { description } + SomeObject: __type(name: "SomeObject") { + description, + fields { + name + description + } + } + SomeEnum: __type(name: "SomeEnum") { + description + enumValues { + name + description + } + } + } + `; + + expect(graphqlSync({ schema, source })).to.deep.equal({ + data: { + Schema: { + description: 'Schema description', + }, + SomeEnum: { + description: 'Enum description', + enumValues: [ + { + name: 'VALUE', + description: 'Value description', + }, + ], + }, + SomeObject: { + description: 'Object description', + fields: [ + { + name: 'someField', + description: 'Field description', + }, + ], + }, + }, + }); + }); + + it('executes an introspection query without calling global resolvers', () => { + const schema = buildSchema(` + type Query { + someField: String + } + `); + + const source = getIntrospectionQuery({ + specifiedByUrl: true, + directiveIsRepeatable: true, + schemaDescription: true, + }); + + /* c8 ignore start */ + function fieldResolver( + _1: any, + _2: any, + _3: any, + info: GraphQLResolveInfo, + ): never { + expect.fail(`Called on ${info.parentType.name}::${info.fieldName}`); + } + + function typeResolver(_1: any, _2: any, info: GraphQLResolveInfo): never { + expect.fail(`Called on ${info.parentType.name}::${info.fieldName}`); + } + /* c8 ignore stop */ + + const result = graphqlSync({ + schema, + source, + fieldResolver, + typeResolver, + }); + expect(result).to.not.have.property('errors'); + }); +}); diff --git a/src/type/__tests__/predicate-test.ts b/src/type/__tests__/predicate-test.ts new file mode 100644 index 00000000..81e721e7 --- /dev/null +++ b/src/type/__tests__/predicate-test.ts @@ -0,0 +1,704 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { DirectiveLocation } from '../../language/directiveLocation'; + +import type { + GraphQLArgument, + GraphQLInputField, + GraphQLInputType, +} from '../definition'; +import { + assertAbstractType, + assertCompositeType, + assertEnumType, + assertInputObjectType, + assertInputType, + assertInterfaceType, + assertLeafType, + assertListType, + assertNamedType, + assertNonNullType, + assertNullableType, + assertObjectType, + assertOutputType, + assertScalarType, + assertType, + assertUnionType, + assertWrappingType, + getNamedType, + getNullableType, + GraphQLEnumType, + GraphQLInputObjectType, + GraphQLInterfaceType, + GraphQLList, + GraphQLNonNull, + GraphQLObjectType, + GraphQLScalarType, + GraphQLUnionType, + isAbstractType, + isCompositeType, + isEnumType, + isInputObjectType, + isInputType, + isInterfaceType, + isLeafType, + isListType, + isNamedType, + isNonNullType, + isNullableType, + isObjectType, + isOutputType, + isRequiredArgument, + isRequiredInputField, + isScalarType, + isType, + isUnionType, + isWrappingType, +} from '../definition'; +import { + assertDirective, + GraphQLDeprecatedDirective, + GraphQLDirective, + GraphQLIncludeDirective, + GraphQLSkipDirective, + isDirective, + isSpecifiedDirective, +} from '../directives'; +import { + GraphQLBoolean, + GraphQLFloat, + GraphQLID, + GraphQLInt, + GraphQLString, + isSpecifiedScalarType, +} from '../scalars'; + +const ObjectType = new GraphQLObjectType({ name: 'Object', fields: {} }); +const InterfaceType = new GraphQLInterfaceType({ + name: 'Interface', + fields: {}, +}); +const UnionType = new GraphQLUnionType({ name: 'Union', types: [ObjectType] }); +const EnumType = new GraphQLEnumType({ name: 'Enum', values: { foo: {} } }); +const InputObjectType = new GraphQLInputObjectType({ + name: 'InputObject', + fields: {}, +}); +const ScalarType = new GraphQLScalarType({ name: 'Scalar' }); +const Directive = new GraphQLDirective({ + name: 'Directive', + locations: [DirectiveLocation.QUERY], +}); + +describe('Type predicates', () => { + describe('isType', () => { + it('returns true for unwrapped types', () => { + expect(isType(GraphQLString)).to.equal(true); + expect(() => assertType(GraphQLString)).to.not.throw(); + expect(isType(ObjectType)).to.equal(true); + expect(() => assertType(ObjectType)).to.not.throw(); + }); + + it('returns true for wrapped types', () => { + expect(isType(new GraphQLNonNull(GraphQLString))).to.equal(true); + expect(() => + assertType(new GraphQLNonNull(GraphQLString)), + ).to.not.throw(); + }); + + it('returns false for type classes (rather than instances)', () => { + expect(isType(GraphQLObjectType)).to.equal(false); + expect(() => assertType(GraphQLObjectType)).to.throw(); + }); + + it('returns false for random garbage', () => { + expect(isType({ what: 'is this' })).to.equal(false); + expect(() => assertType({ what: 'is this' })).to.throw(); + }); + }); + + describe('isScalarType', () => { + it('returns true for spec defined scalar', () => { + expect(isScalarType(GraphQLString)).to.equal(true); + expect(() => assertScalarType(GraphQLString)).to.not.throw(); + }); + + it('returns true for custom scalar', () => { + expect(isScalarType(ScalarType)).to.equal(true); + expect(() => assertScalarType(ScalarType)).to.not.throw(); + }); + + it('returns false for scalar class (rather than instance)', () => { + expect(isScalarType(GraphQLScalarType)).to.equal(false); + expect(() => assertScalarType(GraphQLScalarType)).to.throw(); + }); + + it('returns false for wrapped scalar', () => { + expect(isScalarType(new GraphQLList(ScalarType))).to.equal(false); + expect(() => assertScalarType(new GraphQLList(ScalarType))).to.throw(); + }); + + it('returns false for non-scalar', () => { + expect(isScalarType(EnumType)).to.equal(false); + expect(() => assertScalarType(EnumType)).to.throw(); + expect(isScalarType(Directive)).to.equal(false); + expect(() => assertScalarType(Directive)).to.throw(); + }); + + it('returns false for random garbage', () => { + expect(isScalarType({ what: 'is this' })).to.equal(false); + expect(() => assertScalarType({ what: 'is this' })).to.throw(); + }); + }); + + describe('isSpecifiedScalarType', () => { + it('returns true for specified scalars', () => { + expect(isSpecifiedScalarType(GraphQLString)).to.equal(true); + expect(isSpecifiedScalarType(GraphQLInt)).to.equal(true); + expect(isSpecifiedScalarType(GraphQLFloat)).to.equal(true); + expect(isSpecifiedScalarType(GraphQLBoolean)).to.equal(true); + expect(isSpecifiedScalarType(GraphQLID)).to.equal(true); + }); + + it('returns false for custom scalar', () => { + expect(isSpecifiedScalarType(ScalarType)).to.equal(false); + }); + }); + + describe('isObjectType', () => { + it('returns true for object type', () => { + expect(isObjectType(ObjectType)).to.equal(true); + expect(() => assertObjectType(ObjectType)).to.not.throw(); + }); + + it('returns false for wrapped object type', () => { + expect(isObjectType(new GraphQLList(ObjectType))).to.equal(false); + expect(() => assertObjectType(new GraphQLList(ObjectType))).to.throw(); + }); + + it('returns false for non-object type', () => { + expect(isObjectType(InterfaceType)).to.equal(false); + expect(() => assertObjectType(InterfaceType)).to.throw(); + }); + }); + + describe('isInterfaceType', () => { + it('returns true for interface type', () => { + expect(isInterfaceType(InterfaceType)).to.equal(true); + expect(() => assertInterfaceType(InterfaceType)).to.not.throw(); + }); + + it('returns false for wrapped interface type', () => { + expect(isInterfaceType(new GraphQLList(InterfaceType))).to.equal(false); + expect(() => + assertInterfaceType(new GraphQLList(InterfaceType)), + ).to.throw(); + }); + + it('returns false for non-interface type', () => { + expect(isInterfaceType(ObjectType)).to.equal(false); + expect(() => assertInterfaceType(ObjectType)).to.throw(); + }); + }); + + describe('isUnionType', () => { + it('returns true for union type', () => { + expect(isUnionType(UnionType)).to.equal(true); + expect(() => assertUnionType(UnionType)).to.not.throw(); + }); + + it('returns false for wrapped union type', () => { + expect(isUnionType(new GraphQLList(UnionType))).to.equal(false); + expect(() => assertUnionType(new GraphQLList(UnionType))).to.throw(); + }); + + it('returns false for non-union type', () => { + expect(isUnionType(ObjectType)).to.equal(false); + expect(() => assertUnionType(ObjectType)).to.throw(); + }); + }); + + describe('isEnumType', () => { + it('returns true for enum type', () => { + expect(isEnumType(EnumType)).to.equal(true); + expect(() => assertEnumType(EnumType)).to.not.throw(); + }); + + it('returns false for wrapped enum type', () => { + expect(isEnumType(new GraphQLList(EnumType))).to.equal(false); + expect(() => assertEnumType(new GraphQLList(EnumType))).to.throw(); + }); + + it('returns false for non-enum type', () => { + expect(isEnumType(ScalarType)).to.equal(false); + expect(() => assertEnumType(ScalarType)).to.throw(); + }); + }); + + describe('isInputObjectType', () => { + it('returns true for input object type', () => { + expect(isInputObjectType(InputObjectType)).to.equal(true); + expect(() => assertInputObjectType(InputObjectType)).to.not.throw(); + }); + + it('returns false for wrapped input object type', () => { + expect(isInputObjectType(new GraphQLList(InputObjectType))).to.equal( + false, + ); + expect(() => + assertInputObjectType(new GraphQLList(InputObjectType)), + ).to.throw(); + }); + + it('returns false for non-input-object type', () => { + expect(isInputObjectType(ObjectType)).to.equal(false); + expect(() => assertInputObjectType(ObjectType)).to.throw(); + }); + }); + + describe('isListType', () => { + it('returns true for a list wrapped type', () => { + expect(isListType(new GraphQLList(ObjectType))).to.equal(true); + expect(() => assertListType(new GraphQLList(ObjectType))).to.not.throw(); + }); + + it('returns false for an unwrapped type', () => { + expect(isListType(ObjectType)).to.equal(false); + expect(() => assertListType(ObjectType)).to.throw(); + }); + + it('returns false for a non-list wrapped type', () => { + expect( + isListType(new GraphQLNonNull(new GraphQLList(ObjectType))), + ).to.equal(false); + expect(() => + assertListType(new GraphQLNonNull(new GraphQLList(ObjectType))), + ).to.throw(); + }); + }); + + describe('isNonNullType', () => { + it('returns true for a non-null wrapped type', () => { + expect(isNonNullType(new GraphQLNonNull(ObjectType))).to.equal(true); + expect(() => + assertNonNullType(new GraphQLNonNull(ObjectType)), + ).to.not.throw(); + }); + + it('returns false for an unwrapped type', () => { + expect(isNonNullType(ObjectType)).to.equal(false); + expect(() => assertNonNullType(ObjectType)).to.throw(); + }); + + it('returns false for a not non-null wrapped type', () => { + expect( + isNonNullType(new GraphQLList(new GraphQLNonNull(ObjectType))), + ).to.equal(false); + expect(() => + assertNonNullType(new GraphQLList(new GraphQLNonNull(ObjectType))), + ).to.throw(); + }); + }); + + describe('isInputType', () => { + function expectInputType(type: unknown) { + expect(isInputType(type)).to.equal(true); + expect(() => assertInputType(type)).to.not.throw(); + } + + it('returns true for an input type', () => { + expectInputType(GraphQLString); + expectInputType(EnumType); + expectInputType(InputObjectType); + }); + + it('returns true for a wrapped input type', () => { + expectInputType(new GraphQLList(GraphQLString)); + expectInputType(new GraphQLList(EnumType)); + expectInputType(new GraphQLList(InputObjectType)); + + expectInputType(new GraphQLNonNull(GraphQLString)); + expectInputType(new GraphQLNonNull(EnumType)); + expectInputType(new GraphQLNonNull(InputObjectType)); + }); + + function expectNonInputType(type: unknown) { + expect(isInputType(type)).to.equal(false); + expect(() => assertInputType(type)).to.throw(); + } + + it('returns false for an output type', () => { + expectNonInputType(ObjectType); + expectNonInputType(InterfaceType); + expectNonInputType(UnionType); + }); + + it('returns false for a wrapped output type', () => { + expectNonInputType(new GraphQLList(ObjectType)); + expectNonInputType(new GraphQLList(InterfaceType)); + expectNonInputType(new GraphQLList(UnionType)); + + expectNonInputType(new GraphQLNonNull(ObjectType)); + expectNonInputType(new GraphQLNonNull(InterfaceType)); + expectNonInputType(new GraphQLNonNull(UnionType)); + }); + }); + + describe('isOutputType', () => { + function expectOutputType(type: unknown) { + expect(isOutputType(type)).to.equal(true); + expect(() => assertOutputType(type)).to.not.throw(); + } + + it('returns true for an output type', () => { + expectOutputType(GraphQLString); + expectOutputType(ObjectType); + expectOutputType(InterfaceType); + expectOutputType(UnionType); + expectOutputType(EnumType); + }); + + it('returns true for a wrapped output type', () => { + expectOutputType(new GraphQLList(GraphQLString)); + expectOutputType(new GraphQLList(ObjectType)); + expectOutputType(new GraphQLList(InterfaceType)); + expectOutputType(new GraphQLList(UnionType)); + expectOutputType(new GraphQLList(EnumType)); + + expectOutputType(new GraphQLNonNull(GraphQLString)); + expectOutputType(new GraphQLNonNull(ObjectType)); + expectOutputType(new GraphQLNonNull(InterfaceType)); + expectOutputType(new GraphQLNonNull(UnionType)); + expectOutputType(new GraphQLNonNull(EnumType)); + }); + + function expectNonOutputType(type: unknown) { + expect(isOutputType(type)).to.equal(false); + expect(() => assertOutputType(type)).to.throw(); + } + + it('returns false for an input type', () => { + expectNonOutputType(InputObjectType); + }); + + it('returns false for a wrapped input type', () => { + expectNonOutputType(new GraphQLList(InputObjectType)); + expectNonOutputType(new GraphQLNonNull(InputObjectType)); + }); + }); + + describe('isLeafType', () => { + it('returns true for scalar and enum types', () => { + expect(isLeafType(ScalarType)).to.equal(true); + expect(() => assertLeafType(ScalarType)).to.not.throw(); + expect(isLeafType(EnumType)).to.equal(true); + expect(() => assertLeafType(EnumType)).to.not.throw(); + }); + + it('returns false for wrapped leaf type', () => { + expect(isLeafType(new GraphQLList(ScalarType))).to.equal(false); + expect(() => assertLeafType(new GraphQLList(ScalarType))).to.throw(); + }); + + it('returns false for non-leaf type', () => { + expect(isLeafType(ObjectType)).to.equal(false); + expect(() => assertLeafType(ObjectType)).to.throw(); + }); + + it('returns false for wrapped non-leaf type', () => { + expect(isLeafType(new GraphQLList(ObjectType))).to.equal(false); + expect(() => assertLeafType(new GraphQLList(ObjectType))).to.throw(); + }); + }); + + describe('isCompositeType', () => { + it('returns true for object, interface, and union types', () => { + expect(isCompositeType(ObjectType)).to.equal(true); + expect(() => assertCompositeType(ObjectType)).to.not.throw(); + expect(isCompositeType(InterfaceType)).to.equal(true); + expect(() => assertCompositeType(InterfaceType)).to.not.throw(); + expect(isCompositeType(UnionType)).to.equal(true); + expect(() => assertCompositeType(UnionType)).to.not.throw(); + }); + + it('returns false for wrapped composite type', () => { + expect(isCompositeType(new GraphQLList(ObjectType))).to.equal(false); + expect(() => assertCompositeType(new GraphQLList(ObjectType))).to.throw(); + }); + + it('returns false for non-composite type', () => { + expect(isCompositeType(InputObjectType)).to.equal(false); + expect(() => assertCompositeType(InputObjectType)).to.throw(); + }); + + it('returns false for wrapped non-composite type', () => { + expect(isCompositeType(new GraphQLList(InputObjectType))).to.equal(false); + expect(() => + assertCompositeType(new GraphQLList(InputObjectType)), + ).to.throw(); + }); + }); + + describe('isAbstractType', () => { + it('returns true for interface and union types', () => { + expect(isAbstractType(InterfaceType)).to.equal(true); + expect(() => assertAbstractType(InterfaceType)).to.not.throw(); + expect(isAbstractType(UnionType)).to.equal(true); + expect(() => assertAbstractType(UnionType)).to.not.throw(); + }); + + it('returns false for wrapped abstract type', () => { + expect(isAbstractType(new GraphQLList(InterfaceType))).to.equal(false); + expect(() => + assertAbstractType(new GraphQLList(InterfaceType)), + ).to.throw(); + }); + + it('returns false for non-abstract type', () => { + expect(isAbstractType(ObjectType)).to.equal(false); + expect(() => assertAbstractType(ObjectType)).to.throw(); + }); + + it('returns false for wrapped non-abstract type', () => { + expect(isAbstractType(new GraphQLList(ObjectType))).to.equal(false); + expect(() => assertAbstractType(new GraphQLList(ObjectType))).to.throw(); + }); + }); + + describe('isWrappingType', () => { + it('returns true for list and non-null types', () => { + expect(isWrappingType(new GraphQLList(ObjectType))).to.equal(true); + expect(() => + assertWrappingType(new GraphQLList(ObjectType)), + ).to.not.throw(); + expect(isWrappingType(new GraphQLNonNull(ObjectType))).to.equal(true); + expect(() => + assertWrappingType(new GraphQLNonNull(ObjectType)), + ).to.not.throw(); + }); + + it('returns false for unwrapped types', () => { + expect(isWrappingType(ObjectType)).to.equal(false); + expect(() => assertWrappingType(ObjectType)).to.throw(); + }); + }); + + describe('isNullableType', () => { + it('returns true for unwrapped types', () => { + expect(isNullableType(ObjectType)).to.equal(true); + expect(() => assertNullableType(ObjectType)).to.not.throw(); + }); + + it('returns true for list of non-null types', () => { + expect( + isNullableType(new GraphQLList(new GraphQLNonNull(ObjectType))), + ).to.equal(true); + expect(() => + assertNullableType(new GraphQLList(new GraphQLNonNull(ObjectType))), + ).to.not.throw(); + }); + + it('returns false for non-null types', () => { + expect(isNullableType(new GraphQLNonNull(ObjectType))).to.equal(false); + expect(() => + assertNullableType(new GraphQLNonNull(ObjectType)), + ).to.throw(); + }); + }); + + describe('getNullableType', () => { + it('returns undefined for no type', () => { + expect(getNullableType(undefined)).to.equal(undefined); + expect(getNullableType(null)).to.equal(undefined); + }); + + it('returns self for a nullable type', () => { + expect(getNullableType(ObjectType)).to.equal(ObjectType); + const listOfObj = new GraphQLList(ObjectType); + expect(getNullableType(listOfObj)).to.equal(listOfObj); + }); + + it('unwraps non-null type', () => { + expect(getNullableType(new GraphQLNonNull(ObjectType))).to.equal( + ObjectType, + ); + }); + }); + + describe('isNamedType', () => { + it('returns true for unwrapped types', () => { + expect(isNamedType(ObjectType)).to.equal(true); + expect(() => assertNamedType(ObjectType)).to.not.throw(); + }); + + it('returns false for list and non-null types', () => { + expect(isNamedType(new GraphQLList(ObjectType))).to.equal(false); + expect(() => assertNamedType(new GraphQLList(ObjectType))).to.throw(); + expect(isNamedType(new GraphQLNonNull(ObjectType))).to.equal(false); + expect(() => assertNamedType(new GraphQLNonNull(ObjectType))).to.throw(); + }); + }); + + describe('getNamedType', () => { + it('returns undefined for no type', () => { + expect(getNamedType(undefined)).to.equal(undefined); + expect(getNamedType(null)).to.equal(undefined); + }); + + it('returns self for a unwrapped type', () => { + expect(getNamedType(ObjectType)).to.equal(ObjectType); + }); + + it('unwraps wrapper types', () => { + expect(getNamedType(new GraphQLNonNull(ObjectType))).to.equal(ObjectType); + expect(getNamedType(new GraphQLList(ObjectType))).to.equal(ObjectType); + }); + + it('unwraps deeply wrapper types', () => { + expect( + getNamedType( + new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(ObjectType))), + ), + ).to.equal(ObjectType); + }); + }); + + describe('isRequiredArgument', () => { + function buildArg(config: { + type: GraphQLInputType; + defaultValue?: unknown; + }): GraphQLArgument { + return { + name: 'someArg', + type: config.type, + description: undefined, + defaultValue: config.defaultValue, + deprecationReason: null, + extensions: Object.create(null), + astNode: undefined, + }; + } + + it('returns true for required arguments', () => { + const requiredArg = buildArg({ + type: new GraphQLNonNull(GraphQLString), + }); + expect(isRequiredArgument(requiredArg)).to.equal(true); + }); + + it('returns false for optional arguments', () => { + const optArg1 = buildArg({ + type: GraphQLString, + }); + expect(isRequiredArgument(optArg1)).to.equal(false); + + const optArg2 = buildArg({ + type: GraphQLString, + defaultValue: null, + }); + expect(isRequiredArgument(optArg2)).to.equal(false); + + const optArg3 = buildArg({ + type: new GraphQLList(new GraphQLNonNull(GraphQLString)), + }); + expect(isRequiredArgument(optArg3)).to.equal(false); + + const optArg4 = buildArg({ + type: new GraphQLNonNull(GraphQLString), + defaultValue: 'default', + }); + expect(isRequiredArgument(optArg4)).to.equal(false); + }); + }); + + describe('isRequiredInputField', () => { + function buildInputField(config: { + type: GraphQLInputType; + defaultValue?: unknown; + }): GraphQLInputField { + return { + name: 'someInputField', + type: config.type, + description: undefined, + defaultValue: config.defaultValue, + deprecationReason: null, + extensions: Object.create(null), + astNode: undefined, + }; + } + + it('returns true for required input field', () => { + const requiredField = buildInputField({ + type: new GraphQLNonNull(GraphQLString), + }); + expect(isRequiredInputField(requiredField)).to.equal(true); + }); + + it('returns false for optional input field', () => { + const optField1 = buildInputField({ + type: GraphQLString, + }); + expect(isRequiredInputField(optField1)).to.equal(false); + + const optField2 = buildInputField({ + type: GraphQLString, + defaultValue: null, + }); + expect(isRequiredInputField(optField2)).to.equal(false); + + const optField3 = buildInputField({ + type: new GraphQLList(new GraphQLNonNull(GraphQLString)), + }); + expect(isRequiredInputField(optField3)).to.equal(false); + + const optField4 = buildInputField({ + type: new GraphQLNonNull(GraphQLString), + defaultValue: 'default', + }); + expect(isRequiredInputField(optField4)).to.equal(false); + }); + }); +}); + +describe('Directive predicates', () => { + describe('isDirective', () => { + it('returns true for spec defined directive', () => { + expect(isDirective(GraphQLSkipDirective)).to.equal(true); + expect(() => assertDirective(GraphQLSkipDirective)).to.not.throw(); + }); + + it('returns true for custom directive', () => { + expect(isDirective(Directive)).to.equal(true); + expect(() => assertDirective(Directive)).to.not.throw(); + }); + + it('returns false for directive class (rather than instance)', () => { + expect(isDirective(GraphQLDirective)).to.equal(false); + expect(() => assertDirective(GraphQLDirective)).to.throw(); + }); + + it('returns false for non-directive', () => { + expect(isDirective(EnumType)).to.equal(false); + expect(() => assertDirective(EnumType)).to.throw(); + expect(isDirective(ScalarType)).to.equal(false); + expect(() => assertDirective(ScalarType)).to.throw(); + }); + + it('returns false for random garbage', () => { + expect(isDirective({ what: 'is this' })).to.equal(false); + expect(() => assertDirective({ what: 'is this' })).to.throw(); + }); + }); + describe('isSpecifiedDirective', () => { + it('returns true for specified directives', () => { + expect(isSpecifiedDirective(GraphQLIncludeDirective)).to.equal(true); + expect(isSpecifiedDirective(GraphQLSkipDirective)).to.equal(true); + expect(isSpecifiedDirective(GraphQLDeprecatedDirective)).to.equal(true); + }); + + it('returns false for custom directive', () => { + expect(isSpecifiedDirective(Directive)).to.equal(false); + }); + }); +}); diff --git a/src/type/__tests__/scalars-test.ts b/src/type/__tests__/scalars-test.ts new file mode 100644 index 00000000..4d563aee --- /dev/null +++ b/src/type/__tests__/scalars-test.ts @@ -0,0 +1,654 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { parseValue as parseValueToAST } from '../../language/parser'; + +import { + GraphQLBoolean, + GraphQLFloat, + GraphQLID, + GraphQLInt, + GraphQLString, +} from '../scalars'; + +describe('Type System: Specified scalar types', () => { + describe('GraphQLInt', () => { + it('parseValue', () => { + function parseValue(value: unknown) { + return GraphQLInt.parseValue(value); + } + + expect(parseValue(1)).to.equal(1); + expect(parseValue(0)).to.equal(0); + expect(parseValue(-1)).to.equal(-1); + + expect(() => parseValue(9876504321)).to.throw( + 'Int cannot represent non 32-bit signed integer value: 9876504321', + ); + expect(() => parseValue(-9876504321)).to.throw( + 'Int cannot represent non 32-bit signed integer value: -9876504321', + ); + expect(() => parseValue(0.1)).to.throw( + 'Int cannot represent non-integer value: 0.1', + ); + expect(() => parseValue(NaN)).to.throw( + 'Int cannot represent non-integer value: NaN', + ); + expect(() => parseValue(Infinity)).to.throw( + 'Int cannot represent non-integer value: Infinity', + ); + + expect(() => parseValue(undefined)).to.throw( + 'Int cannot represent non-integer value: undefined', + ); + expect(() => parseValue(null)).to.throw( + 'Int cannot represent non-integer value: null', + ); + expect(() => parseValue('')).to.throw( + 'Int cannot represent non-integer value: ""', + ); + expect(() => parseValue('123')).to.throw( + 'Int cannot represent non-integer value: "123"', + ); + expect(() => parseValue(false)).to.throw( + 'Int cannot represent non-integer value: false', + ); + expect(() => parseValue(true)).to.throw( + 'Int cannot represent non-integer value: true', + ); + expect(() => parseValue([1])).to.throw( + 'Int cannot represent non-integer value: [1]', + ); + expect(() => parseValue({ value: 1 })).to.throw( + 'Int cannot represent non-integer value: { value: 1 }', + ); + }); + + it('parseLiteral', () => { + function parseLiteral(str: string) { + return GraphQLInt.parseLiteral(parseValueToAST(str), undefined); + } + + expect(parseLiteral('1')).to.equal(1); + expect(parseLiteral('0')).to.equal(0); + expect(parseLiteral('-1')).to.equal(-1); + + expect(() => parseLiteral('9876504321')).to.throw( + 'Int cannot represent non 32-bit signed integer value: 9876504321', + ); + expect(() => parseLiteral('-9876504321')).to.throw( + 'Int cannot represent non 32-bit signed integer value: -9876504321', + ); + + expect(() => parseLiteral('1.0')).to.throw( + 'Int cannot represent non-integer value: 1.0', + ); + expect(() => parseLiteral('null')).to.throw( + 'Int cannot represent non-integer value: null', + ); + expect(() => parseLiteral('""')).to.throw( + 'Int cannot represent non-integer value: ""', + ); + expect(() => parseLiteral('"123"')).to.throw( + 'Int cannot represent non-integer value: "123"', + ); + expect(() => parseLiteral('false')).to.throw( + 'Int cannot represent non-integer value: false', + ); + expect(() => parseLiteral('[1]')).to.throw( + 'Int cannot represent non-integer value: [1]', + ); + expect(() => parseLiteral('{ value: 1 }')).to.throw( + 'Int cannot represent non-integer value: {value: 1}', + ); + expect(() => parseLiteral('ENUM_VALUE')).to.throw( + 'Int cannot represent non-integer value: ENUM_VALUE', + ); + expect(() => parseLiteral('$var')).to.throw( + 'Int cannot represent non-integer value: $var', + ); + }); + + it('serialize', () => { + function serialize(value: unknown) { + return GraphQLInt.serialize(value); + } + + expect(serialize(1)).to.equal(1); + expect(serialize('123')).to.equal(123); + expect(serialize(0)).to.equal(0); + expect(serialize(-1)).to.equal(-1); + expect(serialize(1e5)).to.equal(100000); + expect(serialize(false)).to.equal(0); + expect(serialize(true)).to.equal(1); + + const customValueOfObj = { + value: 5, + valueOf() { + return this.value; + }, + }; + expect(serialize(customValueOfObj)).to.equal(5); + + // The GraphQL specification does not allow serializing non-integer values + // as Int to avoid accidental data loss. + expect(() => serialize(0.1)).to.throw( + 'Int cannot represent non-integer value: 0.1', + ); + expect(() => serialize(1.1)).to.throw( + 'Int cannot represent non-integer value: 1.1', + ); + expect(() => serialize(-1.1)).to.throw( + 'Int cannot represent non-integer value: -1.1', + ); + expect(() => serialize('-1.1')).to.throw( + 'Int cannot represent non-integer value: "-1.1"', + ); + + // Maybe a safe JavaScript int, but bigger than 2^32, so not + // representable as a GraphQL Int + expect(() => serialize(9876504321)).to.throw( + 'Int cannot represent non 32-bit signed integer value: 9876504321', + ); + expect(() => serialize(-9876504321)).to.throw( + 'Int cannot represent non 32-bit signed integer value: -9876504321', + ); + + // Too big to represent as an Int in JavaScript or GraphQL + expect(() => serialize(1e100)).to.throw( + 'Int cannot represent non 32-bit signed integer value: 1e+100', + ); + expect(() => serialize(-1e100)).to.throw( + 'Int cannot represent non 32-bit signed integer value: -1e+100', + ); + expect(() => serialize('one')).to.throw( + 'Int cannot represent non-integer value: "one"', + ); + + // Doesn't represent number + expect(() => serialize('')).to.throw( + 'Int cannot represent non-integer value: ""', + ); + expect(() => serialize(NaN)).to.throw( + 'Int cannot represent non-integer value: NaN', + ); + expect(() => serialize(Infinity)).to.throw( + 'Int cannot represent non-integer value: Infinity', + ); + expect(() => serialize([5])).to.throw( + 'Int cannot represent non-integer value: [5]', + ); + }); + }); + + describe('GraphQLFloat', () => { + it('parseValue', () => { + function parseValue(value: unknown) { + return GraphQLFloat.parseValue(value); + } + + expect(parseValue(1)).to.equal(1); + expect(parseValue(0)).to.equal(0); + expect(parseValue(-1)).to.equal(-1); + expect(parseValue(0.1)).to.equal(0.1); + expect(parseValue(Math.PI)).to.equal(Math.PI); + + expect(() => parseValue(NaN)).to.throw( + 'Float cannot represent non numeric value: NaN', + ); + expect(() => parseValue(Infinity)).to.throw( + 'Float cannot represent non numeric value: Infinity', + ); + + expect(() => parseValue(undefined)).to.throw( + 'Float cannot represent non numeric value: undefined', + ); + expect(() => parseValue(null)).to.throw( + 'Float cannot represent non numeric value: null', + ); + expect(() => parseValue('')).to.throw( + 'Float cannot represent non numeric value: ""', + ); + expect(() => parseValue('123')).to.throw( + 'Float cannot represent non numeric value: "123"', + ); + expect(() => parseValue('123.5')).to.throw( + 'Float cannot represent non numeric value: "123.5"', + ); + expect(() => parseValue(false)).to.throw( + 'Float cannot represent non numeric value: false', + ); + expect(() => parseValue(true)).to.throw( + 'Float cannot represent non numeric value: true', + ); + expect(() => parseValue([0.1])).to.throw( + 'Float cannot represent non numeric value: [0.1]', + ); + expect(() => parseValue({ value: 0.1 })).to.throw( + 'Float cannot represent non numeric value: { value: 0.1 }', + ); + }); + + it('parseLiteral', () => { + function parseLiteral(str: string) { + return GraphQLFloat.parseLiteral(parseValueToAST(str), undefined); + } + + expect(parseLiteral('1')).to.equal(1); + expect(parseLiteral('0')).to.equal(0); + expect(parseLiteral('-1')).to.equal(-1); + expect(parseLiteral('0.1')).to.equal(0.1); + expect(parseLiteral(Math.PI.toString())).to.equal(Math.PI); + + expect(() => parseLiteral('null')).to.throw( + 'Float cannot represent non numeric value: null', + ); + expect(() => parseLiteral('""')).to.throw( + 'Float cannot represent non numeric value: ""', + ); + expect(() => parseLiteral('"123"')).to.throw( + 'Float cannot represent non numeric value: "123"', + ); + expect(() => parseLiteral('"123.5"')).to.throw( + 'Float cannot represent non numeric value: "123.5"', + ); + expect(() => parseLiteral('false')).to.throw( + 'Float cannot represent non numeric value: false', + ); + expect(() => parseLiteral('[0.1]')).to.throw( + 'Float cannot represent non numeric value: [0.1]', + ); + expect(() => parseLiteral('{ value: 0.1 }')).to.throw( + 'Float cannot represent non numeric value: {value: 0.1}', + ); + expect(() => parseLiteral('ENUM_VALUE')).to.throw( + 'Float cannot represent non numeric value: ENUM_VALUE', + ); + expect(() => parseLiteral('$var')).to.throw( + 'Float cannot represent non numeric value: $var', + ); + }); + + it('serialize', () => { + function serialize(value: unknown) { + return GraphQLFloat.serialize(value); + } + + expect(serialize(1)).to.equal(1.0); + expect(serialize(0)).to.equal(0.0); + expect(serialize('123.5')).to.equal(123.5); + expect(serialize(-1)).to.equal(-1.0); + expect(serialize(0.1)).to.equal(0.1); + expect(serialize(1.1)).to.equal(1.1); + expect(serialize(-1.1)).to.equal(-1.1); + expect(serialize('-1.1')).to.equal(-1.1); + expect(serialize(false)).to.equal(0.0); + expect(serialize(true)).to.equal(1.0); + + const customValueOfObj = { + value: 5.5, + valueOf() { + return this.value; + }, + }; + expect(serialize(customValueOfObj)).to.equal(5.5); + + expect(() => serialize(NaN)).to.throw( + 'Float cannot represent non numeric value: NaN', + ); + expect(() => serialize(Infinity)).to.throw( + 'Float cannot represent non numeric value: Infinity', + ); + expect(() => serialize('one')).to.throw( + 'Float cannot represent non numeric value: "one"', + ); + expect(() => serialize('')).to.throw( + 'Float cannot represent non numeric value: ""', + ); + expect(() => serialize([5])).to.throw( + 'Float cannot represent non numeric value: [5]', + ); + }); + }); + + describe('GraphQLString', () => { + it('parseValue', () => { + function parseValue(value: unknown) { + return GraphQLString.parseValue(value); + } + + expect(parseValue('foo')).to.equal('foo'); + + expect(() => parseValue(undefined)).to.throw( + 'String cannot represent a non string value: undefined', + ); + expect(() => parseValue(null)).to.throw( + 'String cannot represent a non string value: null', + ); + expect(() => parseValue(1)).to.throw( + 'String cannot represent a non string value: 1', + ); + expect(() => parseValue(NaN)).to.throw( + 'String cannot represent a non string value: NaN', + ); + expect(() => parseValue(false)).to.throw( + 'String cannot represent a non string value: false', + ); + expect(() => parseValue(['foo'])).to.throw( + 'String cannot represent a non string value: ["foo"]', + ); + expect(() => parseValue({ value: 'foo' })).to.throw( + 'String cannot represent a non string value: { value: "foo" }', + ); + }); + + it('parseLiteral', () => { + function parseLiteral(str: string) { + return GraphQLString.parseLiteral(parseValueToAST(str), undefined); + } + + expect(parseLiteral('"foo"')).to.equal('foo'); + expect(parseLiteral('"""bar"""')).to.equal('bar'); + + expect(() => parseLiteral('null')).to.throw( + 'String cannot represent a non string value: null', + ); + expect(() => parseLiteral('1')).to.throw( + 'String cannot represent a non string value: 1', + ); + expect(() => parseLiteral('0.1')).to.throw( + 'String cannot represent a non string value: 0.1', + ); + expect(() => parseLiteral('false')).to.throw( + 'String cannot represent a non string value: false', + ); + expect(() => parseLiteral('["foo"]')).to.throw( + 'String cannot represent a non string value: ["foo"]', + ); + expect(() => parseLiteral('{ value: "foo" }')).to.throw( + 'String cannot represent a non string value: {value: "foo"}', + ); + expect(() => parseLiteral('ENUM_VALUE')).to.throw( + 'String cannot represent a non string value: ENUM_VALUE', + ); + expect(() => parseLiteral('$var')).to.throw( + 'String cannot represent a non string value: $var', + ); + }); + + it('serialize', () => { + function serialize(value: unknown) { + return GraphQLString.serialize(value); + } + + expect(serialize('string')).to.equal('string'); + expect(serialize(1)).to.equal('1'); + expect(serialize(-1.1)).to.equal('-1.1'); + expect(serialize(true)).to.equal('true'); + expect(serialize(false)).to.equal('false'); + + const valueOf = () => 'valueOf string'; + const toJSON = () => 'toJSON string'; + + const valueOfAndToJSONValue = { valueOf, toJSON }; + expect(serialize(valueOfAndToJSONValue)).to.equal('valueOf string'); + + const onlyToJSONValue = { toJSON }; + expect(serialize(onlyToJSONValue)).to.equal('toJSON string'); + + expect(() => serialize(NaN)).to.throw( + 'String cannot represent value: NaN', + ); + + expect(() => serialize([1])).to.throw( + 'String cannot represent value: [1]', + ); + + const badObjValue = {}; + expect(() => serialize(badObjValue)).to.throw( + 'String cannot represent value: {}', + ); + + const badValueOfObjValue = { valueOf: 'valueOf string' }; + expect(() => serialize(badValueOfObjValue)).to.throw( + 'String cannot represent value: { valueOf: "valueOf string" }', + ); + }); + }); + + describe('GraphQLBoolean', () => { + it('parseValue', () => { + function parseValue(value: unknown) { + return GraphQLBoolean.parseValue(value); + } + + expect(parseValue(true)).to.equal(true); + expect(parseValue(false)).to.equal(false); + + expect(() => parseValue(undefined)).to.throw( + 'Boolean cannot represent a non boolean value: undefined', + ); + expect(() => parseValue(null)).to.throw( + 'Boolean cannot represent a non boolean value: null', + ); + expect(() => parseValue(0)).to.throw( + 'Boolean cannot represent a non boolean value: 0', + ); + expect(() => parseValue(1)).to.throw( + 'Boolean cannot represent a non boolean value: 1', + ); + expect(() => parseValue(NaN)).to.throw( + 'Boolean cannot represent a non boolean value: NaN', + ); + expect(() => parseValue('')).to.throw( + 'Boolean cannot represent a non boolean value: ""', + ); + expect(() => parseValue('false')).to.throw( + 'Boolean cannot represent a non boolean value: "false"', + ); + expect(() => parseValue([false])).to.throw( + 'Boolean cannot represent a non boolean value: [false]', + ); + expect(() => parseValue({ value: false })).to.throw( + 'Boolean cannot represent a non boolean value: { value: false }', + ); + }); + + it('parseLiteral', () => { + function parseLiteral(str: string) { + return GraphQLBoolean.parseLiteral(parseValueToAST(str), undefined); + } + + expect(parseLiteral('true')).to.equal(true); + expect(parseLiteral('false')).to.equal(false); + + expect(() => parseLiteral('null')).to.throw( + 'Boolean cannot represent a non boolean value: null', + ); + expect(() => parseLiteral('0')).to.throw( + 'Boolean cannot represent a non boolean value: 0', + ); + expect(() => parseLiteral('1')).to.throw( + 'Boolean cannot represent a non boolean value: 1', + ); + expect(() => parseLiteral('0.1')).to.throw( + 'Boolean cannot represent a non boolean value: 0.1', + ); + expect(() => parseLiteral('""')).to.throw( + 'Boolean cannot represent a non boolean value: ""', + ); + expect(() => parseLiteral('"false"')).to.throw( + 'Boolean cannot represent a non boolean value: "false"', + ); + expect(() => parseLiteral('[false]')).to.throw( + 'Boolean cannot represent a non boolean value: [false]', + ); + expect(() => parseLiteral('{ value: false }')).to.throw( + 'Boolean cannot represent a non boolean value: {value: false}', + ); + expect(() => parseLiteral('ENUM_VALUE')).to.throw( + 'Boolean cannot represent a non boolean value: ENUM_VALUE', + ); + expect(() => parseLiteral('$var')).to.throw( + 'Boolean cannot represent a non boolean value: $var', + ); + }); + + it('serialize', () => { + function serialize(value: unknown) { + return GraphQLBoolean.serialize(value); + } + + expect(serialize(1)).to.equal(true); + expect(serialize(0)).to.equal(false); + expect(serialize(true)).to.equal(true); + expect(serialize(false)).to.equal(false); + expect( + serialize({ + value: true, + valueOf() { + return (this as { value: boolean }).value; + }, + }), + ).to.equal(true); + + expect(() => serialize(NaN)).to.throw( + 'Boolean cannot represent a non boolean value: NaN', + ); + expect(() => serialize('')).to.throw( + 'Boolean cannot represent a non boolean value: ""', + ); + expect(() => serialize('true')).to.throw( + 'Boolean cannot represent a non boolean value: "true"', + ); + expect(() => serialize([false])).to.throw( + 'Boolean cannot represent a non boolean value: [false]', + ); + expect(() => serialize({})).to.throw( + 'Boolean cannot represent a non boolean value: {}', + ); + }); + }); + + describe('GraphQLID', () => { + it('parseValue', () => { + function parseValue(value: unknown) { + return GraphQLID.parseValue(value); + } + + expect(parseValue('')).to.equal(''); + expect(parseValue('1')).to.equal('1'); + expect(parseValue('foo')).to.equal('foo'); + expect(parseValue(1)).to.equal('1'); + expect(parseValue(0)).to.equal('0'); + expect(parseValue(-1)).to.equal('-1'); + + // Maximum and minimum safe numbers in JS + expect(parseValue(9007199254740991)).to.equal('9007199254740991'); + expect(parseValue(-9007199254740991)).to.equal('-9007199254740991'); + + expect(() => parseValue(undefined)).to.throw( + 'ID cannot represent value: undefined', + ); + expect(() => parseValue(null)).to.throw( + 'ID cannot represent value: null', + ); + expect(() => parseValue(0.1)).to.throw('ID cannot represent value: 0.1'); + expect(() => parseValue(NaN)).to.throw('ID cannot represent value: NaN'); + expect(() => parseValue(Infinity)).to.throw( + 'ID cannot represent value: Inf', + ); + expect(() => parseValue(false)).to.throw( + 'ID cannot represent value: false', + ); + expect(() => GraphQLID.parseValue(['1'])).to.throw( + 'ID cannot represent value: ["1"]', + ); + expect(() => GraphQLID.parseValue({ value: '1' })).to.throw( + 'ID cannot represent value: { value: "1" }', + ); + }); + + it('parseLiteral', () => { + function parseLiteral(str: string) { + return GraphQLID.parseLiteral(parseValueToAST(str), undefined); + } + + expect(parseLiteral('""')).to.equal(''); + expect(parseLiteral('"1"')).to.equal('1'); + expect(parseLiteral('"foo"')).to.equal('foo'); + expect(parseLiteral('"""foo"""')).to.equal('foo'); + expect(parseLiteral('1')).to.equal('1'); + expect(parseLiteral('0')).to.equal('0'); + expect(parseLiteral('-1')).to.equal('-1'); + + // Support arbitrary long numbers even if they can't be represented in JS + expect(parseLiteral('90071992547409910')).to.equal('90071992547409910'); + expect(parseLiteral('-90071992547409910')).to.equal('-90071992547409910'); + + expect(() => parseLiteral('null')).to.throw( + 'ID cannot represent a non-string and non-integer value: null', + ); + expect(() => parseLiteral('0.1')).to.throw( + 'ID cannot represent a non-string and non-integer value: 0.1', + ); + expect(() => parseLiteral('false')).to.throw( + 'ID cannot represent a non-string and non-integer value: false', + ); + expect(() => parseLiteral('["1"]')).to.throw( + 'ID cannot represent a non-string and non-integer value: ["1"]', + ); + expect(() => parseLiteral('{ value: "1" }')).to.throw( + 'ID cannot represent a non-string and non-integer value: {value: "1"}', + ); + expect(() => parseLiteral('ENUM_VALUE')).to.throw( + 'ID cannot represent a non-string and non-integer value: ENUM_VALUE', + ); + expect(() => parseLiteral('$var')).to.throw( + 'ID cannot represent a non-string and non-integer value: $var', + ); + }); + + it('serialize', () => { + function serialize(value: unknown) { + return GraphQLID.serialize(value); + } + + expect(serialize('string')).to.equal('string'); + expect(serialize('false')).to.equal('false'); + expect(serialize('')).to.equal(''); + expect(serialize(123)).to.equal('123'); + expect(serialize(0)).to.equal('0'); + expect(serialize(-1)).to.equal('-1'); + + const valueOf = () => 'valueOf ID'; + const toJSON = () => 'toJSON ID'; + + const valueOfAndToJSONValue = { valueOf, toJSON }; + expect(serialize(valueOfAndToJSONValue)).to.equal('valueOf ID'); + + const onlyToJSONValue = { toJSON }; + expect(serialize(onlyToJSONValue)).to.equal('toJSON ID'); + + const badObjValue = { + _id: false, + valueOf() { + return this._id; + }, + }; + expect(() => serialize(badObjValue)).to.throw( + 'ID cannot represent value: { _id: false, valueOf: [function valueOf] }', + ); + + expect(() => serialize(true)).to.throw('ID cannot represent value: true'); + + expect(() => serialize(3.14)).to.throw('ID cannot represent value: 3.14'); + + expect(() => serialize({})).to.throw('ID cannot represent value: {}'); + + expect(() => serialize(['abc'])).to.throw( + 'ID cannot represent value: ["abc"]', + ); + }); + }); +}); diff --git a/src/type/__tests__/schema-test.ts b/src/type/__tests__/schema-test.ts new file mode 100644 index 00000000..8a31b50a --- /dev/null +++ b/src/type/__tests__/schema-test.ts @@ -0,0 +1,409 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { dedent } from '../../__testUtils__/dedent'; + +import { DirectiveLocation } from '../../language/directiveLocation'; + +import { printSchema } from '../../utilities/printSchema'; + +import { + GraphQLInputObjectType, + GraphQLInterfaceType, + GraphQLList, + GraphQLObjectType, + GraphQLScalarType, +} from '../definition'; +import { GraphQLDirective } from '../directives'; +import { GraphQLBoolean, GraphQLInt, GraphQLString } from '../scalars'; +import { GraphQLSchema } from '../schema'; + +describe('Type System: Schema', () => { + it('Define sample schema', () => { + const BlogImage = new GraphQLObjectType({ + name: 'Image', + fields: { + url: { type: GraphQLString }, + width: { type: GraphQLInt }, + height: { type: GraphQLInt }, + }, + }); + + const BlogAuthor: GraphQLObjectType = new GraphQLObjectType({ + name: 'Author', + fields: () => ({ + id: { type: GraphQLString }, + name: { type: GraphQLString }, + pic: { + args: { width: { type: GraphQLInt }, height: { type: GraphQLInt } }, + type: BlogImage, + }, + recentArticle: { type: BlogArticle }, + }), + }); + + const BlogArticle: GraphQLObjectType = new GraphQLObjectType({ + name: 'Article', + fields: { + id: { type: GraphQLString }, + isPublished: { type: GraphQLBoolean }, + author: { type: BlogAuthor }, + title: { type: GraphQLString }, + body: { type: GraphQLString }, + }, + }); + + const BlogQuery = new GraphQLObjectType({ + name: 'Query', + fields: { + article: { + args: { id: { type: GraphQLString } }, + type: BlogArticle, + }, + feed: { + type: new GraphQLList(BlogArticle), + }, + }, + }); + + const BlogMutation = new GraphQLObjectType({ + name: 'Mutation', + fields: { + writeArticle: { + type: BlogArticle, + }, + }, + }); + + const BlogSubscription = new GraphQLObjectType({ + name: 'Subscription', + fields: { + articleSubscribe: { + args: { id: { type: GraphQLString } }, + type: BlogArticle, + }, + }, + }); + + const schema = new GraphQLSchema({ + description: 'Sample schema', + query: BlogQuery, + mutation: BlogMutation, + subscription: BlogSubscription, + }); + + expect(printSchema(schema)).to.equal(dedent` + """Sample schema""" + schema { + query: Query + mutation: Mutation + subscription: Subscription + } + + type Query { + article(id: String): Article + feed: [Article] + } + + type Article { + id: String + isPublished: Boolean + author: Author + title: String + body: String + } + + type Author { + id: String + name: String + pic(width: Int, height: Int): Image + recentArticle: Article + } + + type Image { + url: String + width: Int + height: Int + } + + type Mutation { + writeArticle: Article + } + + type Subscription { + articleSubscribe(id: String): Article + } + `); + }); + + describe('Root types', () => { + const testType = new GraphQLObjectType({ name: 'TestType', fields: {} }); + + it('defines a query root', () => { + const schema = new GraphQLSchema({ query: testType }); + expect(schema.getQueryType()).to.equal(testType); + expect(schema.getTypeMap()).to.include.keys('TestType'); + }); + + it('defines a mutation root', () => { + const schema = new GraphQLSchema({ mutation: testType }); + expect(schema.getMutationType()).to.equal(testType); + expect(schema.getTypeMap()).to.include.keys('TestType'); + }); + + it('defines a subscription root', () => { + const schema = new GraphQLSchema({ subscription: testType }); + expect(schema.getSubscriptionType()).to.equal(testType); + expect(schema.getTypeMap()).to.include.keys('TestType'); + }); + }); + + describe('Type Map', () => { + it('includes interface possible types in the type map', () => { + const SomeInterface = new GraphQLInterfaceType({ + name: 'SomeInterface', + fields: {}, + }); + + const SomeSubtype = new GraphQLObjectType({ + name: 'SomeSubtype', + fields: {}, + interfaces: [SomeInterface], + }); + + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Query', + fields: { + iface: { type: SomeInterface }, + }, + }), + types: [SomeSubtype], + }); + + expect(schema.getType('SomeInterface')).to.equal(SomeInterface); + expect(schema.getType('SomeSubtype')).to.equal(SomeSubtype); + + expect(schema.isSubType(SomeInterface, SomeSubtype)).to.equal(true); + }); + + it("includes interface's thunk subtypes in the type map", () => { + const SomeInterface = new GraphQLInterfaceType({ + name: 'SomeInterface', + fields: {}, + interfaces: () => [AnotherInterface], + }); + + const AnotherInterface = new GraphQLInterfaceType({ + name: 'AnotherInterface', + fields: {}, + }); + + const SomeSubtype = new GraphQLObjectType({ + name: 'SomeSubtype', + fields: {}, + interfaces: () => [SomeInterface], + }); + + const schema = new GraphQLSchema({ types: [SomeSubtype] }); + + expect(schema.getType('SomeInterface')).to.equal(SomeInterface); + expect(schema.getType('AnotherInterface')).to.equal(AnotherInterface); + expect(schema.getType('SomeSubtype')).to.equal(SomeSubtype); + }); + + it('includes nested input objects in the map', () => { + const NestedInputObject = new GraphQLInputObjectType({ + name: 'NestedInputObject', + fields: {}, + }); + + const SomeInputObject = new GraphQLInputObjectType({ + name: 'SomeInputObject', + fields: { nested: { type: NestedInputObject } }, + }); + + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Query', + fields: { + something: { + type: GraphQLString, + args: { input: { type: SomeInputObject } }, + }, + }, + }), + }); + + expect(schema.getType('SomeInputObject')).to.equal(SomeInputObject); + expect(schema.getType('NestedInputObject')).to.equal(NestedInputObject); + }); + + it('includes input types only used in directives', () => { + const directive = new GraphQLDirective({ + name: 'dir', + locations: [DirectiveLocation.OBJECT], + args: { + arg: { + type: new GraphQLInputObjectType({ name: 'Foo', fields: {} }), + }, + argList: { + type: new GraphQLList( + new GraphQLInputObjectType({ name: 'Bar', fields: {} }), + ), + }, + }, + }); + const schema = new GraphQLSchema({ directives: [directive] }); + + expect(schema.getTypeMap()).to.include.keys('Foo', 'Bar'); + }); + }); + + it('preserves the order of user provided types', () => { + const aType = new GraphQLObjectType({ + name: 'A', + fields: { + sub: { type: new GraphQLScalarType({ name: 'ASub' }) }, + }, + }); + const zType = new GraphQLObjectType({ + name: 'Z', + fields: { + sub: { type: new GraphQLScalarType({ name: 'ZSub' }) }, + }, + }); + const queryType = new GraphQLObjectType({ + name: 'Query', + fields: { + a: { type: aType }, + z: { type: zType }, + sub: { type: new GraphQLScalarType({ name: 'QuerySub' }) }, + }, + }); + const schema = new GraphQLSchema({ + types: [zType, queryType, aType], + query: queryType, + }); + + const typeNames = Object.keys(schema.getTypeMap()); + expect(typeNames).to.deep.equal([ + 'Z', + 'ZSub', + 'Query', + 'QuerySub', + 'A', + 'ASub', + 'Boolean', + 'String', + '__Schema', + '__Type', + '__TypeKind', + '__Field', + '__InputValue', + '__EnumValue', + '__Directive', + '__DirectiveLocation', + ]); + + // Also check that this order is stable + const copySchema = new GraphQLSchema(schema.toConfig()); + expect(Object.keys(copySchema.getTypeMap())).to.deep.equal(typeNames); + }); + + it('can be Object.toStringified', () => { + const schema = new GraphQLSchema({}); + + expect(Object.prototype.toString.call(schema)).to.equal( + '[object GraphQLSchema]', + ); + }); + + describe('Validity', () => { + describe('when not assumed valid', () => { + it('configures the schema to still needing validation', () => { + expect( + new GraphQLSchema({ + assumeValid: false, + }).__validationErrors, + ).to.equal(undefined); + }); + + it('checks the configuration for mistakes', () => { + // @ts-expect-error + expect(() => new GraphQLSchema(JSON.parse)).to.throw(); + // @ts-expect-error + expect(() => new GraphQLSchema({ types: {} })).to.throw(); + // @ts-expect-error + expect(() => new GraphQLSchema({ directives: {} })).to.throw(); + }); + }); + + describe('A Schema must contain uniquely named types', () => { + it('rejects a Schema which redefines a built-in type', () => { + const FakeString = new GraphQLScalarType({ name: 'String' }); + + const QueryType = new GraphQLObjectType({ + name: 'Query', + fields: { + normal: { type: GraphQLString }, + fake: { type: FakeString }, + }, + }); + + expect(() => new GraphQLSchema({ query: QueryType })).to.throw( + 'Schema must contain uniquely named types but contains multiple types named "String".', + ); + }); + + it('rejects a Schema when a provided type has no name', () => { + const query = new GraphQLObjectType({ + name: 'Query', + fields: { foo: { type: GraphQLString } }, + }); + const types = [{}, query, {}]; + + // @ts-expect-error + expect(() => new GraphQLSchema({ query, types })).to.throw( + 'One of the provided types for building the Schema is missing a name.', + ); + }); + + it('rejects a Schema which defines an object type twice', () => { + const types = [ + new GraphQLObjectType({ name: 'SameName', fields: {} }), + new GraphQLObjectType({ name: 'SameName', fields: {} }), + ]; + + expect(() => new GraphQLSchema({ types })).to.throw( + 'Schema must contain uniquely named types but contains multiple types named "SameName".', + ); + }); + + it('rejects a Schema which defines fields with conflicting types', () => { + const fields = {}; + const QueryType = new GraphQLObjectType({ + name: 'Query', + fields: { + a: { type: new GraphQLObjectType({ name: 'SameName', fields }) }, + b: { type: new GraphQLObjectType({ name: 'SameName', fields }) }, + }, + }); + + expect(() => new GraphQLSchema({ query: QueryType })).to.throw( + 'Schema must contain uniquely named types but contains multiple types named "SameName".', + ); + }); + }); + + describe('when assumed valid', () => { + it('configures the schema to have no errors', () => { + expect( + new GraphQLSchema({ + assumeValid: true, + }).__validationErrors, + ).to.deep.equal([]); + }); + }); + }); +}); diff --git a/src/type/__tests__/validation-test.ts b/src/type/__tests__/validation-test.ts new file mode 100644 index 00000000..e34abbe7 --- /dev/null +++ b/src/type/__tests__/validation-test.ts @@ -0,0 +1,2629 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { dedent } from '../../__testUtils__/dedent'; +import { expectJSON } from '../../__testUtils__/expectJSON'; + +import { inspect } from '../../jsutils/inspect'; + +import { DirectiveLocation } from '../../language/directiveLocation'; +import { parse } from '../../language/parser'; + +import { buildSchema } from '../../utilities/buildASTSchema'; +import { extendSchema } from '../../utilities/extendSchema'; + +import type { + GraphQLArgumentConfig, + GraphQLFieldConfig, + GraphQLInputFieldConfig, + GraphQLInputType, + GraphQLNamedType, + GraphQLOutputType, +} from '../definition'; +import { + assertEnumType, + assertInputObjectType, + assertInterfaceType, + assertObjectType, + assertScalarType, + assertUnionType, + GraphQLEnumType, + GraphQLInputObjectType, + GraphQLInterfaceType, + GraphQLList, + GraphQLNonNull, + GraphQLObjectType, + GraphQLUnionType, +} from '../definition'; +import { assertDirective, GraphQLDirective } from '../directives'; +import { GraphQLString } from '../scalars'; +import { GraphQLSchema } from '../schema'; +import { assertValidSchema, validateSchema } from '../validate'; + +const SomeSchema = buildSchema(` + scalar SomeScalar + + interface SomeInterface { f: SomeObject } + + type SomeObject implements SomeInterface { f: SomeObject } + + union SomeUnion = SomeObject + + enum SomeEnum { ONLY } + + input SomeInputObject { val: String = "hello" } + + directive @SomeDirective on QUERY +`); + +const SomeScalarType = assertScalarType(SomeSchema.getType('SomeScalar')); +const SomeInterfaceType = assertInterfaceType( + SomeSchema.getType('SomeInterface'), +); +const SomeObjectType = assertObjectType(SomeSchema.getType('SomeObject')); +const SomeUnionType = assertUnionType(SomeSchema.getType('SomeUnion')); +const SomeEnumType = assertEnumType(SomeSchema.getType('SomeEnum')); +const SomeInputObjectType = assertInputObjectType( + SomeSchema.getType('SomeInputObject'), +); + +const SomeDirective = assertDirective(SomeSchema.getDirective('SomeDirective')); + +function withModifiers( + type: T, +): Array | GraphQLNonNull>> { + return [ + type, + new GraphQLList(type), + new GraphQLNonNull(type), + new GraphQLNonNull(new GraphQLList(type)), + ]; +} + +const outputTypes: ReadonlyArray = [ + ...withModifiers(GraphQLString), + ...withModifiers(SomeScalarType), + ...withModifiers(SomeEnumType), + ...withModifiers(SomeObjectType), + ...withModifiers(SomeUnionType), + ...withModifiers(SomeInterfaceType), +]; + +const notOutputTypes: ReadonlyArray = [ + ...withModifiers(SomeInputObjectType), +]; + +const inputTypes: ReadonlyArray = [ + ...withModifiers(GraphQLString), + ...withModifiers(SomeScalarType), + ...withModifiers(SomeEnumType), + ...withModifiers(SomeInputObjectType), +]; + +const notInputTypes: ReadonlyArray = [ + ...withModifiers(SomeObjectType), + ...withModifiers(SomeUnionType), + ...withModifiers(SomeInterfaceType), +]; + +function schemaWithFieldType(type: GraphQLOutputType): GraphQLSchema { + return new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Query', + fields: { f: { type } }, + }), + }); +} + +describe('Type System: A Schema must have Object root types', () => { + it('accepts a Schema whose query type is an object type', () => { + const schema = buildSchema(` + type Query { + test: String + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([]); + + const schemaWithDef = buildSchema(` + schema { + query: QueryRoot + } + + type QueryRoot { + test: String + } + `); + expectJSON(validateSchema(schemaWithDef)).toDeepEqual([]); + }); + + it('accepts a Schema whose query and mutation types are object types', () => { + const schema = buildSchema(` + type Query { + test: String + } + + type Mutation { + test: String + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([]); + + const schemaWithDef = buildSchema(` + schema { + query: QueryRoot + mutation: MutationRoot + } + + type QueryRoot { + test: String + } + + type MutationRoot { + test: String + } + `); + expectJSON(validateSchema(schemaWithDef)).toDeepEqual([]); + }); + + it('accepts a Schema whose query and subscription types are object types', () => { + const schema = buildSchema(` + type Query { + test: String + } + + type Subscription { + test: String + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([]); + + const schemaWithDef = buildSchema(` + schema { + query: QueryRoot + subscription: SubscriptionRoot + } + + type QueryRoot { + test: String + } + + type SubscriptionRoot { + test: String + } + `); + expectJSON(validateSchema(schemaWithDef)).toDeepEqual([]); + }); + + it('rejects a Schema without a query type', () => { + const schema = buildSchema(` + type Mutation { + test: String + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: 'Query root type must be provided.', + }, + ]); + + const schemaWithDef = buildSchema(` + schema { + mutation: MutationRoot + } + + type MutationRoot { + test: String + } + `); + expectJSON(validateSchema(schemaWithDef)).toDeepEqual([ + { + message: 'Query root type must be provided.', + locations: [{ line: 2, column: 7 }], + }, + ]); + }); + + it('rejects a Schema whose query root type is not an Object type', () => { + const schema = buildSchema(` + input Query { + test: String + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: 'Query root type must be Object type, it cannot be Query.', + locations: [{ line: 2, column: 7 }], + }, + ]); + + const schemaWithDef = buildSchema(` + schema { + query: SomeInputObject + } + + input SomeInputObject { + test: String + } + `); + expectJSON(validateSchema(schemaWithDef)).toDeepEqual([ + { + message: + 'Query root type must be Object type, it cannot be SomeInputObject.', + locations: [{ line: 3, column: 16 }], + }, + ]); + }); + + it('rejects a Schema whose mutation type is an input type', () => { + const schema = buildSchema(` + type Query { + field: String + } + + input Mutation { + test: String + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Mutation root type must be Object type if provided, it cannot be Mutation.', + locations: [{ line: 6, column: 7 }], + }, + ]); + + const schemaWithDef = buildSchema(` + schema { + query: Query + mutation: SomeInputObject + } + + type Query { + field: String + } + + input SomeInputObject { + test: String + } + `); + expectJSON(validateSchema(schemaWithDef)).toDeepEqual([ + { + message: + 'Mutation root type must be Object type if provided, it cannot be SomeInputObject.', + locations: [{ line: 4, column: 19 }], + }, + ]); + }); + + it('rejects a Schema whose subscription type is an input type', () => { + const schema = buildSchema(` + type Query { + field: String + } + + input Subscription { + test: String + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Subscription root type must be Object type if provided, it cannot be Subscription.', + locations: [{ line: 6, column: 7 }], + }, + ]); + + const schemaWithDef = buildSchema(` + schema { + query: Query + subscription: SomeInputObject + } + + type Query { + field: String + } + + input SomeInputObject { + test: String + } + `); + expectJSON(validateSchema(schemaWithDef)).toDeepEqual([ + { + message: + 'Subscription root type must be Object type if provided, it cannot be SomeInputObject.', + locations: [{ line: 4, column: 23 }], + }, + ]); + }); + + it('rejects a schema extended with invalid root types', () => { + let schema = buildSchema(` + input SomeInputObject { + test: String + } + `); + + schema = extendSchema( + schema, + parse(` + extend schema { + query: SomeInputObject + } + `), + ); + + schema = extendSchema( + schema, + parse(` + extend schema { + mutation: SomeInputObject + } + `), + ); + + schema = extendSchema( + schema, + parse(` + extend schema { + subscription: SomeInputObject + } + `), + ); + + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Query root type must be Object type, it cannot be SomeInputObject.', + locations: [{ line: 3, column: 18 }], + }, + { + message: + 'Mutation root type must be Object type if provided, it cannot be SomeInputObject.', + locations: [{ line: 3, column: 21 }], + }, + { + message: + 'Subscription root type must be Object type if provided, it cannot be SomeInputObject.', + locations: [{ line: 3, column: 25 }], + }, + ]); + }); + + it('rejects a Schema whose types are incorrectly typed', () => { + const schema = new GraphQLSchema({ + query: SomeObjectType, + // @ts-expect-error + types: [{ name: 'SomeType' }, SomeDirective], + }); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: 'Expected GraphQL named type but got: { name: "SomeType" }.', + }, + { + message: 'Expected GraphQL named type but got: @SomeDirective.', + locations: [{ line: 14, column: 3 }], + }, + ]); + }); + + it('rejects a Schema whose directives are incorrectly typed', () => { + const schema = new GraphQLSchema({ + query: SomeObjectType, + // @ts-expect-error + directives: [null, 'SomeDirective', SomeScalarType], + }); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: 'Expected directive but got: null.', + }, + { + message: 'Expected directive but got: "SomeDirective".', + }, + { + message: 'Expected directive but got: SomeScalar.', + locations: [{ line: 2, column: 3 }], + }, + ]); + }); +}); + +describe('Type System: Objects must have fields', () => { + it('accepts an Object type with fields object', () => { + const schema = buildSchema(` + type Query { + field: SomeObject + } + + type SomeObject { + field: String + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([]); + }); + + it('rejects an Object type with missing fields', () => { + const schema = buildSchema(` + type Query { + test: IncompleteObject + } + + type IncompleteObject + `); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: 'Type IncompleteObject must define one or more fields.', + locations: [{ line: 6, column: 7 }], + }, + ]); + + const manualSchema = schemaWithFieldType( + new GraphQLObjectType({ + name: 'IncompleteObject', + fields: {}, + }), + ); + expectJSON(validateSchema(manualSchema)).toDeepEqual([ + { + message: 'Type IncompleteObject must define one or more fields.', + }, + ]); + + const manualSchema2 = schemaWithFieldType( + new GraphQLObjectType({ + name: 'IncompleteObject', + fields() { + return {}; + }, + }), + ); + expectJSON(validateSchema(manualSchema2)).toDeepEqual([ + { + message: 'Type IncompleteObject must define one or more fields.', + }, + ]); + }); + + it('rejects an Object type with incorrectly named fields', () => { + const schema = schemaWithFieldType( + new GraphQLObjectType({ + name: 'SomeObject', + fields: { + __badName: { type: GraphQLString }, + }, + }), + ); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Name "__badName" must not begin with "__", which is reserved by GraphQL introspection.', + }, + ]); + }); +}); + +describe('Type System: Fields args must be properly named', () => { + it('accepts field args with valid names', () => { + const schema = schemaWithFieldType( + new GraphQLObjectType({ + name: 'SomeObject', + fields: { + goodField: { + type: GraphQLString, + args: { + goodArg: { type: GraphQLString }, + }, + }, + }, + }), + ); + expectJSON(validateSchema(schema)).toDeepEqual([]); + }); + + it('rejects field arg with invalid names', () => { + const schema = schemaWithFieldType( + new GraphQLObjectType({ + name: 'SomeObject', + fields: { + badField: { + type: GraphQLString, + args: { + __badName: { type: GraphQLString }, + }, + }, + }, + }), + ); + + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Name "__badName" must not begin with "__", which is reserved by GraphQL introspection.', + }, + ]); + }); +}); + +describe('Type System: Union types must be valid', () => { + it('accepts a Union type with member types', () => { + const schema = buildSchema(` + type Query { + test: GoodUnion + } + + type TypeA { + field: String + } + + type TypeB { + field: String + } + + union GoodUnion = + | TypeA + | TypeB + `); + expectJSON(validateSchema(schema)).toDeepEqual([]); + }); + + it('rejects a Union type with empty types', () => { + let schema = buildSchema(` + type Query { + test: BadUnion + } + + union BadUnion + `); + + schema = extendSchema( + schema, + parse(` + directive @test on UNION + + extend union BadUnion @test + `), + ); + + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: 'Union type BadUnion must define one or more member types.', + locations: [ + { line: 6, column: 7 }, + { line: 4, column: 9 }, + ], + }, + ]); + }); + + it('rejects a Union type with duplicated member type', () => { + let schema = buildSchema(` + type Query { + test: BadUnion + } + + type TypeA { + field: String + } + + type TypeB { + field: String + } + + union BadUnion = + | TypeA + | TypeB + | TypeA + `); + + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: 'Union type BadUnion can only include type TypeA once.', + locations: [ + { line: 15, column: 11 }, + { line: 17, column: 11 }, + ], + }, + ]); + + schema = extendSchema(schema, parse('extend union BadUnion = TypeB')); + + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: 'Union type BadUnion can only include type TypeA once.', + locations: [ + { line: 15, column: 11 }, + { line: 17, column: 11 }, + ], + }, + { + message: 'Union type BadUnion can only include type TypeB once.', + locations: [ + { line: 16, column: 11 }, + { line: 1, column: 25 }, + ], + }, + ]); + }); + + it('rejects a Union type with non-Object members types', () => { + let schema = buildSchema(` + type Query { + test: BadUnion + } + + type TypeA { + field: String + } + + type TypeB { + field: String + } + + union BadUnion = + | TypeA + | String + | TypeB + `); + + schema = extendSchema(schema, parse('extend union BadUnion = Int')); + + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Union type BadUnion can only include Object types, it cannot include String.', + locations: [{ line: 16, column: 11 }], + }, + { + message: + 'Union type BadUnion can only include Object types, it cannot include Int.', + locations: [{ line: 1, column: 25 }], + }, + ]); + + const badUnionMemberTypes = [ + GraphQLString, + new GraphQLNonNull(SomeObjectType), + new GraphQLList(SomeObjectType), + SomeInterfaceType, + SomeUnionType, + SomeEnumType, + SomeInputObjectType, + ]; + for (const memberType of badUnionMemberTypes) { + const badUnion = new GraphQLUnionType({ + name: 'BadUnion', + // @ts-expect-error + types: [memberType], + }); + const badSchema = schemaWithFieldType(badUnion); + expectJSON(validateSchema(badSchema)).toDeepEqual([ + { + message: + 'Union type BadUnion can only include Object types, ' + + `it cannot include ${inspect(memberType)}.`, + }, + ]); + } + }); +}); + +describe('Type System: Input Objects must have fields', () => { + it('accepts an Input Object type with fields', () => { + const schema = buildSchema(` + type Query { + field(arg: SomeInputObject): String + } + + input SomeInputObject { + field: String + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([]); + }); + + it('rejects an Input Object type with missing fields', () => { + let schema = buildSchema(` + type Query { + field(arg: SomeInputObject): String + } + + input SomeInputObject + `); + + schema = extendSchema( + schema, + parse(` + directive @test on INPUT_OBJECT + + extend input SomeInputObject @test + `), + ); + + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Input Object type SomeInputObject must define one or more fields.', + locations: [ + { line: 6, column: 7 }, + { line: 4, column: 9 }, + ], + }, + ]); + }); + + it('accepts an Input Object with breakable circular reference', () => { + const schema = buildSchema(` + type Query { + field(arg: SomeInputObject): String + } + + input SomeInputObject { + self: SomeInputObject + arrayOfSelf: [SomeInputObject] + nonNullArrayOfSelf: [SomeInputObject]! + nonNullArrayOfNonNullSelf: [SomeInputObject!]! + intermediateSelf: AnotherInputObject + } + + input AnotherInputObject { + parent: SomeInputObject + } + `); + + expectJSON(validateSchema(schema)).toDeepEqual([]); + }); + + it('rejects an Input Object with non-breakable circular reference', () => { + const schema = buildSchema(` + type Query { + field(arg: SomeInputObject): String + } + + input SomeInputObject { + nonNullSelf: SomeInputObject! + } + `); + + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Cannot reference Input Object "SomeInputObject" within itself through a series of non-null fields: "nonNullSelf".', + locations: [{ line: 7, column: 9 }], + }, + ]); + }); + + it('rejects Input Objects with non-breakable circular reference spread across them', () => { + const schema = buildSchema(` + type Query { + field(arg: SomeInputObject): String + } + + input SomeInputObject { + startLoop: AnotherInputObject! + } + + input AnotherInputObject { + nextInLoop: YetAnotherInputObject! + } + + input YetAnotherInputObject { + closeLoop: SomeInputObject! + } + `); + + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Cannot reference Input Object "SomeInputObject" within itself through a series of non-null fields: "startLoop.nextInLoop.closeLoop".', + locations: [ + { line: 7, column: 9 }, + { line: 11, column: 9 }, + { line: 15, column: 9 }, + ], + }, + ]); + }); + + it('rejects Input Objects with multiple non-breakable circular reference', () => { + const schema = buildSchema(` + type Query { + field(arg: SomeInputObject): String + } + + input SomeInputObject { + startLoop: AnotherInputObject! + } + + input AnotherInputObject { + closeLoop: SomeInputObject! + startSecondLoop: YetAnotherInputObject! + } + + input YetAnotherInputObject { + closeSecondLoop: AnotherInputObject! + nonNullSelf: YetAnotherInputObject! + } + `); + + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Cannot reference Input Object "SomeInputObject" within itself through a series of non-null fields: "startLoop.closeLoop".', + locations: [ + { line: 7, column: 9 }, + { line: 11, column: 9 }, + ], + }, + { + message: + 'Cannot reference Input Object "AnotherInputObject" within itself through a series of non-null fields: "startSecondLoop.closeSecondLoop".', + locations: [ + { line: 12, column: 9 }, + { line: 16, column: 9 }, + ], + }, + { + message: + 'Cannot reference Input Object "YetAnotherInputObject" within itself through a series of non-null fields: "nonNullSelf".', + locations: [{ line: 17, column: 9 }], + }, + ]); + }); + + it('rejects an Input Object type with incorrectly typed fields', () => { + const schema = buildSchema(` + type Query { + field(arg: SomeInputObject): String + } + + type SomeObject { + field: String + } + + union SomeUnion = SomeObject + + input SomeInputObject { + badObject: SomeObject + badUnion: SomeUnion + goodInputObject: SomeInputObject + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'The type of SomeInputObject.badObject must be Input Type but got: SomeObject.', + locations: [{ line: 13, column: 20 }], + }, + { + message: + 'The type of SomeInputObject.badUnion must be Input Type but got: SomeUnion.', + locations: [{ line: 14, column: 19 }], + }, + ]); + }); + + it('rejects an Input Object type with required argument that is deprecated', () => { + const schema = buildSchema(` + type Query { + field(arg: SomeInputObject): String + } + + input SomeInputObject { + badField: String! @deprecated + optionalField: String @deprecated + anotherOptionalField: String! = "" @deprecated + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Required input field SomeInputObject.badField cannot be deprecated.', + locations: [ + { line: 7, column: 27 }, + { line: 7, column: 19 }, + ], + }, + ]); + }); +}); + +describe('Type System: Enum types must be well defined', () => { + it('rejects an Enum type without values', () => { + let schema = buildSchema(` + type Query { + field: SomeEnum + } + + enum SomeEnum + `); + + schema = extendSchema( + schema, + parse(` + directive @test on ENUM + + extend enum SomeEnum @test + `), + ); + + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: 'Enum type SomeEnum must define one or more values.', + locations: [ + { line: 6, column: 7 }, + { line: 4, column: 9 }, + ], + }, + ]); + }); + + it('rejects an Enum type with incorrectly named values', () => { + const schema = schemaWithFieldType( + new GraphQLEnumType({ + name: 'SomeEnum', + values: { + __badName: {}, + }, + }), + ); + + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Name "__badName" must not begin with "__", which is reserved by GraphQL introspection.', + }, + ]); + }); +}); + +describe('Type System: Object fields must have output types', () => { + function schemaWithObjectField( + fieldConfig: GraphQLFieldConfig, + ): GraphQLSchema { + const BadObjectType = new GraphQLObjectType({ + name: 'BadObject', + fields: { + badField: fieldConfig, + }, + }); + + return new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Query', + fields: { + f: { type: BadObjectType }, + }, + }), + types: [SomeObjectType], + }); + } + + for (const type of outputTypes) { + const typeName = inspect(type); + it(`accepts an output type as an Object field type: ${typeName}`, () => { + const schema = schemaWithObjectField({ type }); + expectJSON(validateSchema(schema)).toDeepEqual([]); + }); + } + + it('rejects an empty Object field type', () => { + // @ts-expect-error (type field must not be undefined) + const schema = schemaWithObjectField({ type: undefined }); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'The type of BadObject.badField must be Output Type but got: undefined.', + }, + ]); + }); + + for (const type of notOutputTypes) { + const typeStr = inspect(type); + it(`rejects a non-output type as an Object field type: ${typeStr}`, () => { + // @ts-expect-error + const schema = schemaWithObjectField({ type }); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: `The type of BadObject.badField must be Output Type but got: ${typeStr}.`, + }, + ]); + }); + } + + it('rejects a non-type value as an Object field type', () => { + // @ts-expect-error + const schema = schemaWithObjectField({ type: Number }); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'The type of BadObject.badField must be Output Type but got: [function Number].', + }, + { + message: 'Expected GraphQL named type but got: [function Number].', + }, + ]); + }); + + it('rejects with relevant locations for a non-output type as an Object field type', () => { + const schema = buildSchema(` + type Query { + field: [SomeInputObject] + } + + input SomeInputObject { + field: String + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'The type of Query.field must be Output Type but got: [SomeInputObject].', + locations: [{ line: 3, column: 16 }], + }, + ]); + }); +}); + +describe('Type System: Objects can only implement unique interfaces', () => { + it('rejects an Object implementing a non-type values', () => { + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'BadObject', + // @ts-expect-error (interfaces must not contain undefined) + interfaces: [undefined], + fields: { f: { type: GraphQLString } }, + }), + }); + + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Type BadObject must only implement Interface types, it cannot implement undefined.', + }, + ]); + }); + + it('rejects an Object implementing a non-Interface type', () => { + const schema = buildSchema(` + type Query { + test: BadObject + } + + input SomeInputObject { + field: String + } + + type BadObject implements SomeInputObject { + field: String + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Type BadObject must only implement Interface types, it cannot implement SomeInputObject.', + locations: [{ line: 10, column: 33 }], + }, + ]); + }); + + it('rejects an Object implementing the same interface twice', () => { + const schema = buildSchema(` + type Query { + test: AnotherObject + } + + interface AnotherInterface { + field: String + } + + type AnotherObject implements AnotherInterface & AnotherInterface { + field: String + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: 'Type AnotherObject can only implement AnotherInterface once.', + locations: [ + { line: 10, column: 37 }, + { line: 10, column: 56 }, + ], + }, + ]); + }); + + it('rejects an Object implementing the same interface twice due to extension', () => { + const schema = buildSchema(` + type Query { + test: AnotherObject + } + + interface AnotherInterface { + field: String + } + + type AnotherObject implements AnotherInterface { + field: String + } + `); + const extendedSchema = extendSchema( + schema, + parse('extend type AnotherObject implements AnotherInterface'), + ); + expectJSON(validateSchema(extendedSchema)).toDeepEqual([ + { + message: 'Type AnotherObject can only implement AnotherInterface once.', + locations: [ + { line: 10, column: 37 }, + { line: 1, column: 38 }, + ], + }, + ]); + }); +}); + +describe('Type System: Interface extensions should be valid', () => { + it('rejects an Object implementing the extended interface due to missing field', () => { + const schema = buildSchema(` + type Query { + test: AnotherObject + } + + interface AnotherInterface { + field: String + } + + type AnotherObject implements AnotherInterface { + field: String + } + `); + const extendedSchema = extendSchema( + schema, + parse(` + extend interface AnotherInterface { + newField: String + } + + extend type AnotherObject { + differentNewField: String + } + `), + ); + expectJSON(validateSchema(extendedSchema)).toDeepEqual([ + { + message: + 'Interface field AnotherInterface.newField expected but AnotherObject does not provide it.', + locations: [ + { line: 3, column: 11 }, + { line: 10, column: 7 }, + { line: 6, column: 9 }, + ], + }, + ]); + }); + + it('rejects an Object implementing the extended interface due to missing field args', () => { + const schema = buildSchema(` + type Query { + test: AnotherObject + } + + interface AnotherInterface { + field: String + } + + type AnotherObject implements AnotherInterface { + field: String + } + `); + const extendedSchema = extendSchema( + schema, + parse(` + extend interface AnotherInterface { + newField(test: Boolean): String + } + + extend type AnotherObject { + newField: String + } + `), + ); + expectJSON(validateSchema(extendedSchema)).toDeepEqual([ + { + message: + 'Interface field argument AnotherInterface.newField(test:) expected but AnotherObject.newField does not provide it.', + locations: [ + { line: 3, column: 20 }, + { line: 7, column: 11 }, + ], + }, + ]); + }); + + it('rejects Objects implementing the extended interface due to mismatching interface type', () => { + const schema = buildSchema(` + type Query { + test: AnotherObject + } + + interface AnotherInterface { + field: String + } + + type AnotherObject implements AnotherInterface { + field: String + } + `); + const extendedSchema = extendSchema( + schema, + parse(` + extend interface AnotherInterface { + newInterfaceField: NewInterface + } + + interface NewInterface { + newField: String + } + + interface MismatchingInterface { + newField: String + } + + extend type AnotherObject { + newInterfaceField: MismatchingInterface + } + + # Required to prevent unused interface errors + type DummyObject implements NewInterface & MismatchingInterface { + newField: String + } + `), + ); + expectJSON(validateSchema(extendedSchema)).toDeepEqual([ + { + message: + 'Interface field AnotherInterface.newInterfaceField expects type NewInterface but AnotherObject.newInterfaceField is type MismatchingInterface.', + locations: [ + { line: 3, column: 30 }, + { line: 15, column: 30 }, + ], + }, + ]); + }); +}); + +describe('Type System: Interface fields must have output types', () => { + function schemaWithInterfaceField( + fieldConfig: GraphQLFieldConfig, + ): GraphQLSchema { + const fields = { badField: fieldConfig }; + + const BadInterfaceType = new GraphQLInterfaceType({ + name: 'BadInterface', + fields, + }); + + const BadImplementingType = new GraphQLObjectType({ + name: 'BadImplementing', + interfaces: [BadInterfaceType], + fields, + }); + + return new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Query', + fields: { + f: { type: BadInterfaceType }, + }, + }), + types: [BadImplementingType, SomeObjectType], + }); + } + + for (const type of outputTypes) { + const typeName = inspect(type); + it(`accepts an output type as an Interface field type: ${typeName}`, () => { + const schema = schemaWithInterfaceField({ type }); + expectJSON(validateSchema(schema)).toDeepEqual([]); + }); + } + + it('rejects an empty Interface field type', () => { + // @ts-expect-error (type field must not be undefined) + const schema = schemaWithInterfaceField({ type: undefined }); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'The type of BadImplementing.badField must be Output Type but got: undefined.', + }, + { + message: + 'The type of BadInterface.badField must be Output Type but got: undefined.', + }, + ]); + }); + + for (const type of notOutputTypes) { + const typeStr = inspect(type); + it(`rejects a non-output type as an Interface field type: ${typeStr}`, () => { + // @ts-expect-error + const schema = schemaWithInterfaceField({ type }); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: `The type of BadImplementing.badField must be Output Type but got: ${typeStr}.`, + }, + { + message: `The type of BadInterface.badField must be Output Type but got: ${typeStr}.`, + }, + ]); + }); + } + + it('rejects a non-type value as an Interface field type', () => { + // @ts-expect-error + const schema = schemaWithInterfaceField({ type: Number }); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'The type of BadImplementing.badField must be Output Type but got: [function Number].', + }, + { + message: + 'The type of BadInterface.badField must be Output Type but got: [function Number].', + }, + { + message: 'Expected GraphQL named type but got: [function Number].', + }, + ]); + }); + + it('rejects a non-output type as an Interface field type with locations', () => { + const schema = buildSchema(` + type Query { + test: SomeInterface + } + + interface SomeInterface { + field: SomeInputObject + } + + input SomeInputObject { + foo: String + } + + type SomeObject implements SomeInterface { + field: SomeInputObject + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'The type of SomeInterface.field must be Output Type but got: SomeInputObject.', + locations: [{ line: 7, column: 16 }], + }, + { + message: + 'The type of SomeObject.field must be Output Type but got: SomeInputObject.', + locations: [{ line: 15, column: 16 }], + }, + ]); + }); + + it('accepts an interface not implemented by at least one object', () => { + const schema = buildSchema(` + type Query { + test: SomeInterface + } + + interface SomeInterface { + foo: String + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([]); + }); +}); + +describe('Type System: Arguments must have input types', () => { + function schemaWithArg(argConfig: GraphQLArgumentConfig): GraphQLSchema { + const BadObjectType = new GraphQLObjectType({ + name: 'BadObject', + fields: { + badField: { + type: GraphQLString, + args: { + badArg: argConfig, + }, + }, + }, + }); + + return new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Query', + fields: { + f: { type: BadObjectType }, + }, + }), + directives: [ + new GraphQLDirective({ + name: 'BadDirective', + args: { + badArg: argConfig, + }, + locations: [DirectiveLocation.QUERY], + }), + ], + }); + } + + for (const type of inputTypes) { + const typeName = inspect(type); + it(`accepts an input type as a field arg type: ${typeName}`, () => { + const schema = schemaWithArg({ type }); + expectJSON(validateSchema(schema)).toDeepEqual([]); + }); + } + + it('rejects an empty field arg type', () => { + // @ts-expect-error (type field must not be undefined) + const schema = schemaWithArg({ type: undefined }); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'The type of @BadDirective(badArg:) must be Input Type but got: undefined.', + }, + { + message: + 'The type of BadObject.badField(badArg:) must be Input Type but got: undefined.', + }, + ]); + }); + + for (const type of notInputTypes) { + const typeStr = inspect(type); + it(`rejects a non-input type as a field arg type: ${typeStr}`, () => { + // @ts-expect-error + const schema = schemaWithArg({ type }); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: `The type of @BadDirective(badArg:) must be Input Type but got: ${typeStr}.`, + }, + { + message: `The type of BadObject.badField(badArg:) must be Input Type but got: ${typeStr}.`, + }, + ]); + }); + } + + it('rejects a non-type value as a field arg type', () => { + // @ts-expect-error + const schema = schemaWithArg({ type: Number }); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'The type of @BadDirective(badArg:) must be Input Type but got: [function Number].', + }, + { + message: + 'The type of BadObject.badField(badArg:) must be Input Type but got: [function Number].', + }, + { + message: 'Expected GraphQL named type but got: [function Number].', + }, + ]); + }); + + it('rejects an required argument that is deprecated', () => { + const schema = buildSchema(` + directive @BadDirective( + badArg: String! @deprecated + optionalArg: String @deprecated + anotherOptionalArg: String! = "" @deprecated + ) on FIELD + + type Query { + test( + badArg: String! @deprecated + optionalArg: String @deprecated + anotherOptionalArg: String! = "" @deprecated + ): String + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Required argument @BadDirective(badArg:) cannot be deprecated.', + locations: [ + { line: 3, column: 25 }, + { line: 3, column: 17 }, + ], + }, + { + message: 'Required argument Query.test(badArg:) cannot be deprecated.', + locations: [ + { line: 10, column: 27 }, + { line: 10, column: 19 }, + ], + }, + ]); + }); + + it('rejects a non-input type as a field arg with locations', () => { + const schema = buildSchema(` + type Query { + test(arg: SomeObject): String + } + + type SomeObject { + foo: String + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'The type of Query.test(arg:) must be Input Type but got: SomeObject.', + locations: [{ line: 3, column: 19 }], + }, + ]); + }); +}); + +describe('Type System: Input Object fields must have input types', () => { + function schemaWithInputField( + inputFieldConfig: GraphQLInputFieldConfig, + ): GraphQLSchema { + const BadInputObjectType = new GraphQLInputObjectType({ + name: 'BadInputObject', + fields: { + badField: inputFieldConfig, + }, + }); + + return new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Query', + fields: { + f: { + type: GraphQLString, + args: { + badArg: { type: BadInputObjectType }, + }, + }, + }, + }), + }); + } + + for (const type of inputTypes) { + const typeName = inspect(type); + it(`accepts an input type as an input field type: ${typeName}`, () => { + const schema = schemaWithInputField({ type }); + expectJSON(validateSchema(schema)).toDeepEqual([]); + }); + } + + it('rejects an empty input field type', () => { + // @ts-expect-error (type field must not be undefined) + const schema = schemaWithInputField({ type: undefined }); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'The type of BadInputObject.badField must be Input Type but got: undefined.', + }, + ]); + }); + + for (const type of notInputTypes) { + const typeStr = inspect(type); + it(`rejects a non-input type as an input field type: ${typeStr}`, () => { + // @ts-expect-error + const schema = schemaWithInputField({ type }); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: `The type of BadInputObject.badField must be Input Type but got: ${typeStr}.`, + }, + ]); + }); + } + + it('rejects a non-type value as an input field type', () => { + // @ts-expect-error + const schema = schemaWithInputField({ type: Number }); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'The type of BadInputObject.badField must be Input Type but got: [function Number].', + }, + { + message: 'Expected GraphQL named type but got: [function Number].', + }, + ]); + }); + + it('rejects a non-input type as an input object field with locations', () => { + const schema = buildSchema(` + type Query { + test(arg: SomeInputObject): String + } + + input SomeInputObject { + foo: SomeObject + } + + type SomeObject { + bar: String + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'The type of SomeInputObject.foo must be Input Type but got: SomeObject.', + locations: [{ line: 7, column: 14 }], + }, + ]); + }); +}); + +describe('Objects must adhere to Interface they implement', () => { + it('accepts an Object which implements an Interface', () => { + const schema = buildSchema(` + type Query { + test: AnotherObject + } + + interface AnotherInterface { + field(input: String): String + } + + type AnotherObject implements AnotherInterface { + field(input: String): String + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([]); + }); + + it('accepts an Object which implements an Interface along with more fields', () => { + const schema = buildSchema(` + type Query { + test: AnotherObject + } + + interface AnotherInterface { + field(input: String): String + } + + type AnotherObject implements AnotherInterface { + field(input: String): String + anotherField: String + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([]); + }); + + it('accepts an Object which implements an Interface field along with additional optional arguments', () => { + const schema = buildSchema(` + type Query { + test: AnotherObject + } + + interface AnotherInterface { + field(input: String): String + } + + type AnotherObject implements AnotherInterface { + field(input: String, anotherInput: String): String + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([]); + }); + + it('rejects an Object missing an Interface field', () => { + const schema = buildSchema(` + type Query { + test: AnotherObject + } + + interface AnotherInterface { + field(input: String): String + } + + type AnotherObject implements AnotherInterface { + anotherField: String + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Interface field AnotherInterface.field expected but AnotherObject does not provide it.', + locations: [ + { line: 7, column: 9 }, + { line: 10, column: 7 }, + ], + }, + ]); + }); + + it('rejects an Object with an incorrectly typed Interface field', () => { + const schema = buildSchema(` + type Query { + test: AnotherObject + } + + interface AnotherInterface { + field(input: String): String + } + + type AnotherObject implements AnotherInterface { + field(input: String): Int + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Interface field AnotherInterface.field expects type String but AnotherObject.field is type Int.', + locations: [ + { line: 7, column: 31 }, + { line: 11, column: 31 }, + ], + }, + ]); + }); + + it('rejects an Object with a differently typed Interface field', () => { + const schema = buildSchema(` + type Query { + test: AnotherObject + } + + type A { foo: String } + type B { foo: String } + + interface AnotherInterface { + field: A + } + + type AnotherObject implements AnotherInterface { + field: B + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Interface field AnotherInterface.field expects type A but AnotherObject.field is type B.', + locations: [ + { line: 10, column: 16 }, + { line: 14, column: 16 }, + ], + }, + ]); + }); + + it('accepts an Object with a subtyped Interface field (interface)', () => { + const schema = buildSchema(` + type Query { + test: AnotherObject + } + + interface AnotherInterface { + field: AnotherInterface + } + + type AnotherObject implements AnotherInterface { + field: AnotherObject + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([]); + }); + + it('accepts an Object with a subtyped Interface field (union)', () => { + const schema = buildSchema(` + type Query { + test: AnotherObject + } + + type SomeObject { + field: String + } + + union SomeUnionType = SomeObject + + interface AnotherInterface { + field: SomeUnionType + } + + type AnotherObject implements AnotherInterface { + field: SomeObject + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([]); + }); + + it('rejects an Object missing an Interface argument', () => { + const schema = buildSchema(` + type Query { + test: AnotherObject + } + + interface AnotherInterface { + field(input: String): String + } + + type AnotherObject implements AnotherInterface { + field: String + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Interface field argument AnotherInterface.field(input:) expected but AnotherObject.field does not provide it.', + locations: [ + { line: 7, column: 15 }, + { line: 11, column: 9 }, + ], + }, + ]); + }); + + it('rejects an Object with an incorrectly typed Interface argument', () => { + const schema = buildSchema(` + type Query { + test: AnotherObject + } + + interface AnotherInterface { + field(input: String): String + } + + type AnotherObject implements AnotherInterface { + field(input: Int): String + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Interface field argument AnotherInterface.field(input:) expects type String but AnotherObject.field(input:) is type Int.', + locations: [ + { line: 7, column: 22 }, + { line: 11, column: 22 }, + ], + }, + ]); + }); + + it('rejects an Object with both an incorrectly typed field and argument', () => { + const schema = buildSchema(` + type Query { + test: AnotherObject + } + + interface AnotherInterface { + field(input: String): String + } + + type AnotherObject implements AnotherInterface { + field(input: Int): Int + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Interface field AnotherInterface.field expects type String but AnotherObject.field is type Int.', + locations: [ + { line: 7, column: 31 }, + { line: 11, column: 28 }, + ], + }, + { + message: + 'Interface field argument AnotherInterface.field(input:) expects type String but AnotherObject.field(input:) is type Int.', + locations: [ + { line: 7, column: 22 }, + { line: 11, column: 22 }, + ], + }, + ]); + }); + + it('rejects an Object which implements an Interface field along with additional required arguments', () => { + const schema = buildSchema(` + type Query { + test: AnotherObject + } + + interface AnotherInterface { + field(baseArg: String): String + } + + type AnotherObject implements AnotherInterface { + field( + baseArg: String, + requiredArg: String! + optionalArg1: String, + optionalArg2: String = "", + ): String + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Object field AnotherObject.field includes required argument requiredArg that is missing from the Interface field AnotherInterface.field.', + locations: [ + { line: 13, column: 11 }, + { line: 7, column: 9 }, + ], + }, + ]); + }); + + it('accepts an Object with an equivalently wrapped Interface field type', () => { + const schema = buildSchema(` + type Query { + test: AnotherObject + } + + interface AnotherInterface { + field: [String]! + } + + type AnotherObject implements AnotherInterface { + field: [String]! + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([]); + }); + + it('rejects an Object with a non-list Interface field list type', () => { + const schema = buildSchema(` + type Query { + test: AnotherObject + } + + interface AnotherInterface { + field: [String] + } + + type AnotherObject implements AnotherInterface { + field: String + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Interface field AnotherInterface.field expects type [String] but AnotherObject.field is type String.', + locations: [ + { line: 7, column: 16 }, + { line: 11, column: 16 }, + ], + }, + ]); + }); + + it('rejects an Object with a list Interface field non-list type', () => { + const schema = buildSchema(` + type Query { + test: AnotherObject + } + + interface AnotherInterface { + field: String + } + + type AnotherObject implements AnotherInterface { + field: [String] + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Interface field AnotherInterface.field expects type String but AnotherObject.field is type [String].', + locations: [ + { line: 7, column: 16 }, + { line: 11, column: 16 }, + ], + }, + ]); + }); + + it('accepts an Object with a subset non-null Interface field type', () => { + const schema = buildSchema(` + type Query { + test: AnotherObject + } + + interface AnotherInterface { + field: String + } + + type AnotherObject implements AnotherInterface { + field: String! + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([]); + }); + + it('rejects an Object with a superset nullable Interface field type', () => { + const schema = buildSchema(` + type Query { + test: AnotherObject + } + + interface AnotherInterface { + field: String! + } + + type AnotherObject implements AnotherInterface { + field: String + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Interface field AnotherInterface.field expects type String! but AnotherObject.field is type String.', + locations: [ + { line: 7, column: 16 }, + { line: 11, column: 16 }, + ], + }, + ]); + }); + + it('rejects an Object missing a transitive interface', () => { + const schema = buildSchema(` + type Query { + test: AnotherObject + } + + interface SuperInterface { + field: String! + } + + interface AnotherInterface implements SuperInterface { + field: String! + } + + type AnotherObject implements AnotherInterface { + field: String! + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Type AnotherObject must implement SuperInterface because it is implemented by AnotherInterface.', + locations: [ + { line: 10, column: 45 }, + { line: 14, column: 37 }, + ], + }, + ]); + }); +}); + +describe('Interfaces must adhere to Interface they implement', () => { + it('accepts an Interface which implements an Interface', () => { + const schema = buildSchema(` + type Query { + test: ChildInterface + } + + interface ParentInterface { + field(input: String): String + } + + interface ChildInterface implements ParentInterface { + field(input: String): String + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([]); + }); + + it('accepts an Interface which implements an Interface along with more fields', () => { + const schema = buildSchema(` + type Query { + test: ChildInterface + } + + interface ParentInterface { + field(input: String): String + } + + interface ChildInterface implements ParentInterface { + field(input: String): String + anotherField: String + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([]); + }); + + it('accepts an Interface which implements an Interface field along with additional optional arguments', () => { + const schema = buildSchema(` + type Query { + test: ChildInterface + } + + interface ParentInterface { + field(input: String): String + } + + interface ChildInterface implements ParentInterface { + field(input: String, anotherInput: String): String + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([]); + }); + + it('rejects an Interface missing an Interface field', () => { + const schema = buildSchema(` + type Query { + test: ChildInterface + } + + interface ParentInterface { + field(input: String): String + } + + interface ChildInterface implements ParentInterface { + anotherField: String + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Interface field ParentInterface.field expected but ChildInterface does not provide it.', + locations: [ + { line: 7, column: 9 }, + { line: 10, column: 7 }, + ], + }, + ]); + }); + + it('rejects an Interface with an incorrectly typed Interface field', () => { + const schema = buildSchema(` + type Query { + test: ChildInterface + } + + interface ParentInterface { + field(input: String): String + } + + interface ChildInterface implements ParentInterface { + field(input: String): Int + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Interface field ParentInterface.field expects type String but ChildInterface.field is type Int.', + locations: [ + { line: 7, column: 31 }, + { line: 11, column: 31 }, + ], + }, + ]); + }); + + it('rejects an Interface with a differently typed Interface field', () => { + const schema = buildSchema(` + type Query { + test: ChildInterface + } + + type A { foo: String } + type B { foo: String } + + interface ParentInterface { + field: A + } + + interface ChildInterface implements ParentInterface { + field: B + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Interface field ParentInterface.field expects type A but ChildInterface.field is type B.', + locations: [ + { line: 10, column: 16 }, + { line: 14, column: 16 }, + ], + }, + ]); + }); + + it('accepts an Interface with a subtyped Interface field (interface)', () => { + const schema = buildSchema(` + type Query { + test: ChildInterface + } + + interface ParentInterface { + field: ParentInterface + } + + interface ChildInterface implements ParentInterface { + field: ChildInterface + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([]); + }); + + it('accepts an Interface with a subtyped Interface field (union)', () => { + const schema = buildSchema(` + type Query { + test: ChildInterface + } + + type SomeObject { + field: String + } + + union SomeUnionType = SomeObject + + interface ParentInterface { + field: SomeUnionType + } + + interface ChildInterface implements ParentInterface { + field: SomeObject + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([]); + }); + + it('rejects an Interface implementing a non-Interface type', () => { + const schema = buildSchema(` + type Query { + field: String + } + + input SomeInputObject { + field: String + } + + interface BadInterface implements SomeInputObject { + field: String + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Type BadInterface must only implement Interface types, it cannot implement SomeInputObject.', + locations: [{ line: 10, column: 41 }], + }, + ]); + }); + + it('rejects an Interface missing an Interface argument', () => { + const schema = buildSchema(` + type Query { + test: ChildInterface + } + + interface ParentInterface { + field(input: String): String + } + + interface ChildInterface implements ParentInterface { + field: String + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Interface field argument ParentInterface.field(input:) expected but ChildInterface.field does not provide it.', + locations: [ + { line: 7, column: 15 }, + { line: 11, column: 9 }, + ], + }, + ]); + }); + + it('rejects an Interface with an incorrectly typed Interface argument', () => { + const schema = buildSchema(` + type Query { + test: ChildInterface + } + + interface ParentInterface { + field(input: String): String + } + + interface ChildInterface implements ParentInterface { + field(input: Int): String + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Interface field argument ParentInterface.field(input:) expects type String but ChildInterface.field(input:) is type Int.', + locations: [ + { line: 7, column: 22 }, + { line: 11, column: 22 }, + ], + }, + ]); + }); + + it('rejects an Interface with both an incorrectly typed field and argument', () => { + const schema = buildSchema(` + type Query { + test: ChildInterface + } + + interface ParentInterface { + field(input: String): String + } + + interface ChildInterface implements ParentInterface { + field(input: Int): Int + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Interface field ParentInterface.field expects type String but ChildInterface.field is type Int.', + locations: [ + { line: 7, column: 31 }, + { line: 11, column: 28 }, + ], + }, + { + message: + 'Interface field argument ParentInterface.field(input:) expects type String but ChildInterface.field(input:) is type Int.', + locations: [ + { line: 7, column: 22 }, + { line: 11, column: 22 }, + ], + }, + ]); + }); + + it('rejects an Interface which implements an Interface field along with additional required arguments', () => { + const schema = buildSchema(` + type Query { + test: ChildInterface + } + + interface ParentInterface { + field(baseArg: String): String + } + + interface ChildInterface implements ParentInterface { + field( + baseArg: String, + requiredArg: String! + optionalArg1: String, + optionalArg2: String = "", + ): String + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Object field ChildInterface.field includes required argument requiredArg that is missing from the Interface field ParentInterface.field.', + locations: [ + { line: 13, column: 11 }, + { line: 7, column: 9 }, + ], + }, + ]); + }); + + it('accepts an Interface with an equivalently wrapped Interface field type', () => { + const schema = buildSchema(` + type Query { + test: ChildInterface + } + + interface ParentInterface { + field: [String]! + } + + interface ChildInterface implements ParentInterface { + field: [String]! + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([]); + }); + + it('rejects an Interface with a non-list Interface field list type', () => { + const schema = buildSchema(` + type Query { + test: ChildInterface + } + + interface ParentInterface { + field: [String] + } + + interface ChildInterface implements ParentInterface { + field: String + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Interface field ParentInterface.field expects type [String] but ChildInterface.field is type String.', + locations: [ + { line: 7, column: 16 }, + { line: 11, column: 16 }, + ], + }, + ]); + }); + + it('rejects an Interface with a list Interface field non-list type', () => { + const schema = buildSchema(` + type Query { + test: ChildInterface + } + + interface ParentInterface { + field: String + } + + interface ChildInterface implements ParentInterface { + field: [String] + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Interface field ParentInterface.field expects type String but ChildInterface.field is type [String].', + locations: [ + { line: 7, column: 16 }, + { line: 11, column: 16 }, + ], + }, + ]); + }); + + it('accepts an Interface with a subset non-null Interface field type', () => { + const schema = buildSchema(` + type Query { + test: ChildInterface + } + + interface ParentInterface { + field: String + } + + interface ChildInterface implements ParentInterface { + field: String! + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([]); + }); + + it('rejects an Interface with a superset nullable Interface field type', () => { + const schema = buildSchema(` + type Query { + test: ChildInterface + } + + interface ParentInterface { + field: String! + } + + interface ChildInterface implements ParentInterface { + field: String + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Interface field ParentInterface.field expects type String! but ChildInterface.field is type String.', + locations: [ + { line: 7, column: 16 }, + { line: 11, column: 16 }, + ], + }, + ]); + }); + + it('rejects an Object missing a transitive interface', () => { + const schema = buildSchema(` + type Query { + test: ChildInterface + } + + interface SuperInterface { + field: String! + } + + interface ParentInterface implements SuperInterface { + field: String! + } + + interface ChildInterface implements ParentInterface { + field: String! + } + `); + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Type ChildInterface must implement SuperInterface because it is implemented by ParentInterface.', + locations: [ + { line: 10, column: 44 }, + { line: 14, column: 43 }, + ], + }, + ]); + }); + + it('rejects a self reference interface', () => { + const schema = buildSchema(` + type Query { + test: FooInterface + } + + interface FooInterface implements FooInterface { + field: String + } + `); + + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Type FooInterface cannot implement itself because it would create a circular reference.', + locations: [{ line: 6, column: 41 }], + }, + ]); + }); + + it('rejects a circular Interface implementation', () => { + const schema = buildSchema(` + type Query { + test: FooInterface + } + + interface FooInterface implements BarInterface { + field: String + } + + interface BarInterface implements FooInterface { + field: String + } + `); + + expectJSON(validateSchema(schema)).toDeepEqual([ + { + message: + 'Type FooInterface cannot implement BarInterface because it would create a circular reference.', + locations: [ + { line: 10, column: 41 }, + { line: 6, column: 41 }, + ], + }, + { + message: + 'Type BarInterface cannot implement FooInterface because it would create a circular reference.', + locations: [ + { line: 6, column: 41 }, + { line: 10, column: 41 }, + ], + }, + ]); + }); +}); + +describe('assertValidSchema', () => { + it('do not throw on valid schemas', () => { + const schema = buildSchema(` + type Query { + foo: String + } + `); + expect(() => assertValidSchema(schema)).to.not.throw(); + }); + + it('include multiple errors into a description', () => { + const schema = buildSchema('type SomeType'); + expect(() => assertValidSchema(schema)).to.throw(dedent` + Query root type must be provided. + + Type SomeType must define one or more fields.`); + }); +}); diff --git a/src/type/assertName.ts b/src/type/assertName.ts new file mode 100644 index 00000000..f4f96fda --- /dev/null +++ b/src/type/assertName.ts @@ -0,0 +1,45 @@ +import { devAssert } from '../jsutils/devAssert'; + +import { GraphQLError } from '../error/GraphQLError'; + +import { isNameContinue, isNameStart } from '../language/characterClasses'; + +/** + * Upholds the spec rules about naming. + */ +export function assertName(name: string): string { + devAssert(name != null, 'Must provide name.'); + devAssert(typeof name === 'string', 'Expected name to be a string.'); + + if (name.length === 0) { + throw new GraphQLError('Expected name to be a non-empty string.'); + } + + for (let i = 1; i < name.length; ++i) { + if (!isNameContinue(name.charCodeAt(i))) { + throw new GraphQLError( + `Names must only contain [_a-zA-Z0-9] but "${name}" does not.`, + ); + } + } + + if (!isNameStart(name.charCodeAt(0))) { + throw new GraphQLError( + `Names must start with [_a-zA-Z] but "${name}" does not.`, + ); + } + + return name; +} + +/** + * Upholds the spec rules about naming enum values. + * + * @internal + */ +export function assertEnumValueName(name: string): string { + if (name === 'true' || name === 'false' || name === 'null') { + throw new GraphQLError(`Enum values cannot be named: ${name}`); + } + return assertName(name); +} diff --git a/src/type/definition.ts b/src/type/definition.ts new file mode 100644 index 00000000..090afa36 --- /dev/null +++ b/src/type/definition.ts @@ -0,0 +1,1741 @@ +import { devAssert } from '../jsutils/devAssert'; +import { didYouMean } from '../jsutils/didYouMean'; +import { identityFunc } from '../jsutils/identityFunc'; +import { inspect } from '../jsutils/inspect'; +import { instanceOf } from '../jsutils/instanceOf'; +import { isObjectLike } from '../jsutils/isObjectLike'; +import { keyMap } from '../jsutils/keyMap'; +import { keyValMap } from '../jsutils/keyValMap'; +import { mapValue } from '../jsutils/mapValue'; +import type { Maybe } from '../jsutils/Maybe'; +import type { ObjMap } from '../jsutils/ObjMap'; +import type { Path } from '../jsutils/Path'; +import type { PromiseOrValue } from '../jsutils/PromiseOrValue'; +import { suggestionList } from '../jsutils/suggestionList'; +import { toObjMap } from '../jsutils/toObjMap'; + +import { GraphQLError } from '../error/GraphQLError'; + +import type { + EnumTypeDefinitionNode, + EnumTypeExtensionNode, + EnumValueDefinitionNode, + FieldDefinitionNode, + FieldNode, + FragmentDefinitionNode, + InputObjectTypeDefinitionNode, + InputObjectTypeExtensionNode, + InputValueDefinitionNode, + InterfaceTypeDefinitionNode, + InterfaceTypeExtensionNode, + ObjectTypeDefinitionNode, + ObjectTypeExtensionNode, + OperationDefinitionNode, + ScalarTypeDefinitionNode, + ScalarTypeExtensionNode, + UnionTypeDefinitionNode, + UnionTypeExtensionNode, + ValueNode, +} from '../language/ast'; +import { Kind } from '../language/kinds'; +import { print } from '../language/printer'; + +import { valueFromASTUntyped } from '../utilities/valueFromASTUntyped'; + +import { assertEnumValueName, assertName } from './assertName'; +import type { GraphQLSchema } from './schema'; + +// Predicates & Assertions + +/** + * These are all of the possible kinds of types. + */ +export type GraphQLType = + | GraphQLScalarType + | GraphQLObjectType + | GraphQLInterfaceType + | GraphQLUnionType + | GraphQLEnumType + | GraphQLInputObjectType + | GraphQLList + | GraphQLNonNull< + | GraphQLScalarType + | GraphQLObjectType + | GraphQLInterfaceType + | GraphQLUnionType + | GraphQLEnumType + | GraphQLInputObjectType + | GraphQLList + >; + +export function isType(type: unknown): type is GraphQLType { + return ( + isScalarType(type) || + isObjectType(type) || + isInterfaceType(type) || + isUnionType(type) || + isEnumType(type) || + isInputObjectType(type) || + isListType(type) || + isNonNullType(type) + ); +} + +export function assertType(type: unknown): GraphQLType { + if (!isType(type)) { + throw new Error(`Expected ${inspect(type)} to be a GraphQL type.`); + } + return type; +} + +/** + * There are predicates for each kind of GraphQL type. + */ +export function isScalarType(type: unknown): type is GraphQLScalarType { + return instanceOf(type, GraphQLScalarType); +} + +export function assertScalarType(type: unknown): GraphQLScalarType { + if (!isScalarType(type)) { + throw new Error(`Expected ${inspect(type)} to be a GraphQL Scalar type.`); + } + return type; +} + +export function isObjectType(type: unknown): type is GraphQLObjectType { + return instanceOf(type, GraphQLObjectType); +} + +export function assertObjectType(type: unknown): GraphQLObjectType { + if (!isObjectType(type)) { + throw new Error(`Expected ${inspect(type)} to be a GraphQL Object type.`); + } + return type; +} + +export function isInterfaceType(type: unknown): type is GraphQLInterfaceType { + return instanceOf(type, GraphQLInterfaceType); +} + +export function assertInterfaceType(type: unknown): GraphQLInterfaceType { + if (!isInterfaceType(type)) { + throw new Error( + `Expected ${inspect(type)} to be a GraphQL Interface type.`, + ); + } + return type; +} + +export function isUnionType(type: unknown): type is GraphQLUnionType { + return instanceOf(type, GraphQLUnionType); +} + +export function assertUnionType(type: unknown): GraphQLUnionType { + if (!isUnionType(type)) { + throw new Error(`Expected ${inspect(type)} to be a GraphQL Union type.`); + } + return type; +} + +export function isEnumType(type: unknown): type is GraphQLEnumType { + return instanceOf(type, GraphQLEnumType); +} + +export function assertEnumType(type: unknown): GraphQLEnumType { + if (!isEnumType(type)) { + throw new Error(`Expected ${inspect(type)} to be a GraphQL Enum type.`); + } + return type; +} + +export function isInputObjectType( + type: unknown, +): type is GraphQLInputObjectType { + return instanceOf(type, GraphQLInputObjectType); +} + +export function assertInputObjectType(type: unknown): GraphQLInputObjectType { + if (!isInputObjectType(type)) { + throw new Error( + `Expected ${inspect(type)} to be a GraphQL Input Object type.`, + ); + } + return type; +} + +export function isListType( + type: GraphQLInputType, +): type is GraphQLList; +export function isListType( + type: GraphQLOutputType, +): type is GraphQLList; +export function isListType(type: unknown): type is GraphQLList; +export function isListType(type: unknown): type is GraphQLList { + return instanceOf(type, GraphQLList); +} + +export function assertListType(type: unknown): GraphQLList { + if (!isListType(type)) { + throw new Error(`Expected ${inspect(type)} to be a GraphQL List type.`); + } + return type; +} + +export function isNonNullType( + type: GraphQLInputType, +): type is GraphQLNonNull; +export function isNonNullType( + type: GraphQLOutputType, +): type is GraphQLNonNull; +export function isNonNullType( + type: unknown, +): type is GraphQLNonNull; +export function isNonNullType( + type: unknown, +): type is GraphQLNonNull { + return instanceOf(type, GraphQLNonNull); +} + +export function assertNonNullType(type: unknown): GraphQLNonNull { + if (!isNonNullType(type)) { + throw new Error(`Expected ${inspect(type)} to be a GraphQL Non-Null type.`); + } + return type; +} + +/** + * These types may be used as input types for arguments and directives. + */ +export type GraphQLInputType = + | GraphQLScalarType + | GraphQLEnumType + | GraphQLInputObjectType + | GraphQLList + | GraphQLNonNull< + | GraphQLScalarType + | GraphQLEnumType + | GraphQLInputObjectType + | GraphQLList + >; + +export function isInputType(type: unknown): type is GraphQLInputType { + return ( + isScalarType(type) || + isEnumType(type) || + isInputObjectType(type) || + (isWrappingType(type) && isInputType(type.ofType)) + ); +} + +export function assertInputType(type: unknown): GraphQLInputType { + if (!isInputType(type)) { + throw new Error(`Expected ${inspect(type)} to be a GraphQL input type.`); + } + return type; +} + +/** + * These types may be used as output types as the result of fields. + */ +export type GraphQLOutputType = + | GraphQLScalarType + | GraphQLObjectType + | GraphQLInterfaceType + | GraphQLUnionType + | GraphQLEnumType + | GraphQLList + | GraphQLNonNull< + | GraphQLScalarType + | GraphQLObjectType + | GraphQLInterfaceType + | GraphQLUnionType + | GraphQLEnumType + | GraphQLList + >; + +export function isOutputType(type: unknown): type is GraphQLOutputType { + return ( + isScalarType(type) || + isObjectType(type) || + isInterfaceType(type) || + isUnionType(type) || + isEnumType(type) || + (isWrappingType(type) && isOutputType(type.ofType)) + ); +} + +export function assertOutputType(type: unknown): GraphQLOutputType { + if (!isOutputType(type)) { + throw new Error(`Expected ${inspect(type)} to be a GraphQL output type.`); + } + return type; +} + +/** + * These types may describe types which may be leaf values. + */ +export type GraphQLLeafType = GraphQLScalarType | GraphQLEnumType; + +export function isLeafType(type: unknown): type is GraphQLLeafType { + return isScalarType(type) || isEnumType(type); +} + +export function assertLeafType(type: unknown): GraphQLLeafType { + if (!isLeafType(type)) { + throw new Error(`Expected ${inspect(type)} to be a GraphQL leaf type.`); + } + return type; +} + +/** + * These types may describe the parent context of a selection set. + */ +export type GraphQLCompositeType = + | GraphQLObjectType + | GraphQLInterfaceType + | GraphQLUnionType; + +export function isCompositeType(type: unknown): type is GraphQLCompositeType { + return isObjectType(type) || isInterfaceType(type) || isUnionType(type); +} + +export function assertCompositeType(type: unknown): GraphQLCompositeType { + if (!isCompositeType(type)) { + throw new Error( + `Expected ${inspect(type)} to be a GraphQL composite type.`, + ); + } + return type; +} + +/** + * These types may describe the parent context of a selection set. + */ +export type GraphQLAbstractType = GraphQLInterfaceType | GraphQLUnionType; + +export function isAbstractType(type: unknown): type is GraphQLAbstractType { + return isInterfaceType(type) || isUnionType(type); +} + +export function assertAbstractType(type: unknown): GraphQLAbstractType { + if (!isAbstractType(type)) { + throw new Error(`Expected ${inspect(type)} to be a GraphQL abstract type.`); + } + return type; +} + +/** + * List Type Wrapper + * + * A list is a wrapping type which points to another type. + * Lists are often created within the context of defining the fields of + * an object type. + * + * Example: + * + * ```ts + * const PersonType = new GraphQLObjectType({ + * name: 'Person', + * fields: () => ({ + * parents: { type: new GraphQLList(PersonType) }, + * children: { type: new GraphQLList(PersonType) }, + * }) + * }) + * ``` + */ +export class GraphQLList { + readonly ofType: T; + + constructor(ofType: T) { + devAssert( + isType(ofType), + `Expected ${inspect(ofType)} to be a GraphQL type.`, + ); + + this.ofType = ofType; + } + + get [Symbol.toStringTag]() { + return 'GraphQLList'; + } + + toString(): string { + return '[' + String(this.ofType) + ']'; + } + + toJSON(): string { + return this.toString(); + } +} + +/** + * Non-Null Type Wrapper + * + * A non-null is a wrapping type which points to another type. + * Non-null types enforce that their values are never null and can ensure + * an error is raised if this ever occurs during a request. It is useful for + * fields which you can make a strong guarantee on non-nullability, for example + * usually the id field of a database row will never be null. + * + * Example: + * + * ```ts + * const RowType = new GraphQLObjectType({ + * name: 'Row', + * fields: () => ({ + * id: { type: new GraphQLNonNull(GraphQLString) }, + * }) + * }) + * ``` + * Note: the enforcement of non-nullability occurs within the executor. + */ +export class GraphQLNonNull { + readonly ofType: T; + + constructor(ofType: T) { + devAssert( + isNullableType(ofType), + `Expected ${inspect(ofType)} to be a GraphQL nullable type.`, + ); + + this.ofType = ofType; + } + + get [Symbol.toStringTag]() { + return 'GraphQLNonNull'; + } + + toString(): string { + return String(this.ofType) + '!'; + } + + toJSON(): string { + return this.toString(); + } +} + +/** + * These types wrap and modify other types + */ + +export type GraphQLWrappingType = + | GraphQLList + | GraphQLNonNull; + +export function isWrappingType(type: unknown): type is GraphQLWrappingType { + return isListType(type) || isNonNullType(type); +} + +export function assertWrappingType(type: unknown): GraphQLWrappingType { + if (!isWrappingType(type)) { + throw new Error(`Expected ${inspect(type)} to be a GraphQL wrapping type.`); + } + return type; +} + +/** + * These types can all accept null as a value. + */ +export type GraphQLNullableType = + | GraphQLScalarType + | GraphQLObjectType + | GraphQLInterfaceType + | GraphQLUnionType + | GraphQLEnumType + | GraphQLInputObjectType + | GraphQLList; + +export function isNullableType(type: unknown): type is GraphQLNullableType { + return isType(type) && !isNonNullType(type); +} + +export function assertNullableType(type: unknown): GraphQLNullableType { + if (!isNullableType(type)) { + throw new Error(`Expected ${inspect(type)} to be a GraphQL nullable type.`); + } + return type; +} + +export function getNullableType(type: undefined | null): void; +export function getNullableType( + type: T | GraphQLNonNull, +): T; +export function getNullableType( + type: Maybe, +): GraphQLNullableType | undefined; +export function getNullableType( + type: Maybe, +): GraphQLNullableType | undefined { + if (type) { + return isNonNullType(type) ? type.ofType : type; + } +} + +/** + * These named types do not include modifiers like List or NonNull. + */ +export type GraphQLNamedType = GraphQLNamedInputType | GraphQLNamedOutputType; + +export type GraphQLNamedInputType = + | GraphQLScalarType + | GraphQLEnumType + | GraphQLInputObjectType; + +export type GraphQLNamedOutputType = + | GraphQLScalarType + | GraphQLObjectType + | GraphQLInterfaceType + | GraphQLUnionType + | GraphQLEnumType; + +export function isNamedType(type: unknown): type is GraphQLNamedType { + return ( + isScalarType(type) || + isObjectType(type) || + isInterfaceType(type) || + isUnionType(type) || + isEnumType(type) || + isInputObjectType(type) + ); +} + +export function assertNamedType(type: unknown): GraphQLNamedType { + if (!isNamedType(type)) { + throw new Error(`Expected ${inspect(type)} to be a GraphQL named type.`); + } + return type; +} + +export function getNamedType(type: undefined | null): void; +export function getNamedType(type: GraphQLInputType): GraphQLNamedInputType; +export function getNamedType(type: GraphQLOutputType): GraphQLNamedOutputType; +export function getNamedType(type: GraphQLType): GraphQLNamedType; +export function getNamedType( + type: Maybe, +): GraphQLNamedType | undefined; +export function getNamedType( + type: Maybe, +): GraphQLNamedType | undefined { + if (type) { + let unwrappedType = type; + while (isWrappingType(unwrappedType)) { + unwrappedType = unwrappedType.ofType; + } + return unwrappedType; + } +} + +/** + * Used while defining GraphQL types to allow for circular references in + * otherwise immutable type definitions. + */ +export type ThunkReadonlyArray = (() => ReadonlyArray) | ReadonlyArray; +export type ThunkObjMap = (() => ObjMap) | ObjMap; + +export function resolveReadonlyArrayThunk( + thunk: ThunkReadonlyArray, +): ReadonlyArray { + return typeof thunk === 'function' ? thunk() : thunk; +} + +export function resolveObjMapThunk(thunk: ThunkObjMap): ObjMap { + return typeof thunk === 'function' ? thunk() : thunk; +} + +/** + * Custom extensions + * + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + */ +export interface GraphQLScalarTypeExtensions { + [attributeName: string]: unknown; +} + +/** + * Scalar Type Definition + * + * The leaf values of any request and input values to arguments are + * Scalars (or Enums) and are defined with a name and a series of functions + * used to parse input from ast or variables and to ensure validity. + * + * If a type's serialize function does not return a value (i.e. it returns + * `undefined`) then an error will be raised and a `null` value will be returned + * in the response. If the serialize function returns `null`, then no error will + * be included in the response. + * + * Example: + * + * ```ts + * const OddType = new GraphQLScalarType({ + * name: 'Odd', + * serialize(value) { + * if (value % 2 === 1) { + * return value; + * } + * } + * }); + * ``` + */ +export class GraphQLScalarType { + name: string; + description: Maybe; + specifiedByURL: Maybe; + serialize: GraphQLScalarSerializer; + parseValue: GraphQLScalarValueParser; + parseLiteral: GraphQLScalarLiteralParser; + extensions: Readonly; + astNode: Maybe; + extensionASTNodes: ReadonlyArray; + + constructor(config: Readonly>) { + const parseValue = + config.parseValue ?? + (identityFunc as GraphQLScalarValueParser); + + this.name = assertName(config.name); + this.description = config.description; + this.specifiedByURL = config.specifiedByURL; + this.serialize = + config.serialize ?? (identityFunc as GraphQLScalarSerializer); + this.parseValue = parseValue; + this.parseLiteral = + config.parseLiteral ?? + ((node, variables) => parseValue(valueFromASTUntyped(node, variables))); + this.extensions = toObjMap(config.extensions); + this.astNode = config.astNode; + this.extensionASTNodes = config.extensionASTNodes ?? []; + + devAssert( + config.specifiedByURL == null || + typeof config.specifiedByURL === 'string', + `${this.name} must provide "specifiedByURL" as a string, ` + + `but got: ${inspect(config.specifiedByURL)}.`, + ); + + devAssert( + config.serialize == null || typeof config.serialize === 'function', + `${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`, + ); + + if (config.parseLiteral) { + devAssert( + typeof config.parseValue === 'function' && + typeof config.parseLiteral === 'function', + `${this.name} must provide both "parseValue" and "parseLiteral" functions.`, + ); + } + } + + get [Symbol.toStringTag]() { + return 'GraphQLScalarType'; + } + + toConfig(): GraphQLScalarTypeNormalizedConfig { + return { + name: this.name, + description: this.description, + specifiedByURL: this.specifiedByURL, + serialize: this.serialize, + parseValue: this.parseValue, + parseLiteral: this.parseLiteral, + extensions: this.extensions, + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes, + }; + } + + toString(): string { + return this.name; + } + + toJSON(): string { + return this.toString(); + } +} + +export type GraphQLScalarSerializer = ( + outputValue: unknown, +) => TExternal; + +export type GraphQLScalarValueParser = ( + inputValue: unknown, +) => TInternal; + +export type GraphQLScalarLiteralParser = ( + valueNode: ValueNode, + variables?: Maybe>, +) => TInternal; + +export interface GraphQLScalarTypeConfig { + name: string; + description?: Maybe; + specifiedByURL?: Maybe; + /** Serializes an internal value to include in a response. */ + serialize?: GraphQLScalarSerializer; + /** Parses an externally provided value to use as an input. */ + parseValue?: GraphQLScalarValueParser; + /** Parses an externally provided literal value to use as an input. */ + parseLiteral?: GraphQLScalarLiteralParser; + extensions?: Maybe>; + astNode?: Maybe; + extensionASTNodes?: Maybe>; +} + +interface GraphQLScalarTypeNormalizedConfig + extends GraphQLScalarTypeConfig { + serialize: GraphQLScalarSerializer; + parseValue: GraphQLScalarValueParser; + parseLiteral: GraphQLScalarLiteralParser; + extensions: Readonly; + extensionASTNodes: ReadonlyArray; +} + +/** + * Custom extensions + * + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + * + * We've provided these template arguments because this is an open type and + * you may find them useful. + */ +export interface GraphQLObjectTypeExtensions<_TSource = any, _TContext = any> { + [attributeName: string]: unknown; +} + +/** + * Object Type Definition + * + * Almost all of the GraphQL types you define will be object types. Object types + * have a name, but most importantly describe their fields. + * + * Example: + * + * ```ts + * const AddressType = new GraphQLObjectType({ + * name: 'Address', + * fields: { + * street: { type: GraphQLString }, + * number: { type: GraphQLInt }, + * formatted: { + * type: GraphQLString, + * resolve(obj) { + * return obj.number + ' ' + obj.street + * } + * } + * } + * }); + * ``` + * + * When two types need to refer to each other, or a type needs to refer to + * itself in a field, you can use a function expression (aka a closure or a + * thunk) to supply the fields lazily. + * + * Example: + * + * ```ts + * const PersonType = new GraphQLObjectType({ + * name: 'Person', + * fields: () => ({ + * name: { type: GraphQLString }, + * bestFriend: { type: PersonType }, + * }) + * }); + * ``` + */ +export class GraphQLObjectType { + name: string; + description: Maybe; + isTypeOf: Maybe>; + extensions: Readonly>; + astNode: Maybe; + extensionASTNodes: ReadonlyArray; + + private _fields: ThunkObjMap>; + private _interfaces: ThunkReadonlyArray; + + constructor(config: Readonly>) { + this.name = assertName(config.name); + this.description = config.description; + this.isTypeOf = config.isTypeOf; + this.extensions = toObjMap(config.extensions); + this.astNode = config.astNode; + this.extensionASTNodes = config.extensionASTNodes ?? []; + + this._fields = () => defineFieldMap(config); + this._interfaces = () => defineInterfaces(config); + devAssert( + config.isTypeOf == null || typeof config.isTypeOf === 'function', + `${this.name} must provide "isTypeOf" as a function, ` + + `but got: ${inspect(config.isTypeOf)}.`, + ); + } + + get [Symbol.toStringTag]() { + return 'GraphQLObjectType'; + } + + getFields(): GraphQLFieldMap { + if (typeof this._fields === 'function') { + this._fields = this._fields(); + } + return this._fields; + } + + getInterfaces(): ReadonlyArray { + if (typeof this._interfaces === 'function') { + this._interfaces = this._interfaces(); + } + return this._interfaces; + } + + toConfig(): GraphQLObjectTypeNormalizedConfig { + return { + name: this.name, + description: this.description, + interfaces: this.getInterfaces(), + fields: fieldsToFieldsConfig(this.getFields()), + isTypeOf: this.isTypeOf, + extensions: this.extensions, + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes, + }; + } + + toString(): string { + return this.name; + } + + toJSON(): string { + return this.toString(); + } +} + +function defineInterfaces( + config: Readonly< + GraphQLObjectTypeConfig | GraphQLInterfaceTypeConfig + >, +): ReadonlyArray { + const interfaces = resolveReadonlyArrayThunk(config.interfaces ?? []); + devAssert( + Array.isArray(interfaces), + `${config.name} interfaces must be an Array or a function which returns an Array.`, + ); + return interfaces; +} + +function defineFieldMap( + config: Readonly< + | GraphQLObjectTypeConfig + | GraphQLInterfaceTypeConfig + >, +): GraphQLFieldMap { + const fieldMap = resolveObjMapThunk(config.fields); + devAssert( + isPlainObj(fieldMap), + `${config.name} fields must be an object with field names as keys or a function which returns such an object.`, + ); + + return mapValue(fieldMap, (fieldConfig, fieldName) => { + devAssert( + isPlainObj(fieldConfig), + `${config.name}.${fieldName} field config must be an object.`, + ); + devAssert( + fieldConfig.resolve == null || typeof fieldConfig.resolve === 'function', + `${config.name}.${fieldName} field resolver must be a function if ` + + `provided, but got: ${inspect(fieldConfig.resolve)}.`, + ); + + const argsConfig = fieldConfig.args ?? {}; + devAssert( + isPlainObj(argsConfig), + `${config.name}.${fieldName} args must be an object with argument names as keys.`, + ); + + return { + name: assertName(fieldName), + description: fieldConfig.description, + type: fieldConfig.type, + args: defineArguments(argsConfig), + resolve: fieldConfig.resolve, + subscribe: fieldConfig.subscribe, + deprecationReason: fieldConfig.deprecationReason, + extensions: toObjMap(fieldConfig.extensions), + astNode: fieldConfig.astNode, + }; + }); +} + +export function defineArguments( + config: GraphQLFieldConfigArgumentMap, +): ReadonlyArray { + return Object.entries(config).map(([argName, argConfig]) => ({ + name: assertName(argName), + description: argConfig.description, + type: argConfig.type, + defaultValue: argConfig.defaultValue, + deprecationReason: argConfig.deprecationReason, + extensions: toObjMap(argConfig.extensions), + astNode: argConfig.astNode, + })); +} + +function isPlainObj(obj: unknown): boolean { + return isObjectLike(obj) && !Array.isArray(obj); +} + +function fieldsToFieldsConfig( + fields: GraphQLFieldMap, +): GraphQLFieldConfigMap { + return mapValue(fields, (field) => ({ + description: field.description, + type: field.type, + args: argsToArgsConfig(field.args), + resolve: field.resolve, + subscribe: field.subscribe, + deprecationReason: field.deprecationReason, + extensions: field.extensions, + astNode: field.astNode, + })); +} + +/** + * @internal + */ +export function argsToArgsConfig( + args: ReadonlyArray, +): GraphQLFieldConfigArgumentMap { + return keyValMap( + args, + (arg) => arg.name, + (arg) => ({ + description: arg.description, + type: arg.type, + defaultValue: arg.defaultValue, + deprecationReason: arg.deprecationReason, + extensions: arg.extensions, + astNode: arg.astNode, + }), + ); +} + +export interface GraphQLObjectTypeConfig { + name: string; + description?: Maybe; + interfaces?: ThunkReadonlyArray; + fields: ThunkObjMap>; + isTypeOf?: Maybe>; + extensions?: Maybe>>; + astNode?: Maybe; + extensionASTNodes?: Maybe>; +} + +interface GraphQLObjectTypeNormalizedConfig + extends GraphQLObjectTypeConfig { + interfaces: ReadonlyArray; + fields: GraphQLFieldConfigMap; + extensions: Readonly>; + extensionASTNodes: ReadonlyArray; +} + +export type GraphQLTypeResolver = ( + value: TSource, + context: TContext, + info: GraphQLResolveInfo, + abstractType: GraphQLAbstractType, +) => PromiseOrValue; + +export type GraphQLIsTypeOfFn = ( + source: TSource, + context: TContext, + info: GraphQLResolveInfo, +) => PromiseOrValue; + +export type GraphQLFieldResolver< + TSource, + TContext, + TArgs = any, + TResult = unknown, +> = ( + source: TSource, + args: TArgs, + context: TContext, + info: GraphQLResolveInfo, +) => TResult; + +export interface GraphQLResolveInfo { + readonly fieldName: string; + readonly fieldNodes: ReadonlyArray; + readonly returnType: GraphQLOutputType; + readonly parentType: GraphQLObjectType; + readonly path: Path; + readonly schema: GraphQLSchema; + readonly fragments: ObjMap; + readonly rootValue: unknown; + readonly operation: OperationDefinitionNode; + readonly variableValues: { [variable: string]: unknown }; +} + +/** + * Custom extensions + * + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + * + * We've provided these template arguments because this is an open type and + * you may find them useful. + */ +export interface GraphQLFieldExtensions<_TSource, _TContext, _TArgs = any> { + [attributeName: string]: unknown; +} + +export interface GraphQLFieldConfig { + description?: Maybe; + type: GraphQLOutputType; + args?: GraphQLFieldConfigArgumentMap; + resolve?: GraphQLFieldResolver; + subscribe?: GraphQLFieldResolver; + deprecationReason?: Maybe; + extensions?: Maybe< + Readonly> + >; + astNode?: Maybe; +} + +export type GraphQLFieldConfigArgumentMap = ObjMap; + +/** + * Custom extensions + * + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + */ +export interface GraphQLArgumentExtensions { + [attributeName: string]: unknown; +} + +export interface GraphQLArgumentConfig { + description?: Maybe; + type: GraphQLInputType; + defaultValue?: unknown; + deprecationReason?: Maybe; + extensions?: Maybe>; + astNode?: Maybe; +} + +export type GraphQLFieldConfigMap = ObjMap< + GraphQLFieldConfig +>; + +export interface GraphQLField { + name: string; + description: Maybe; + type: GraphQLOutputType; + args: ReadonlyArray; + resolve?: GraphQLFieldResolver; + subscribe?: GraphQLFieldResolver; + deprecationReason: Maybe; + extensions: Readonly>; + astNode: Maybe; +} + +export interface GraphQLArgument { + name: string; + description: Maybe; + type: GraphQLInputType; + defaultValue: unknown; + deprecationReason: Maybe; + extensions: Readonly; + astNode: Maybe; +} + +export function isRequiredArgument(arg: GraphQLArgument): boolean { + return isNonNullType(arg.type) && arg.defaultValue === undefined; +} + +export type GraphQLFieldMap = ObjMap< + GraphQLField +>; + +/** + * Custom extensions + * + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + */ +export interface GraphQLInterfaceTypeExtensions { + [attributeName: string]: unknown; +} + +/** + * Interface Type Definition + * + * When a field can return one of a heterogeneous set of types, a Interface type + * is used to describe what types are possible, what fields are in common across + * all types, as well as a function to determine which type is actually used + * when the field is resolved. + * + * Example: + * + * ```ts + * const EntityType = new GraphQLInterfaceType({ + * name: 'Entity', + * fields: { + * name: { type: GraphQLString } + * } + * }); + * ``` + */ +export class GraphQLInterfaceType { + name: string; + description: Maybe; + resolveType: Maybe>; + extensions: Readonly; + astNode: Maybe; + extensionASTNodes: ReadonlyArray; + + private _fields: ThunkObjMap>; + private _interfaces: ThunkReadonlyArray; + + constructor(config: Readonly>) { + this.name = assertName(config.name); + this.description = config.description; + this.resolveType = config.resolveType; + this.extensions = toObjMap(config.extensions); + this.astNode = config.astNode; + this.extensionASTNodes = config.extensionASTNodes ?? []; + + this._fields = defineFieldMap.bind(undefined, config); + this._interfaces = defineInterfaces.bind(undefined, config); + devAssert( + config.resolveType == null || typeof config.resolveType === 'function', + `${this.name} must provide "resolveType" as a function, ` + + `but got: ${inspect(config.resolveType)}.`, + ); + } + + get [Symbol.toStringTag]() { + return 'GraphQLInterfaceType'; + } + + getFields(): GraphQLFieldMap { + if (typeof this._fields === 'function') { + this._fields = this._fields(); + } + return this._fields; + } + + getInterfaces(): ReadonlyArray { + if (typeof this._interfaces === 'function') { + this._interfaces = this._interfaces(); + } + return this._interfaces; + } + + toConfig(): GraphQLInterfaceTypeNormalizedConfig { + return { + name: this.name, + description: this.description, + interfaces: this.getInterfaces(), + fields: fieldsToFieldsConfig(this.getFields()), + resolveType: this.resolveType, + extensions: this.extensions, + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes, + }; + } + + toString(): string { + return this.name; + } + + toJSON(): string { + return this.toString(); + } +} + +export interface GraphQLInterfaceTypeConfig { + name: string; + description?: Maybe; + interfaces?: ThunkReadonlyArray; + fields: ThunkObjMap>; + /** + * Optionally provide a custom type resolver function. If one is not provided, + * the default implementation will call `isTypeOf` on each implementing + * Object type. + */ + resolveType?: Maybe>; + extensions?: Maybe>; + astNode?: Maybe; + extensionASTNodes?: Maybe>; +} + +export interface GraphQLInterfaceTypeNormalizedConfig + extends GraphQLInterfaceTypeConfig { + interfaces: ReadonlyArray; + fields: GraphQLFieldConfigMap; + extensions: Readonly; + extensionASTNodes: ReadonlyArray; +} + +/** + * Custom extensions + * + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + */ +export interface GraphQLUnionTypeExtensions { + [attributeName: string]: unknown; +} + +/** + * Union Type Definition + * + * When a field can return one of a heterogeneous set of types, a Union type + * is used to describe what types are possible as well as providing a function + * to determine which type is actually used when the field is resolved. + * + * Example: + * + * ```ts + * const PetType = new GraphQLUnionType({ + * name: 'Pet', + * types: [ DogType, CatType ], + * resolveType(value) { + * if (value instanceof Dog) { + * return DogType; + * } + * if (value instanceof Cat) { + * return CatType; + * } + * } + * }); + * ``` + */ +export class GraphQLUnionType { + name: string; + description: Maybe; + resolveType: Maybe>; + extensions: Readonly; + astNode: Maybe; + extensionASTNodes: ReadonlyArray; + + private _types: ThunkReadonlyArray; + + constructor(config: Readonly>) { + this.name = assertName(config.name); + this.description = config.description; + this.resolveType = config.resolveType; + this.extensions = toObjMap(config.extensions); + this.astNode = config.astNode; + this.extensionASTNodes = config.extensionASTNodes ?? []; + + this._types = defineTypes.bind(undefined, config); + devAssert( + config.resolveType == null || typeof config.resolveType === 'function', + `${this.name} must provide "resolveType" as a function, ` + + `but got: ${inspect(config.resolveType)}.`, + ); + } + + get [Symbol.toStringTag]() { + return 'GraphQLUnionType'; + } + + getTypes(): ReadonlyArray { + if (typeof this._types === 'function') { + this._types = this._types(); + } + return this._types; + } + + toConfig(): GraphQLUnionTypeNormalizedConfig { + return { + name: this.name, + description: this.description, + types: this.getTypes(), + resolveType: this.resolveType, + extensions: this.extensions, + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes, + }; + } + + toString(): string { + return this.name; + } + + toJSON(): string { + return this.toString(); + } +} + +function defineTypes( + config: Readonly>, +): ReadonlyArray { + const types = resolveReadonlyArrayThunk(config.types); + devAssert( + Array.isArray(types), + `Must provide Array of types or a function which returns such an array for Union ${config.name}.`, + ); + return types; +} + +export interface GraphQLUnionTypeConfig { + name: string; + description?: Maybe; + types: ThunkReadonlyArray; + /** + * Optionally provide a custom type resolver function. If one is not provided, + * the default implementation will call `isTypeOf` on each implementing + * Object type. + */ + resolveType?: Maybe>; + extensions?: Maybe>; + astNode?: Maybe; + extensionASTNodes?: Maybe>; +} + +interface GraphQLUnionTypeNormalizedConfig + extends GraphQLUnionTypeConfig { + types: ReadonlyArray; + extensions: Readonly; + extensionASTNodes: ReadonlyArray; +} + +/** + * Custom extensions + * + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + */ +export interface GraphQLEnumTypeExtensions { + [attributeName: string]: unknown; +} + +/** + * Enum Type Definition + * + * Some leaf values of requests and input values are Enums. GraphQL serializes + * Enum values as strings, however internally Enums can be represented by any + * kind of type, often integers. + * + * Example: + * + * ```ts + * const RGBType = new GraphQLEnumType({ + * name: 'RGB', + * values: { + * RED: { value: 0 }, + * GREEN: { value: 1 }, + * BLUE: { value: 2 } + * } + * }); + * ``` + * + * Note: If a value is not provided in a definition, the name of the enum value + * will be used as its internal value. + */ +export class GraphQLEnumType /* */ { + name: string; + description: Maybe; + extensions: Readonly; + astNode: Maybe; + extensionASTNodes: ReadonlyArray; + + private _values: ReadonlyArray */>; + private _valueLookup: ReadonlyMap; + private _nameLookup: ObjMap; + + constructor(config: Readonly */>) { + this.name = assertName(config.name); + this.description = config.description; + this.extensions = toObjMap(config.extensions); + this.astNode = config.astNode; + this.extensionASTNodes = config.extensionASTNodes ?? []; + + this._values = defineEnumValues(this.name, config.values); + this._valueLookup = new Map( + this._values.map((enumValue) => [enumValue.value, enumValue]), + ); + this._nameLookup = keyMap(this._values, (value) => value.name); + } + + get [Symbol.toStringTag]() { + return 'GraphQLEnumType'; + } + + getValues(): ReadonlyArray */> { + return this._values; + } + + getValue(name: string): Maybe { + return this._nameLookup[name]; + } + + serialize(outputValue: unknown /* T */): Maybe { + const enumValue = this._valueLookup.get(outputValue); + if (enumValue === undefined) { + throw new GraphQLError( + `Enum "${this.name}" cannot represent value: ${inspect(outputValue)}`, + ); + } + return enumValue.name; + } + + parseValue(inputValue: unknown): Maybe /* T */ { + if (typeof inputValue !== 'string') { + const valueStr = inspect(inputValue); + throw new GraphQLError( + `Enum "${this.name}" cannot represent non-string value: ${valueStr}.` + + didYouMeanEnumValue(this, valueStr), + ); + } + + const enumValue = this.getValue(inputValue); + if (enumValue == null) { + throw new GraphQLError( + `Value "${inputValue}" does not exist in "${this.name}" enum.` + + didYouMeanEnumValue(this, inputValue), + ); + } + return enumValue.value; + } + + parseLiteral( + valueNode: ValueNode, + _variables: Maybe>, + ): Maybe /* T */ { + // Note: variables will be resolved to a value before calling this function. + if (valueNode.kind !== Kind.ENUM) { + const valueStr = print(valueNode); + throw new GraphQLError( + `Enum "${this.name}" cannot represent non-enum value: ${valueStr}.` + + didYouMeanEnumValue(this, valueStr), + valueNode, + ); + } + + const enumValue = this.getValue(valueNode.value); + if (enumValue == null) { + const valueStr = print(valueNode); + throw new GraphQLError( + `Value "${valueStr}" does not exist in "${this.name}" enum.` + + didYouMeanEnumValue(this, valueStr), + valueNode, + ); + } + return enumValue.value; + } + + toConfig(): GraphQLEnumTypeNormalizedConfig { + const values = keyValMap( + this.getValues(), + (value) => value.name, + (value) => ({ + description: value.description, + value: value.value, + deprecationReason: value.deprecationReason, + extensions: value.extensions, + astNode: value.astNode, + }), + ); + + return { + name: this.name, + description: this.description, + values, + extensions: this.extensions, + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes, + }; + } + + toString(): string { + return this.name; + } + + toJSON(): string { + return this.toString(); + } +} + +function didYouMeanEnumValue( + enumType: GraphQLEnumType, + unknownValueStr: string, +): string { + const allNames = enumType.getValues().map((value) => value.name); + const suggestedValues = suggestionList(unknownValueStr, allNames); + + return didYouMean('the enum value', suggestedValues); +} + +function defineEnumValues( + typeName: string, + valueMap: GraphQLEnumValueConfigMap /* */, +): ReadonlyArray */> { + devAssert( + isPlainObj(valueMap), + `${typeName} values must be an object with value names as keys.`, + ); + return Object.entries(valueMap).map(([valueName, valueConfig]) => { + devAssert( + isPlainObj(valueConfig), + `${typeName}.${valueName} must refer to an object with a "value" key ` + + `representing an internal value but got: ${inspect(valueConfig)}.`, + ); + return { + name: assertEnumValueName(valueName), + description: valueConfig.description, + value: valueConfig.value !== undefined ? valueConfig.value : valueName, + deprecationReason: valueConfig.deprecationReason, + extensions: toObjMap(valueConfig.extensions), + astNode: valueConfig.astNode, + }; + }); +} + +export interface GraphQLEnumTypeConfig { + name: string; + description?: Maybe; + values: GraphQLEnumValueConfigMap /* */; + extensions?: Maybe>; + astNode?: Maybe; + extensionASTNodes?: Maybe>; +} + +interface GraphQLEnumTypeNormalizedConfig extends GraphQLEnumTypeConfig { + extensions: Readonly; + extensionASTNodes: ReadonlyArray; +} + +export type GraphQLEnumValueConfigMap /* */ = + ObjMap */>; + +/** + * Custom extensions + * + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + */ +export interface GraphQLEnumValueExtensions { + [attributeName: string]: unknown; +} + +export interface GraphQLEnumValueConfig { + description?: Maybe; + value?: any /* T */; + deprecationReason?: Maybe; + extensions?: Maybe>; + astNode?: Maybe; +} + +export interface GraphQLEnumValue { + name: string; + description: Maybe; + value: any /* T */; + deprecationReason: Maybe; + extensions: Readonly; + astNode: Maybe; +} + +/** + * Custom extensions + * + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + */ +export interface GraphQLInputObjectTypeExtensions { + [attributeName: string]: unknown; +} + +/** + * Input Object Type Definition + * + * An input object defines a structured collection of fields which may be + * supplied to a field argument. + * + * Using `NonNull` will ensure that a value must be provided by the query + * + * Example: + * + * ```ts + * const GeoPoint = new GraphQLInputObjectType({ + * name: 'GeoPoint', + * fields: { + * lat: { type: new GraphQLNonNull(GraphQLFloat) }, + * lon: { type: new GraphQLNonNull(GraphQLFloat) }, + * alt: { type: GraphQLFloat, defaultValue: 0 }, + * } + * }); + * ``` + */ +export class GraphQLInputObjectType { + name: string; + description: Maybe; + extensions: Readonly; + astNode: Maybe; + extensionASTNodes: ReadonlyArray; + + private _fields: ThunkObjMap; + + constructor(config: Readonly) { + this.name = assertName(config.name); + this.description = config.description; + this.extensions = toObjMap(config.extensions); + this.astNode = config.astNode; + this.extensionASTNodes = config.extensionASTNodes ?? []; + + this._fields = defineInputFieldMap.bind(undefined, config); + } + + get [Symbol.toStringTag]() { + return 'GraphQLInputObjectType'; + } + + getFields(): GraphQLInputFieldMap { + if (typeof this._fields === 'function') { + this._fields = this._fields(); + } + return this._fields; + } + + toConfig(): GraphQLInputObjectTypeNormalizedConfig { + const fields = mapValue(this.getFields(), (field) => ({ + description: field.description, + type: field.type, + defaultValue: field.defaultValue, + deprecationReason: field.deprecationReason, + extensions: field.extensions, + astNode: field.astNode, + })); + + return { + name: this.name, + description: this.description, + fields, + extensions: this.extensions, + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes, + }; + } + + toString(): string { + return this.name; + } + + toJSON(): string { + return this.toString(); + } +} + +function defineInputFieldMap( + config: Readonly, +): GraphQLInputFieldMap { + const fieldMap = resolveObjMapThunk(config.fields); + devAssert( + isPlainObj(fieldMap), + `${config.name} fields must be an object with field names as keys or a function which returns such an object.`, + ); + return mapValue(fieldMap, (fieldConfig, fieldName) => { + devAssert( + !('resolve' in fieldConfig), + `${config.name}.${fieldName} field has a resolve property, but Input Types cannot define resolvers.`, + ); + + return { + name: assertName(fieldName), + description: fieldConfig.description, + type: fieldConfig.type, + defaultValue: fieldConfig.defaultValue, + deprecationReason: fieldConfig.deprecationReason, + extensions: toObjMap(fieldConfig.extensions), + astNode: fieldConfig.astNode, + }; + }); +} + +export interface GraphQLInputObjectTypeConfig { + name: string; + description?: Maybe; + fields: ThunkObjMap; + extensions?: Maybe>; + astNode?: Maybe; + extensionASTNodes?: Maybe>; +} + +interface GraphQLInputObjectTypeNormalizedConfig + extends GraphQLInputObjectTypeConfig { + fields: GraphQLInputFieldConfigMap; + extensions: Readonly; + extensionASTNodes: ReadonlyArray; +} + +/** + * Custom extensions + * + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + */ +export interface GraphQLInputFieldExtensions { + [attributeName: string]: unknown; +} + +export interface GraphQLInputFieldConfig { + description?: Maybe; + type: GraphQLInputType; + defaultValue?: unknown; + deprecationReason?: Maybe; + extensions?: Maybe>; + astNode?: Maybe; +} + +export type GraphQLInputFieldConfigMap = ObjMap; + +export interface GraphQLInputField { + name: string; + description: Maybe; + type: GraphQLInputType; + defaultValue: unknown; + deprecationReason: Maybe; + extensions: Readonly; + astNode: Maybe; +} + +export function isRequiredInputField(field: GraphQLInputField): boolean { + return isNonNullType(field.type) && field.defaultValue === undefined; +} + +export type GraphQLInputFieldMap = ObjMap; diff --git a/src/type/directives.ts b/src/type/directives.ts new file mode 100644 index 00000000..bb3e441a --- /dev/null +++ b/src/type/directives.ts @@ -0,0 +1,225 @@ +import { devAssert } from '../jsutils/devAssert'; +import { inspect } from '../jsutils/inspect'; +import { instanceOf } from '../jsutils/instanceOf'; +import { isObjectLike } from '../jsutils/isObjectLike'; +import type { Maybe } from '../jsutils/Maybe'; +import { toObjMap } from '../jsutils/toObjMap'; + +import type { DirectiveDefinitionNode } from '../language/ast'; +import { DirectiveLocation } from '../language/directiveLocation'; + +import { assertName } from './assertName'; +import type { + GraphQLArgument, + GraphQLFieldConfigArgumentMap, +} from './definition'; +import { + argsToArgsConfig, + defineArguments, + GraphQLNonNull, +} from './definition'; +import { GraphQLBoolean, GraphQLString } from './scalars'; + +/** + * Test if the given value is a GraphQL directive. + */ +export function isDirective(directive: unknown): directive is GraphQLDirective { + return instanceOf(directive, GraphQLDirective); +} + +export function assertDirective(directive: unknown): GraphQLDirective { + if (!isDirective(directive)) { + throw new Error( + `Expected ${inspect(directive)} to be a GraphQL directive.`, + ); + } + return directive; +} + +/** + * Custom extensions + * + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + */ +export interface GraphQLDirectiveExtensions { + [attributeName: string]: unknown; +} + +/** + * Directives are used by the GraphQL runtime as a way of modifying execution + * behavior. Type system creators will usually not create these directly. + */ +export class GraphQLDirective { + name: string; + description: Maybe; + locations: ReadonlyArray; + args: ReadonlyArray; + isRepeatable: boolean; + extensions: Readonly; + astNode: Maybe; + + constructor(config: Readonly) { + this.name = assertName(config.name); + this.description = config.description; + this.locations = config.locations; + this.isRepeatable = config.isRepeatable ?? false; + this.extensions = toObjMap(config.extensions); + this.astNode = config.astNode; + + devAssert( + Array.isArray(config.locations), + `@${config.name} locations must be an Array.`, + ); + + const args = config.args ?? {}; + devAssert( + isObjectLike(args) && !Array.isArray(args), + `@${config.name} args must be an object with argument names as keys.`, + ); + + this.args = defineArguments(args); + } + + get [Symbol.toStringTag]() { + return 'GraphQLDirective'; + } + + toConfig(): GraphQLDirectiveNormalizedConfig { + return { + name: this.name, + description: this.description, + locations: this.locations, + args: argsToArgsConfig(this.args), + isRepeatable: this.isRepeatable, + extensions: this.extensions, + astNode: this.astNode, + }; + } + + toString(): string { + return '@' + this.name; + } + + toJSON(): string { + return this.toString(); + } +} + +export interface GraphQLDirectiveConfig { + name: string; + description?: Maybe; + locations: ReadonlyArray; + args?: Maybe; + isRepeatable?: Maybe; + extensions?: Maybe>; + astNode?: Maybe; +} + +interface GraphQLDirectiveNormalizedConfig extends GraphQLDirectiveConfig { + args: GraphQLFieldConfigArgumentMap; + isRepeatable: boolean; + extensions: Readonly; +} + +/** + * Used to conditionally include fields or fragments. + */ +export const GraphQLIncludeDirective: GraphQLDirective = new GraphQLDirective({ + name: 'include', + description: + 'Directs the executor to include this field or fragment only when the `if` argument is true.', + locations: [ + DirectiveLocation.FIELD, + DirectiveLocation.FRAGMENT_SPREAD, + DirectiveLocation.INLINE_FRAGMENT, + ], + args: { + if: { + type: new GraphQLNonNull(GraphQLBoolean), + description: 'Included when true.', + }, + }, +}); + +/** + * Used to conditionally skip (exclude) fields or fragments. + */ +export const GraphQLSkipDirective: GraphQLDirective = new GraphQLDirective({ + name: 'skip', + description: + 'Directs the executor to skip this field or fragment when the `if` argument is true.', + locations: [ + DirectiveLocation.FIELD, + DirectiveLocation.FRAGMENT_SPREAD, + DirectiveLocation.INLINE_FRAGMENT, + ], + args: { + if: { + type: new GraphQLNonNull(GraphQLBoolean), + description: 'Skipped when true.', + }, + }, +}); + +/** + * Constant string used for default reason for a deprecation. + */ +export const DEFAULT_DEPRECATION_REASON = 'No longer supported'; + +/** + * Used to declare element of a GraphQL schema as deprecated. + */ +export const GraphQLDeprecatedDirective: GraphQLDirective = + new GraphQLDirective({ + name: 'deprecated', + description: 'Marks an element of a GraphQL schema as no longer supported.', + locations: [ + DirectiveLocation.FIELD_DEFINITION, + DirectiveLocation.ARGUMENT_DEFINITION, + DirectiveLocation.INPUT_FIELD_DEFINITION, + DirectiveLocation.ENUM_VALUE, + ], + args: { + reason: { + type: GraphQLString, + description: + 'Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).', + defaultValue: DEFAULT_DEPRECATION_REASON, + }, + }, + }); + +/** + * Used to provide a URL for specifying the behavior of custom scalar definitions. + */ +export const GraphQLSpecifiedByDirective: GraphQLDirective = + new GraphQLDirective({ + name: 'specifiedBy', + description: 'Exposes a URL that specifies the behavior of this scalar.', + locations: [DirectiveLocation.SCALAR], + args: { + url: { + type: new GraphQLNonNull(GraphQLString), + description: 'The URL that specifies the behavior of this scalar.', + }, + }, + }); + +/** + * The full list of specified directives. + */ +export const specifiedDirectives: ReadonlyArray = + Object.freeze([ + GraphQLIncludeDirective, + GraphQLSkipDirective, + GraphQLDeprecatedDirective, + GraphQLSpecifiedByDirective, + ]); + +export function isSpecifiedDirective(directive: GraphQLDirective): boolean { + return specifiedDirectives.some(({ name }) => name === directive.name); +} diff --git a/src/type/index.ts b/src/type/index.ts new file mode 100644 index 00000000..270dd67d --- /dev/null +++ b/src/type/index.ts @@ -0,0 +1,186 @@ +export type { Path as ResponsePath } from '../jsutils/Path'; + +export { + // Predicate + isSchema, + // Assertion + assertSchema, + // GraphQL Schema definition + GraphQLSchema, +} from './schema'; +export type { GraphQLSchemaConfig, GraphQLSchemaExtensions } from './schema'; + +export { + resolveObjMapThunk, + resolveReadonlyArrayThunk, + // Predicates + isType, + isScalarType, + isObjectType, + isInterfaceType, + isUnionType, + isEnumType, + isInputObjectType, + isListType, + isNonNullType, + isInputType, + isOutputType, + isLeafType, + isCompositeType, + isAbstractType, + isWrappingType, + isNullableType, + isNamedType, + isRequiredArgument, + isRequiredInputField, + // Assertions + assertType, + assertScalarType, + assertObjectType, + assertInterfaceType, + assertUnionType, + assertEnumType, + assertInputObjectType, + assertListType, + assertNonNullType, + assertInputType, + assertOutputType, + assertLeafType, + assertCompositeType, + assertAbstractType, + assertWrappingType, + assertNullableType, + assertNamedType, + // Un-modifiers + getNullableType, + getNamedType, + // Definitions + GraphQLScalarType, + GraphQLObjectType, + GraphQLInterfaceType, + GraphQLUnionType, + GraphQLEnumType, + GraphQLInputObjectType, + // Type Wrappers + GraphQLList, + GraphQLNonNull, +} from './definition'; + +export type { + GraphQLType, + GraphQLInputType, + GraphQLOutputType, + GraphQLLeafType, + GraphQLCompositeType, + GraphQLAbstractType, + GraphQLWrappingType, + GraphQLNullableType, + GraphQLNamedType, + GraphQLNamedInputType, + GraphQLNamedOutputType, + ThunkReadonlyArray, + ThunkObjMap, + GraphQLArgument, + GraphQLArgumentConfig, + GraphQLArgumentExtensions, + GraphQLEnumTypeConfig, + GraphQLEnumTypeExtensions, + GraphQLEnumValue, + GraphQLEnumValueConfig, + GraphQLEnumValueConfigMap, + GraphQLEnumValueExtensions, + GraphQLField, + GraphQLFieldConfig, + GraphQLFieldConfigArgumentMap, + GraphQLFieldConfigMap, + GraphQLFieldExtensions, + GraphQLFieldMap, + GraphQLFieldResolver, + GraphQLInputField, + GraphQLInputFieldConfig, + GraphQLInputFieldConfigMap, + GraphQLInputFieldExtensions, + GraphQLInputFieldMap, + GraphQLInputObjectTypeConfig, + GraphQLInputObjectTypeExtensions, + GraphQLInterfaceTypeConfig, + GraphQLInterfaceTypeExtensions, + GraphQLIsTypeOfFn, + GraphQLObjectTypeConfig, + GraphQLObjectTypeExtensions, + GraphQLResolveInfo, + GraphQLScalarTypeConfig, + GraphQLScalarTypeExtensions, + GraphQLTypeResolver, + GraphQLUnionTypeConfig, + GraphQLUnionTypeExtensions, + GraphQLScalarSerializer, + GraphQLScalarValueParser, + GraphQLScalarLiteralParser, +} from './definition'; + +export { + // Predicate + isDirective, + // Assertion + assertDirective, + // Directives Definition + GraphQLDirective, + // Built-in Directives defined by the Spec + isSpecifiedDirective, + specifiedDirectives, + GraphQLIncludeDirective, + GraphQLSkipDirective, + GraphQLDeprecatedDirective, + GraphQLSpecifiedByDirective, + // Constant Deprecation Reason + DEFAULT_DEPRECATION_REASON, +} from './directives'; + +export type { + GraphQLDirectiveConfig, + GraphQLDirectiveExtensions, +} from './directives'; + +// Common built-in scalar instances. +export { + // Predicate + isSpecifiedScalarType, + // Standard GraphQL Scalars + specifiedScalarTypes, + GraphQLInt, + GraphQLFloat, + GraphQLString, + GraphQLBoolean, + GraphQLID, + // Int boundaries constants + GRAPHQL_MAX_INT, + GRAPHQL_MIN_INT, +} from './scalars'; + +export { + // Predicate + isIntrospectionType, + // GraphQL Types for introspection. + introspectionTypes, + __Schema, + __Directive, + __DirectiveLocation, + __Type, + __Field, + __InputValue, + __EnumValue, + __TypeKind, + // "Enum" of Type Kinds + TypeKind, + // Meta-field definitions. + SchemaMetaFieldDef, + TypeMetaFieldDef, + TypeNameMetaFieldDef, +} from './introspection'; + +// Validate GraphQL schema. +export { validateSchema, assertValidSchema } from './validate'; + +// Upholds the spec rules about naming. +export { assertName, assertEnumValueName } from './assertName'; diff --git a/src/type/introspection.ts b/src/type/introspection.ts new file mode 100644 index 00000000..e5fce6f2 --- /dev/null +++ b/src/type/introspection.ts @@ -0,0 +1,556 @@ +import { inspect } from '../jsutils/inspect'; +import { invariant } from '../jsutils/invariant'; + +import { DirectiveLocation } from '../language/directiveLocation'; +import { print } from '../language/printer'; + +import { astFromValue } from '../utilities/astFromValue'; + +import type { + GraphQLEnumValue, + GraphQLField, + GraphQLFieldConfigMap, + GraphQLInputField, + GraphQLNamedType, + GraphQLType, +} from './definition'; +import { + GraphQLEnumType, + GraphQLList, + GraphQLNonNull, + GraphQLObjectType, + isAbstractType, + isEnumType, + isInputObjectType, + isInterfaceType, + isListType, + isNonNullType, + isObjectType, + isScalarType, + isUnionType, +} from './definition'; +import type { GraphQLDirective } from './directives'; +import { GraphQLBoolean, GraphQLString } from './scalars'; +import type { GraphQLSchema } from './schema'; + +export const __Schema: GraphQLObjectType = new GraphQLObjectType({ + name: '__Schema', + description: + 'A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.', + fields: () => + ({ + description: { + type: GraphQLString, + resolve: (schema) => schema.description, + }, + types: { + description: 'A list of all types supported by this server.', + type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__Type))), + resolve(schema) { + return Object.values(schema.getTypeMap()); + }, + }, + queryType: { + description: 'The type that query operations will be rooted at.', + type: new GraphQLNonNull(__Type), + resolve: (schema) => schema.getQueryType(), + }, + mutationType: { + description: + 'If this server supports mutation, the type that mutation operations will be rooted at.', + type: __Type, + resolve: (schema) => schema.getMutationType(), + }, + subscriptionType: { + description: + 'If this server support subscription, the type that subscription operations will be rooted at.', + type: __Type, + resolve: (schema) => schema.getSubscriptionType(), + }, + directives: { + description: 'A list of all directives supported by this server.', + type: new GraphQLNonNull( + new GraphQLList(new GraphQLNonNull(__Directive)), + ), + resolve: (schema) => schema.getDirectives(), + }, + } as GraphQLFieldConfigMap), +}); + +export const __Directive: GraphQLObjectType = new GraphQLObjectType({ + name: '__Directive', + description: + "A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.", + fields: () => + ({ + name: { + type: new GraphQLNonNull(GraphQLString), + resolve: (directive) => directive.name, + }, + description: { + type: GraphQLString, + resolve: (directive) => directive.description, + }, + isRepeatable: { + type: new GraphQLNonNull(GraphQLBoolean), + resolve: (directive) => directive.isRepeatable, + }, + locations: { + type: new GraphQLNonNull( + new GraphQLList(new GraphQLNonNull(__DirectiveLocation)), + ), + resolve: (directive) => directive.locations, + }, + args: { + type: new GraphQLNonNull( + new GraphQLList(new GraphQLNonNull(__InputValue)), + ), + args: { + includeDeprecated: { + type: GraphQLBoolean, + defaultValue: false, + }, + }, + resolve(field, { includeDeprecated }) { + return includeDeprecated + ? field.args + : field.args.filter((arg) => arg.deprecationReason == null); + }, + }, + } as GraphQLFieldConfigMap), +}); + +export const __DirectiveLocation: GraphQLEnumType = new GraphQLEnumType({ + name: '__DirectiveLocation', + description: + 'A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.', + values: { + QUERY: { + value: DirectiveLocation.QUERY, + description: 'Location adjacent to a query operation.', + }, + MUTATION: { + value: DirectiveLocation.MUTATION, + description: 'Location adjacent to a mutation operation.', + }, + SUBSCRIPTION: { + value: DirectiveLocation.SUBSCRIPTION, + description: 'Location adjacent to a subscription operation.', + }, + FIELD: { + value: DirectiveLocation.FIELD, + description: 'Location adjacent to a field.', + }, + FRAGMENT_DEFINITION: { + value: DirectiveLocation.FRAGMENT_DEFINITION, + description: 'Location adjacent to a fragment definition.', + }, + FRAGMENT_SPREAD: { + value: DirectiveLocation.FRAGMENT_SPREAD, + description: 'Location adjacent to a fragment spread.', + }, + INLINE_FRAGMENT: { + value: DirectiveLocation.INLINE_FRAGMENT, + description: 'Location adjacent to an inline fragment.', + }, + VARIABLE_DEFINITION: { + value: DirectiveLocation.VARIABLE_DEFINITION, + description: 'Location adjacent to a variable definition.', + }, + SCHEMA: { + value: DirectiveLocation.SCHEMA, + description: 'Location adjacent to a schema definition.', + }, + SCALAR: { + value: DirectiveLocation.SCALAR, + description: 'Location adjacent to a scalar definition.', + }, + OBJECT: { + value: DirectiveLocation.OBJECT, + description: 'Location adjacent to an object type definition.', + }, + FIELD_DEFINITION: { + value: DirectiveLocation.FIELD_DEFINITION, + description: 'Location adjacent to a field definition.', + }, + ARGUMENT_DEFINITION: { + value: DirectiveLocation.ARGUMENT_DEFINITION, + description: 'Location adjacent to an argument definition.', + }, + INTERFACE: { + value: DirectiveLocation.INTERFACE, + description: 'Location adjacent to an interface definition.', + }, + UNION: { + value: DirectiveLocation.UNION, + description: 'Location adjacent to a union definition.', + }, + ENUM: { + value: DirectiveLocation.ENUM, + description: 'Location adjacent to an enum definition.', + }, + ENUM_VALUE: { + value: DirectiveLocation.ENUM_VALUE, + description: 'Location adjacent to an enum value definition.', + }, + INPUT_OBJECT: { + value: DirectiveLocation.INPUT_OBJECT, + description: 'Location adjacent to an input object type definition.', + }, + INPUT_FIELD_DEFINITION: { + value: DirectiveLocation.INPUT_FIELD_DEFINITION, + description: 'Location adjacent to an input object field definition.', + }, + }, +}); + +export const __Type: GraphQLObjectType = new GraphQLObjectType({ + name: '__Type', + description: + 'The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.', + fields: () => + ({ + kind: { + type: new GraphQLNonNull(__TypeKind), + resolve(type) { + if (isScalarType(type)) { + return TypeKind.SCALAR; + } + if (isObjectType(type)) { + return TypeKind.OBJECT; + } + if (isInterfaceType(type)) { + return TypeKind.INTERFACE; + } + if (isUnionType(type)) { + return TypeKind.UNION; + } + if (isEnumType(type)) { + return TypeKind.ENUM; + } + if (isInputObjectType(type)) { + return TypeKind.INPUT_OBJECT; + } + if (isListType(type)) { + return TypeKind.LIST; + } + if (isNonNullType(type)) { + return TypeKind.NON_NULL; + } + /* c8 ignore next 3 */ + // Not reachable, all possible types have been considered) + invariant(false, `Unexpected type: "${inspect(type)}".`); + }, + }, + name: { + type: GraphQLString, + resolve: (type) => ('name' in type ? type.name : undefined), + }, + description: { + type: GraphQLString, + resolve: (type) => + // FIXME: add test case + /* c8 ignore next */ + 'description' in type ? type.description : undefined, + }, + specifiedByURL: { + type: GraphQLString, + resolve: (obj) => + 'specifiedByURL' in obj ? obj.specifiedByURL : undefined, + }, + fields: { + type: new GraphQLList(new GraphQLNonNull(__Field)), + args: { + includeDeprecated: { type: GraphQLBoolean, defaultValue: false }, + }, + resolve(type, { includeDeprecated }) { + if (isObjectType(type) || isInterfaceType(type)) { + const fields = Object.values(type.getFields()); + return includeDeprecated + ? fields + : fields.filter((field) => field.deprecationReason == null); + } + }, + }, + interfaces: { + type: new GraphQLList(new GraphQLNonNull(__Type)), + resolve(type) { + if (isObjectType(type) || isInterfaceType(type)) { + return type.getInterfaces(); + } + }, + }, + possibleTypes: { + type: new GraphQLList(new GraphQLNonNull(__Type)), + resolve(type, _args, _context, { schema }) { + if (isAbstractType(type)) { + return schema.getPossibleTypes(type); + } + }, + }, + enumValues: { + type: new GraphQLList(new GraphQLNonNull(__EnumValue)), + args: { + includeDeprecated: { type: GraphQLBoolean, defaultValue: false }, + }, + resolve(type, { includeDeprecated }) { + if (isEnumType(type)) { + const values = type.getValues(); + return includeDeprecated + ? values + : values.filter((field) => field.deprecationReason == null); + } + }, + }, + inputFields: { + type: new GraphQLList(new GraphQLNonNull(__InputValue)), + args: { + includeDeprecated: { + type: GraphQLBoolean, + defaultValue: false, + }, + }, + resolve(type, { includeDeprecated }) { + if (isInputObjectType(type)) { + const values = Object.values(type.getFields()); + return includeDeprecated + ? values + : values.filter((field) => field.deprecationReason == null); + } + }, + }, + ofType: { + type: __Type, + resolve: (type) => ('ofType' in type ? type.ofType : undefined), + }, + } as GraphQLFieldConfigMap), +}); + +export const __Field: GraphQLObjectType = new GraphQLObjectType({ + name: '__Field', + description: + 'Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.', + fields: () => + ({ + name: { + type: new GraphQLNonNull(GraphQLString), + resolve: (field) => field.name, + }, + description: { + type: GraphQLString, + resolve: (field) => field.description, + }, + args: { + type: new GraphQLNonNull( + new GraphQLList(new GraphQLNonNull(__InputValue)), + ), + args: { + includeDeprecated: { + type: GraphQLBoolean, + defaultValue: false, + }, + }, + resolve(field, { includeDeprecated }) { + return includeDeprecated + ? field.args + : field.args.filter((arg) => arg.deprecationReason == null); + }, + }, + type: { + type: new GraphQLNonNull(__Type), + resolve: (field) => field.type, + }, + isDeprecated: { + type: new GraphQLNonNull(GraphQLBoolean), + resolve: (field) => field.deprecationReason != null, + }, + deprecationReason: { + type: GraphQLString, + resolve: (field) => field.deprecationReason, + }, + } as GraphQLFieldConfigMap, unknown>), +}); + +export const __InputValue: GraphQLObjectType = new GraphQLObjectType({ + name: '__InputValue', + description: + 'Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.', + fields: () => + ({ + name: { + type: new GraphQLNonNull(GraphQLString), + resolve: (inputValue) => inputValue.name, + }, + description: { + type: GraphQLString, + resolve: (inputValue) => inputValue.description, + }, + type: { + type: new GraphQLNonNull(__Type), + resolve: (inputValue) => inputValue.type, + }, + defaultValue: { + type: GraphQLString, + description: + 'A GraphQL-formatted string representing the default value for this input value.', + resolve(inputValue) { + const { type, defaultValue } = inputValue; + const valueAST = astFromValue(defaultValue, type); + return valueAST ? print(valueAST) : null; + }, + }, + isDeprecated: { + type: new GraphQLNonNull(GraphQLBoolean), + resolve: (field) => field.deprecationReason != null, + }, + deprecationReason: { + type: GraphQLString, + resolve: (obj) => obj.deprecationReason, + }, + } as GraphQLFieldConfigMap), +}); + +export const __EnumValue: GraphQLObjectType = new GraphQLObjectType({ + name: '__EnumValue', + description: + 'One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.', + fields: () => + ({ + name: { + type: new GraphQLNonNull(GraphQLString), + resolve: (enumValue) => enumValue.name, + }, + description: { + type: GraphQLString, + resolve: (enumValue) => enumValue.description, + }, + isDeprecated: { + type: new GraphQLNonNull(GraphQLBoolean), + resolve: (enumValue) => enumValue.deprecationReason != null, + }, + deprecationReason: { + type: GraphQLString, + resolve: (enumValue) => enumValue.deprecationReason, + }, + } as GraphQLFieldConfigMap), +}); + +export enum TypeKind { + SCALAR = 'SCALAR', + OBJECT = 'OBJECT', + INTERFACE = 'INTERFACE', + UNION = 'UNION', + ENUM = 'ENUM', + INPUT_OBJECT = 'INPUT_OBJECT', + LIST = 'LIST', + NON_NULL = 'NON_NULL', +} + +export const __TypeKind: GraphQLEnumType = new GraphQLEnumType({ + name: '__TypeKind', + description: 'An enum describing what kind of type a given `__Type` is.', + values: { + SCALAR: { + value: TypeKind.SCALAR, + description: 'Indicates this type is a scalar.', + }, + OBJECT: { + value: TypeKind.OBJECT, + description: + 'Indicates this type is an object. `fields` and `interfaces` are valid fields.', + }, + INTERFACE: { + value: TypeKind.INTERFACE, + description: + 'Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields.', + }, + UNION: { + value: TypeKind.UNION, + description: + 'Indicates this type is a union. `possibleTypes` is a valid field.', + }, + ENUM: { + value: TypeKind.ENUM, + description: + 'Indicates this type is an enum. `enumValues` is a valid field.', + }, + INPUT_OBJECT: { + value: TypeKind.INPUT_OBJECT, + description: + 'Indicates this type is an input object. `inputFields` is a valid field.', + }, + LIST: { + value: TypeKind.LIST, + description: 'Indicates this type is a list. `ofType` is a valid field.', + }, + NON_NULL: { + value: TypeKind.NON_NULL, + description: + 'Indicates this type is a non-null. `ofType` is a valid field.', + }, + }, +}); + +/** + * Note that these are GraphQLField and not GraphQLFieldConfig, + * so the format for args is different. + */ + +export const SchemaMetaFieldDef: GraphQLField = { + name: '__schema', + type: new GraphQLNonNull(__Schema), + description: 'Access the current type schema of this server.', + args: [], + resolve: (_source, _args, _context, { schema }) => schema, + deprecationReason: undefined, + extensions: Object.create(null), + astNode: undefined, +}; + +export const TypeMetaFieldDef: GraphQLField = { + name: '__type', + type: __Type, + description: 'Request the type information of a single type.', + args: [ + { + name: 'name', + description: undefined, + type: new GraphQLNonNull(GraphQLString), + defaultValue: undefined, + deprecationReason: undefined, + extensions: Object.create(null), + astNode: undefined, + }, + ], + resolve: (_source, { name }, _context, { schema }) => schema.getType(name), + deprecationReason: undefined, + extensions: Object.create(null), + astNode: undefined, +}; + +export const TypeNameMetaFieldDef: GraphQLField = { + name: '__typename', + type: new GraphQLNonNull(GraphQLString), + description: 'The name of the current Object type at runtime.', + args: [], + resolve: (_source, _args, _context, { parentType }) => parentType.name, + deprecationReason: undefined, + extensions: Object.create(null), + astNode: undefined, +}; + +export const introspectionTypes: ReadonlyArray = + Object.freeze([ + __Schema, + __Directive, + __DirectiveLocation, + __Type, + __Field, + __InputValue, + __EnumValue, + __TypeKind, + ]); + +export function isIntrospectionType(type: GraphQLNamedType): boolean { + return introspectionTypes.some(({ name }) => type.name === name); +} diff --git a/src/type/scalars.ts b/src/type/scalars.ts new file mode 100644 index 00000000..de78e6b0 --- /dev/null +++ b/src/type/scalars.ts @@ -0,0 +1,284 @@ +import { inspect } from '../jsutils/inspect'; +import { isObjectLike } from '../jsutils/isObjectLike'; + +import { GraphQLError } from '../error/GraphQLError'; + +import { Kind } from '../language/kinds'; +import { print } from '../language/printer'; + +import type { GraphQLNamedType } from './definition'; +import { GraphQLScalarType } from './definition'; + +/** + * Maximum possible Int value as per GraphQL Spec (32-bit signed integer). + * n.b. This differs from JavaScript's numbers that are IEEE 754 doubles safe up-to 2^53 - 1 + * */ +export const GRAPHQL_MAX_INT = 2147483647; + +/** + * Minimum possible Int value as per GraphQL Spec (32-bit signed integer). + * n.b. This differs from JavaScript's numbers that are IEEE 754 doubles safe starting at -(2^53 - 1) + * */ +export const GRAPHQL_MIN_INT = -2147483648; + +export const GraphQLInt = new GraphQLScalarType({ + name: 'Int', + description: + 'The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.', + + serialize(outputValue) { + const coercedValue = serializeObject(outputValue); + + if (typeof coercedValue === 'boolean') { + return coercedValue ? 1 : 0; + } + + let num = coercedValue; + if (typeof coercedValue === 'string' && coercedValue !== '') { + num = Number(coercedValue); + } + + if (typeof num !== 'number' || !Number.isInteger(num)) { + throw new GraphQLError( + `Int cannot represent non-integer value: ${inspect(coercedValue)}`, + ); + } + if (num > GRAPHQL_MAX_INT || num < GRAPHQL_MIN_INT) { + throw new GraphQLError( + 'Int cannot represent non 32-bit signed integer value: ' + + inspect(coercedValue), + ); + } + return num; + }, + + parseValue(inputValue) { + if (typeof inputValue !== 'number' || !Number.isInteger(inputValue)) { + throw new GraphQLError( + `Int cannot represent non-integer value: ${inspect(inputValue)}`, + ); + } + if (inputValue > GRAPHQL_MAX_INT || inputValue < GRAPHQL_MIN_INT) { + throw new GraphQLError( + `Int cannot represent non 32-bit signed integer value: ${inputValue}`, + ); + } + return inputValue; + }, + + parseLiteral(valueNode) { + if (valueNode.kind !== Kind.INT) { + throw new GraphQLError( + `Int cannot represent non-integer value: ${print(valueNode)}`, + valueNode, + ); + } + const num = parseInt(valueNode.value, 10); + if (num > GRAPHQL_MAX_INT || num < GRAPHQL_MIN_INT) { + throw new GraphQLError( + `Int cannot represent non 32-bit signed integer value: ${valueNode.value}`, + valueNode, + ); + } + return num; + }, +}); + +export const GraphQLFloat = new GraphQLScalarType({ + name: 'Float', + description: + 'The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).', + + serialize(outputValue) { + const coercedValue = serializeObject(outputValue); + + if (typeof coercedValue === 'boolean') { + return coercedValue ? 1 : 0; + } + + let num = coercedValue; + if (typeof coercedValue === 'string' && coercedValue !== '') { + num = Number(coercedValue); + } + + if (typeof num !== 'number' || !Number.isFinite(num)) { + throw new GraphQLError( + `Float cannot represent non numeric value: ${inspect(coercedValue)}`, + ); + } + return num; + }, + + parseValue(inputValue) { + if (typeof inputValue !== 'number' || !Number.isFinite(inputValue)) { + throw new GraphQLError( + `Float cannot represent non numeric value: ${inspect(inputValue)}`, + ); + } + return inputValue; + }, + + parseLiteral(valueNode) { + if (valueNode.kind !== Kind.FLOAT && valueNode.kind !== Kind.INT) { + throw new GraphQLError( + `Float cannot represent non numeric value: ${print(valueNode)}`, + valueNode, + ); + } + return parseFloat(valueNode.value); + }, +}); + +export const GraphQLString = new GraphQLScalarType({ + name: 'String', + description: + 'The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.', + + serialize(outputValue) { + const coercedValue = serializeObject(outputValue); + + // Serialize string, boolean and number values to a string, but do not + // attempt to coerce object, function, symbol, or other types as strings. + if (typeof coercedValue === 'string') { + return coercedValue; + } + if (typeof coercedValue === 'boolean') { + return coercedValue ? 'true' : 'false'; + } + if (typeof coercedValue === 'number' && Number.isFinite(coercedValue)) { + return coercedValue.toString(); + } + throw new GraphQLError( + `String cannot represent value: ${inspect(outputValue)}`, + ); + }, + + parseValue(inputValue) { + if (typeof inputValue !== 'string') { + throw new GraphQLError( + `String cannot represent a non string value: ${inspect(inputValue)}`, + ); + } + return inputValue; + }, + + parseLiteral(valueNode) { + if (valueNode.kind !== Kind.STRING) { + throw new GraphQLError( + `String cannot represent a non string value: ${print(valueNode)}`, + valueNode, + ); + } + return valueNode.value; + }, +}); + +export const GraphQLBoolean = new GraphQLScalarType({ + name: 'Boolean', + description: 'The `Boolean` scalar type represents `true` or `false`.', + + serialize(outputValue) { + const coercedValue = serializeObject(outputValue); + + if (typeof coercedValue === 'boolean') { + return coercedValue; + } + if (Number.isFinite(coercedValue)) { + return coercedValue !== 0; + } + throw new GraphQLError( + `Boolean cannot represent a non boolean value: ${inspect(coercedValue)}`, + ); + }, + + parseValue(inputValue) { + if (typeof inputValue !== 'boolean') { + throw new GraphQLError( + `Boolean cannot represent a non boolean value: ${inspect(inputValue)}`, + ); + } + return inputValue; + }, + + parseLiteral(valueNode) { + if (valueNode.kind !== Kind.BOOLEAN) { + throw new GraphQLError( + `Boolean cannot represent a non boolean value: ${print(valueNode)}`, + valueNode, + ); + } + return valueNode.value; + }, +}); + +export const GraphQLID = new GraphQLScalarType({ + name: 'ID', + description: + 'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.', + + serialize(outputValue) { + const coercedValue = serializeObject(outputValue); + + if (typeof coercedValue === 'string') { + return coercedValue; + } + if (Number.isInteger(coercedValue)) { + return String(coercedValue); + } + throw new GraphQLError( + `ID cannot represent value: ${inspect(outputValue)}`, + ); + }, + + parseValue(inputValue) { + if (typeof inputValue === 'string') { + return inputValue; + } + if (typeof inputValue === 'number' && Number.isInteger(inputValue)) { + return inputValue.toString(); + } + throw new GraphQLError(`ID cannot represent value: ${inspect(inputValue)}`); + }, + + parseLiteral(valueNode) { + if (valueNode.kind !== Kind.STRING && valueNode.kind !== Kind.INT) { + throw new GraphQLError( + 'ID cannot represent a non-string and non-integer value: ' + + print(valueNode), + valueNode, + ); + } + return valueNode.value; + }, +}); + +export const specifiedScalarTypes: ReadonlyArray = + Object.freeze([ + GraphQLString, + GraphQLInt, + GraphQLFloat, + GraphQLBoolean, + GraphQLID, + ]); + +export function isSpecifiedScalarType(type: GraphQLNamedType): boolean { + return specifiedScalarTypes.some(({ name }) => type.name === name); +} + +// Support serializing objects with custom valueOf() or toJSON() functions - +// a common way to represent a complex value which can be represented as +// a string (ex: MongoDB id objects). +function serializeObject(outputValue: unknown): unknown { + if (isObjectLike(outputValue)) { + if (typeof outputValue.valueOf === 'function') { + const valueOfResult = outputValue.valueOf(); + if (!isObjectLike(valueOfResult)) { + return valueOfResult; + } + } + if (typeof outputValue.toJSON === 'function') { + return outputValue.toJSON(); + } + } + return outputValue; +} diff --git a/src/type/schema.ts b/src/type/schema.ts new file mode 100644 index 00000000..97c27821 --- /dev/null +++ b/src/type/schema.ts @@ -0,0 +1,437 @@ +import { devAssert } from '../jsutils/devAssert'; +import { inspect } from '../jsutils/inspect'; +import { instanceOf } from '../jsutils/instanceOf'; +import { isObjectLike } from '../jsutils/isObjectLike'; +import type { Maybe } from '../jsutils/Maybe'; +import type { ObjMap } from '../jsutils/ObjMap'; +import { toObjMap } from '../jsutils/toObjMap'; + +import type { GraphQLError } from '../error/GraphQLError'; + +import type { + SchemaDefinitionNode, + SchemaExtensionNode, +} from '../language/ast'; +import { OperationTypeNode } from '../language/ast'; + +import type { + GraphQLAbstractType, + GraphQLInterfaceType, + GraphQLNamedType, + GraphQLObjectType, + GraphQLType, +} from './definition'; +import { + getNamedType, + isInputObjectType, + isInterfaceType, + isObjectType, + isUnionType, +} from './definition'; +import type { GraphQLDirective } from './directives'; +import { isDirective, specifiedDirectives } from './directives'; +import { __Schema } from './introspection'; + +/** + * Test if the given value is a GraphQL schema. + */ +export function isSchema(schema: unknown): schema is GraphQLSchema { + return instanceOf(schema, GraphQLSchema); +} + +export function assertSchema(schema: unknown): GraphQLSchema { + if (!isSchema(schema)) { + throw new Error(`Expected ${inspect(schema)} to be a GraphQL schema.`); + } + return schema; +} + +/** + * Custom extensions + * + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + */ +export interface GraphQLSchemaExtensions { + [attributeName: string]: unknown; +} + +/** + * Schema Definition + * + * A Schema is created by supplying the root types of each type of operation, + * query and mutation (optional). A schema definition is then supplied to the + * validator and executor. + * + * Example: + * + * ```ts + * const MyAppSchema = new GraphQLSchema({ + * query: MyAppQueryRootType, + * mutation: MyAppMutationRootType, + * }) + * ``` + * + * Note: When the schema is constructed, by default only the types that are + * reachable by traversing the root types are included, other types must be + * explicitly referenced. + * + * Example: + * + * ```ts + * const characterInterface = new GraphQLInterfaceType({ + * name: 'Character', + * ... + * }); + * + * const humanType = new GraphQLObjectType({ + * name: 'Human', + * interfaces: [characterInterface], + * ... + * }); + * + * const droidType = new GraphQLObjectType({ + * name: 'Droid', + * interfaces: [characterInterface], + * ... + * }); + * + * const schema = new GraphQLSchema({ + * query: new GraphQLObjectType({ + * name: 'Query', + * fields: { + * hero: { type: characterInterface, ... }, + * } + * }), + * ... + * // Since this schema references only the `Character` interface it's + * // necessary to explicitly list the types that implement it if + * // you want them to be included in the final schema. + * types: [humanType, droidType], + * }) + * ``` + * + * Note: If an array of `directives` are provided to GraphQLSchema, that will be + * the exact list of directives represented and allowed. If `directives` is not + * provided then a default set of the specified directives (e.g. `@include` and + * `@skip`) will be used. If you wish to provide *additional* directives to these + * specified directives, you must explicitly declare them. Example: + * + * ```ts + * const MyAppSchema = new GraphQLSchema({ + * ... + * directives: specifiedDirectives.concat([ myCustomDirective ]), + * }) + * ``` + */ +export class GraphQLSchema { + description: Maybe; + extensions: Readonly; + astNode: Maybe; + extensionASTNodes: ReadonlyArray; + + // Used as a cache for validateSchema(). + __validationErrors: Maybe>; + + private _queryType: Maybe; + private _mutationType: Maybe; + private _subscriptionType: Maybe; + private _directives: ReadonlyArray; + private _typeMap: TypeMap; + private _subTypeMap: ObjMap>; + private _implementationsMap: ObjMap<{ + objects: Array; + interfaces: Array; + }>; + + constructor(config: Readonly) { + // If this schema was built from a source known to be valid, then it may be + // marked with assumeValid to avoid an additional type system validation. + this.__validationErrors = config.assumeValid === true ? [] : undefined; + + // Check for common mistakes during construction to produce early errors. + devAssert(isObjectLike(config), 'Must provide configuration object.'); + devAssert( + !config.types || Array.isArray(config.types), + `"types" must be Array if provided but got: ${inspect(config.types)}.`, + ); + devAssert( + !config.directives || Array.isArray(config.directives), + '"directives" must be Array if provided but got: ' + + `${inspect(config.directives)}.`, + ); + + this.description = config.description; + this.extensions = toObjMap(config.extensions); + this.astNode = config.astNode; + this.extensionASTNodes = config.extensionASTNodes ?? []; + + this._queryType = config.query; + this._mutationType = config.mutation; + this._subscriptionType = config.subscription; + // Provide specified directives (e.g. @include and @skip) by default. + this._directives = config.directives ?? specifiedDirectives; + + // To preserve order of user-provided types, we add first to add them to + // the set of "collected" types, so `collectReferencedTypes` ignore them. + const allReferencedTypes: Set = new Set(config.types); + if (config.types != null) { + for (const type of config.types) { + // When we ready to process this type, we remove it from "collected" types + // and then add it together with all dependent types in the correct position. + allReferencedTypes.delete(type); + collectReferencedTypes(type, allReferencedTypes); + } + } + + if (this._queryType != null) { + collectReferencedTypes(this._queryType, allReferencedTypes); + } + if (this._mutationType != null) { + collectReferencedTypes(this._mutationType, allReferencedTypes); + } + if (this._subscriptionType != null) { + collectReferencedTypes(this._subscriptionType, allReferencedTypes); + } + + for (const directive of this._directives) { + // Directives are not validated until validateSchema() is called. + if (isDirective(directive)) { + for (const arg of directive.args) { + collectReferencedTypes(arg.type, allReferencedTypes); + } + } + } + collectReferencedTypes(__Schema, allReferencedTypes); + + // Storing the resulting map for reference by the schema. + this._typeMap = Object.create(null); + this._subTypeMap = Object.create(null); + // Keep track of all implementations by interface name. + this._implementationsMap = Object.create(null); + + for (const namedType of allReferencedTypes) { + if (namedType == null) { + continue; + } + + const typeName = namedType.name; + devAssert( + typeName, + 'One of the provided types for building the Schema is missing a name.', + ); + if (this._typeMap[typeName] !== undefined) { + throw new Error( + `Schema must contain uniquely named types but contains multiple types named "${typeName}".`, + ); + } + this._typeMap[typeName] = namedType; + + if (isInterfaceType(namedType)) { + // Store implementations by interface. + for (const iface of namedType.getInterfaces()) { + if (isInterfaceType(iface)) { + let implementations = this._implementationsMap[iface.name]; + if (implementations === undefined) { + implementations = this._implementationsMap[iface.name] = { + objects: [], + interfaces: [], + }; + } + + implementations.interfaces.push(namedType); + } + } + } else if (isObjectType(namedType)) { + // Store implementations by objects. + for (const iface of namedType.getInterfaces()) { + if (isInterfaceType(iface)) { + let implementations = this._implementationsMap[iface.name]; + if (implementations === undefined) { + implementations = this._implementationsMap[iface.name] = { + objects: [], + interfaces: [], + }; + } + + implementations.objects.push(namedType); + } + } + } + } + } + + get [Symbol.toStringTag]() { + return 'GraphQLSchema'; + } + + getQueryType(): Maybe { + return this._queryType; + } + + getMutationType(): Maybe { + return this._mutationType; + } + + getSubscriptionType(): Maybe { + return this._subscriptionType; + } + + getRootType(operation: OperationTypeNode): Maybe { + switch (operation) { + case OperationTypeNode.QUERY: + return this.getQueryType(); + case OperationTypeNode.MUTATION: + return this.getMutationType(); + case OperationTypeNode.SUBSCRIPTION: + return this.getSubscriptionType(); + } + } + + getTypeMap(): TypeMap { + return this._typeMap; + } + + getType(name: string): GraphQLNamedType | undefined { + return this.getTypeMap()[name]; + } + + getPossibleTypes( + abstractType: GraphQLAbstractType, + ): ReadonlyArray { + return isUnionType(abstractType) + ? abstractType.getTypes() + : this.getImplementations(abstractType).objects; + } + + getImplementations(interfaceType: GraphQLInterfaceType): { + objects: ReadonlyArray; + interfaces: ReadonlyArray; + } { + const implementations = this._implementationsMap[interfaceType.name]; + return implementations ?? { objects: [], interfaces: [] }; + } + + isSubType( + abstractType: GraphQLAbstractType, + maybeSubType: GraphQLObjectType | GraphQLInterfaceType, + ): boolean { + let map = this._subTypeMap[abstractType.name]; + if (map === undefined) { + map = Object.create(null); + + if (isUnionType(abstractType)) { + for (const type of abstractType.getTypes()) { + map[type.name] = true; + } + } else { + const implementations = this.getImplementations(abstractType); + for (const type of implementations.objects) { + map[type.name] = true; + } + for (const type of implementations.interfaces) { + map[type.name] = true; + } + } + + this._subTypeMap[abstractType.name] = map; + } + return map[maybeSubType.name] !== undefined; + } + + getDirectives(): ReadonlyArray { + return this._directives; + } + + getDirective(name: string): Maybe { + return this.getDirectives().find((directive) => directive.name === name); + } + + toConfig(): GraphQLSchemaNormalizedConfig { + return { + description: this.description, + query: this.getQueryType(), + mutation: this.getMutationType(), + subscription: this.getSubscriptionType(), + types: Object.values(this.getTypeMap()), + directives: this.getDirectives(), + extensions: this.extensions, + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes, + assumeValid: this.__validationErrors !== undefined, + }; + } +} + +type TypeMap = ObjMap; + +export interface GraphQLSchemaValidationOptions { + /** + * When building a schema from a GraphQL service's introspection result, it + * might be safe to assume the schema is valid. Set to true to assume the + * produced schema is valid. + * + * Default: false + */ + assumeValid?: boolean; +} + +export interface GraphQLSchemaConfig extends GraphQLSchemaValidationOptions { + description?: Maybe; + query?: Maybe; + mutation?: Maybe; + subscription?: Maybe; + types?: Maybe>; + directives?: Maybe>; + extensions?: Maybe>; + astNode?: Maybe; + extensionASTNodes?: Maybe>; +} + +/** + * @internal + */ +export interface GraphQLSchemaNormalizedConfig extends GraphQLSchemaConfig { + description: Maybe; + types: ReadonlyArray; + directives: ReadonlyArray; + extensions: Readonly; + extensionASTNodes: ReadonlyArray; + assumeValid: boolean; +} + +function collectReferencedTypes( + type: GraphQLType, + typeSet: Set, +): Set { + const namedType = getNamedType(type); + + if (!typeSet.has(namedType)) { + typeSet.add(namedType); + if (isUnionType(namedType)) { + for (const memberType of namedType.getTypes()) { + collectReferencedTypes(memberType, typeSet); + } + } else if (isObjectType(namedType) || isInterfaceType(namedType)) { + for (const interfaceType of namedType.getInterfaces()) { + collectReferencedTypes(interfaceType, typeSet); + } + + for (const field of Object.values(namedType.getFields())) { + collectReferencedTypes(field.type, typeSet); + for (const arg of field.args) { + collectReferencedTypes(arg.type, typeSet); + } + } + } else if (isInputObjectType(namedType)) { + for (const field of Object.values(namedType.getFields())) { + collectReferencedTypes(field.type, typeSet); + } + } + } + + return typeSet; +} diff --git a/src/type/validate.ts b/src/type/validate.ts new file mode 100644 index 00000000..92f70787 --- /dev/null +++ b/src/type/validate.ts @@ -0,0 +1,627 @@ +import { inspect } from '../jsutils/inspect'; +import type { Maybe } from '../jsutils/Maybe'; + +import { GraphQLError } from '../error/GraphQLError'; + +import type { + ASTNode, + DirectiveNode, + InterfaceTypeDefinitionNode, + InterfaceTypeExtensionNode, + NamedTypeNode, + ObjectTypeDefinitionNode, + ObjectTypeExtensionNode, + UnionTypeDefinitionNode, + UnionTypeExtensionNode, +} from '../language/ast'; +import { OperationTypeNode } from '../language/ast'; + +import { isEqualType, isTypeSubTypeOf } from '../utilities/typeComparators'; + +import type { + GraphQLEnumType, + GraphQLInputField, + GraphQLInputObjectType, + GraphQLInterfaceType, + GraphQLObjectType, + GraphQLUnionType, +} from './definition'; +import { + isEnumType, + isInputObjectType, + isInputType, + isInterfaceType, + isNamedType, + isNonNullType, + isObjectType, + isOutputType, + isRequiredArgument, + isRequiredInputField, + isUnionType, +} from './definition'; +import { GraphQLDeprecatedDirective, isDirective } from './directives'; +import { isIntrospectionType } from './introspection'; +import type { GraphQLSchema } from './schema'; +import { assertSchema } from './schema'; + +/** + * Implements the "Type Validation" sub-sections of the specification's + * "Type System" section. + * + * Validation runs synchronously, returning an array of encountered errors, or + * an empty array if no errors were encountered and the Schema is valid. + */ +export function validateSchema( + schema: GraphQLSchema, +): ReadonlyArray { + // First check to ensure the provided value is in fact a GraphQLSchema. + assertSchema(schema); + + // If this Schema has already been validated, return the previous results. + if (schema.__validationErrors) { + return schema.__validationErrors; + } + + // Validate the schema, producing a list of errors. + const context = new SchemaValidationContext(schema); + validateRootTypes(context); + validateDirectives(context); + validateTypes(context); + + // Persist the results of validation before returning to ensure validation + // does not run multiple times for this schema. + const errors = context.getErrors(); + schema.__validationErrors = errors; + return errors; +} + +/** + * Utility function which asserts a schema is valid by throwing an error if + * it is invalid. + */ +export function assertValidSchema(schema: GraphQLSchema): void { + const errors = validateSchema(schema); + if (errors.length !== 0) { + throw new Error(errors.map((error) => error.message).join('\n\n')); + } +} + +class SchemaValidationContext { + readonly _errors: Array; + readonly schema: GraphQLSchema; + + constructor(schema: GraphQLSchema) { + this._errors = []; + this.schema = schema; + } + + reportError( + message: string, + nodes?: ReadonlyArray> | Maybe, + ): void { + const _nodes = Array.isArray(nodes) + ? (nodes.filter(Boolean) as ReadonlyArray) + : (nodes as Maybe); + this._errors.push(new GraphQLError(message, _nodes)); + } + + getErrors(): ReadonlyArray { + return this._errors; + } +} + +function validateRootTypes(context: SchemaValidationContext): void { + const schema = context.schema; + const queryType = schema.getQueryType(); + if (!queryType) { + context.reportError('Query root type must be provided.', schema.astNode); + } else if (!isObjectType(queryType)) { + context.reportError( + `Query root type must be Object type, it cannot be ${inspect( + queryType, + )}.`, + getOperationTypeNode(schema, OperationTypeNode.QUERY) ?? + (queryType as any).astNode, + ); + } + + const mutationType = schema.getMutationType(); + if (mutationType && !isObjectType(mutationType)) { + context.reportError( + 'Mutation root type must be Object type if provided, it cannot be ' + + `${inspect(mutationType)}.`, + getOperationTypeNode(schema, OperationTypeNode.MUTATION) ?? + (mutationType as any).astNode, + ); + } + + const subscriptionType = schema.getSubscriptionType(); + if (subscriptionType && !isObjectType(subscriptionType)) { + context.reportError( + 'Subscription root type must be Object type if provided, it cannot be ' + + `${inspect(subscriptionType)}.`, + getOperationTypeNode(schema, OperationTypeNode.SUBSCRIPTION) ?? + (subscriptionType as any).astNode, + ); + } +} + +function getOperationTypeNode( + schema: GraphQLSchema, + operation: OperationTypeNode, +): Maybe { + return [schema.astNode, ...schema.extensionASTNodes] + .flatMap( + // FIXME: https://github.com/graphql/graphql-js/issues/2203 + (schemaNode) => /* c8 ignore next */ schemaNode?.operationTypes ?? [], + ) + .find((operationNode) => operationNode.operation === operation)?.type; +} + +function validateDirectives(context: SchemaValidationContext): void { + for (const directive of context.schema.getDirectives()) { + // Ensure all directives are in fact GraphQL directives. + if (!isDirective(directive)) { + context.reportError( + `Expected directive but got: ${inspect(directive)}.`, + (directive as any)?.astNode, + ); + continue; + } + + // Ensure they are named correctly. + validateName(context, directive); + + // TODO: Ensure proper locations. + + // Ensure the arguments are valid. + for (const arg of directive.args) { + // Ensure they are named correctly. + validateName(context, arg); + + // Ensure the type is an input type. + if (!isInputType(arg.type)) { + context.reportError( + `The type of @${directive.name}(${arg.name}:) must be Input Type ` + + `but got: ${inspect(arg.type)}.`, + arg.astNode, + ); + } + + if (isRequiredArgument(arg) && arg.deprecationReason != null) { + context.reportError( + `Required argument @${directive.name}(${arg.name}:) cannot be deprecated.`, + [getDeprecatedDirectiveNode(arg.astNode), arg.astNode?.type], + ); + } + } + } +} + +function validateName( + context: SchemaValidationContext, + node: { readonly name: string; readonly astNode: Maybe }, +): void { + // Ensure names are valid, however introspection types opt out. + if (node.name.startsWith('__')) { + context.reportError( + `Name "${node.name}" must not begin with "__", which is reserved by GraphQL introspection.`, + node.astNode, + ); + } +} + +function validateTypes(context: SchemaValidationContext): void { + const validateInputObjectCircularRefs = + createInputObjectCircularRefsValidator(context); + const typeMap = context.schema.getTypeMap(); + for (const type of Object.values(typeMap)) { + // Ensure all provided types are in fact GraphQL type. + if (!isNamedType(type)) { + context.reportError( + `Expected GraphQL named type but got: ${inspect(type)}.`, + (type as any).astNode, + ); + continue; + } + + // Ensure it is named correctly (excluding introspection types). + if (!isIntrospectionType(type)) { + validateName(context, type); + } + + if (isObjectType(type)) { + // Ensure fields are valid + validateFields(context, type); + + // Ensure objects implement the interfaces they claim to. + validateInterfaces(context, type); + } else if (isInterfaceType(type)) { + // Ensure fields are valid. + validateFields(context, type); + + // Ensure interfaces implement the interfaces they claim to. + validateInterfaces(context, type); + } else if (isUnionType(type)) { + // Ensure Unions include valid member types. + validateUnionMembers(context, type); + } else if (isEnumType(type)) { + // Ensure Enums have valid values. + validateEnumValues(context, type); + } else if (isInputObjectType(type)) { + // Ensure Input Object fields are valid. + validateInputFields(context, type); + + // Ensure Input Objects do not contain non-nullable circular references + validateInputObjectCircularRefs(type); + } + } +} + +function validateFields( + context: SchemaValidationContext, + type: GraphQLObjectType | GraphQLInterfaceType, +): void { + const fields = Object.values(type.getFields()); + + // Objects and Interfaces both must define one or more fields. + if (fields.length === 0) { + context.reportError(`Type ${type.name} must define one or more fields.`, [ + type.astNode, + ...type.extensionASTNodes, + ]); + } + + for (const field of fields) { + // Ensure they are named correctly. + validateName(context, field); + + // Ensure the type is an output type + if (!isOutputType(field.type)) { + context.reportError( + `The type of ${type.name}.${field.name} must be Output Type ` + + `but got: ${inspect(field.type)}.`, + field.astNode?.type, + ); + } + + // Ensure the arguments are valid + for (const arg of field.args) { + const argName = arg.name; + + // Ensure they are named correctly. + validateName(context, arg); + + // Ensure the type is an input type + if (!isInputType(arg.type)) { + context.reportError( + `The type of ${type.name}.${field.name}(${argName}:) must be Input ` + + `Type but got: ${inspect(arg.type)}.`, + arg.astNode?.type, + ); + } + + if (isRequiredArgument(arg) && arg.deprecationReason != null) { + context.reportError( + `Required argument ${type.name}.${field.name}(${argName}:) cannot be deprecated.`, + [getDeprecatedDirectiveNode(arg.astNode), arg.astNode?.type], + ); + } + } + } +} + +function validateInterfaces( + context: SchemaValidationContext, + type: GraphQLObjectType | GraphQLInterfaceType, +): void { + const ifaceTypeNames = Object.create(null); + for (const iface of type.getInterfaces()) { + if (!isInterfaceType(iface)) { + context.reportError( + `Type ${inspect(type)} must only implement Interface types, ` + + `it cannot implement ${inspect(iface)}.`, + getAllImplementsInterfaceNodes(type, iface), + ); + continue; + } + + if (type === iface) { + context.reportError( + `Type ${type.name} cannot implement itself because it would create a circular reference.`, + getAllImplementsInterfaceNodes(type, iface), + ); + continue; + } + + if (ifaceTypeNames[iface.name]) { + context.reportError( + `Type ${type.name} can only implement ${iface.name} once.`, + getAllImplementsInterfaceNodes(type, iface), + ); + continue; + } + + ifaceTypeNames[iface.name] = true; + + validateTypeImplementsAncestors(context, type, iface); + validateTypeImplementsInterface(context, type, iface); + } +} + +function validateTypeImplementsInterface( + context: SchemaValidationContext, + type: GraphQLObjectType | GraphQLInterfaceType, + iface: GraphQLInterfaceType, +): void { + const typeFieldMap = type.getFields(); + + // Assert each interface field is implemented. + for (const ifaceField of Object.values(iface.getFields())) { + const fieldName = ifaceField.name; + const typeField = typeFieldMap[fieldName]; + + // Assert interface field exists on type. + if (!typeField) { + context.reportError( + `Interface field ${iface.name}.${fieldName} expected but ${type.name} does not provide it.`, + [ifaceField.astNode, type.astNode, ...type.extensionASTNodes], + ); + continue; + } + + // Assert interface field type is satisfied by type field type, by being + // a valid subtype. (covariant) + if (!isTypeSubTypeOf(context.schema, typeField.type, ifaceField.type)) { + context.reportError( + `Interface field ${iface.name}.${fieldName} expects type ` + + `${inspect(ifaceField.type)} but ${type.name}.${fieldName} ` + + `is type ${inspect(typeField.type)}.`, + [ifaceField.astNode?.type, typeField.astNode?.type], + ); + } + + // Assert each interface field arg is implemented. + for (const ifaceArg of ifaceField.args) { + const argName = ifaceArg.name; + const typeArg = typeField.args.find((arg) => arg.name === argName); + + // Assert interface field arg exists on object field. + if (!typeArg) { + context.reportError( + `Interface field argument ${iface.name}.${fieldName}(${argName}:) expected but ${type.name}.${fieldName} does not provide it.`, + [ifaceArg.astNode, typeField.astNode], + ); + continue; + } + + // Assert interface field arg type matches object field arg type. + // (invariant) + // TODO: change to contravariant? + if (!isEqualType(ifaceArg.type, typeArg.type)) { + context.reportError( + `Interface field argument ${iface.name}.${fieldName}(${argName}:) ` + + `expects type ${inspect(ifaceArg.type)} but ` + + `${type.name}.${fieldName}(${argName}:) is type ` + + `${inspect(typeArg.type)}.`, + [ifaceArg.astNode?.type, typeArg.astNode?.type], + ); + } + + // TODO: validate default values? + } + + // Assert additional arguments must not be required. + for (const typeArg of typeField.args) { + const argName = typeArg.name; + const ifaceArg = ifaceField.args.find((arg) => arg.name === argName); + if (!ifaceArg && isRequiredArgument(typeArg)) { + context.reportError( + `Object field ${type.name}.${fieldName} includes required argument ${argName} that is missing from the Interface field ${iface.name}.${fieldName}.`, + [typeArg.astNode, ifaceField.astNode], + ); + } + } + } +} + +function validateTypeImplementsAncestors( + context: SchemaValidationContext, + type: GraphQLObjectType | GraphQLInterfaceType, + iface: GraphQLInterfaceType, +): void { + const ifaceInterfaces = type.getInterfaces(); + for (const transitive of iface.getInterfaces()) { + if (!ifaceInterfaces.includes(transitive)) { + context.reportError( + transitive === type + ? `Type ${type.name} cannot implement ${iface.name} because it would create a circular reference.` + : `Type ${type.name} must implement ${transitive.name} because it is implemented by ${iface.name}.`, + [ + ...getAllImplementsInterfaceNodes(iface, transitive), + ...getAllImplementsInterfaceNodes(type, iface), + ], + ); + } + } +} + +function validateUnionMembers( + context: SchemaValidationContext, + union: GraphQLUnionType, +): void { + const memberTypes = union.getTypes(); + + if (memberTypes.length === 0) { + context.reportError( + `Union type ${union.name} must define one or more member types.`, + [union.astNode, ...union.extensionASTNodes], + ); + } + + const includedTypeNames = Object.create(null); + for (const memberType of memberTypes) { + if (includedTypeNames[memberType.name]) { + context.reportError( + `Union type ${union.name} can only include type ${memberType.name} once.`, + getUnionMemberTypeNodes(union, memberType.name), + ); + continue; + } + includedTypeNames[memberType.name] = true; + if (!isObjectType(memberType)) { + context.reportError( + `Union type ${union.name} can only include Object types, ` + + `it cannot include ${inspect(memberType)}.`, + getUnionMemberTypeNodes(union, String(memberType)), + ); + } + } +} + +function validateEnumValues( + context: SchemaValidationContext, + enumType: GraphQLEnumType, +): void { + const enumValues = enumType.getValues(); + + if (enumValues.length === 0) { + context.reportError( + `Enum type ${enumType.name} must define one or more values.`, + [enumType.astNode, ...enumType.extensionASTNodes], + ); + } + + for (const enumValue of enumValues) { + // Ensure valid name. + validateName(context, enumValue); + } +} + +function validateInputFields( + context: SchemaValidationContext, + inputObj: GraphQLInputObjectType, +): void { + const fields = Object.values(inputObj.getFields()); + + if (fields.length === 0) { + context.reportError( + `Input Object type ${inputObj.name} must define one or more fields.`, + [inputObj.astNode, ...inputObj.extensionASTNodes], + ); + } + + // Ensure the arguments are valid + for (const field of fields) { + // Ensure they are named correctly. + validateName(context, field); + + // Ensure the type is an input type + if (!isInputType(field.type)) { + context.reportError( + `The type of ${inputObj.name}.${field.name} must be Input Type ` + + `but got: ${inspect(field.type)}.`, + field.astNode?.type, + ); + } + + if (isRequiredInputField(field) && field.deprecationReason != null) { + context.reportError( + `Required input field ${inputObj.name}.${field.name} cannot be deprecated.`, + [getDeprecatedDirectiveNode(field.astNode), field.astNode?.type], + ); + } + } +} + +function createInputObjectCircularRefsValidator( + context: SchemaValidationContext, +): (inputObj: GraphQLInputObjectType) => void { + // Modified copy of algorithm from 'src/validation/rules/NoFragmentCycles.js'. + // Tracks already visited types to maintain O(N) and to ensure that cycles + // are not redundantly reported. + const visitedTypes = Object.create(null); + + // Array of types nodes used to produce meaningful errors + const fieldPath: Array = []; + + // Position in the type path + const fieldPathIndexByTypeName = Object.create(null); + + return detectCycleRecursive; + + // This does a straight-forward DFS to find cycles. + // It does not terminate when a cycle was found but continues to explore + // the graph to find all possible cycles. + function detectCycleRecursive(inputObj: GraphQLInputObjectType): void { + if (visitedTypes[inputObj.name]) { + return; + } + + visitedTypes[inputObj.name] = true; + fieldPathIndexByTypeName[inputObj.name] = fieldPath.length; + + const fields = Object.values(inputObj.getFields()); + for (const field of fields) { + if (isNonNullType(field.type) && isInputObjectType(field.type.ofType)) { + const fieldType = field.type.ofType; + const cycleIndex = fieldPathIndexByTypeName[fieldType.name]; + + fieldPath.push(field); + if (cycleIndex === undefined) { + detectCycleRecursive(fieldType); + } else { + const cyclePath = fieldPath.slice(cycleIndex); + const pathStr = cyclePath.map((fieldObj) => fieldObj.name).join('.'); + context.reportError( + `Cannot reference Input Object "${fieldType.name}" within itself through a series of non-null fields: "${pathStr}".`, + cyclePath.map((fieldObj) => fieldObj.astNode), + ); + } + fieldPath.pop(); + } + } + + fieldPathIndexByTypeName[inputObj.name] = undefined; + } +} + +function getAllImplementsInterfaceNodes( + type: GraphQLObjectType | GraphQLInterfaceType, + iface: GraphQLInterfaceType, +): ReadonlyArray { + const { astNode, extensionASTNodes } = type; + const nodes: ReadonlyArray< + | ObjectTypeDefinitionNode + | ObjectTypeExtensionNode + | InterfaceTypeDefinitionNode + | InterfaceTypeExtensionNode + > = astNode != null ? [astNode, ...extensionASTNodes] : extensionASTNodes; + + // FIXME: https://github.com/graphql/graphql-js/issues/2203 + return nodes + .flatMap((typeNode) => /* c8 ignore next */ typeNode.interfaces ?? []) + .filter((ifaceNode) => ifaceNode.name.value === iface.name); +} + +function getUnionMemberTypeNodes( + union: GraphQLUnionType, + typeName: string, +): Maybe> { + const { astNode, extensionASTNodes } = union; + const nodes: ReadonlyArray = + astNode != null ? [astNode, ...extensionASTNodes] : extensionASTNodes; + + // FIXME: https://github.com/graphql/graphql-js/issues/2203 + return nodes + .flatMap((unionNode) => /* c8 ignore next */ unionNode.types ?? []) + .filter((typeNode) => typeNode.name.value === typeName); +} + +function getDeprecatedDirectiveNode( + definitionNode: Maybe<{ readonly directives?: ReadonlyArray }>, +): Maybe { + return definitionNode?.directives?.find( + (node) => node.name.value === GraphQLDeprecatedDirective.name, + ); +} diff --git a/src/utilities/README.md b/src/utilities/README.md new file mode 100644 index 00000000..0e626e23 --- /dev/null +++ b/src/utilities/README.md @@ -0,0 +1,9 @@ +## GraphQL Utilities + +The `graphql/utilities` module contains common useful computations to use with +the GraphQL language and type objects. + +```js +import { ... } from 'graphql/utilities'; // ES6 +var GraphQLUtilities = require('graphql/utilities'); // CommonJS +``` diff --git a/src/utilities/TypeInfo.ts b/src/utilities/TypeInfo.ts new file mode 100644 index 00000000..e72dfb01 --- /dev/null +++ b/src/utilities/TypeInfo.ts @@ -0,0 +1,363 @@ +import type { Maybe } from '../jsutils/Maybe'; + +import type { ASTNode, FieldNode } from '../language/ast'; +import { isNode } from '../language/ast'; +import { Kind } from '../language/kinds'; +import type { ASTVisitor } from '../language/visitor'; +import { getEnterLeaveForKind } from '../language/visitor'; + +import type { + GraphQLArgument, + GraphQLCompositeType, + GraphQLEnumValue, + GraphQLField, + GraphQLInputField, + GraphQLInputType, + GraphQLOutputType, + GraphQLType, +} from '../type/definition'; +import { + getNamedType, + getNullableType, + isCompositeType, + isEnumType, + isInputObjectType, + isInputType, + isInterfaceType, + isListType, + isObjectType, + isOutputType, +} from '../type/definition'; +import type { GraphQLDirective } from '../type/directives'; +import { + SchemaMetaFieldDef, + TypeMetaFieldDef, + TypeNameMetaFieldDef, +} from '../type/introspection'; +import type { GraphQLSchema } from '../type/schema'; + +import { typeFromAST } from './typeFromAST'; + +/** + * TypeInfo is a utility class which, given a GraphQL schema, can keep track + * of the current field and type definitions at any point in a GraphQL document + * AST during a recursive descent by calling `enter(node)` and `leave(node)`. + */ +export class TypeInfo { + private _schema: GraphQLSchema; + private _typeStack: Array>; + private _parentTypeStack: Array>; + private _inputTypeStack: Array>; + private _fieldDefStack: Array>>; + private _defaultValueStack: Array>; + private _directive: Maybe; + private _argument: Maybe; + private _enumValue: Maybe; + private _getFieldDef: GetFieldDefFn; + + constructor( + schema: GraphQLSchema, + /** + * Initial type may be provided in rare cases to facilitate traversals + * beginning somewhere other than documents. + */ + initialType?: Maybe, + + /** @deprecated will be removed in 17.0.0 */ + getFieldDefFn?: GetFieldDefFn, + ) { + this._schema = schema; + this._typeStack = []; + this._parentTypeStack = []; + this._inputTypeStack = []; + this._fieldDefStack = []; + this._defaultValueStack = []; + this._directive = null; + this._argument = null; + this._enumValue = null; + this._getFieldDef = getFieldDefFn ?? getFieldDef; + if (initialType) { + if (isInputType(initialType)) { + this._inputTypeStack.push(initialType); + } + if (isCompositeType(initialType)) { + this._parentTypeStack.push(initialType); + } + if (isOutputType(initialType)) { + this._typeStack.push(initialType); + } + } + } + + get [Symbol.toStringTag]() { + return 'TypeInfo'; + } + + getType(): Maybe { + if (this._typeStack.length > 0) { + return this._typeStack[this._typeStack.length - 1]; + } + } + + getParentType(): Maybe { + if (this._parentTypeStack.length > 0) { + return this._parentTypeStack[this._parentTypeStack.length - 1]; + } + } + + getInputType(): Maybe { + if (this._inputTypeStack.length > 0) { + return this._inputTypeStack[this._inputTypeStack.length - 1]; + } + } + + getParentInputType(): Maybe { + if (this._inputTypeStack.length > 1) { + return this._inputTypeStack[this._inputTypeStack.length - 2]; + } + } + + getFieldDef(): Maybe> { + if (this._fieldDefStack.length > 0) { + return this._fieldDefStack[this._fieldDefStack.length - 1]; + } + } + + getDefaultValue(): Maybe { + if (this._defaultValueStack.length > 0) { + return this._defaultValueStack[this._defaultValueStack.length - 1]; + } + } + + getDirective(): Maybe { + return this._directive; + } + + getArgument(): Maybe { + return this._argument; + } + + getEnumValue(): Maybe { + return this._enumValue; + } + + enter(node: ASTNode) { + const schema = this._schema; + // Note: many of the types below are explicitly typed as "unknown" to drop + // any assumptions of a valid schema to ensure runtime types are properly + // checked before continuing since TypeInfo is used as part of validation + // which occurs before guarantees of schema and document validity. + switch (node.kind) { + case Kind.SELECTION_SET: { + const namedType: unknown = getNamedType(this.getType()); + this._parentTypeStack.push( + isCompositeType(namedType) ? namedType : undefined, + ); + break; + } + case Kind.FIELD: { + const parentType = this.getParentType(); + let fieldDef; + let fieldType: unknown; + if (parentType) { + fieldDef = this._getFieldDef(schema, parentType, node); + if (fieldDef) { + fieldType = fieldDef.type; + } + } + this._fieldDefStack.push(fieldDef); + this._typeStack.push(isOutputType(fieldType) ? fieldType : undefined); + break; + } + case Kind.DIRECTIVE: + this._directive = schema.getDirective(node.name.value); + break; + case Kind.OPERATION_DEFINITION: { + const rootType = schema.getRootType(node.operation); + this._typeStack.push(isObjectType(rootType) ? rootType : undefined); + break; + } + case Kind.INLINE_FRAGMENT: + case Kind.FRAGMENT_DEFINITION: { + const typeConditionAST = node.typeCondition; + const outputType: unknown = typeConditionAST + ? typeFromAST(schema, typeConditionAST) + : getNamedType(this.getType()); + this._typeStack.push(isOutputType(outputType) ? outputType : undefined); + break; + } + case Kind.VARIABLE_DEFINITION: { + const inputType: unknown = typeFromAST(schema, node.type); + this._inputTypeStack.push( + isInputType(inputType) ? inputType : undefined, + ); + break; + } + case Kind.ARGUMENT: { + let argDef; + let argType: unknown; + const fieldOrDirective = this.getDirective() ?? this.getFieldDef(); + if (fieldOrDirective) { + argDef = fieldOrDirective.args.find( + (arg) => arg.name === node.name.value, + ); + if (argDef) { + argType = argDef.type; + } + } + this._argument = argDef; + this._defaultValueStack.push(argDef ? argDef.defaultValue : undefined); + this._inputTypeStack.push(isInputType(argType) ? argType : undefined); + break; + } + case Kind.LIST: { + const listType: unknown = getNullableType(this.getInputType()); + const itemType: unknown = isListType(listType) + ? listType.ofType + : listType; + // List positions never have a default value. + this._defaultValueStack.push(undefined); + this._inputTypeStack.push(isInputType(itemType) ? itemType : undefined); + break; + } + case Kind.OBJECT_FIELD: { + const objectType: unknown = getNamedType(this.getInputType()); + let inputFieldType: GraphQLInputType | undefined; + let inputField: GraphQLInputField | undefined; + if (isInputObjectType(objectType)) { + inputField = objectType.getFields()[node.name.value]; + if (inputField) { + inputFieldType = inputField.type; + } + } + this._defaultValueStack.push( + inputField ? inputField.defaultValue : undefined, + ); + this._inputTypeStack.push( + isInputType(inputFieldType) ? inputFieldType : undefined, + ); + break; + } + case Kind.ENUM: { + const enumType: unknown = getNamedType(this.getInputType()); + let enumValue; + if (isEnumType(enumType)) { + enumValue = enumType.getValue(node.value); + } + this._enumValue = enumValue; + break; + } + default: + // Ignore other nodes + } + } + + leave(node: ASTNode) { + switch (node.kind) { + case Kind.SELECTION_SET: + this._parentTypeStack.pop(); + break; + case Kind.FIELD: + this._fieldDefStack.pop(); + this._typeStack.pop(); + break; + case Kind.DIRECTIVE: + this._directive = null; + break; + case Kind.OPERATION_DEFINITION: + case Kind.INLINE_FRAGMENT: + case Kind.FRAGMENT_DEFINITION: + this._typeStack.pop(); + break; + case Kind.VARIABLE_DEFINITION: + this._inputTypeStack.pop(); + break; + case Kind.ARGUMENT: + this._argument = null; + this._defaultValueStack.pop(); + this._inputTypeStack.pop(); + break; + case Kind.LIST: + case Kind.OBJECT_FIELD: + this._defaultValueStack.pop(); + this._inputTypeStack.pop(); + break; + case Kind.ENUM: + this._enumValue = null; + break; + default: + // Ignore other nodes + } + } +} + +type GetFieldDefFn = ( + schema: GraphQLSchema, + parentType: GraphQLType, + fieldNode: FieldNode, +) => Maybe>; + +/** + * Not exactly the same as the executor's definition of getFieldDef, in this + * statically evaluated environment we do not always have an Object type, + * and need to handle Interface and Union types. + */ +function getFieldDef( + schema: GraphQLSchema, + parentType: GraphQLType, + fieldNode: FieldNode, +): Maybe> { + const name = fieldNode.name.value; + if ( + name === SchemaMetaFieldDef.name && + schema.getQueryType() === parentType + ) { + return SchemaMetaFieldDef; + } + if (name === TypeMetaFieldDef.name && schema.getQueryType() === parentType) { + return TypeMetaFieldDef; + } + if (name === TypeNameMetaFieldDef.name && isCompositeType(parentType)) { + return TypeNameMetaFieldDef; + } + if (isObjectType(parentType) || isInterfaceType(parentType)) { + return parentType.getFields()[name]; + } +} + +/** + * Creates a new visitor instance which maintains a provided TypeInfo instance + * along with visiting visitor. + */ +export function visitWithTypeInfo( + typeInfo: TypeInfo, + visitor: ASTVisitor, +): ASTVisitor { + return { + enter(...args) { + const node = args[0]; + typeInfo.enter(node); + const fn = getEnterLeaveForKind(visitor, node.kind).enter; + if (fn) { + const result = fn.apply(visitor, args); + if (result !== undefined) { + typeInfo.leave(node); + if (isNode(result)) { + typeInfo.enter(result); + } + } + return result; + } + }, + leave(...args) { + const node = args[0]; + const fn = getEnterLeaveForKind(visitor, node.kind).leave; + let result; + if (fn) { + result = fn.apply(visitor, args); + } + typeInfo.leave(node); + return result; + }, + }; +} diff --git a/src/utilities/__tests__/TypeInfo-test.ts b/src/utilities/__tests__/TypeInfo-test.ts new file mode 100644 index 00000000..5c04458c --- /dev/null +++ b/src/utilities/__tests__/TypeInfo-test.ts @@ -0,0 +1,460 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { invariant } from '../../jsutils/invariant'; + +import { parse, parseValue } from '../../language/parser'; +import { print } from '../../language/printer'; +import { visit } from '../../language/visitor'; + +import { getNamedType, isCompositeType } from '../../type/definition'; +import { GraphQLSchema } from '../../type/schema'; + +import { buildSchema } from '../buildASTSchema'; +import { TypeInfo, visitWithTypeInfo } from '../TypeInfo'; + +const testSchema = buildSchema(` + interface Pet { + name: String + } + + type Dog implements Pet { + name: String + } + + type Cat implements Pet { + name: String + } + + type Human { + name: String + pets: [Pet] + } + + type Alien { + name(surname: Boolean): String + } + + type QueryRoot { + human(id: ID): Human + alien: Alien + } + + schema { + query: QueryRoot + } +`); + +describe('TypeInfo', () => { + const schema = new GraphQLSchema({}); + + it('can be Object.toStringified', () => { + const typeInfo = new TypeInfo(schema); + + expect(Object.prototype.toString.call(typeInfo)).to.equal( + '[object TypeInfo]', + ); + }); + + it('allow all methods to be called before entering any node', () => { + const typeInfo = new TypeInfo(schema); + + expect(typeInfo.getType()).to.equal(undefined); + expect(typeInfo.getParentType()).to.equal(undefined); + expect(typeInfo.getInputType()).to.equal(undefined); + expect(typeInfo.getParentInputType()).to.equal(undefined); + expect(typeInfo.getFieldDef()).to.equal(undefined); + expect(typeInfo.getDefaultValue()).to.equal(undefined); + expect(typeInfo.getDirective()).to.equal(null); + expect(typeInfo.getArgument()).to.equal(null); + expect(typeInfo.getEnumValue()).to.equal(null); + }); +}); + +describe('visitWithTypeInfo', () => { + it('supports different operation types', () => { + const schema = buildSchema(` + schema { + query: QueryRoot + mutation: MutationRoot + subscription: SubscriptionRoot + } + + type QueryRoot { + foo: String + } + + type MutationRoot { + bar: String + } + + type SubscriptionRoot { + baz: String + } + `); + const ast = parse(` + query { foo } + mutation { bar } + subscription { baz } + `); + const typeInfo = new TypeInfo(schema); + + const rootTypes: any = {}; + visit( + ast, + visitWithTypeInfo(typeInfo, { + OperationDefinition(node) { + rootTypes[node.operation] = String(typeInfo.getType()); + }, + }), + ); + + expect(rootTypes).to.deep.equal({ + query: 'QueryRoot', + mutation: 'MutationRoot', + subscription: 'SubscriptionRoot', + }); + }); + + it('provide exact same arguments to wrapped visitor', () => { + const ast = parse( + '{ human(id: 4) { name, pets { ... { name } }, unknown } }', + ); + + const visitorArgs: Array = []; + visit(ast, { + enter(...args) { + visitorArgs.push(['enter', ...args]); + }, + leave(...args) { + visitorArgs.push(['leave', ...args]); + }, + }); + + const wrappedVisitorArgs: Array = []; + const typeInfo = new TypeInfo(testSchema); + visit( + ast, + visitWithTypeInfo(typeInfo, { + enter(...args) { + wrappedVisitorArgs.push(['enter', ...args]); + }, + leave(...args) { + wrappedVisitorArgs.push(['leave', ...args]); + }, + }), + ); + + expect(visitorArgs).to.deep.equal(wrappedVisitorArgs); + }); + + it('maintains type info during visit', () => { + const visited: Array = []; + + const typeInfo = new TypeInfo(testSchema); + + const ast = parse( + '{ human(id: 4) { name, pets { ... { name } }, unknown } }', + ); + + visit( + ast, + visitWithTypeInfo(typeInfo, { + enter(node) { + const parentType = typeInfo.getParentType(); + const type = typeInfo.getType(); + const inputType = typeInfo.getInputType(); + visited.push([ + 'enter', + node.kind, + node.kind === 'Name' ? node.value : null, + parentType ? String(parentType) : null, + type ? String(type) : null, + inputType ? String(inputType) : null, + ]); + }, + leave(node) { + const parentType = typeInfo.getParentType(); + const type = typeInfo.getType(); + const inputType = typeInfo.getInputType(); + visited.push([ + 'leave', + node.kind, + node.kind === 'Name' ? node.value : null, + parentType ? String(parentType) : null, + type ? String(type) : null, + inputType ? String(inputType) : null, + ]); + }, + }), + ); + + expect(visited).to.deep.equal([ + ['enter', 'Document', null, null, null, null], + ['enter', 'OperationDefinition', null, null, 'QueryRoot', null], + ['enter', 'SelectionSet', null, 'QueryRoot', 'QueryRoot', null], + ['enter', 'Field', null, 'QueryRoot', 'Human', null], + ['enter', 'Name', 'human', 'QueryRoot', 'Human', null], + ['leave', 'Name', 'human', 'QueryRoot', 'Human', null], + ['enter', 'Argument', null, 'QueryRoot', 'Human', 'ID'], + ['enter', 'Name', 'id', 'QueryRoot', 'Human', 'ID'], + ['leave', 'Name', 'id', 'QueryRoot', 'Human', 'ID'], + ['enter', 'IntValue', null, 'QueryRoot', 'Human', 'ID'], + ['leave', 'IntValue', null, 'QueryRoot', 'Human', 'ID'], + ['leave', 'Argument', null, 'QueryRoot', 'Human', 'ID'], + ['enter', 'SelectionSet', null, 'Human', 'Human', null], + ['enter', 'Field', null, 'Human', 'String', null], + ['enter', 'Name', 'name', 'Human', 'String', null], + ['leave', 'Name', 'name', 'Human', 'String', null], + ['leave', 'Field', null, 'Human', 'String', null], + ['enter', 'Field', null, 'Human', '[Pet]', null], + ['enter', 'Name', 'pets', 'Human', '[Pet]', null], + ['leave', 'Name', 'pets', 'Human', '[Pet]', null], + ['enter', 'SelectionSet', null, 'Pet', '[Pet]', null], + ['enter', 'InlineFragment', null, 'Pet', 'Pet', null], + ['enter', 'SelectionSet', null, 'Pet', 'Pet', null], + ['enter', 'Field', null, 'Pet', 'String', null], + ['enter', 'Name', 'name', 'Pet', 'String', null], + ['leave', 'Name', 'name', 'Pet', 'String', null], + ['leave', 'Field', null, 'Pet', 'String', null], + ['leave', 'SelectionSet', null, 'Pet', 'Pet', null], + ['leave', 'InlineFragment', null, 'Pet', 'Pet', null], + ['leave', 'SelectionSet', null, 'Pet', '[Pet]', null], + ['leave', 'Field', null, 'Human', '[Pet]', null], + ['enter', 'Field', null, 'Human', null, null], + ['enter', 'Name', 'unknown', 'Human', null, null], + ['leave', 'Name', 'unknown', 'Human', null, null], + ['leave', 'Field', null, 'Human', null, null], + ['leave', 'SelectionSet', null, 'Human', 'Human', null], + ['leave', 'Field', null, 'QueryRoot', 'Human', null], + ['leave', 'SelectionSet', null, 'QueryRoot', 'QueryRoot', null], + ['leave', 'OperationDefinition', null, null, 'QueryRoot', null], + ['leave', 'Document', null, null, null, null], + ]); + }); + + it('maintains type info during edit', () => { + const visited: Array = []; + const typeInfo = new TypeInfo(testSchema); + + const ast = parse('{ human(id: 4) { name, pets }, alien }'); + const editedAST = visit( + ast, + visitWithTypeInfo(typeInfo, { + enter(node) { + const parentType = typeInfo.getParentType(); + const type = typeInfo.getType(); + const inputType = typeInfo.getInputType(); + visited.push([ + 'enter', + node.kind, + node.kind === 'Name' ? node.value : null, + parentType ? String(parentType) : null, + type ? String(type) : null, + inputType ? String(inputType) : null, + ]); + + // Make a query valid by adding missing selection sets. + if ( + node.kind === 'Field' && + !node.selectionSet && + isCompositeType(getNamedType(type)) + ) { + return { + ...node, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: '__typename' }, + }, + ], + }, + }; + } + }, + leave(node) { + const parentType = typeInfo.getParentType(); + const type = typeInfo.getType(); + const inputType = typeInfo.getInputType(); + visited.push([ + 'leave', + node.kind, + node.kind === 'Name' ? node.value : null, + parentType ? String(parentType) : null, + type ? String(type) : null, + inputType ? String(inputType) : null, + ]); + }, + }), + ); + + expect(print(ast)).to.deep.equal( + print(parse('{ human(id: 4) { name, pets }, alien }')), + ); + + expect(print(editedAST)).to.deep.equal( + print( + parse( + '{ human(id: 4) { name, pets { __typename } }, alien { __typename } }', + ), + ), + ); + + expect(visited).to.deep.equal([ + ['enter', 'Document', null, null, null, null], + ['enter', 'OperationDefinition', null, null, 'QueryRoot', null], + ['enter', 'SelectionSet', null, 'QueryRoot', 'QueryRoot', null], + ['enter', 'Field', null, 'QueryRoot', 'Human', null], + ['enter', 'Name', 'human', 'QueryRoot', 'Human', null], + ['leave', 'Name', 'human', 'QueryRoot', 'Human', null], + ['enter', 'Argument', null, 'QueryRoot', 'Human', 'ID'], + ['enter', 'Name', 'id', 'QueryRoot', 'Human', 'ID'], + ['leave', 'Name', 'id', 'QueryRoot', 'Human', 'ID'], + ['enter', 'IntValue', null, 'QueryRoot', 'Human', 'ID'], + ['leave', 'IntValue', null, 'QueryRoot', 'Human', 'ID'], + ['leave', 'Argument', null, 'QueryRoot', 'Human', 'ID'], + ['enter', 'SelectionSet', null, 'Human', 'Human', null], + ['enter', 'Field', null, 'Human', 'String', null], + ['enter', 'Name', 'name', 'Human', 'String', null], + ['leave', 'Name', 'name', 'Human', 'String', null], + ['leave', 'Field', null, 'Human', 'String', null], + ['enter', 'Field', null, 'Human', '[Pet]', null], + ['enter', 'Name', 'pets', 'Human', '[Pet]', null], + ['leave', 'Name', 'pets', 'Human', '[Pet]', null], + ['enter', 'SelectionSet', null, 'Pet', '[Pet]', null], + ['enter', 'Field', null, 'Pet', 'String!', null], + ['enter', 'Name', '__typename', 'Pet', 'String!', null], + ['leave', 'Name', '__typename', 'Pet', 'String!', null], + ['leave', 'Field', null, 'Pet', 'String!', null], + ['leave', 'SelectionSet', null, 'Pet', '[Pet]', null], + ['leave', 'Field', null, 'Human', '[Pet]', null], + ['leave', 'SelectionSet', null, 'Human', 'Human', null], + ['leave', 'Field', null, 'QueryRoot', 'Human', null], + ['enter', 'Field', null, 'QueryRoot', 'Alien', null], + ['enter', 'Name', 'alien', 'QueryRoot', 'Alien', null], + ['leave', 'Name', 'alien', 'QueryRoot', 'Alien', null], + ['enter', 'SelectionSet', null, 'Alien', 'Alien', null], + ['enter', 'Field', null, 'Alien', 'String!', null], + ['enter', 'Name', '__typename', 'Alien', 'String!', null], + ['leave', 'Name', '__typename', 'Alien', 'String!', null], + ['leave', 'Field', null, 'Alien', 'String!', null], + ['leave', 'SelectionSet', null, 'Alien', 'Alien', null], + ['leave', 'Field', null, 'QueryRoot', 'Alien', null], + ['leave', 'SelectionSet', null, 'QueryRoot', 'QueryRoot', null], + ['leave', 'OperationDefinition', null, null, 'QueryRoot', null], + ['leave', 'Document', null, null, null, null], + ]); + }); + + it('supports traversals of input values', () => { + const schema = buildSchema(` + input ComplexInput { + stringListField: [String] + } + `); + const ast = parseValue('{ stringListField: ["foo"] }'); + const complexInputType = schema.getType('ComplexInput'); + invariant(complexInputType != null); + + const typeInfo = new TypeInfo(schema, complexInputType); + + const visited: Array = []; + visit( + ast, + visitWithTypeInfo(typeInfo, { + enter(node) { + const type = typeInfo.getInputType(); + visited.push([ + 'enter', + node.kind, + node.kind === 'Name' ? node.value : null, + String(type), + ]); + }, + leave(node) { + const type = typeInfo.getInputType(); + visited.push([ + 'leave', + node.kind, + node.kind === 'Name' ? node.value : null, + String(type), + ]); + }, + }), + ); + + expect(visited).to.deep.equal([ + ['enter', 'ObjectValue', null, 'ComplexInput'], + ['enter', 'ObjectField', null, '[String]'], + ['enter', 'Name', 'stringListField', '[String]'], + ['leave', 'Name', 'stringListField', '[String]'], + ['enter', 'ListValue', null, 'String'], + ['enter', 'StringValue', null, 'String'], + ['leave', 'StringValue', null, 'String'], + ['leave', 'ListValue', null, 'String'], + ['leave', 'ObjectField', null, '[String]'], + ['leave', 'ObjectValue', null, 'ComplexInput'], + ]); + }); + + it('supports traversals of selection sets', () => { + const humanType = testSchema.getType('Human'); + invariant(humanType != null); + + const typeInfo = new TypeInfo(testSchema, humanType); + + const ast = parse('{ name, pets { name } }'); + const operationNode = ast.definitions[0]; + invariant(operationNode.kind === 'OperationDefinition'); + + const visited: Array = []; + visit( + operationNode.selectionSet, + visitWithTypeInfo(typeInfo, { + enter(node) { + const parentType = typeInfo.getParentType(); + const type = typeInfo.getType(); + visited.push([ + 'enter', + node.kind, + node.kind === 'Name' ? node.value : null, + String(parentType), + String(type), + ]); + }, + leave(node) { + const parentType = typeInfo.getParentType(); + const type = typeInfo.getType(); + visited.push([ + 'leave', + node.kind, + node.kind === 'Name' ? node.value : null, + String(parentType), + String(type), + ]); + }, + }), + ); + + expect(visited).to.deep.equal([ + ['enter', 'SelectionSet', null, 'Human', 'Human'], + ['enter', 'Field', null, 'Human', 'String'], + ['enter', 'Name', 'name', 'Human', 'String'], + ['leave', 'Name', 'name', 'Human', 'String'], + ['leave', 'Field', null, 'Human', 'String'], + ['enter', 'Field', null, 'Human', '[Pet]'], + ['enter', 'Name', 'pets', 'Human', '[Pet]'], + ['leave', 'Name', 'pets', 'Human', '[Pet]'], + ['enter', 'SelectionSet', null, 'Pet', '[Pet]'], + ['enter', 'Field', null, 'Pet', 'String'], + ['enter', 'Name', 'name', 'Pet', 'String'], + ['leave', 'Name', 'name', 'Pet', 'String'], + ['leave', 'Field', null, 'Pet', 'String'], + ['leave', 'SelectionSet', null, 'Pet', '[Pet]'], + ['leave', 'Field', null, 'Human', '[Pet]'], + ['leave', 'SelectionSet', null, 'Human', 'Human'], + ]); + }); +}); diff --git a/src/utilities/__tests__/astFromValue-test.ts b/src/utilities/__tests__/astFromValue-test.ts new file mode 100644 index 00000000..b8f2361b --- /dev/null +++ b/src/utilities/__tests__/astFromValue-test.ts @@ -0,0 +1,379 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { + GraphQLEnumType, + GraphQLInputObjectType, + GraphQLList, + GraphQLNonNull, + GraphQLScalarType, +} from '../../type/definition'; +import { + GraphQLBoolean, + GraphQLFloat, + GraphQLID, + GraphQLInt, + GraphQLString, +} from '../../type/scalars'; + +import { astFromValue } from '../astFromValue'; + +describe('astFromValue', () => { + it('converts boolean values to ASTs', () => { + expect(astFromValue(true, GraphQLBoolean)).to.deep.equal({ + kind: 'BooleanValue', + value: true, + }); + + expect(astFromValue(false, GraphQLBoolean)).to.deep.equal({ + kind: 'BooleanValue', + value: false, + }); + + expect(astFromValue(undefined, GraphQLBoolean)).to.deep.equal(null); + + expect(astFromValue(null, GraphQLBoolean)).to.deep.equal({ + kind: 'NullValue', + }); + + expect(astFromValue(0, GraphQLBoolean)).to.deep.equal({ + kind: 'BooleanValue', + value: false, + }); + + expect(astFromValue(1, GraphQLBoolean)).to.deep.equal({ + kind: 'BooleanValue', + value: true, + }); + + const NonNullBoolean = new GraphQLNonNull(GraphQLBoolean); + expect(astFromValue(0, NonNullBoolean)).to.deep.equal({ + kind: 'BooleanValue', + value: false, + }); + }); + + it('converts Int values to Int ASTs', () => { + expect(astFromValue(-1, GraphQLInt)).to.deep.equal({ + kind: 'IntValue', + value: '-1', + }); + + expect(astFromValue(123.0, GraphQLInt)).to.deep.equal({ + kind: 'IntValue', + value: '123', + }); + + expect(astFromValue(1e4, GraphQLInt)).to.deep.equal({ + kind: 'IntValue', + value: '10000', + }); + + // GraphQL spec does not allow coercing non-integer values to Int to avoid + // accidental data loss. + expect(() => astFromValue(123.5, GraphQLInt)).to.throw( + 'Int cannot represent non-integer value: 123.5', + ); + + // Note: outside the bounds of 32bit signed int. + expect(() => astFromValue(1e40, GraphQLInt)).to.throw( + 'Int cannot represent non 32-bit signed integer value: 1e+40', + ); + + expect(() => astFromValue(NaN, GraphQLInt)).to.throw( + 'Int cannot represent non-integer value: NaN', + ); + }); + + it('converts Float values to Int/Float ASTs', () => { + expect(astFromValue(-1, GraphQLFloat)).to.deep.equal({ + kind: 'IntValue', + value: '-1', + }); + + expect(astFromValue(123.0, GraphQLFloat)).to.deep.equal({ + kind: 'IntValue', + value: '123', + }); + + expect(astFromValue(123.5, GraphQLFloat)).to.deep.equal({ + kind: 'FloatValue', + value: '123.5', + }); + + expect(astFromValue(1e4, GraphQLFloat)).to.deep.equal({ + kind: 'IntValue', + value: '10000', + }); + + expect(astFromValue(1e40, GraphQLFloat)).to.deep.equal({ + kind: 'FloatValue', + value: '1e+40', + }); + }); + + it('converts String values to String ASTs', () => { + expect(astFromValue('hello', GraphQLString)).to.deep.equal({ + kind: 'StringValue', + value: 'hello', + }); + + expect(astFromValue('VALUE', GraphQLString)).to.deep.equal({ + kind: 'StringValue', + value: 'VALUE', + }); + + expect(astFromValue('VA\nLUE', GraphQLString)).to.deep.equal({ + kind: 'StringValue', + value: 'VA\nLUE', + }); + + expect(astFromValue(123, GraphQLString)).to.deep.equal({ + kind: 'StringValue', + value: '123', + }); + + expect(astFromValue(false, GraphQLString)).to.deep.equal({ + kind: 'StringValue', + value: 'false', + }); + + expect(astFromValue(null, GraphQLString)).to.deep.equal({ + kind: 'NullValue', + }); + + expect(astFromValue(undefined, GraphQLString)).to.deep.equal(null); + }); + + it('converts ID values to Int/String ASTs', () => { + expect(astFromValue('hello', GraphQLID)).to.deep.equal({ + kind: 'StringValue', + value: 'hello', + }); + + expect(astFromValue('VALUE', GraphQLID)).to.deep.equal({ + kind: 'StringValue', + value: 'VALUE', + }); + + // Note: EnumValues cannot contain non-identifier characters + expect(astFromValue('VA\nLUE', GraphQLID)).to.deep.equal({ + kind: 'StringValue', + value: 'VA\nLUE', + }); + + // Note: IntValues are used when possible. + expect(astFromValue(-1, GraphQLID)).to.deep.equal({ + kind: 'IntValue', + value: '-1', + }); + + expect(astFromValue(123, GraphQLID)).to.deep.equal({ + kind: 'IntValue', + value: '123', + }); + + expect(astFromValue('123', GraphQLID)).to.deep.equal({ + kind: 'IntValue', + value: '123', + }); + + expect(astFromValue('01', GraphQLID)).to.deep.equal({ + kind: 'StringValue', + value: '01', + }); + + expect(() => astFromValue(false, GraphQLID)).to.throw( + 'ID cannot represent value: false', + ); + + expect(astFromValue(null, GraphQLID)).to.deep.equal({ kind: 'NullValue' }); + + expect(astFromValue(undefined, GraphQLID)).to.deep.equal(null); + }); + + it('converts using serialize from a custom scalar type', () => { + const passthroughScalar = new GraphQLScalarType({ + name: 'PassthroughScalar', + serialize(value) { + return value; + }, + }); + + expect(astFromValue('value', passthroughScalar)).to.deep.equal({ + kind: 'StringValue', + value: 'value', + }); + + expect(() => astFromValue(NaN, passthroughScalar)).to.throw( + 'Cannot convert value to AST: NaN.', + ); + expect(() => astFromValue(Infinity, passthroughScalar)).to.throw( + 'Cannot convert value to AST: Infinity.', + ); + + const returnNullScalar = new GraphQLScalarType({ + name: 'ReturnNullScalar', + serialize() { + return null; + }, + }); + + expect(astFromValue('value', returnNullScalar)).to.equal(null); + + class SomeClass {} + + const returnCustomClassScalar = new GraphQLScalarType({ + name: 'ReturnCustomClassScalar', + serialize() { + return new SomeClass(); + }, + }); + + expect(() => astFromValue('value', returnCustomClassScalar)).to.throw( + 'Cannot convert value to AST: {}.', + ); + }); + + it('does not converts NonNull values to NullValue', () => { + const NonNullBoolean = new GraphQLNonNull(GraphQLBoolean); + expect(astFromValue(null, NonNullBoolean)).to.deep.equal(null); + }); + + const complexValue = { someArbitrary: 'complexValue' }; + + const myEnum = new GraphQLEnumType({ + name: 'MyEnum', + values: { + HELLO: {}, + GOODBYE: {}, + COMPLEX: { value: complexValue }, + }, + }); + + it('converts string values to Enum ASTs if possible', () => { + expect(astFromValue('HELLO', myEnum)).to.deep.equal({ + kind: 'EnumValue', + value: 'HELLO', + }); + + expect(astFromValue(complexValue, myEnum)).to.deep.equal({ + kind: 'EnumValue', + value: 'COMPLEX', + }); + + // Note: case sensitive + expect(() => astFromValue('hello', myEnum)).to.throw( + 'Enum "MyEnum" cannot represent value: "hello"', + ); + + // Note: Not a valid enum value + expect(() => astFromValue('UNKNOWN_VALUE', myEnum)).to.throw( + 'Enum "MyEnum" cannot represent value: "UNKNOWN_VALUE"', + ); + }); + + it('converts array values to List ASTs', () => { + expect( + astFromValue(['FOO', 'BAR'], new GraphQLList(GraphQLString)), + ).to.deep.equal({ + kind: 'ListValue', + values: [ + { kind: 'StringValue', value: 'FOO' }, + { kind: 'StringValue', value: 'BAR' }, + ], + }); + + expect( + astFromValue(['HELLO', 'GOODBYE'], new GraphQLList(myEnum)), + ).to.deep.equal({ + kind: 'ListValue', + values: [ + { kind: 'EnumValue', value: 'HELLO' }, + { kind: 'EnumValue', value: 'GOODBYE' }, + ], + }); + + function* listGenerator() { + yield 1; + yield 2; + yield 3; + } + + expect( + astFromValue(listGenerator(), new GraphQLList(GraphQLInt)), + ).to.deep.equal({ + kind: 'ListValue', + values: [ + { kind: 'IntValue', value: '1' }, + { kind: 'IntValue', value: '2' }, + { kind: 'IntValue', value: '3' }, + ], + }); + }); + + it('converts list singletons', () => { + expect(astFromValue('FOO', new GraphQLList(GraphQLString))).to.deep.equal({ + kind: 'StringValue', + value: 'FOO', + }); + }); + + it('skip invalid list items', () => { + const ast = astFromValue( + ['FOO', null, 'BAR'], + new GraphQLList(new GraphQLNonNull(GraphQLString)), + ); + + expect(ast).to.deep.equal({ + kind: 'ListValue', + values: [ + { kind: 'StringValue', value: 'FOO' }, + { kind: 'StringValue', value: 'BAR' }, + ], + }); + }); + + const inputObj = new GraphQLInputObjectType({ + name: 'MyInputObj', + fields: { + foo: { type: GraphQLFloat }, + bar: { type: myEnum }, + }, + }); + + it('converts input objects', () => { + expect(astFromValue({ foo: 3, bar: 'HELLO' }, inputObj)).to.deep.equal({ + kind: 'ObjectValue', + fields: [ + { + kind: 'ObjectField', + name: { kind: 'Name', value: 'foo' }, + value: { kind: 'IntValue', value: '3' }, + }, + { + kind: 'ObjectField', + name: { kind: 'Name', value: 'bar' }, + value: { kind: 'EnumValue', value: 'HELLO' }, + }, + ], + }); + }); + + it('converts input objects with explicit nulls', () => { + expect(astFromValue({ foo: null }, inputObj)).to.deep.equal({ + kind: 'ObjectValue', + fields: [ + { + kind: 'ObjectField', + name: { kind: 'Name', value: 'foo' }, + value: { kind: 'NullValue' }, + }, + ], + }); + }); + + it('does not converts non-object values as input objects', () => { + expect(astFromValue(5, inputObj)).to.equal(null); + }); +}); diff --git a/src/utilities/__tests__/buildASTSchema-test.ts b/src/utilities/__tests__/buildASTSchema-test.ts new file mode 100644 index 00000000..7427ebb5 --- /dev/null +++ b/src/utilities/__tests__/buildASTSchema-test.ts @@ -0,0 +1,1108 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { dedent } from '../../__testUtils__/dedent'; + +import { invariant } from '../../jsutils/invariant'; +import type { Maybe } from '../../jsutils/Maybe'; + +import type { ASTNode } from '../../language/ast'; +import { Kind } from '../../language/kinds'; +import { parse } from '../../language/parser'; +import { print } from '../../language/printer'; + +import { + assertEnumType, + assertInputObjectType, + assertInterfaceType, + assertObjectType, + assertScalarType, + assertUnionType, +} from '../../type/definition'; +import { + assertDirective, + GraphQLDeprecatedDirective, + GraphQLIncludeDirective, + GraphQLSkipDirective, + GraphQLSpecifiedByDirective, +} from '../../type/directives'; +import { __EnumValue, __Schema } from '../../type/introspection'; +import { + GraphQLBoolean, + GraphQLFloat, + GraphQLID, + GraphQLInt, + GraphQLString, +} from '../../type/scalars'; +import { GraphQLSchema } from '../../type/schema'; +import { validateSchema } from '../../type/validate'; + +import { graphqlSync } from '../../graphql'; + +import { buildASTSchema, buildSchema } from '../buildASTSchema'; +import { printSchema, printType } from '../printSchema'; + +/** + * This function does a full cycle of going from a string with the contents of + * the SDL, parsed in a schema AST, materializing that schema AST into an + * in-memory GraphQLSchema, and then finally printing that object into the SDL + */ +function cycleSDL(sdl: string): string { + return printSchema(buildSchema(sdl)); +} + +function expectASTNode(obj: Maybe<{ readonly astNode: Maybe }>) { + invariant(obj?.astNode != null); + return expect(print(obj.astNode)); +} + +function expectExtensionASTNodes(obj: { + readonly extensionASTNodes: ReadonlyArray; +}) { + return expect(obj.extensionASTNodes.map(print).join('\n\n')); +} + +describe('Schema Builder', () => { + it('can use built schema for limited execution', () => { + const schema = buildASTSchema( + parse(` + type Query { + str: String + } + `), + ); + + const result = graphqlSync({ + schema, + source: '{ str }', + rootValue: { str: 123 }, + }); + expect(result.data).to.deep.equal({ str: '123' }); + }); + + it('can build a schema directly from the source', () => { + const schema = buildSchema(` + type Query { + add(x: Int, y: Int): Int + } + `); + + const source = '{ add(x: 34, y: 55) }'; + const rootValue = { + add: ({ x, y }: { x: number; y: number }) => x + y, + }; + expect(graphqlSync({ schema, source, rootValue })).to.deep.equal({ + data: { add: 89 }, + }); + }); + + it('Ignores non-type system definitions', () => { + const sdl = ` + type Query { + str: String + } + + fragment SomeFragment on Query { + str + } + `; + expect(() => buildSchema(sdl)).to.not.throw(); + }); + + it('Match order of default types and directives', () => { + const schema = new GraphQLSchema({}); + const sdlSchema = buildASTSchema({ + kind: Kind.DOCUMENT, + definitions: [], + }); + + expect(sdlSchema.getDirectives()).to.deep.equal(schema.getDirectives()); + + expect(sdlSchema.getTypeMap()).to.deep.equal(schema.getTypeMap()); + expect(Object.keys(sdlSchema.getTypeMap())).to.deep.equal( + Object.keys(schema.getTypeMap()), + ); + }); + + it('Empty type', () => { + const sdl = dedent` + type EmptyType + `; + expect(cycleSDL(sdl)).to.equal(sdl); + }); + + it('Simple type', () => { + const sdl = dedent` + type Query { + str: String + int: Int + float: Float + id: ID + bool: Boolean + } + `; + expect(cycleSDL(sdl)).to.equal(sdl); + + const schema = buildSchema(sdl); + // Built-ins are used + expect(schema.getType('Int')).to.equal(GraphQLInt); + expect(schema.getType('Float')).to.equal(GraphQLFloat); + expect(schema.getType('String')).to.equal(GraphQLString); + expect(schema.getType('Boolean')).to.equal(GraphQLBoolean); + expect(schema.getType('ID')).to.equal(GraphQLID); + }); + + it('include standard type only if it is used', () => { + const schema = buildSchema('type Query'); + + // String and Boolean are always included through introspection types + expect(schema.getType('Int')).to.equal(undefined); + expect(schema.getType('Float')).to.equal(undefined); + expect(schema.getType('ID')).to.equal(undefined); + }); + + it('With directives', () => { + const sdl = dedent` + directive @foo(arg: Int) on FIELD + + directive @repeatableFoo(arg: Int) repeatable on FIELD + `; + expect(cycleSDL(sdl)).to.equal(sdl); + }); + + it('Supports descriptions', () => { + const sdl = dedent` + """Do you agree that this is the most creative schema ever?""" + schema { + query: Query + } + + """This is a directive""" + directive @foo( + """It has an argument""" + arg: Int + ) on FIELD + + """Who knows what inside this scalar?""" + scalar MysteryScalar + + """This is a input object type""" + input FooInput { + """It has a field""" + field: Int + } + + """This is a interface type""" + interface Energy { + """It also has a field""" + str: String + } + + """There is nothing inside!""" + union BlackHole + + """With an enum""" + enum Color { + RED + + """Not a creative color""" + GREEN + BLUE + } + + """What a great type""" + type Query { + """And a field to boot""" + str: String + } + `; + expect(cycleSDL(sdl)).to.equal(sdl); + }); + + it('Maintains @include, @skip & @specifiedBy', () => { + const schema = buildSchema('type Query'); + + expect(schema.getDirectives()).to.have.lengthOf(4); + expect(schema.getDirective('skip')).to.equal(GraphQLSkipDirective); + expect(schema.getDirective('include')).to.equal(GraphQLIncludeDirective); + expect(schema.getDirective('deprecated')).to.equal( + GraphQLDeprecatedDirective, + ); + expect(schema.getDirective('specifiedBy')).to.equal( + GraphQLSpecifiedByDirective, + ); + }); + + it('Overriding directives excludes specified', () => { + const schema = buildSchema(` + directive @skip on FIELD + directive @include on FIELD + directive @deprecated on FIELD_DEFINITION + directive @specifiedBy on FIELD_DEFINITION + `); + + expect(schema.getDirectives()).to.have.lengthOf(4); + expect(schema.getDirective('skip')).to.not.equal(GraphQLSkipDirective); + expect(schema.getDirective('include')).to.not.equal( + GraphQLIncludeDirective, + ); + expect(schema.getDirective('deprecated')).to.not.equal( + GraphQLDeprecatedDirective, + ); + expect(schema.getDirective('specifiedBy')).to.not.equal( + GraphQLSpecifiedByDirective, + ); + }); + + it('Adding directives maintains @include, @skip & @specifiedBy', () => { + const schema = buildSchema(` + directive @foo(arg: Int) on FIELD + `); + + expect(schema.getDirectives()).to.have.lengthOf(5); + expect(schema.getDirective('skip')).to.not.equal(undefined); + expect(schema.getDirective('include')).to.not.equal(undefined); + expect(schema.getDirective('deprecated')).to.not.equal(undefined); + expect(schema.getDirective('specifiedBy')).to.not.equal(undefined); + }); + + it('Type modifiers', () => { + const sdl = dedent` + type Query { + nonNullStr: String! + listOfStrings: [String] + listOfNonNullStrings: [String!] + nonNullListOfStrings: [String]! + nonNullListOfNonNullStrings: [String!]! + } + `; + expect(cycleSDL(sdl)).to.equal(sdl); + }); + + it('Recursive type', () => { + const sdl = dedent` + type Query { + str: String + recurse: Query + } + `; + expect(cycleSDL(sdl)).to.equal(sdl); + }); + + it('Two types circular', () => { + const sdl = dedent` + type TypeOne { + str: String + typeTwo: TypeTwo + } + + type TypeTwo { + str: String + typeOne: TypeOne + } + `; + expect(cycleSDL(sdl)).to.equal(sdl); + }); + + it('Single argument field', () => { + const sdl = dedent` + type Query { + str(int: Int): String + floatToStr(float: Float): String + idToStr(id: ID): String + booleanToStr(bool: Boolean): String + strToStr(bool: String): String + } + `; + expect(cycleSDL(sdl)).to.equal(sdl); + }); + + it('Simple type with multiple arguments', () => { + const sdl = dedent` + type Query { + str(int: Int, bool: Boolean): String + } + `; + expect(cycleSDL(sdl)).to.equal(sdl); + }); + + it('Empty interface', () => { + const sdl = dedent` + interface EmptyInterface + `; + + const definition = parse(sdl).definitions[0]; + expect( + definition.kind === 'InterfaceTypeDefinition' && definition.interfaces, + ).to.deep.equal([], 'The interfaces property must be an empty array.'); + + expect(cycleSDL(sdl)).to.equal(sdl); + }); + + it('Simple type with interface', () => { + const sdl = dedent` + type Query implements WorldInterface { + str: String + } + + interface WorldInterface { + str: String + } + `; + expect(cycleSDL(sdl)).to.equal(sdl); + }); + + it('Simple interface hierarchy', () => { + const sdl = dedent` + schema { + query: Child + } + + interface Child implements Parent { + str: String + } + + type Hello implements Parent & Child { + str: String + } + + interface Parent { + str: String + } + `; + expect(cycleSDL(sdl)).to.equal(sdl); + }); + + it('Empty enum', () => { + const sdl = dedent` + enum EmptyEnum + `; + expect(cycleSDL(sdl)).to.equal(sdl); + }); + + it('Simple output enum', () => { + const sdl = dedent` + enum Hello { + WORLD + } + + type Query { + hello: Hello + } + `; + expect(cycleSDL(sdl)).to.equal(sdl); + }); + + it('Simple input enum', () => { + const sdl = dedent` + enum Hello { + WORLD + } + + type Query { + str(hello: Hello): String + } + `; + expect(cycleSDL(sdl)).to.equal(sdl); + }); + + it('Multiple value enum', () => { + const sdl = dedent` + enum Hello { + WO + RLD + } + + type Query { + hello: Hello + } + `; + expect(cycleSDL(sdl)).to.equal(sdl); + }); + + it('Empty union', () => { + const sdl = dedent` + union EmptyUnion + `; + expect(cycleSDL(sdl)).to.equal(sdl); + }); + + it('Simple Union', () => { + const sdl = dedent` + union Hello = World + + type Query { + hello: Hello + } + + type World { + str: String + } + `; + expect(cycleSDL(sdl)).to.equal(sdl); + }); + + it('Multiple Union', () => { + const sdl = dedent` + union Hello = WorldOne | WorldTwo + + type Query { + hello: Hello + } + + type WorldOne { + str: String + } + + type WorldTwo { + str: String + } + `; + expect(cycleSDL(sdl)).to.equal(sdl); + }); + + it('Can build recursive Union', () => { + const schema = buildSchema(` + union Hello = Hello + + type Query { + hello: Hello + } + `); + const errors = validateSchema(schema); + expect(errors).to.have.lengthOf.above(0); + }); + + it('Custom Scalar', () => { + const sdl = dedent` + scalar CustomScalar + + type Query { + customScalar: CustomScalar + } + `; + expect(cycleSDL(sdl)).to.equal(sdl); + }); + + it('Empty Input Object', () => { + const sdl = dedent` + input EmptyInputObject + `; + expect(cycleSDL(sdl)).to.equal(sdl); + }); + + it('Simple Input Object', () => { + const sdl = dedent` + input Input { + int: Int + } + + type Query { + field(in: Input): String + } + `; + expect(cycleSDL(sdl)).to.equal(sdl); + }); + + it('Simple argument field with default', () => { + const sdl = dedent` + type Query { + str(int: Int = 2): String + } + `; + expect(cycleSDL(sdl)).to.equal(sdl); + }); + + it('Custom scalar argument field with default', () => { + const sdl = dedent` + scalar CustomScalar + + type Query { + str(int: CustomScalar = 2): String + } + `; + expect(cycleSDL(sdl)).to.equal(sdl); + }); + + it('Simple type with mutation', () => { + const sdl = dedent` + schema { + query: HelloScalars + mutation: Mutation + } + + type HelloScalars { + str: String + int: Int + bool: Boolean + } + + type Mutation { + addHelloScalars(str: String, int: Int, bool: Boolean): HelloScalars + } + `; + expect(cycleSDL(sdl)).to.equal(sdl); + }); + + it('Simple type with subscription', () => { + const sdl = dedent` + schema { + query: HelloScalars + subscription: Subscription + } + + type HelloScalars { + str: String + int: Int + bool: Boolean + } + + type Subscription { + subscribeHelloScalars(str: String, int: Int, bool: Boolean): HelloScalars + } + `; + expect(cycleSDL(sdl)).to.equal(sdl); + }); + + it('Unreferenced type implementing referenced interface', () => { + const sdl = dedent` + type Concrete implements Interface { + key: String + } + + interface Interface { + key: String + } + + type Query { + interface: Interface + } + `; + expect(cycleSDL(sdl)).to.equal(sdl); + }); + + it('Unreferenced interface implementing referenced interface', () => { + const sdl = dedent` + interface Child implements Parent { + key: String + } + + interface Parent { + key: String + } + + type Query { + interfaceField: Parent + } + `; + expect(cycleSDL(sdl)).to.equal(sdl); + }); + + it('Unreferenced type implementing referenced union', () => { + const sdl = dedent` + type Concrete { + key: String + } + + type Query { + union: Union + } + + union Union = Concrete + `; + expect(cycleSDL(sdl)).to.equal(sdl); + }); + + it('Supports @deprecated', () => { + const sdl = dedent` + enum MyEnum { + VALUE + OLD_VALUE @deprecated + OTHER_VALUE @deprecated(reason: "Terrible reasons") + } + + input MyInput { + oldInput: String @deprecated + otherInput: String @deprecated(reason: "Use newInput") + newInput: String + } + + type Query { + field1: String @deprecated + field2: Int @deprecated(reason: "Because I said so") + enum: MyEnum + field3(oldArg: String @deprecated, arg: String): String + field4(oldArg: String @deprecated(reason: "Why not?"), arg: String): String + field5(arg: MyInput): String + } + `; + expect(cycleSDL(sdl)).to.equal(sdl); + + const schema = buildSchema(sdl); + + const myEnum = assertEnumType(schema.getType('MyEnum')); + + const value = myEnum.getValue('VALUE'); + expect(value).to.include({ deprecationReason: undefined }); + + const oldValue = myEnum.getValue('OLD_VALUE'); + expect(oldValue).to.include({ + deprecationReason: 'No longer supported', + }); + + const otherValue = myEnum.getValue('OTHER_VALUE'); + expect(otherValue).to.include({ + deprecationReason: 'Terrible reasons', + }); + + const rootFields = assertObjectType(schema.getType('Query')).getFields(); + expect(rootFields.field1).to.include({ + deprecationReason: 'No longer supported', + }); + expect(rootFields.field2).to.include({ + deprecationReason: 'Because I said so', + }); + + const inputFields = assertInputObjectType( + schema.getType('MyInput'), + ).getFields(); + + const newInput = inputFields.newInput; + expect(newInput).to.include({ + deprecationReason: undefined, + }); + + const oldInput = inputFields.oldInput; + expect(oldInput).to.include({ + deprecationReason: 'No longer supported', + }); + + const otherInput = inputFields.otherInput; + expect(otherInput).to.include({ + deprecationReason: 'Use newInput', + }); + + const field3OldArg = rootFields.field3.args[0]; + expect(field3OldArg).to.include({ + deprecationReason: 'No longer supported', + }); + + const field4OldArg = rootFields.field4.args[0]; + expect(field4OldArg).to.include({ + deprecationReason: 'Why not?', + }); + }); + + it('Supports @specifiedBy', () => { + const sdl = dedent` + scalar Foo @specifiedBy(url: "https://example.com/foo_spec") + + type Query { + foo: Foo @deprecated + } + `; + expect(cycleSDL(sdl)).to.equal(sdl); + + const schema = buildSchema(sdl); + + expect(schema.getType('Foo')).to.include({ + specifiedByURL: 'https://example.com/foo_spec', + }); + }); + + it('Correctly extend scalar type', () => { + const schema = buildSchema(` + scalar SomeScalar + extend scalar SomeScalar @foo + extend scalar SomeScalar @bar + + directive @foo on SCALAR + directive @bar on SCALAR + `); + + const someScalar = assertScalarType(schema.getType('SomeScalar')); + expect(printType(someScalar)).to.equal(dedent` + scalar SomeScalar + `); + + expectASTNode(someScalar).to.equal('scalar SomeScalar'); + expectExtensionASTNodes(someScalar).to.equal(dedent` + extend scalar SomeScalar @foo + + extend scalar SomeScalar @bar + `); + }); + + it('Correctly extend object type', () => { + const schema = buildSchema(` + type SomeObject implements Foo { + first: String + } + + extend type SomeObject implements Bar { + second: Int + } + + extend type SomeObject implements Baz { + third: Float + } + + interface Foo + interface Bar + interface Baz + `); + + const someObject = assertObjectType(schema.getType('SomeObject')); + expect(printType(someObject)).to.equal(dedent` + type SomeObject implements Foo & Bar & Baz { + first: String + second: Int + third: Float + } + `); + + expectASTNode(someObject).to.equal(dedent` + type SomeObject implements Foo { + first: String + } + `); + expectExtensionASTNodes(someObject).to.equal(dedent` + extend type SomeObject implements Bar { + second: Int + } + + extend type SomeObject implements Baz { + third: Float + } + `); + }); + + it('Correctly extend interface type', () => { + const schema = buildSchema(dedent` + interface SomeInterface { + first: String + } + + extend interface SomeInterface { + second: Int + } + + extend interface SomeInterface { + third: Float + } + `); + + const someInterface = assertInterfaceType(schema.getType('SomeInterface')); + expect(printType(someInterface)).to.equal(dedent` + interface SomeInterface { + first: String + second: Int + third: Float + } + `); + + expectASTNode(someInterface).to.equal(dedent` + interface SomeInterface { + first: String + } + `); + expectExtensionASTNodes(someInterface).to.equal(dedent` + extend interface SomeInterface { + second: Int + } + + extend interface SomeInterface { + third: Float + } + `); + }); + + it('Correctly extend union type', () => { + const schema = buildSchema(` + union SomeUnion = FirstType + extend union SomeUnion = SecondType + extend union SomeUnion = ThirdType + + type FirstType + type SecondType + type ThirdType + `); + + const someUnion = assertUnionType(schema.getType('SomeUnion')); + expect(printType(someUnion)).to.equal(dedent` + union SomeUnion = FirstType | SecondType | ThirdType + `); + + expectASTNode(someUnion).to.equal('union SomeUnion = FirstType'); + expectExtensionASTNodes(someUnion).to.equal(dedent` + extend union SomeUnion = SecondType + + extend union SomeUnion = ThirdType + `); + }); + + it('Correctly extend enum type', () => { + const schema = buildSchema(dedent` + enum SomeEnum { + FIRST + } + + extend enum SomeEnum { + SECOND + } + + extend enum SomeEnum { + THIRD + } + `); + + const someEnum = assertEnumType(schema.getType('SomeEnum')); + expect(printType(someEnum)).to.equal(dedent` + enum SomeEnum { + FIRST + SECOND + THIRD + } + `); + + expectASTNode(someEnum).to.equal(dedent` + enum SomeEnum { + FIRST + } + `); + expectExtensionASTNodes(someEnum).to.equal(dedent` + extend enum SomeEnum { + SECOND + } + + extend enum SomeEnum { + THIRD + } + `); + }); + + it('Correctly extend input object type', () => { + const schema = buildSchema(dedent` + input SomeInput { + first: String + } + + extend input SomeInput { + second: Int + } + + extend input SomeInput { + third: Float + } + `); + + const someInput = assertInputObjectType(schema.getType('SomeInput')); + expect(printType(someInput)).to.equal(dedent` + input SomeInput { + first: String + second: Int + third: Float + } + `); + + expectASTNode(someInput).to.equal(dedent` + input SomeInput { + first: String + } + `); + expectExtensionASTNodes(someInput).to.equal(dedent` + extend input SomeInput { + second: Int + } + + extend input SomeInput { + third: Float + } + `); + }); + + it('Correctly assign AST nodes', () => { + const sdl = dedent` + schema { + query: Query + } + + type Query { + testField(testArg: TestInput): TestUnion + } + + input TestInput { + testInputField: TestEnum + } + + enum TestEnum { + TEST_VALUE + } + + union TestUnion = TestType + + interface TestInterface { + interfaceField: String + } + + type TestType implements TestInterface { + interfaceField: String + } + + scalar TestScalar + + directive @test(arg: TestScalar) on FIELD + `; + const ast = parse(sdl, { noLocation: true }); + + const schema = buildASTSchema(ast); + const query = assertObjectType(schema.getType('Query')); + const testInput = assertInputObjectType(schema.getType('TestInput')); + const testEnum = assertEnumType(schema.getType('TestEnum')); + const testUnion = assertUnionType(schema.getType('TestUnion')); + const testInterface = assertInterfaceType(schema.getType('TestInterface')); + const testType = assertObjectType(schema.getType('TestType')); + const testScalar = assertScalarType(schema.getType('TestScalar')); + const testDirective = assertDirective(schema.getDirective('test')); + + expect([ + schema.astNode, + query.astNode, + testInput.astNode, + testEnum.astNode, + testUnion.astNode, + testInterface.astNode, + testType.astNode, + testScalar.astNode, + testDirective.astNode, + ]).to.be.deep.equal(ast.definitions); + + const testField = query.getFields().testField; + expectASTNode(testField).to.equal( + 'testField(testArg: TestInput): TestUnion', + ); + expectASTNode(testField.args[0]).to.equal('testArg: TestInput'); + expectASTNode(testInput.getFields().testInputField).to.equal( + 'testInputField: TestEnum', + ); + + expectASTNode(testEnum.getValue('TEST_VALUE')).to.equal('TEST_VALUE'); + + expectASTNode(testInterface.getFields().interfaceField).to.equal( + 'interfaceField: String', + ); + expectASTNode(testType.getFields().interfaceField).to.equal( + 'interfaceField: String', + ); + expectASTNode(testDirective.args[0]).to.equal('arg: TestScalar'); + }); + + it('Root operation types with custom names', () => { + const schema = buildSchema(` + schema { + query: SomeQuery + mutation: SomeMutation + subscription: SomeSubscription + } + type SomeQuery + type SomeMutation + type SomeSubscription + `); + + expect(schema.getQueryType()).to.include({ name: 'SomeQuery' }); + expect(schema.getMutationType()).to.include({ name: 'SomeMutation' }); + expect(schema.getSubscriptionType()).to.include({ + name: 'SomeSubscription', + }); + }); + + it('Default root operation type names', () => { + const schema = buildSchema(` + type Query + type Mutation + type Subscription + `); + + expect(schema.getQueryType()).to.include({ name: 'Query' }); + expect(schema.getMutationType()).to.include({ name: 'Mutation' }); + expect(schema.getSubscriptionType()).to.include({ name: 'Subscription' }); + }); + + it('can build invalid schema', () => { + // Invalid schema, because it is missing query root type + const schema = buildSchema('type Mutation'); + const errors = validateSchema(schema); + expect(errors).to.have.lengthOf.above(0); + }); + + it('Do not override standard types', () => { + // NOTE: not sure it's desired behavior to just silently ignore override + // attempts so just documenting it here. + + const schema = buildSchema(` + scalar ID + + scalar __Schema + `); + + expect(schema.getType('ID')).to.equal(GraphQLID); + expect(schema.getType('__Schema')).to.equal(__Schema); + }); + + it('Allows to reference introspection types', () => { + const schema = buildSchema(` + type Query { + introspectionField: __EnumValue + } + `); + + const queryType = assertObjectType(schema.getType('Query')); + expect(queryType.getFields()).to.have.nested.property( + 'introspectionField.type', + __EnumValue, + ); + expect(schema.getType('__EnumValue')).to.equal(__EnumValue); + }); + + it('Rejects invalid SDL', () => { + const sdl = ` + type Query { + foo: String @unknown + } + `; + expect(() => buildSchema(sdl)).to.throw('Unknown directive "@unknown".'); + }); + + it('Allows to disable SDL validation', () => { + const sdl = ` + type Query { + foo: String @unknown + } + `; + buildSchema(sdl, { assumeValid: true }); + buildSchema(sdl, { assumeValidSDL: true }); + }); + + it('Throws on unknown types', () => { + const sdl = ` + type Query { + unknown: UnknownType + } + `; + expect(() => buildSchema(sdl, { assumeValidSDL: true })).to.throw( + 'Unknown type: "UnknownType".', + ); + }); + + it('Rejects invalid AST', () => { + // @ts-expect-error (First parameter expected to be DocumentNode) + expect(() => buildASTSchema(null)).to.throw( + 'Must provide valid Document AST', + ); + + // @ts-expect-error + expect(() => buildASTSchema({})).to.throw( + 'Must provide valid Document AST', + ); + }); +}); diff --git a/src/utilities/__tests__/buildClientSchema-test.ts b/src/utilities/__tests__/buildClientSchema-test.ts new file mode 100644 index 00000000..7d178115 --- /dev/null +++ b/src/utilities/__tests__/buildClientSchema-test.ts @@ -0,0 +1,971 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { dedent } from '../../__testUtils__/dedent'; + +import { invariant } from '../../jsutils/invariant'; + +import { + assertEnumType, + GraphQLEnumType, + GraphQLObjectType, +} from '../../type/definition'; +import { + GraphQLBoolean, + GraphQLFloat, + GraphQLID, + GraphQLInt, + GraphQLString, +} from '../../type/scalars'; +import { GraphQLSchema } from '../../type/schema'; + +import { graphqlSync } from '../../graphql'; + +import { buildSchema } from '../buildASTSchema'; +import { buildClientSchema } from '../buildClientSchema'; +import { introspectionFromSchema } from '../introspectionFromSchema'; +import { printSchema } from '../printSchema'; + +/** + * This function does a full cycle of going from a string with the contents of + * the SDL, build in-memory GraphQLSchema from it, produce a client-side + * representation of the schema by using "buildClientSchema" and then + * returns that schema printed as SDL. + */ +function cycleIntrospection(sdlString: string): string { + const serverSchema = buildSchema(sdlString); + const initialIntrospection = introspectionFromSchema(serverSchema); + const clientSchema = buildClientSchema(initialIntrospection); + const secondIntrospection = introspectionFromSchema(clientSchema); + + /** + * If the client then runs the introspection query against the client-side + * schema, it should get a result identical to what was returned by the server + */ + expect(secondIntrospection).to.deep.equal(initialIntrospection); + return printSchema(clientSchema); +} + +describe('Type System: build schema from introspection', () => { + it('builds a simple schema', () => { + const sdl = dedent` + """Simple schema""" + schema { + query: Simple + } + + """This is a simple type""" + type Simple { + """This is a string field""" + string: String + } + `; + + expect(cycleIntrospection(sdl)).to.equal(sdl); + }); + + it('builds a schema without the query type', () => { + const sdl = dedent` + type Query { + foo: String + } + `; + + const schema = buildSchema(sdl); + const introspection = introspectionFromSchema(schema); + + // @ts-expect-error + delete introspection.__schema.queryType; + + const clientSchema = buildClientSchema(introspection); + expect(clientSchema.getQueryType()).to.equal(null); + expect(printSchema(clientSchema)).to.equal(sdl); + }); + + it('builds a simple schema with all operation types', () => { + const sdl = dedent` + schema { + query: QueryType + mutation: MutationType + subscription: SubscriptionType + } + + """This is a simple mutation type""" + type MutationType { + """Set the string field""" + string: String + } + + """This is a simple query type""" + type QueryType { + """This is a string field""" + string: String + } + + """This is a simple subscription type""" + type SubscriptionType { + """This is a string field""" + string: String + } + `; + + expect(cycleIntrospection(sdl)).to.equal(sdl); + }); + + it('uses built-in scalars when possible', () => { + const sdl = dedent` + scalar CustomScalar + + type Query { + int: Int + float: Float + string: String + boolean: Boolean + id: ID + custom: CustomScalar + } + `; + + expect(cycleIntrospection(sdl)).to.equal(sdl); + + const schema = buildSchema(sdl); + const introspection = introspectionFromSchema(schema); + const clientSchema = buildClientSchema(introspection); + + // Built-ins are used + expect(clientSchema.getType('Int')).to.equal(GraphQLInt); + expect(clientSchema.getType('Float')).to.equal(GraphQLFloat); + expect(clientSchema.getType('String')).to.equal(GraphQLString); + expect(clientSchema.getType('Boolean')).to.equal(GraphQLBoolean); + expect(clientSchema.getType('ID')).to.equal(GraphQLID); + + // Custom are built + const customScalar = schema.getType('CustomScalar'); + expect(clientSchema.getType('CustomScalar')).to.not.equal(customScalar); + }); + + it('includes standard types only if they are used', () => { + const schema = buildSchema(` + type Query { + foo: String + } + `); + const introspection = introspectionFromSchema(schema); + const clientSchema = buildClientSchema(introspection); + + expect(clientSchema.getType('Int')).to.equal(undefined); + expect(clientSchema.getType('Float')).to.equal(undefined); + expect(clientSchema.getType('ID')).to.equal(undefined); + }); + + it('builds a schema with a recursive type reference', () => { + const sdl = dedent` + schema { + query: Recur + } + + type Recur { + recur: Recur + } + `; + + expect(cycleIntrospection(sdl)).to.equal(sdl); + }); + + it('builds a schema with a circular type reference', () => { + const sdl = dedent` + type Dog { + bestFriend: Human + } + + type Human { + bestFriend: Dog + } + + type Query { + dog: Dog + human: Human + } + `; + + expect(cycleIntrospection(sdl)).to.equal(sdl); + }); + + it('builds a schema with an interface', () => { + const sdl = dedent` + type Dog implements Friendly { + bestFriend: Friendly + } + + interface Friendly { + """The best friend of this friendly thing""" + bestFriend: Friendly + } + + type Human implements Friendly { + bestFriend: Friendly + } + + type Query { + friendly: Friendly + } + `; + + expect(cycleIntrospection(sdl)).to.equal(sdl); + }); + + it('builds a schema with an interface hierarchy', () => { + const sdl = dedent` + type Dog implements Friendly & Named { + bestFriend: Friendly + name: String + } + + interface Friendly implements Named { + """The best friend of this friendly thing""" + bestFriend: Friendly + name: String + } + + type Human implements Friendly & Named { + bestFriend: Friendly + name: String + } + + interface Named { + name: String + } + + type Query { + friendly: Friendly + } + `; + + expect(cycleIntrospection(sdl)).to.equal(sdl); + }); + + it('builds a schema with an implicit interface', () => { + const sdl = dedent` + type Dog implements Friendly { + bestFriend: Friendly + } + + interface Friendly { + """The best friend of this friendly thing""" + bestFriend: Friendly + } + + type Query { + dog: Dog + } + `; + + expect(cycleIntrospection(sdl)).to.equal(sdl); + }); + + it('builds a schema with a union', () => { + const sdl = dedent` + type Dog { + bestFriend: Friendly + } + + union Friendly = Dog | Human + + type Human { + bestFriend: Friendly + } + + type Query { + friendly: Friendly + } + `; + + expect(cycleIntrospection(sdl)).to.equal(sdl); + }); + + it('builds a schema with complex field values', () => { + const sdl = dedent` + type Query { + string: String + listOfString: [String] + nonNullString: String! + nonNullListOfString: [String]! + nonNullListOfNonNullString: [String!]! + } + `; + + expect(cycleIntrospection(sdl)).to.equal(sdl); + }); + + it('builds a schema with field arguments', () => { + const sdl = dedent` + type Query { + """A field with a single arg""" + one( + """This is an int arg""" + intArg: Int + ): String + + """A field with a two args""" + two( + """This is an list of int arg""" + listArg: [Int] + + """This is a required arg""" + requiredArg: Boolean! + ): String + } + `; + + expect(cycleIntrospection(sdl)).to.equal(sdl); + }); + + it('builds a schema with default value on custom scalar field', () => { + const sdl = dedent` + scalar CustomScalar + + type Query { + testField(testArg: CustomScalar = "default"): String + } + `; + + expect(cycleIntrospection(sdl)).to.equal(sdl); + }); + + it('builds a schema with an enum', () => { + const foodEnum = new GraphQLEnumType({ + name: 'Food', + description: 'Varieties of food stuffs', + values: { + VEGETABLES: { + description: 'Foods that are vegetables.', + value: 1, + }, + FRUITS: { + value: 2, + }, + OILS: { + value: 3, + deprecationReason: 'Too fatty', + }, + }, + }); + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'EnumFields', + fields: { + food: { + description: 'Repeats the arg you give it', + type: foodEnum, + args: { + kind: { + description: 'what kind of food?', + type: foodEnum, + }, + }, + }, + }, + }), + }); + + const introspection = introspectionFromSchema(schema); + const clientSchema = buildClientSchema(introspection); + + const secondIntrospection = introspectionFromSchema(clientSchema); + expect(secondIntrospection).to.deep.equal(introspection); + + // It's also an Enum type on the client. + const clientFoodEnum = assertEnumType(clientSchema.getType('Food')); + + // Client types do not get server-only values, so `value` mirrors `name`, + // rather than using the integers defined in the "server" schema. + expect(clientFoodEnum.getValues()).to.deep.equal([ + { + name: 'VEGETABLES', + description: 'Foods that are vegetables.', + value: 'VEGETABLES', + deprecationReason: null, + extensions: {}, + astNode: undefined, + }, + { + name: 'FRUITS', + description: null, + value: 'FRUITS', + deprecationReason: null, + extensions: {}, + astNode: undefined, + }, + { + name: 'OILS', + description: null, + value: 'OILS', + deprecationReason: 'Too fatty', + extensions: {}, + astNode: undefined, + }, + ]); + }); + + it('builds a schema with an input object', () => { + const sdl = dedent` + """An input address""" + input Address { + """What street is this address?""" + street: String! + + """The city the address is within?""" + city: String! + + """The country (blank will assume USA).""" + country: String = "USA" + } + + type Query { + """Get a geocode from an address""" + geocode( + """The address to lookup""" + address: Address + ): String + } + `; + + expect(cycleIntrospection(sdl)).to.equal(sdl); + }); + + it('builds a schema with field arguments with default values', () => { + const sdl = dedent` + input Geo { + lat: Float + lon: Float + } + + type Query { + defaultInt(intArg: Int = 30): String + defaultList(listArg: [Int] = [1, 2, 3]): String + defaultObject(objArg: Geo = {lat: 37.485, lon: -122.148}): String + defaultNull(intArg: Int = null): String + noDefault(intArg: Int): String + } + `; + + expect(cycleIntrospection(sdl)).to.equal(sdl); + }); + + it('builds a schema with custom directives', () => { + const sdl = dedent` + """This is a custom directive""" + directive @customDirective repeatable on FIELD + + type Query { + string: String + } + `; + + expect(cycleIntrospection(sdl)).to.equal(sdl); + }); + + it('builds a schema without directives', () => { + const sdl = dedent` + type Query { + string: String + } + `; + + const schema = buildSchema(sdl); + const introspection = introspectionFromSchema(schema); + + // @ts-expect-error + delete introspection.__schema.directives; + + const clientSchema = buildClientSchema(introspection); + + expect(schema.getDirectives()).to.have.lengthOf.above(0); + expect(clientSchema.getDirectives()).to.deep.equal([]); + expect(printSchema(clientSchema)).to.equal(sdl); + }); + + it('builds a schema aware of deprecation', () => { + const sdl = dedent` + directive @someDirective( + """This is a shiny new argument""" + shinyArg: SomeInputObject + + """This was our design mistake :(""" + oldArg: String @deprecated(reason: "Use shinyArg") + ) on QUERY + + enum Color { + """So rosy""" + RED + + """So grassy""" + GREEN + + """So calming""" + BLUE + + """So sickening""" + MAUVE @deprecated(reason: "No longer in fashion") + } + + input SomeInputObject { + """Nothing special about it, just deprecated for some unknown reason""" + oldField: String @deprecated(reason: "Don't use it, use newField instead!") + + """Same field but with a new name""" + newField: String + } + + type Query { + """This is a shiny string field""" + shinyString: String + + """This is a deprecated string field""" + deprecatedString: String @deprecated(reason: "Use shinyString") + + """Color of a week""" + color: Color + + """Some random field""" + someField( + """This is a shiny new argument""" + shinyArg: SomeInputObject + + """This was our design mistake :(""" + oldArg: String @deprecated(reason: "Use shinyArg") + ): String + } + `; + + expect(cycleIntrospection(sdl)).to.equal(sdl); + }); + + it('builds a schema with empty deprecation reasons', () => { + const sdl = dedent` + directive @someDirective(someArg: SomeInputObject @deprecated(reason: "")) on QUERY + + type Query { + someField(someArg: SomeInputObject @deprecated(reason: "")): SomeEnum @deprecated(reason: "") + } + + input SomeInputObject { + someInputField: String @deprecated(reason: "") + } + + enum SomeEnum { + SOME_VALUE @deprecated(reason: "") + } + `; + + expect(cycleIntrospection(sdl)).to.equal(sdl); + }); + + it('builds a schema with specifiedBy url', () => { + const sdl = dedent` + scalar Foo @specifiedBy(url: "https://example.com/foo_spec") + + type Query { + foo: Foo + } + `; + + expect(cycleIntrospection(sdl)).to.equal(sdl); + }); + + it('can use client schema for limited execution', () => { + const schema = buildSchema(` + scalar CustomScalar + + type Query { + foo(custom1: CustomScalar, custom2: CustomScalar): String + } + `); + + const introspection = introspectionFromSchema(schema); + const clientSchema = buildClientSchema(introspection); + + const result = graphqlSync({ + schema: clientSchema, + source: + 'query Limited($v: CustomScalar) { foo(custom1: 123, custom2: $v) }', + rootValue: { foo: 'bar', unused: 'value' }, + variableValues: { v: 'baz' }, + }); + + expect(result.data).to.deep.equal({ foo: 'bar' }); + }); + + it('can build invalid schema', () => { + const schema = buildSchema('type Query', { assumeValid: true }); + + const introspection = introspectionFromSchema(schema); + const clientSchema = buildClientSchema(introspection, { + assumeValid: true, + }); + + expect(clientSchema.toConfig().assumeValid).to.equal(true); + }); + + describe('throws when given invalid introspection', () => { + const dummySchema = buildSchema(` + type Query { + foo(bar: String): String + } + + interface SomeInterface { + foo: String + } + + union SomeUnion = Query + + enum SomeEnum { FOO } + + input SomeInputObject { + foo: String + } + + directive @SomeDirective on QUERY + `); + + it('throws when introspection is missing __schema property', () => { + // @ts-expect-error (First parameter expected to be introspection results) + expect(() => buildClientSchema(null)).to.throw( + 'Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: null.', + ); + + // @ts-expect-error + expect(() => buildClientSchema({})).to.throw( + 'Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: {}.', + ); + }); + + it('throws when referenced unknown type', () => { + const introspection = introspectionFromSchema(dummySchema); + + // @ts-expect-error + introspection.__schema.types = introspection.__schema.types.filter( + ({ name }) => name !== 'Query', + ); + + expect(() => buildClientSchema(introspection)).to.throw( + 'Invalid or incomplete schema, unknown type: Query. Ensure that a full introspection query is used in order to build a client schema.', + ); + }); + + it('throws when missing definition for one of the standard scalars', () => { + const schema = buildSchema(` + type Query { + foo: Float + } + `); + const introspection = introspectionFromSchema(schema); + + // @ts-expect-error + introspection.__schema.types = introspection.__schema.types.filter( + ({ name }) => name !== 'Float', + ); + + expect(() => buildClientSchema(introspection)).to.throw( + 'Invalid or incomplete schema, unknown type: Float. Ensure that a full introspection query is used in order to build a client schema.', + ); + }); + + it('throws when type reference is missing name', () => { + const introspection = introspectionFromSchema(dummySchema); + + expect(introspection).to.have.nested.property('__schema.queryType.name'); + + // @ts-expect-error + delete introspection.__schema.queryType.name; + + expect(() => buildClientSchema(introspection)).to.throw( + 'Unknown type reference: {}.', + ); + }); + + it('throws when missing kind', () => { + const introspection = introspectionFromSchema(dummySchema); + const queryTypeIntrospection = introspection.__schema.types.find( + ({ name }) => name === 'Query', + ); + + invariant(queryTypeIntrospection?.kind === 'OBJECT'); + // @ts-expect-error + delete queryTypeIntrospection.kind; + + expect(() => buildClientSchema(introspection)).to.throw( + /Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: { name: "Query", .* }\./, + ); + }); + + it('throws when missing interfaces', () => { + const introspection = introspectionFromSchema(dummySchema); + const queryTypeIntrospection = introspection.__schema.types.find( + ({ name }) => name === 'Query', + ); + + expect(queryTypeIntrospection).to.have.property('interfaces'); + + invariant(queryTypeIntrospection?.kind === 'OBJECT'); + // @ts-expect-error + delete queryTypeIntrospection.interfaces; + + expect(() => buildClientSchema(introspection)).to.throw( + /Introspection result missing interfaces: { kind: "OBJECT", name: "Query", .* }\./, + ); + }); + + it('Legacy support for interfaces with null as interfaces field', () => { + const introspection = introspectionFromSchema(dummySchema); + const someInterfaceIntrospection = introspection.__schema.types.find( + ({ name }) => name === 'SomeInterface', + ); + + invariant(someInterfaceIntrospection?.kind === 'INTERFACE'); + // @ts-expect-error + someInterfaceIntrospection.interfaces = null; + + const clientSchema = buildClientSchema(introspection); + expect(printSchema(clientSchema)).to.equal(printSchema(dummySchema)); + }); + + it('throws when missing fields', () => { + const introspection = introspectionFromSchema(dummySchema); + const queryTypeIntrospection = introspection.__schema.types.find( + ({ name }) => name === 'Query', + ); + + invariant(queryTypeIntrospection?.kind === 'OBJECT'); + // @ts-expect-error + delete queryTypeIntrospection.fields; + + expect(() => buildClientSchema(introspection)).to.throw( + /Introspection result missing fields: { kind: "OBJECT", name: "Query", .* }\./, + ); + }); + + it('throws when missing field args', () => { + const introspection = introspectionFromSchema(dummySchema); + const queryTypeIntrospection = introspection.__schema.types.find( + ({ name }) => name === 'Query', + ); + + invariant(queryTypeIntrospection?.kind === 'OBJECT'); + // @ts-expect-error + delete queryTypeIntrospection.fields[0].args; + + expect(() => buildClientSchema(introspection)).to.throw( + /Introspection result missing field args: { name: "foo", .* }\./, + ); + }); + + it('throws when output type is used as an arg type', () => { + const introspection = introspectionFromSchema(dummySchema); + const queryTypeIntrospection = introspection.__schema.types.find( + ({ name }) => name === 'Query', + ); + + invariant(queryTypeIntrospection?.kind === 'OBJECT'); + const argType = queryTypeIntrospection.fields[0].args[0].type; + invariant(argType.kind === 'SCALAR'); + + expect(argType).to.have.property('name', 'String'); + // @ts-expect-error + argType.name = 'SomeUnion'; + + expect(() => buildClientSchema(introspection)).to.throw( + 'Introspection must provide input type for arguments, but received: SomeUnion.', + ); + }); + + it('throws when input type is used as a field type', () => { + const introspection = introspectionFromSchema(dummySchema); + const queryTypeIntrospection = introspection.__schema.types.find( + ({ name }) => name === 'Query', + ); + + invariant(queryTypeIntrospection?.kind === 'OBJECT'); + const fieldType = queryTypeIntrospection.fields[0].type; + invariant(fieldType.kind === 'SCALAR'); + + expect(fieldType).to.have.property('name', 'String'); + // @ts-expect-error + fieldType.name = 'SomeInputObject'; + + expect(() => buildClientSchema(introspection)).to.throw( + 'Introspection must provide output type for fields, but received: SomeInputObject.', + ); + }); + + it('throws when missing possibleTypes', () => { + const introspection = introspectionFromSchema(dummySchema); + const someUnionIntrospection = introspection.__schema.types.find( + ({ name }) => name === 'SomeUnion', + ); + + invariant(someUnionIntrospection?.kind === 'UNION'); + // @ts-expect-error + delete someUnionIntrospection.possibleTypes; + + expect(() => buildClientSchema(introspection)).to.throw( + /Introspection result missing possibleTypes: { kind: "UNION", name: "SomeUnion",.* }\./, + ); + }); + + it('throws when missing enumValues', () => { + const introspection = introspectionFromSchema(dummySchema); + const someEnumIntrospection = introspection.__schema.types.find( + ({ name }) => name === 'SomeEnum', + ); + + invariant(someEnumIntrospection?.kind === 'ENUM'); + // @ts-expect-error + delete someEnumIntrospection.enumValues; + + expect(() => buildClientSchema(introspection)).to.throw( + /Introspection result missing enumValues: { kind: "ENUM", name: "SomeEnum", .* }\./, + ); + }); + + it('throws when missing inputFields', () => { + const introspection = introspectionFromSchema(dummySchema); + const someInputObjectIntrospection = introspection.__schema.types.find( + ({ name }) => name === 'SomeInputObject', + ); + + invariant(someInputObjectIntrospection?.kind === 'INPUT_OBJECT'); + // @ts-expect-error + delete someInputObjectIntrospection.inputFields; + + expect(() => buildClientSchema(introspection)).to.throw( + /Introspection result missing inputFields: { kind: "INPUT_OBJECT", name: "SomeInputObject", .* }\./, + ); + }); + + it('throws when missing directive locations', () => { + const introspection = introspectionFromSchema(dummySchema); + + const someDirectiveIntrospection = introspection.__schema.directives[0]; + expect(someDirectiveIntrospection).to.deep.include({ + name: 'SomeDirective', + locations: ['QUERY'], + }); + + // @ts-expect-error + delete someDirectiveIntrospection.locations; + + expect(() => buildClientSchema(introspection)).to.throw( + /Introspection result missing directive locations: { name: "SomeDirective", .* }\./, + ); + }); + + it('throws when missing directive args', () => { + const introspection = introspectionFromSchema(dummySchema); + + const someDirectiveIntrospection = introspection.__schema.directives[0]; + expect(someDirectiveIntrospection).to.deep.include({ + name: 'SomeDirective', + args: [], + }); + + // @ts-expect-error + delete someDirectiveIntrospection.args; + + expect(() => buildClientSchema(introspection)).to.throw( + /Introspection result missing directive args: { name: "SomeDirective", .* }\./, + ); + }); + }); + + describe('very deep decorators are not supported', () => { + it('fails on very deep (> 7 levels) lists', () => { + const schema = buildSchema(` + type Query { + foo: [[[[[[[[String]]]]]]]] + } + `); + + const introspection = introspectionFromSchema(schema); + expect(() => buildClientSchema(introspection)).to.throw( + 'Decorated type deeper than introspection query.', + ); + }); + + it('fails on a very deep (> 7 levels) non-null', () => { + const schema = buildSchema(` + type Query { + foo: [[[[String!]!]!]!] + } + `); + + const introspection = introspectionFromSchema(schema); + expect(() => buildClientSchema(introspection)).to.throw( + 'Decorated type deeper than introspection query.', + ); + }); + + it('succeeds on deep (<= 7 levels) types', () => { + // e.g., fully non-null 3D matrix + const sdl = dedent` + type Query { + foo: [[[String!]!]!]! + } + `; + + expect(cycleIntrospection(sdl)).to.equal(sdl); + }); + }); + + describe('prevents infinite recursion on invalid introspection', () => { + it('recursive interfaces', () => { + const sdl = ` + type Query { + foo: Foo + } + + type Foo implements Foo { + foo: String + } + `; + const schema = buildSchema(sdl, { assumeValid: true }); + const introspection = introspectionFromSchema(schema); + + const fooIntrospection = introspection.__schema.types.find( + (type) => type.name === 'Foo', + ); + expect(fooIntrospection).to.deep.include({ + name: 'Foo', + interfaces: [{ kind: 'OBJECT', name: 'Foo', ofType: null }], + }); + + expect(() => buildClientSchema(introspection)).to.throw( + 'Expected Foo to be a GraphQL Interface type.', + ); + }); + + it('recursive union', () => { + const sdl = ` + type Query { + foo: Foo + } + + union Foo = Foo + `; + const schema = buildSchema(sdl, { assumeValid: true }); + const introspection = introspectionFromSchema(schema); + + const fooIntrospection = introspection.__schema.types.find( + (type) => type.name === 'Foo', + ); + expect(fooIntrospection).to.deep.include({ + name: 'Foo', + possibleTypes: [{ kind: 'UNION', name: 'Foo', ofType: null }], + }); + + expect(() => buildClientSchema(introspection)).to.throw( + 'Expected Foo to be a GraphQL Object type.', + ); + }); + }); +}); diff --git a/src/utilities/__tests__/coerceInputValue-test.ts b/src/utilities/__tests__/coerceInputValue-test.ts new file mode 100644 index 00000000..a73cdc61 --- /dev/null +++ b/src/utilities/__tests__/coerceInputValue-test.ts @@ -0,0 +1,429 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import type { GraphQLInputType } from '../../type/definition'; +import { + GraphQLEnumType, + GraphQLInputObjectType, + GraphQLList, + GraphQLNonNull, + GraphQLScalarType, +} from '../../type/definition'; +import { GraphQLInt } from '../../type/scalars'; + +import { coerceInputValue } from '../coerceInputValue'; + +interface CoerceResult { + value: unknown; + errors: ReadonlyArray; +} + +interface CoerceError { + path: ReadonlyArray; + value: unknown; + error: string; +} + +function coerceValue( + inputValue: unknown, + type: GraphQLInputType, +): CoerceResult { + const errors: Array = []; + const value = coerceInputValue( + inputValue, + type, + (path, invalidValue, error) => { + errors.push({ path, value: invalidValue, error: error.message }); + }, + ); + + return { errors, value }; +} + +function expectValue(result: CoerceResult) { + expect(result.errors).to.deep.equal([]); + return expect(result.value); +} + +function expectErrors(result: CoerceResult) { + return expect(result.errors); +} + +describe('coerceInputValue', () => { + describe('for GraphQLNonNull', () => { + const TestNonNull = new GraphQLNonNull(GraphQLInt); + + it('returns no error for non-null value', () => { + const result = coerceValue(1, TestNonNull); + expectValue(result).to.equal(1); + }); + + it('returns an error for undefined value', () => { + const result = coerceValue(undefined, TestNonNull); + expectErrors(result).to.deep.equal([ + { + error: 'Expected non-nullable type "Int!" not to be null.', + path: [], + value: undefined, + }, + ]); + }); + + it('returns an error for null value', () => { + const result = coerceValue(null, TestNonNull); + expectErrors(result).to.deep.equal([ + { + error: 'Expected non-nullable type "Int!" not to be null.', + path: [], + value: null, + }, + ]); + }); + }); + + describe('for GraphQLScalar', () => { + const TestScalar = new GraphQLScalarType({ + name: 'TestScalar', + parseValue(input: any) { + if (input.error != null) { + throw new Error(input.error); + } + return input.value; + }, + }); + + it('returns no error for valid input', () => { + const result = coerceValue({ value: 1 }, TestScalar); + expectValue(result).to.equal(1); + }); + + it('returns no error for null result', () => { + const result = coerceValue({ value: null }, TestScalar); + expectValue(result).to.equal(null); + }); + + it('returns no error for NaN result', () => { + const result = coerceValue({ value: NaN }, TestScalar); + expectValue(result).to.satisfy(Number.isNaN); + }); + + it('returns an error for undefined result', () => { + const result = coerceValue({ value: undefined }, TestScalar); + expectErrors(result).to.deep.equal([ + { + error: 'Expected type "TestScalar".', + path: [], + value: { value: undefined }, + }, + ]); + }); + + it('returns an error for undefined result', () => { + const inputValue = { error: 'Some error message' }; + const result = coerceValue(inputValue, TestScalar); + expectErrors(result).to.deep.equal([ + { + error: 'Expected type "TestScalar". Some error message', + path: [], + value: { error: 'Some error message' }, + }, + ]); + }); + }); + + describe('for GraphQLEnum', () => { + const TestEnum = new GraphQLEnumType({ + name: 'TestEnum', + values: { + FOO: { value: 'InternalFoo' }, + BAR: { value: 123456789 }, + }, + }); + + it('returns no error for a known enum name', () => { + const fooResult = coerceValue('FOO', TestEnum); + expectValue(fooResult).to.equal('InternalFoo'); + + const barResult = coerceValue('BAR', TestEnum); + expectValue(barResult).to.equal(123456789); + }); + + it('returns an error for misspelled enum value', () => { + const result = coerceValue('foo', TestEnum); + expectErrors(result).to.deep.equal([ + { + error: + 'Value "foo" does not exist in "TestEnum" enum. Did you mean the enum value "FOO"?', + path: [], + value: 'foo', + }, + ]); + }); + + it('returns an error for incorrect value type', () => { + const result1 = coerceValue(123, TestEnum); + expectErrors(result1).to.deep.equal([ + { + error: 'Enum "TestEnum" cannot represent non-string value: 123.', + path: [], + value: 123, + }, + ]); + + const result2 = coerceValue({ field: 'value' }, TestEnum); + expectErrors(result2).to.deep.equal([ + { + error: + 'Enum "TestEnum" cannot represent non-string value: { field: "value" }.', + path: [], + value: { field: 'value' }, + }, + ]); + }); + }); + + describe('for GraphQLInputObject', () => { + const TestInputObject = new GraphQLInputObjectType({ + name: 'TestInputObject', + fields: { + foo: { type: new GraphQLNonNull(GraphQLInt) }, + bar: { type: GraphQLInt }, + }, + }); + + it('returns no error for a valid input', () => { + const result = coerceValue({ foo: 123 }, TestInputObject); + expectValue(result).to.deep.equal({ foo: 123 }); + }); + + it('returns an error for a non-object type', () => { + const result = coerceValue(123, TestInputObject); + expectErrors(result).to.deep.equal([ + { + error: 'Expected type "TestInputObject" to be an object.', + path: [], + value: 123, + }, + ]); + }); + + it('returns an error for an invalid field', () => { + const result = coerceValue({ foo: NaN }, TestInputObject); + expectErrors(result).to.deep.equal([ + { + error: 'Int cannot represent non-integer value: NaN', + path: ['foo'], + value: NaN, + }, + ]); + }); + + it('returns multiple errors for multiple invalid fields', () => { + const result = coerceValue({ foo: 'abc', bar: 'def' }, TestInputObject); + expectErrors(result).to.deep.equal([ + { + error: 'Int cannot represent non-integer value: "abc"', + path: ['foo'], + value: 'abc', + }, + { + error: 'Int cannot represent non-integer value: "def"', + path: ['bar'], + value: 'def', + }, + ]); + }); + + it('returns error for a missing required field', () => { + const result = coerceValue({ bar: 123 }, TestInputObject); + expectErrors(result).to.deep.equal([ + { + error: 'Field "foo" of required type "Int!" was not provided.', + path: [], + value: { bar: 123 }, + }, + ]); + }); + + it('returns error for an unknown field', () => { + const result = coerceValue( + { foo: 123, unknownField: 123 }, + TestInputObject, + ); + expectErrors(result).to.deep.equal([ + { + error: + 'Field "unknownField" is not defined by type "TestInputObject".', + path: [], + value: { foo: 123, unknownField: 123 }, + }, + ]); + }); + + it('returns error for a misspelled field', () => { + const result = coerceValue({ foo: 123, bart: 123 }, TestInputObject); + expectErrors(result).to.deep.equal([ + { + error: + 'Field "bart" is not defined by type "TestInputObject". Did you mean "bar"?', + path: [], + value: { foo: 123, bart: 123 }, + }, + ]); + }); + }); + + describe('for GraphQLInputObject with default value', () => { + const makeTestInputObject = (defaultValue: any) => + new GraphQLInputObjectType({ + name: 'TestInputObject', + fields: { + foo: { + type: new GraphQLScalarType({ name: 'TestScalar' }), + defaultValue, + }, + }, + }); + + it('returns no errors for valid input value', () => { + const result = coerceValue({ foo: 5 }, makeTestInputObject(7)); + expectValue(result).to.deep.equal({ foo: 5 }); + }); + + it('returns object with default value', () => { + const result = coerceValue({}, makeTestInputObject(7)); + expectValue(result).to.deep.equal({ foo: 7 }); + }); + + it('returns null as value', () => { + const result = coerceValue({}, makeTestInputObject(null)); + expectValue(result).to.deep.equal({ foo: null }); + }); + + it('returns NaN as value', () => { + const result = coerceValue({}, makeTestInputObject(NaN)); + expectValue(result).to.have.property('foo').that.satisfy(Number.isNaN); + }); + }); + + describe('for GraphQLList', () => { + const TestList = new GraphQLList(GraphQLInt); + + it('returns no error for a valid input', () => { + const result = coerceValue([1, 2, 3], TestList); + expectValue(result).to.deep.equal([1, 2, 3]); + }); + + it('returns no error for a valid iterable input', () => { + function* listGenerator() { + yield 1; + yield 2; + yield 3; + } + + const result = coerceValue(listGenerator(), TestList); + expectValue(result).to.deep.equal([1, 2, 3]); + }); + + it('returns an error for an invalid input', () => { + const result = coerceValue([1, 'b', true, 4], TestList); + expectErrors(result).to.deep.equal([ + { + error: 'Int cannot represent non-integer value: "b"', + path: [1], + value: 'b', + }, + { + error: 'Int cannot represent non-integer value: true', + path: [2], + value: true, + }, + ]); + }); + + it('returns a list for a non-list value', () => { + const result = coerceValue(42, TestList); + expectValue(result).to.deep.equal([42]); + }); + + it('returns a list for a non-list object value', () => { + const TestListOfObjects = new GraphQLList( + new GraphQLInputObjectType({ + name: 'TestObject', + fields: { + length: { type: GraphQLInt }, + }, + }), + ); + + const result = coerceValue({ length: 100500 }, TestListOfObjects); + expectValue(result).to.deep.equal([{ length: 100500 }]); + }); + + it('returns an error for a non-list invalid value', () => { + const result = coerceValue('INVALID', TestList); + expectErrors(result).to.deep.equal([ + { + error: 'Int cannot represent non-integer value: "INVALID"', + path: [], + value: 'INVALID', + }, + ]); + }); + + it('returns null for a null value', () => { + const result = coerceValue(null, TestList); + expectValue(result).to.deep.equal(null); + }); + }); + + describe('for nested GraphQLList', () => { + const TestNestedList = new GraphQLList(new GraphQLList(GraphQLInt)); + + it('returns no error for a valid input', () => { + const result = coerceValue([[1], [2, 3]], TestNestedList); + expectValue(result).to.deep.equal([[1], [2, 3]]); + }); + + it('returns a list for a non-list value', () => { + const result = coerceValue(42, TestNestedList); + expectValue(result).to.deep.equal([[42]]); + }); + + it('returns null for a null value', () => { + const result = coerceValue(null, TestNestedList); + expectValue(result).to.deep.equal(null); + }); + + it('returns nested lists for nested non-list values', () => { + const result = coerceValue([1, 2, 3], TestNestedList); + expectValue(result).to.deep.equal([[1], [2], [3]]); + }); + + it('returns nested null for nested null values', () => { + const result = coerceValue([42, [null], null], TestNestedList); + expectValue(result).to.deep.equal([[42], [null], null]); + }); + }); + + describe('with default onError', () => { + it('throw error without path', () => { + expect(() => + coerceInputValue(null, new GraphQLNonNull(GraphQLInt)), + ).to.throw( + 'Invalid value null: Expected non-nullable type "Int!" not to be null.', + ); + }); + + it('throw error with path', () => { + expect(() => + coerceInputValue( + [null], + new GraphQLList(new GraphQLNonNull(GraphQLInt)), + ), + ).to.throw( + 'Invalid value null at "value[0]": Expected non-nullable type "Int!" not to be null.', + ); + }); + }); +}); diff --git a/src/utilities/__tests__/concatAST-test.ts b/src/utilities/__tests__/concatAST-test.ts new file mode 100644 index 00000000..622abd6b --- /dev/null +++ b/src/utilities/__tests__/concatAST-test.ts @@ -0,0 +1,40 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { dedent } from '../../__testUtils__/dedent'; + +import { parse } from '../../language/parser'; +import { print } from '../../language/printer'; +import { Source } from '../../language/source'; + +import { concatAST } from '../concatAST'; + +describe('concatAST', () => { + it('concatenates two ASTs together', () => { + const sourceA = new Source(` + { a, b, ...Frag } + `); + + const sourceB = new Source(` + fragment Frag on T { + c + } + `); + + const astA = parse(sourceA); + const astB = parse(sourceB); + const astC = concatAST([astA, astB]); + + expect(print(astC)).to.equal(dedent` + { + a + b + ...Frag + } + + fragment Frag on T { + c + } + `); + }); +}); diff --git a/src/utilities/__tests__/extendSchema-test.ts b/src/utilities/__tests__/extendSchema-test.ts new file mode 100644 index 00000000..86baf0e6 --- /dev/null +++ b/src/utilities/__tests__/extendSchema-test.ts @@ -0,0 +1,1322 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { dedent } from '../../__testUtils__/dedent'; + +import { invariant } from '../../jsutils/invariant'; +import type { Maybe } from '../../jsutils/Maybe'; + +import type { ASTNode } from '../../language/ast'; +import { parse } from '../../language/parser'; +import { print } from '../../language/printer'; + +import { + assertEnumType, + assertInputObjectType, + assertInterfaceType, + assertObjectType, + assertScalarType, + assertUnionType, +} from '../../type/definition'; +import { assertDirective } from '../../type/directives'; +import { + GraphQLBoolean, + GraphQLFloat, + GraphQLID, + GraphQLInt, + GraphQLString, +} from '../../type/scalars'; +import { GraphQLSchema } from '../../type/schema'; +import { validateSchema } from '../../type/validate'; + +import { graphqlSync } from '../../graphql'; + +import { buildSchema } from '../buildASTSchema'; +import { concatAST } from '../concatAST'; +import { extendSchema } from '../extendSchema'; +import { printSchema } from '../printSchema'; + +function expectExtensionASTNodes(obj: { + readonly extensionASTNodes: ReadonlyArray; +}) { + return expect(obj.extensionASTNodes.map(print).join('\n\n')); +} + +function expectASTNode(obj: Maybe<{ readonly astNode: Maybe }>) { + invariant(obj?.astNode != null); + return expect(print(obj.astNode)); +} + +function expectSchemaChanges( + schema: GraphQLSchema, + extendedSchema: GraphQLSchema, +) { + const schemaDefinitions = parse(printSchema(schema)).definitions.map(print); + return expect( + parse(printSchema(extendedSchema)) + .definitions.map(print) + .filter((def) => !schemaDefinitions.includes(def)) + .join('\n\n'), + ); +} + +describe('extendSchema', () => { + it('returns the original schema when there are no type definitions', () => { + const schema = buildSchema('type Query'); + const extendedSchema = extendSchema(schema, parse('{ field }')); + expect(extendedSchema).to.equal(schema); + }); + + it('can be used for limited execution', () => { + const schema = buildSchema('type Query'); + const extendAST = parse(` + extend type Query { + newField: String + } + `); + const extendedSchema = extendSchema(schema, extendAST); + + const result = graphqlSync({ + schema: extendedSchema, + source: '{ newField }', + rootValue: { newField: 123 }, + }); + expect(result).to.deep.equal({ + data: { newField: '123' }, + }); + }); + + it('extends objects by adding new fields', () => { + const schema = buildSchema(` + type Query { + someObject: SomeObject + } + + type SomeObject implements AnotherInterface & SomeInterface { + self: SomeObject + tree: [SomeObject]! + """Old field description.""" + oldField: String + } + + interface SomeInterface { + self: SomeInterface + } + + interface AnotherInterface { + self: SomeObject + } + `); + const extensionSDL = dedent` + extend type SomeObject { + """New field description.""" + newField(arg: Boolean): String + } + `; + const extendedSchema = extendSchema(schema, parse(extensionSDL)); + + expect(validateSchema(extendedSchema)).to.deep.equal([]); + expectSchemaChanges(schema, extendedSchema).to.equal(dedent` + type SomeObject implements AnotherInterface & SomeInterface { + self: SomeObject + tree: [SomeObject]! + """Old field description.""" + oldField: String + """New field description.""" + newField(arg: Boolean): String + } + `); + }); + + it('extends objects with standard type fields', () => { + const schema = buildSchema('type Query'); + + // String and Boolean are always included through introspection types + expect(schema.getType('Int')).to.equal(undefined); + expect(schema.getType('Float')).to.equal(undefined); + expect(schema.getType('String')).to.equal(GraphQLString); + expect(schema.getType('Boolean')).to.equal(GraphQLBoolean); + expect(schema.getType('ID')).to.equal(undefined); + + const extendAST = parse(` + extend type Query { + bool: Boolean + } + `); + const extendedSchema = extendSchema(schema, extendAST); + + expect(validateSchema(extendedSchema)).to.deep.equal([]); + expect(extendedSchema.getType('Int')).to.equal(undefined); + expect(extendedSchema.getType('Float')).to.equal(undefined); + expect(extendedSchema.getType('String')).to.equal(GraphQLString); + expect(extendedSchema.getType('Boolean')).to.equal(GraphQLBoolean); + expect(extendedSchema.getType('ID')).to.equal(undefined); + + const extendTwiceAST = parse(` + extend type Query { + int: Int + float: Float + id: ID + } + `); + const extendedTwiceSchema = extendSchema(schema, extendTwiceAST); + + expect(validateSchema(extendedTwiceSchema)).to.deep.equal([]); + expect(extendedTwiceSchema.getType('Int')).to.equal(GraphQLInt); + expect(extendedTwiceSchema.getType('Float')).to.equal(GraphQLFloat); + expect(extendedTwiceSchema.getType('String')).to.equal(GraphQLString); + expect(extendedTwiceSchema.getType('Boolean')).to.equal(GraphQLBoolean); + expect(extendedTwiceSchema.getType('ID')).to.equal(GraphQLID); + }); + + it('extends enums by adding new values', () => { + const schema = buildSchema(` + type Query { + someEnum(arg: SomeEnum): SomeEnum + } + + directive @foo(arg: SomeEnum) on SCHEMA + + enum SomeEnum { + """Old value description.""" + OLD_VALUE + } + `); + const extendAST = parse(` + extend enum SomeEnum { + """New value description.""" + NEW_VALUE + } + `); + const extendedSchema = extendSchema(schema, extendAST); + + expect(validateSchema(extendedSchema)).to.deep.equal([]); + expectSchemaChanges(schema, extendedSchema).to.equal(dedent` + enum SomeEnum { + """Old value description.""" + OLD_VALUE + """New value description.""" + NEW_VALUE + } + `); + }); + + it('extends unions by adding new types', () => { + const schema = buildSchema(` + type Query { + someUnion: SomeUnion + } + + union SomeUnion = Foo | Biz + + type Foo { foo: String } + type Biz { biz: String } + type Bar { bar: String } + `); + const extendAST = parse(` + extend union SomeUnion = Bar + `); + const extendedSchema = extendSchema(schema, extendAST); + + expect(validateSchema(extendedSchema)).to.deep.equal([]); + expectSchemaChanges(schema, extendedSchema).to.equal(dedent` + union SomeUnion = Foo | Biz | Bar + `); + }); + + it('allows extension of union by adding itself', () => { + const schema = buildSchema(` + union SomeUnion + `); + const extendAST = parse(` + extend union SomeUnion = SomeUnion + `); + const extendedSchema = extendSchema(schema, extendAST); + + expect(validateSchema(extendedSchema)).to.have.lengthOf.above(0); + expectSchemaChanges(schema, extendedSchema).to.equal(dedent` + union SomeUnion = SomeUnion + `); + }); + + it('extends inputs by adding new fields', () => { + const schema = buildSchema(` + type Query { + someInput(arg: SomeInput): String + } + + directive @foo(arg: SomeInput) on SCHEMA + + input SomeInput { + """Old field description.""" + oldField: String + } + `); + const extendAST = parse(` + extend input SomeInput { + """New field description.""" + newField: String + } + `); + const extendedSchema = extendSchema(schema, extendAST); + + expect(validateSchema(extendedSchema)).to.deep.equal([]); + expectSchemaChanges(schema, extendedSchema).to.equal(dedent` + input SomeInput { + """Old field description.""" + oldField: String + """New field description.""" + newField: String + } + `); + }); + + it('extends scalars by adding new directives', () => { + const schema = buildSchema(` + type Query { + someScalar(arg: SomeScalar): SomeScalar + } + + directive @foo(arg: SomeScalar) on SCALAR + + input FooInput { + foo: SomeScalar + } + + scalar SomeScalar + `); + const extensionSDL = dedent` + extend scalar SomeScalar @foo + `; + const extendedSchema = extendSchema(schema, parse(extensionSDL)); + const someScalar = assertScalarType(extendedSchema.getType('SomeScalar')); + + expect(validateSchema(extendedSchema)).to.deep.equal([]); + expectExtensionASTNodes(someScalar).to.equal(extensionSDL); + }); + + it('extends scalars by adding specifiedBy directive', () => { + const schema = buildSchema(` + type Query { + foo: Foo + } + + scalar Foo + + directive @foo on SCALAR + `); + const extensionSDL = dedent` + extend scalar Foo @foo + + extend scalar Foo @specifiedBy(url: "https://example.com/foo_spec") + `; + + const extendedSchema = extendSchema(schema, parse(extensionSDL)); + const foo = assertScalarType(extendedSchema.getType('Foo')); + + expect(foo.specifiedByURL).to.equal('https://example.com/foo_spec'); + + expect(validateSchema(extendedSchema)).to.deep.equal([]); + expectExtensionASTNodes(foo).to.equal(extensionSDL); + }); + + it('correctly assign AST nodes to new and extended types', () => { + const schema = buildSchema(` + type Query + + scalar SomeScalar + enum SomeEnum + union SomeUnion + input SomeInput + type SomeObject + interface SomeInterface + + directive @foo on SCALAR + `); + const firstExtensionAST = parse(` + extend type Query { + newField(testArg: TestInput): TestEnum + } + + extend scalar SomeScalar @foo + + extend enum SomeEnum { + NEW_VALUE + } + + extend union SomeUnion = SomeObject + + extend input SomeInput { + newField: String + } + + extend interface SomeInterface { + newField: String + } + + enum TestEnum { + TEST_VALUE + } + + input TestInput { + testInputField: TestEnum + } + `); + const extendedSchema = extendSchema(schema, firstExtensionAST); + + const secondExtensionAST = parse(` + extend type Query { + oneMoreNewField: TestUnion + } + + extend scalar SomeScalar @test + + extend enum SomeEnum { + ONE_MORE_NEW_VALUE + } + + extend union SomeUnion = TestType + + extend input SomeInput { + oneMoreNewField: String + } + + extend interface SomeInterface { + oneMoreNewField: String + } + + union TestUnion = TestType + + interface TestInterface { + interfaceField: String + } + + type TestType implements TestInterface { + interfaceField: String + } + + directive @test(arg: Int) repeatable on FIELD | SCALAR + `); + const extendedTwiceSchema = extendSchema( + extendedSchema, + secondExtensionAST, + ); + + const extendedInOneGoSchema = extendSchema( + schema, + concatAST([firstExtensionAST, secondExtensionAST]), + ); + expect(printSchema(extendedInOneGoSchema)).to.equal( + printSchema(extendedTwiceSchema), + ); + + const query = assertObjectType(extendedTwiceSchema.getType('Query')); + const someEnum = assertEnumType(extendedTwiceSchema.getType('SomeEnum')); + const someUnion = assertUnionType(extendedTwiceSchema.getType('SomeUnion')); + const someScalar = assertScalarType( + extendedTwiceSchema.getType('SomeScalar'), + ); + const someInput = assertInputObjectType( + extendedTwiceSchema.getType('SomeInput'), + ); + const someInterface = assertInterfaceType( + extendedTwiceSchema.getType('SomeInterface'), + ); + + const testInput = assertInputObjectType( + extendedTwiceSchema.getType('TestInput'), + ); + const testEnum = assertEnumType(extendedTwiceSchema.getType('TestEnum')); + const testUnion = assertUnionType(extendedTwiceSchema.getType('TestUnion')); + const testType = assertObjectType(extendedTwiceSchema.getType('TestType')); + const testInterface = assertInterfaceType( + extendedTwiceSchema.getType('TestInterface'), + ); + const testDirective = assertDirective( + extendedTwiceSchema.getDirective('test'), + ); + + expect(testType.extensionASTNodes).to.deep.equal([]); + expect(testEnum.extensionASTNodes).to.deep.equal([]); + expect(testUnion.extensionASTNodes).to.deep.equal([]); + expect(testInput.extensionASTNodes).to.deep.equal([]); + expect(testInterface.extensionASTNodes).to.deep.equal([]); + + expect([ + testInput.astNode, + testEnum.astNode, + testUnion.astNode, + testInterface.astNode, + testType.astNode, + testDirective.astNode, + ...query.extensionASTNodes, + ...someScalar.extensionASTNodes, + ...someEnum.extensionASTNodes, + ...someUnion.extensionASTNodes, + ...someInput.extensionASTNodes, + ...someInterface.extensionASTNodes, + ]).to.have.members([ + ...firstExtensionAST.definitions, + ...secondExtensionAST.definitions, + ]); + + const newField = query.getFields().newField; + expectASTNode(newField).to.equal('newField(testArg: TestInput): TestEnum'); + expectASTNode(newField.args[0]).to.equal('testArg: TestInput'); + expectASTNode(query.getFields().oneMoreNewField).to.equal( + 'oneMoreNewField: TestUnion', + ); + + expectASTNode(someEnum.getValue('NEW_VALUE')).to.equal('NEW_VALUE'); + expectASTNode(someEnum.getValue('ONE_MORE_NEW_VALUE')).to.equal( + 'ONE_MORE_NEW_VALUE', + ); + + expectASTNode(someInput.getFields().newField).to.equal('newField: String'); + expectASTNode(someInput.getFields().oneMoreNewField).to.equal( + 'oneMoreNewField: String', + ); + expectASTNode(someInterface.getFields().newField).to.equal( + 'newField: String', + ); + expectASTNode(someInterface.getFields().oneMoreNewField).to.equal( + 'oneMoreNewField: String', + ); + + expectASTNode(testInput.getFields().testInputField).to.equal( + 'testInputField: TestEnum', + ); + + expectASTNode(testEnum.getValue('TEST_VALUE')).to.equal('TEST_VALUE'); + + expectASTNode(testInterface.getFields().interfaceField).to.equal( + 'interfaceField: String', + ); + expectASTNode(testType.getFields().interfaceField).to.equal( + 'interfaceField: String', + ); + expectASTNode(testDirective.args[0]).to.equal('arg: Int'); + }); + + it('builds types with deprecated fields/values', () => { + const schema = new GraphQLSchema({}); + const extendAST = parse(` + type SomeObject { + deprecatedField: String @deprecated(reason: "not used anymore") + } + + enum SomeEnum { + DEPRECATED_VALUE @deprecated(reason: "do not use") + } + `); + const extendedSchema = extendSchema(schema, extendAST); + + const someType = assertObjectType(extendedSchema.getType('SomeObject')); + expect(someType.getFields().deprecatedField).to.include({ + deprecationReason: 'not used anymore', + }); + + const someEnum = assertEnumType(extendedSchema.getType('SomeEnum')); + expect(someEnum.getValue('DEPRECATED_VALUE')).to.include({ + deprecationReason: 'do not use', + }); + }); + + it('extends objects with deprecated fields', () => { + const schema = buildSchema('type SomeObject'); + const extendAST = parse(` + extend type SomeObject { + deprecatedField: String @deprecated(reason: "not used anymore") + } + `); + const extendedSchema = extendSchema(schema, extendAST); + + const someType = assertObjectType(extendedSchema.getType('SomeObject')); + expect(someType.getFields().deprecatedField).to.include({ + deprecationReason: 'not used anymore', + }); + }); + + it('extends enums with deprecated values', () => { + const schema = buildSchema('enum SomeEnum'); + const extendAST = parse(` + extend enum SomeEnum { + DEPRECATED_VALUE @deprecated(reason: "do not use") + } + `); + const extendedSchema = extendSchema(schema, extendAST); + + const someEnum = assertEnumType(extendedSchema.getType('SomeEnum')); + expect(someEnum.getValue('DEPRECATED_VALUE')).to.include({ + deprecationReason: 'do not use', + }); + }); + + it('adds new unused types', () => { + const schema = buildSchema(` + type Query { + dummy: String + } + `); + const extensionSDL = dedent` + type DummyUnionMember { + someField: String + } + + enum UnusedEnum { + SOME_VALUE + } + + input UnusedInput { + someField: String + } + + interface UnusedInterface { + someField: String + } + + type UnusedObject { + someField: String + } + + union UnusedUnion = DummyUnionMember + `; + const extendedSchema = extendSchema(schema, parse(extensionSDL)); + + expect(validateSchema(extendedSchema)).to.deep.equal([]); + expectSchemaChanges(schema, extendedSchema).to.equal(extensionSDL); + }); + + it('extends objects by adding new fields with arguments', () => { + const schema = buildSchema(` + type SomeObject + + type Query { + someObject: SomeObject + } + `); + const extendAST = parse(` + input NewInputObj { + field1: Int + field2: [Float] + field3: String! + } + + extend type SomeObject { + newField(arg1: String, arg2: NewInputObj!): String + } + `); + const extendedSchema = extendSchema(schema, extendAST); + + expect(validateSchema(extendedSchema)).to.deep.equal([]); + expectSchemaChanges(schema, extendedSchema).to.equal(dedent` + type SomeObject { + newField(arg1: String, arg2: NewInputObj!): String + } + + input NewInputObj { + field1: Int + field2: [Float] + field3: String! + } + `); + }); + + it('extends objects by adding new fields with existing types', () => { + const schema = buildSchema(` + type Query { + someObject: SomeObject + } + + type SomeObject + enum SomeEnum { VALUE } + `); + const extendAST = parse(` + extend type SomeObject { + newField(arg1: SomeEnum!): SomeEnum + } + `); + const extendedSchema = extendSchema(schema, extendAST); + + expect(validateSchema(extendedSchema)).to.deep.equal([]); + expectSchemaChanges(schema, extendedSchema).to.equal(dedent` + type SomeObject { + newField(arg1: SomeEnum!): SomeEnum + } + `); + }); + + it('extends objects by adding implemented interfaces', () => { + const schema = buildSchema(` + type Query { + someObject: SomeObject + } + + type SomeObject { + foo: String + } + + interface SomeInterface { + foo: String + } + `); + const extendAST = parse(` + extend type SomeObject implements SomeInterface + `); + const extendedSchema = extendSchema(schema, extendAST); + + expect(validateSchema(extendedSchema)).to.deep.equal([]); + expectSchemaChanges(schema, extendedSchema).to.equal(dedent` + type SomeObject implements SomeInterface { + foo: String + } + `); + }); + + it('extends objects by including new types', () => { + const schema = buildSchema(` + type Query { + someObject: SomeObject + } + + type SomeObject { + oldField: String + } + `); + const newTypesSDL = dedent` + enum NewEnum { + VALUE + } + + interface NewInterface { + baz: String + } + + type NewObject implements NewInterface { + baz: String + } + + scalar NewScalar + + union NewUnion = NewObject`; + const extendAST = parse(` + ${newTypesSDL} + extend type SomeObject { + newObject: NewObject + newInterface: NewInterface + newUnion: NewUnion + newScalar: NewScalar + newEnum: NewEnum + newTree: [SomeObject]! + } + `); + const extendedSchema = extendSchema(schema, extendAST); + + expect(validateSchema(extendedSchema)).to.deep.equal([]); + expectSchemaChanges(schema, extendedSchema).to.equal(dedent` + type SomeObject { + oldField: String + newObject: NewObject + newInterface: NewInterface + newUnion: NewUnion + newScalar: NewScalar + newEnum: NewEnum + newTree: [SomeObject]! + } + + ${newTypesSDL} + `); + }); + + it('extends objects by adding implemented new interfaces', () => { + const schema = buildSchema(` + type Query { + someObject: SomeObject + } + + type SomeObject implements OldInterface { + oldField: String + } + + interface OldInterface { + oldField: String + } + `); + const extendAST = parse(` + extend type SomeObject implements NewInterface { + newField: String + } + + interface NewInterface { + newField: String + } + `); + const extendedSchema = extendSchema(schema, extendAST); + + expect(validateSchema(extendedSchema)).to.deep.equal([]); + expectSchemaChanges(schema, extendedSchema).to.equal(dedent` + type SomeObject implements OldInterface & NewInterface { + oldField: String + newField: String + } + + interface NewInterface { + newField: String + } + `); + }); + + it('extends different types multiple times', () => { + const schema = buildSchema(` + type Query { + someScalar: SomeScalar + someObject(someInput: SomeInput): SomeObject + someInterface: SomeInterface + someEnum: SomeEnum + someUnion: SomeUnion + } + + scalar SomeScalar + + type SomeObject implements SomeInterface { + oldField: String + } + + interface SomeInterface { + oldField: String + } + + enum SomeEnum { + OLD_VALUE + } + + union SomeUnion = SomeObject + + input SomeInput { + oldField: String + } + `); + const newTypesSDL = dedent` + scalar NewScalar + + scalar AnotherNewScalar + + type NewObject { + foo: String + } + + type AnotherNewObject { + foo: String + } + + interface NewInterface { + newField: String + } + + interface AnotherNewInterface { + anotherNewField: String + } + `; + const schemaWithNewTypes = extendSchema(schema, parse(newTypesSDL)); + expectSchemaChanges(schema, schemaWithNewTypes).to.equal(newTypesSDL); + + const extendAST = parse(` + extend scalar SomeScalar @specifiedBy(url: "http://example.com/foo_spec") + + extend type SomeObject implements NewInterface { + newField: String + } + + extend type SomeObject implements AnotherNewInterface { + anotherNewField: String + } + + extend enum SomeEnum { + NEW_VALUE + } + + extend enum SomeEnum { + ANOTHER_NEW_VALUE + } + + extend union SomeUnion = NewObject + + extend union SomeUnion = AnotherNewObject + + extend input SomeInput { + newField: String + } + + extend input SomeInput { + anotherNewField: String + } + `); + const extendedSchema = extendSchema(schemaWithNewTypes, extendAST); + + expect(validateSchema(extendedSchema)).to.deep.equal([]); + expectSchemaChanges(schema, extendedSchema).to.equal(dedent` + scalar SomeScalar @specifiedBy(url: "http://example.com/foo_spec") + + type SomeObject implements SomeInterface & NewInterface & AnotherNewInterface { + oldField: String + newField: String + anotherNewField: String + } + + enum SomeEnum { + OLD_VALUE + NEW_VALUE + ANOTHER_NEW_VALUE + } + + union SomeUnion = SomeObject | NewObject | AnotherNewObject + + input SomeInput { + oldField: String + newField: String + anotherNewField: String + } + + ${newTypesSDL} + `); + }); + + it('extends interfaces by adding new fields', () => { + const schema = buildSchema(` + interface SomeInterface { + oldField: String + } + + interface AnotherInterface implements SomeInterface { + oldField: String + } + + type SomeObject implements SomeInterface & AnotherInterface { + oldField: String + } + + type Query { + someInterface: SomeInterface + } + `); + const extendAST = parse(` + extend interface SomeInterface { + newField: String + } + + extend interface AnotherInterface { + newField: String + } + + extend type SomeObject { + newField: String + } + `); + const extendedSchema = extendSchema(schema, extendAST); + + expect(validateSchema(extendedSchema)).to.deep.equal([]); + expectSchemaChanges(schema, extendedSchema).to.equal(dedent` + interface SomeInterface { + oldField: String + newField: String + } + + interface AnotherInterface implements SomeInterface { + oldField: String + newField: String + } + + type SomeObject implements SomeInterface & AnotherInterface { + oldField: String + newField: String + } + `); + }); + + it('extends interfaces by adding new implemented interfaces', () => { + const schema = buildSchema(` + interface SomeInterface { + oldField: String + } + + interface AnotherInterface implements SomeInterface { + oldField: String + } + + type SomeObject implements SomeInterface & AnotherInterface { + oldField: String + } + + type Query { + someInterface: SomeInterface + } + `); + const extendAST = parse(` + interface NewInterface { + newField: String + } + + extend interface AnotherInterface implements NewInterface { + newField: String + } + + extend type SomeObject implements NewInterface { + newField: String + } + `); + const extendedSchema = extendSchema(schema, extendAST); + + expect(validateSchema(extendedSchema)).to.deep.equal([]); + expectSchemaChanges(schema, extendedSchema).to.equal(dedent` + interface AnotherInterface implements SomeInterface & NewInterface { + oldField: String + newField: String + } + + type SomeObject implements SomeInterface & AnotherInterface & NewInterface { + oldField: String + newField: String + } + + interface NewInterface { + newField: String + } + `); + }); + + it('allows extension of interface with missing Object fields', () => { + const schema = buildSchema(` + type Query { + someInterface: SomeInterface + } + + type SomeObject implements SomeInterface { + oldField: SomeInterface + } + + interface SomeInterface { + oldField: SomeInterface + } + `); + const extendAST = parse(` + extend interface SomeInterface { + newField: String + } + `); + const extendedSchema = extendSchema(schema, extendAST); + + expect(validateSchema(extendedSchema)).to.have.lengthOf.above(0); + expectSchemaChanges(schema, extendedSchema).to.equal(dedent` + interface SomeInterface { + oldField: SomeInterface + newField: String + } + `); + }); + + it('extends interfaces multiple times', () => { + const schema = buildSchema(` + type Query { + someInterface: SomeInterface + } + + interface SomeInterface { + some: SomeInterface + } + `); + + const extendAST = parse(` + extend interface SomeInterface { + newFieldA: Int + } + + extend interface SomeInterface { + newFieldB(test: Boolean): String + } + `); + const extendedSchema = extendSchema(schema, extendAST); + + expect(validateSchema(extendedSchema)).to.deep.equal([]); + expectSchemaChanges(schema, extendedSchema).to.equal(dedent` + interface SomeInterface { + some: SomeInterface + newFieldA: Int + newFieldB(test: Boolean): String + } + `); + }); + + it('may extend mutations and subscriptions', () => { + const mutationSchema = buildSchema(` + type Query { + queryField: String + } + + type Mutation { + mutationField: String + } + + type Subscription { + subscriptionField: String + } + `); + const ast = parse(` + extend type Query { + newQueryField: Int + } + + extend type Mutation { + newMutationField: Int + } + + extend type Subscription { + newSubscriptionField: Int + } + `); + const originalPrint = printSchema(mutationSchema); + const extendedSchema = extendSchema(mutationSchema, ast); + expect(extendedSchema).to.not.equal(mutationSchema); + expect(printSchema(mutationSchema)).to.equal(originalPrint); + expect(printSchema(extendedSchema)).to.equal(dedent` + type Query { + queryField: String + newQueryField: Int + } + + type Mutation { + mutationField: String + newMutationField: Int + } + + type Subscription { + subscriptionField: String + newSubscriptionField: Int + } + `); + }); + + it('may extend directives with new directive', () => { + const schema = buildSchema(` + type Query { + foo: String + } + `); + const extensionSDL = dedent` + """New directive.""" + directive @new(enable: Boolean!, tag: String) repeatable on QUERY | FIELD + `; + const extendedSchema = extendSchema(schema, parse(extensionSDL)); + + expect(validateSchema(extendedSchema)).to.deep.equal([]); + expectSchemaChanges(schema, extendedSchema).to.equal(extensionSDL); + }); + + it('Rejects invalid SDL', () => { + const schema = new GraphQLSchema({}); + const extendAST = parse('extend schema @unknown'); + + expect(() => extendSchema(schema, extendAST)).to.throw( + 'Unknown directive "@unknown".', + ); + }); + + it('Allows to disable SDL validation', () => { + const schema = new GraphQLSchema({}); + const extendAST = parse('extend schema @unknown'); + + extendSchema(schema, extendAST, { assumeValid: true }); + extendSchema(schema, extendAST, { assumeValidSDL: true }); + }); + + it('Throws on unknown types', () => { + const schema = new GraphQLSchema({}); + const ast = parse(` + type Query { + unknown: UnknownType + } + `); + expect(() => extendSchema(schema, ast, { assumeValidSDL: true })).to.throw( + 'Unknown type: "UnknownType".', + ); + }); + + it('Rejects invalid AST', () => { + const schema = new GraphQLSchema({}); + + // @ts-expect-error (Second argument expects DocumentNode) + expect(() => extendSchema(schema, null)).to.throw( + 'Must provide valid Document AST', + ); + + // @ts-expect-error + expect(() => extendSchema(schema, {})).to.throw( + 'Must provide valid Document AST', + ); + }); + + it('does not allow replacing a default directive', () => { + const schema = new GraphQLSchema({}); + const extendAST = parse(` + directive @include(if: Boolean!) on FIELD | FRAGMENT_SPREAD + `); + + expect(() => extendSchema(schema, extendAST)).to.throw( + 'Directive "@include" already exists in the schema. It cannot be redefined.', + ); + }); + + it('does not allow replacing an existing enum value', () => { + const schema = buildSchema(` + enum SomeEnum { + ONE + } + `); + const extendAST = parse(` + extend enum SomeEnum { + ONE + } + `); + + expect(() => extendSchema(schema, extendAST)).to.throw( + 'Enum value "SomeEnum.ONE" already exists in the schema. It cannot also be defined in this type extension.', + ); + }); + + describe('can add additional root operation types', () => { + it('does not automatically include common root type names', () => { + const schema = new GraphQLSchema({}); + const extendedSchema = extendSchema(schema, parse('type Mutation')); + + expect(extendedSchema.getType('Mutation')).to.not.equal(undefined); + expect(extendedSchema.getMutationType()).to.equal(undefined); + }); + + it('adds schema definition missing in the original schema', () => { + const schema = buildSchema(` + directive @foo on SCHEMA + type Foo + `); + expect(schema.getQueryType()).to.equal(undefined); + + const extensionSDL = dedent` + schema @foo { + query: Foo + } + `; + const extendedSchema = extendSchema(schema, parse(extensionSDL)); + + const queryType = extendedSchema.getQueryType(); + expect(queryType).to.include({ name: 'Foo' }); + expectASTNode(extendedSchema).to.equal(extensionSDL); + }); + + it('adds new root types via schema extension', () => { + const schema = buildSchema(` + type Query + type MutationRoot + `); + const extensionSDL = dedent` + extend schema { + mutation: MutationRoot + } + `; + const extendedSchema = extendSchema(schema, parse(extensionSDL)); + + const mutationType = extendedSchema.getMutationType(); + expect(mutationType).to.include({ name: 'MutationRoot' }); + expectExtensionASTNodes(extendedSchema).to.equal(extensionSDL); + }); + + it('adds directive via schema extension', () => { + const schema = buildSchema(` + type Query + + directive @foo on SCHEMA + `); + const extensionSDL = dedent` + extend schema @foo + `; + const extendedSchema = extendSchema(schema, parse(extensionSDL)); + + expectExtensionASTNodes(extendedSchema).to.equal(extensionSDL); + }); + + it('adds multiple new root types via schema extension', () => { + const schema = buildSchema('type Query'); + const extendAST = parse(` + extend schema { + mutation: Mutation + subscription: Subscription + } + + type Mutation + type Subscription + `); + const extendedSchema = extendSchema(schema, extendAST); + + const mutationType = extendedSchema.getMutationType(); + expect(mutationType).to.include({ name: 'Mutation' }); + + const subscriptionType = extendedSchema.getSubscriptionType(); + expect(subscriptionType).to.include({ name: 'Subscription' }); + }); + + it('applies multiple schema extensions', () => { + const schema = buildSchema('type Query'); + const extendAST = parse(` + extend schema { + mutation: Mutation + } + type Mutation + + extend schema { + subscription: Subscription + } + type Subscription + `); + const extendedSchema = extendSchema(schema, extendAST); + + const mutationType = extendedSchema.getMutationType(); + expect(mutationType).to.include({ name: 'Mutation' }); + + const subscriptionType = extendedSchema.getSubscriptionType(); + expect(subscriptionType).to.include({ name: 'Subscription' }); + }); + + it('schema extension AST are available from schema object', () => { + const schema = buildSchema(` + type Query + + directive @foo on SCHEMA + `); + + const extendAST = parse(` + extend schema { + mutation: Mutation + } + type Mutation + + extend schema { + subscription: Subscription + } + type Subscription + `); + const extendedSchema = extendSchema(schema, extendAST); + + const secondExtendAST = parse('extend schema @foo'); + const extendedTwiceSchema = extendSchema(extendedSchema, secondExtendAST); + + expectExtensionASTNodes(extendedTwiceSchema).to.equal(dedent` + extend schema { + mutation: Mutation + } + + extend schema { + subscription: Subscription + } + + extend schema @foo + `); + }); + }); +}); diff --git a/src/utilities/__tests__/findBreakingChanges-test.ts b/src/utilities/__tests__/findBreakingChanges-test.ts new file mode 100644 index 00000000..5a7956ae --- /dev/null +++ b/src/utilities/__tests__/findBreakingChanges-test.ts @@ -0,0 +1,1230 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { + GraphQLDeprecatedDirective, + GraphQLIncludeDirective, + GraphQLSkipDirective, + GraphQLSpecifiedByDirective, +} from '../../type/directives'; +import { GraphQLSchema } from '../../type/schema'; + +import { buildSchema } from '../buildASTSchema'; +import { + BreakingChangeType, + DangerousChangeType, + findBreakingChanges, + findDangerousChanges, +} from '../findBreakingChanges'; + +describe('findBreakingChanges', () => { + it('should detect if a type was removed or not', () => { + const oldSchema = buildSchema(` + type Type1 + type Type2 + `); + + const newSchema = buildSchema(` + type Type2 + `); + expect(findBreakingChanges(oldSchema, newSchema)).to.deep.equal([ + { + type: BreakingChangeType.TYPE_REMOVED, + description: 'Type1 was removed.', + }, + ]); + expect(findBreakingChanges(oldSchema, oldSchema)).to.deep.equal([]); + }); + + it('should detect if a standard scalar was removed', () => { + const oldSchema = buildSchema(` + type Query { + foo: Float + } + `); + + const newSchema = buildSchema(` + type Query { + foo: String + } + `); + expect(findBreakingChanges(oldSchema, newSchema)).to.deep.equal([ + { + type: BreakingChangeType.TYPE_REMOVED, + description: + 'Standard scalar Float was removed because it is not referenced anymore.', + }, + { + type: BreakingChangeType.FIELD_CHANGED_KIND, + description: 'Query.foo changed type from Float to String.', + }, + ]); + expect(findBreakingChanges(oldSchema, oldSchema)).to.deep.equal([]); + }); + + it('should detect if a type changed its type', () => { + const oldSchema = buildSchema(` + scalar TypeWasScalarBecomesEnum + interface TypeWasInterfaceBecomesUnion + type TypeWasObjectBecomesInputObject + `); + + const newSchema = buildSchema(` + enum TypeWasScalarBecomesEnum + union TypeWasInterfaceBecomesUnion + input TypeWasObjectBecomesInputObject + `); + expect(findBreakingChanges(oldSchema, newSchema)).to.deep.equal([ + { + type: BreakingChangeType.TYPE_CHANGED_KIND, + description: + 'TypeWasScalarBecomesEnum changed from a Scalar type to an Enum type.', + }, + { + type: BreakingChangeType.TYPE_CHANGED_KIND, + description: + 'TypeWasInterfaceBecomesUnion changed from an Interface type to a Union type.', + }, + { + type: BreakingChangeType.TYPE_CHANGED_KIND, + description: + 'TypeWasObjectBecomesInputObject changed from an Object type to an Input type.', + }, + ]); + }); + + it('should detect if a field on a type was deleted or changed type', () => { + const oldSchema = buildSchema(` + type TypeA + type TypeB + + interface Type1 { + field1: TypeA + field2: String + field3: String + field4: TypeA + field6: String + field7: [String] + field8: Int + field9: Int! + field10: [Int]! + field11: Int + field12: [Int] + field13: [Int!] + field14: [Int] + field15: [[Int]] + field16: Int! + field17: [Int] + field18: [[Int!]!] + } + `); + + const newSchema = buildSchema(` + type TypeA + type TypeB + + interface Type1 { + field1: TypeA + field3: Boolean + field4: TypeB + field5: String + field6: [String] + field7: String + field8: Int! + field9: Int + field10: [Int] + field11: [Int]! + field12: [Int!] + field13: [Int] + field14: [[Int]] + field15: [Int] + field16: [Int]! + field17: [Int]! + field18: [[Int!]] + } + `); + + const changes = findBreakingChanges(oldSchema, newSchema); + expect(changes).to.deep.equal([ + { + type: BreakingChangeType.FIELD_REMOVED, + description: 'Type1.field2 was removed.', + }, + { + type: BreakingChangeType.FIELD_CHANGED_KIND, + description: 'Type1.field3 changed type from String to Boolean.', + }, + { + type: BreakingChangeType.FIELD_CHANGED_KIND, + description: 'Type1.field4 changed type from TypeA to TypeB.', + }, + { + type: BreakingChangeType.FIELD_CHANGED_KIND, + description: 'Type1.field6 changed type from String to [String].', + }, + { + type: BreakingChangeType.FIELD_CHANGED_KIND, + description: 'Type1.field7 changed type from [String] to String.', + }, + { + type: BreakingChangeType.FIELD_CHANGED_KIND, + description: 'Type1.field9 changed type from Int! to Int.', + }, + { + type: BreakingChangeType.FIELD_CHANGED_KIND, + description: 'Type1.field10 changed type from [Int]! to [Int].', + }, + { + type: BreakingChangeType.FIELD_CHANGED_KIND, + description: 'Type1.field11 changed type from Int to [Int]!.', + }, + { + type: BreakingChangeType.FIELD_CHANGED_KIND, + description: 'Type1.field13 changed type from [Int!] to [Int].', + }, + { + type: BreakingChangeType.FIELD_CHANGED_KIND, + description: 'Type1.field14 changed type from [Int] to [[Int]].', + }, + { + type: BreakingChangeType.FIELD_CHANGED_KIND, + description: 'Type1.field15 changed type from [[Int]] to [Int].', + }, + { + type: BreakingChangeType.FIELD_CHANGED_KIND, + description: 'Type1.field16 changed type from Int! to [Int]!.', + }, + { + type: BreakingChangeType.FIELD_CHANGED_KIND, + description: 'Type1.field18 changed type from [[Int!]!] to [[Int!]].', + }, + ]); + }); + + it('should detect if fields on input types changed kind or were removed', () => { + const oldSchema = buildSchema(` + input InputType1 { + field1: String + field2: Boolean + field3: [String] + field4: String! + field5: String + field6: [Int] + field7: [Int]! + field8: Int + field9: [Int] + field10: [Int!] + field11: [Int] + field12: [[Int]] + field13: Int! + field14: [[Int]!] + field15: [[Int]!] + } + `); + + const newSchema = buildSchema(` + input InputType1 { + field1: Int + field3: String + field4: String + field5: String! + field6: [Int]! + field7: [Int] + field8: [Int]! + field9: [Int!] + field10: [Int] + field11: [[Int]] + field12: [Int] + field13: [Int]! + field14: [[Int]] + field15: [[Int!]!] + } + `); + + expect(findBreakingChanges(oldSchema, newSchema)).to.deep.equal([ + { + type: BreakingChangeType.FIELD_REMOVED, + description: 'InputType1.field2 was removed.', + }, + { + type: BreakingChangeType.FIELD_CHANGED_KIND, + description: 'InputType1.field1 changed type from String to Int.', + }, + { + type: BreakingChangeType.FIELD_CHANGED_KIND, + description: 'InputType1.field3 changed type from [String] to String.', + }, + { + type: BreakingChangeType.FIELD_CHANGED_KIND, + description: 'InputType1.field5 changed type from String to String!.', + }, + { + type: BreakingChangeType.FIELD_CHANGED_KIND, + description: 'InputType1.field6 changed type from [Int] to [Int]!.', + }, + { + type: BreakingChangeType.FIELD_CHANGED_KIND, + description: 'InputType1.field8 changed type from Int to [Int]!.', + }, + { + type: BreakingChangeType.FIELD_CHANGED_KIND, + description: 'InputType1.field9 changed type from [Int] to [Int!].', + }, + { + type: BreakingChangeType.FIELD_CHANGED_KIND, + description: 'InputType1.field11 changed type from [Int] to [[Int]].', + }, + { + type: BreakingChangeType.FIELD_CHANGED_KIND, + description: 'InputType1.field12 changed type from [[Int]] to [Int].', + }, + { + type: BreakingChangeType.FIELD_CHANGED_KIND, + description: 'InputType1.field13 changed type from Int! to [Int]!.', + }, + { + type: BreakingChangeType.FIELD_CHANGED_KIND, + description: + 'InputType1.field15 changed type from [[Int]!] to [[Int!]!].', + }, + ]); + }); + + it('should detect if a required field is added to an input type', () => { + const oldSchema = buildSchema(` + input InputType1 { + field1: String + } + `); + + const newSchema = buildSchema(` + input InputType1 { + field1: String + requiredField: Int! + optionalField1: Boolean + optionalField2: Boolean! = false + } + `); + + expect(findBreakingChanges(oldSchema, newSchema)).to.deep.equal([ + { + type: BreakingChangeType.REQUIRED_INPUT_FIELD_ADDED, + description: + 'A required field requiredField on input type InputType1 was added.', + }, + ]); + }); + + it('should detect if a type was removed from a union type', () => { + const oldSchema = buildSchema(` + type Type1 + type Type2 + type Type3 + + union UnionType1 = Type1 | Type2 + `); + const newSchema = buildSchema(` + type Type1 + type Type2 + type Type3 + + union UnionType1 = Type1 | Type3 + `); + + expect(findBreakingChanges(oldSchema, newSchema)).to.deep.equal([ + { + type: BreakingChangeType.TYPE_REMOVED_FROM_UNION, + description: 'Type2 was removed from union type UnionType1.', + }, + ]); + }); + + it('should detect if a value was removed from an enum type', () => { + const oldSchema = buildSchema(` + enum EnumType1 { + VALUE0 + VALUE1 + VALUE2 + } + `); + + const newSchema = buildSchema(` + enum EnumType1 { + VALUE0 + VALUE2 + VALUE3 + } + `); + + expect(findBreakingChanges(oldSchema, newSchema)).to.deep.equal([ + { + type: BreakingChangeType.VALUE_REMOVED_FROM_ENUM, + description: 'VALUE1 was removed from enum type EnumType1.', + }, + ]); + }); + + it('should detect if a field argument was removed', () => { + const oldSchema = buildSchema(` + interface Interface1 { + field1(arg1: Boolean, objectArg: String): String + } + + type Type1 { + field1(name: String): String + } + `); + + const newSchema = buildSchema(` + interface Interface1 { + field1: String + } + + type Type1 { + field1: String + } + `); + + expect(findBreakingChanges(oldSchema, newSchema)).to.deep.equal([ + { + type: BreakingChangeType.ARG_REMOVED, + description: 'Interface1.field1 arg arg1 was removed.', + }, + { + type: BreakingChangeType.ARG_REMOVED, + description: 'Interface1.field1 arg objectArg was removed.', + }, + { + type: BreakingChangeType.ARG_REMOVED, + description: 'Type1.field1 arg name was removed.', + }, + ]); + }); + + it('should detect if a field argument has changed type', () => { + const oldSchema = buildSchema(` + type Type1 { + field1( + arg1: String + arg2: String + arg3: [String] + arg4: String + arg5: String! + arg6: String! + arg7: [Int]! + arg8: Int + arg9: [Int] + arg10: [Int!] + arg11: [Int] + arg12: [[Int]] + arg13: Int! + arg14: [[Int]!] + arg15: [[Int]!] + ): String + } + `); + + const newSchema = buildSchema(` + type Type1 { + field1( + arg1: Int + arg2: [String] + arg3: String + arg4: String! + arg5: Int + arg6: Int! + arg7: [Int] + arg8: [Int]! + arg9: [Int!] + arg10: [Int] + arg11: [[Int]] + arg12: [Int] + arg13: [Int]! + arg14: [[Int]] + arg15: [[Int!]!] + ): String + } + `); + + expect(findBreakingChanges(oldSchema, newSchema)).to.deep.equal([ + { + type: BreakingChangeType.ARG_CHANGED_KIND, + description: + 'Type1.field1 arg arg1 has changed type from String to Int.', + }, + { + type: BreakingChangeType.ARG_CHANGED_KIND, + description: + 'Type1.field1 arg arg2 has changed type from String to [String].', + }, + { + type: BreakingChangeType.ARG_CHANGED_KIND, + description: + 'Type1.field1 arg arg3 has changed type from [String] to String.', + }, + { + type: BreakingChangeType.ARG_CHANGED_KIND, + description: + 'Type1.field1 arg arg4 has changed type from String to String!.', + }, + { + type: BreakingChangeType.ARG_CHANGED_KIND, + description: + 'Type1.field1 arg arg5 has changed type from String! to Int.', + }, + { + type: BreakingChangeType.ARG_CHANGED_KIND, + description: + 'Type1.field1 arg arg6 has changed type from String! to Int!.', + }, + { + type: BreakingChangeType.ARG_CHANGED_KIND, + description: + 'Type1.field1 arg arg8 has changed type from Int to [Int]!.', + }, + { + type: BreakingChangeType.ARG_CHANGED_KIND, + description: + 'Type1.field1 arg arg9 has changed type from [Int] to [Int!].', + }, + { + type: BreakingChangeType.ARG_CHANGED_KIND, + description: + 'Type1.field1 arg arg11 has changed type from [Int] to [[Int]].', + }, + { + type: BreakingChangeType.ARG_CHANGED_KIND, + description: + 'Type1.field1 arg arg12 has changed type from [[Int]] to [Int].', + }, + { + type: BreakingChangeType.ARG_CHANGED_KIND, + description: + 'Type1.field1 arg arg13 has changed type from Int! to [Int]!.', + }, + { + type: BreakingChangeType.ARG_CHANGED_KIND, + description: + 'Type1.field1 arg arg15 has changed type from [[Int]!] to [[Int!]!].', + }, + ]); + }); + + it('should detect if a required field argument was added', () => { + const oldSchema = buildSchema(` + type Type1 { + field1(arg1: String): String + } + `); + + const newSchema = buildSchema(` + type Type1 { + field1( + arg1: String, + newRequiredArg: String! + newOptionalArg1: Int + newOptionalArg2: Int! = 0 + ): String + } + `); + + expect(findBreakingChanges(oldSchema, newSchema)).to.deep.equal([ + { + type: BreakingChangeType.REQUIRED_ARG_ADDED, + description: 'A required arg newRequiredArg on Type1.field1 was added.', + }, + ]); + }); + + it('should not flag args with the same type signature as breaking', () => { + const oldSchema = buildSchema(` + input InputType1 { + field1: String + } + + type Type1 { + field1(arg1: Int!, arg2: InputType1): Int + } + `); + + const newSchema = buildSchema(` + input InputType1 { + field1: String + } + + type Type1 { + field1(arg1: Int!, arg2: InputType1): Int + } + `); + + expect(findBreakingChanges(oldSchema, newSchema)).to.deep.equal([]); + }); + + it('should consider args that move away from NonNull as non-breaking', () => { + const oldSchema = buildSchema(` + type Type1 { + field1(name: String!): String + } + `); + + const newSchema = buildSchema(` + type Type1 { + field1(name: String): String + } + `); + + expect(findBreakingChanges(oldSchema, newSchema)).to.deep.equal([]); + }); + + it('should detect interfaces removed from types', () => { + const oldSchema = buildSchema(` + interface Interface1 + + type Type1 implements Interface1 + `); + + const newSchema = buildSchema(` + interface Interface1 + + type Type1 + `); + + expect(findBreakingChanges(oldSchema, newSchema)).to.deep.equal([ + { + type: BreakingChangeType.IMPLEMENTED_INTERFACE_REMOVED, + description: 'Type1 no longer implements interface Interface1.', + }, + ]); + }); + + it('should detect interfaces removed from interfaces', () => { + const oldSchema = buildSchema(` + interface Interface1 + + interface Interface2 implements Interface1 + `); + + const newSchema = buildSchema(` + interface Interface1 + + interface Interface2 + `); + + expect(findBreakingChanges(oldSchema, newSchema)).to.deep.equal([ + { + type: BreakingChangeType.IMPLEMENTED_INTERFACE_REMOVED, + description: 'Interface2 no longer implements interface Interface1.', + }, + ]); + }); + + it('should ignore changes in order of interfaces', () => { + const oldSchema = buildSchema(` + interface FirstInterface + interface SecondInterface + + type Type1 implements FirstInterface & SecondInterface + `); + + const newSchema = buildSchema(` + interface FirstInterface + interface SecondInterface + + type Type1 implements SecondInterface & FirstInterface + `); + + expect(findBreakingChanges(oldSchema, newSchema)).to.deep.equal([]); + }); + + it('should detect all breaking changes', () => { + const oldSchema = buildSchema(` + directive @DirectiveThatIsRemoved on FIELD_DEFINITION + + directive @DirectiveThatRemovesArg(arg1: String) on FIELD_DEFINITION + + directive @NonNullDirectiveAdded on FIELD_DEFINITION + + directive @DirectiveThatWasRepeatable repeatable on FIELD_DEFINITION + + directive @DirectiveName on FIELD_DEFINITION | QUERY + + type ArgThatChanges { + field1(id: Float): String + } + + enum EnumTypeThatLosesAValue { + VALUE0 + VALUE1 + VALUE2 + } + + interface Interface1 + type TypeThatLooseInterface1 implements Interface1 + + type TypeInUnion1 + type TypeInUnion2 + union UnionTypeThatLosesAType = TypeInUnion1 | TypeInUnion2 + + type TypeThatChangesType + + type TypeThatGetsRemoved + + interface TypeThatHasBreakingFieldChanges { + field1: String + field2: String + } + `); + + const newSchema = buildSchema(` + directive @DirectiveThatRemovesArg on FIELD_DEFINITION + + directive @NonNullDirectiveAdded(arg1: Boolean!) on FIELD_DEFINITION + + directive @DirectiveThatWasRepeatable on FIELD_DEFINITION + + directive @DirectiveName on FIELD_DEFINITION + + type ArgThatChanges { + field1(id: String): String + } + + enum EnumTypeThatLosesAValue { + VALUE1 + VALUE2 + } + + interface Interface1 + type TypeThatLooseInterface1 + + type TypeInUnion1 + type TypeInUnion2 + union UnionTypeThatLosesAType = TypeInUnion1 + + interface TypeThatChangesType + + interface TypeThatHasBreakingFieldChanges { + field2: Boolean + } + `); + + expect(findBreakingChanges(oldSchema, newSchema)).to.deep.equal([ + { + type: BreakingChangeType.TYPE_REMOVED, + description: + 'Standard scalar Float was removed because it is not referenced anymore.', + }, + { + type: BreakingChangeType.TYPE_REMOVED, + description: 'TypeThatGetsRemoved was removed.', + }, + { + type: BreakingChangeType.ARG_CHANGED_KIND, + description: + 'ArgThatChanges.field1 arg id has changed type from Float to String.', + }, + { + type: BreakingChangeType.VALUE_REMOVED_FROM_ENUM, + description: + 'VALUE0 was removed from enum type EnumTypeThatLosesAValue.', + }, + { + type: BreakingChangeType.IMPLEMENTED_INTERFACE_REMOVED, + description: + 'TypeThatLooseInterface1 no longer implements interface Interface1.', + }, + { + type: BreakingChangeType.TYPE_REMOVED_FROM_UNION, + description: + 'TypeInUnion2 was removed from union type UnionTypeThatLosesAType.', + }, + { + type: BreakingChangeType.TYPE_CHANGED_KIND, + description: + 'TypeThatChangesType changed from an Object type to an Interface type.', + }, + { + type: BreakingChangeType.FIELD_REMOVED, + description: 'TypeThatHasBreakingFieldChanges.field1 was removed.', + }, + { + type: BreakingChangeType.FIELD_CHANGED_KIND, + description: + 'TypeThatHasBreakingFieldChanges.field2 changed type from String to Boolean.', + }, + { + type: BreakingChangeType.DIRECTIVE_REMOVED, + description: 'DirectiveThatIsRemoved was removed.', + }, + { + type: BreakingChangeType.DIRECTIVE_ARG_REMOVED, + description: 'arg1 was removed from DirectiveThatRemovesArg.', + }, + { + type: BreakingChangeType.REQUIRED_DIRECTIVE_ARG_ADDED, + description: + 'A required arg arg1 on directive NonNullDirectiveAdded was added.', + }, + { + type: BreakingChangeType.DIRECTIVE_REPEATABLE_REMOVED, + description: + 'Repeatable flag was removed from DirectiveThatWasRepeatable.', + }, + { + type: BreakingChangeType.DIRECTIVE_LOCATION_REMOVED, + description: 'QUERY was removed from DirectiveName.', + }, + ]); + }); + + it('should detect if a directive was explicitly removed', () => { + const oldSchema = buildSchema(` + directive @DirectiveThatIsRemoved on FIELD_DEFINITION + directive @DirectiveThatStays on FIELD_DEFINITION + `); + + const newSchema = buildSchema(` + directive @DirectiveThatStays on FIELD_DEFINITION + `); + + expect(findBreakingChanges(oldSchema, newSchema)).to.deep.equal([ + { + type: BreakingChangeType.DIRECTIVE_REMOVED, + description: 'DirectiveThatIsRemoved was removed.', + }, + ]); + }); + + it('should detect if a directive was implicitly removed', () => { + const oldSchema = new GraphQLSchema({}); + + const newSchema = new GraphQLSchema({ + directives: [ + GraphQLSkipDirective, + GraphQLIncludeDirective, + GraphQLSpecifiedByDirective, + ], + }); + + expect(findBreakingChanges(oldSchema, newSchema)).to.deep.equal([ + { + type: BreakingChangeType.DIRECTIVE_REMOVED, + description: `${GraphQLDeprecatedDirective.name} was removed.`, + }, + ]); + }); + + it('should detect if a directive argument was removed', () => { + const oldSchema = buildSchema(` + directive @DirectiveWithArg(arg1: String) on FIELD_DEFINITION + `); + + const newSchema = buildSchema(` + directive @DirectiveWithArg on FIELD_DEFINITION + `); + + expect(findBreakingChanges(oldSchema, newSchema)).to.deep.equal([ + { + type: BreakingChangeType.DIRECTIVE_ARG_REMOVED, + description: 'arg1 was removed from DirectiveWithArg.', + }, + ]); + }); + + it('should detect if an optional directive argument was added', () => { + const oldSchema = buildSchema(` + directive @DirectiveName on FIELD_DEFINITION + `); + + const newSchema = buildSchema(` + directive @DirectiveName( + newRequiredArg: String! + newOptionalArg1: Int + newOptionalArg2: Int! = 0 + ) on FIELD_DEFINITION + `); + + expect(findBreakingChanges(oldSchema, newSchema)).to.deep.equal([ + { + type: BreakingChangeType.REQUIRED_DIRECTIVE_ARG_ADDED, + description: + 'A required arg newRequiredArg on directive DirectiveName was added.', + }, + ]); + }); + + it('should detect removal of repeatable flag', () => { + const oldSchema = buildSchema(` + directive @DirectiveName repeatable on OBJECT + `); + + const newSchema = buildSchema(` + directive @DirectiveName on OBJECT + `); + + expect(findBreakingChanges(oldSchema, newSchema)).to.deep.equal([ + { + type: BreakingChangeType.DIRECTIVE_REPEATABLE_REMOVED, + description: 'Repeatable flag was removed from DirectiveName.', + }, + ]); + }); + + it('should detect locations removed from a directive', () => { + const oldSchema = buildSchema(` + directive @DirectiveName on FIELD_DEFINITION | QUERY + `); + + const newSchema = buildSchema(` + directive @DirectiveName on FIELD_DEFINITION + `); + + expect(findBreakingChanges(oldSchema, newSchema)).to.deep.equal([ + { + type: BreakingChangeType.DIRECTIVE_LOCATION_REMOVED, + description: 'QUERY was removed from DirectiveName.', + }, + ]); + }); +}); + +describe('findDangerousChanges', () => { + it('should detect if a defaultValue changed on an argument', () => { + const oldSDL = ` + input Input1 { + innerInputArray: [Input2] + } + + input Input2 { + arrayField: [Int] + } + + type Type1 { + field1( + withDefaultValue: String = "TO BE DELETED" + stringArg: String = "test" + emptyArray: [Int!] = [] + valueArray: [[String]] = [["a", "b"], ["c"]] + complexObject: Input1 = { + innerInputArray: [{ arrayField: [1, 2, 3] }] + } + ): String + } + `; + + const oldSchema = buildSchema(oldSDL); + const copyOfOldSchema = buildSchema(oldSDL); + expect(findDangerousChanges(oldSchema, copyOfOldSchema)).to.deep.equal([]); + + const newSchema = buildSchema(` + input Input1 { + innerInputArray: [Input2] + } + + input Input2 { + arrayField: [Int] + } + + type Type1 { + field1( + withDefaultValue: String + stringArg: String = "Test" + emptyArray: [Int!] = [7] + valueArray: [[String]] = [["b", "a"], ["d"]] + complexObject: Input1 = { + innerInputArray: [{ arrayField: [3, 2, 1] }] + } + ): String + } + `); + + expect(findDangerousChanges(oldSchema, newSchema)).to.deep.equal([ + { + type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE, + description: + 'Type1.field1 arg withDefaultValue defaultValue was removed.', + }, + { + type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE, + description: + 'Type1.field1 arg stringArg has changed defaultValue from "test" to "Test".', + }, + { + type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE, + description: + 'Type1.field1 arg emptyArray has changed defaultValue from [] to [7].', + }, + { + type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE, + description: + 'Type1.field1 arg valueArray has changed defaultValue from [["a", "b"], ["c"]] to [["b", "a"], ["d"]].', + }, + { + type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE, + description: + 'Type1.field1 arg complexObject has changed defaultValue from {innerInputArray: [{arrayField: [1, 2, 3]}]} to {innerInputArray: [{arrayField: [3, 2, 1]}]}.', + }, + ]); + }); + + it('should ignore changes in field order of defaultValue', () => { + const oldSchema = buildSchema(` + input Input1 { + a: String + b: String + c: String + } + + type Type1 { + field1( + arg1: Input1 = { a: "a", b: "b", c: "c" } + ): String + } + `); + + const newSchema = buildSchema(` + input Input1 { + a: String + b: String + c: String + } + + type Type1 { + field1( + arg1: Input1 = { c: "c", b: "b", a: "a" } + ): String + } + `); + + expect(findDangerousChanges(oldSchema, newSchema)).to.deep.equal([]); + }); + + it('should ignore changes in field definitions order', () => { + const oldSchema = buildSchema(` + input Input1 { + a: String + b: String + c: String + } + + type Type1 { + field1( + arg1: Input1 = { a: "a", b: "b", c: "c" } + ): String + } + `); + + const newSchema = buildSchema(` + input Input1 { + c: String + b: String + a: String + } + + type Type1 { + field1( + arg1: Input1 = { a: "a", b: "b", c: "c" } + ): String + } + `); + + expect(findDangerousChanges(oldSchema, newSchema)).to.deep.equal([]); + }); + + it('should detect if a value was added to an enum type', () => { + const oldSchema = buildSchema(` + enum EnumType1 { + VALUE0 + VALUE1 + } + `); + + const newSchema = buildSchema(` + enum EnumType1 { + VALUE0 + VALUE1 + VALUE2 + } + `); + + expect(findDangerousChanges(oldSchema, newSchema)).to.deep.equal([ + { + type: DangerousChangeType.VALUE_ADDED_TO_ENUM, + description: 'VALUE2 was added to enum type EnumType1.', + }, + ]); + }); + + it('should detect interfaces added to types', () => { + const oldSchema = buildSchema(` + interface OldInterface + interface NewInterface + + type Type1 implements OldInterface + `); + + const newSchema = buildSchema(` + interface OldInterface + interface NewInterface + + type Type1 implements OldInterface & NewInterface + `); + + expect(findDangerousChanges(oldSchema, newSchema)).to.deep.equal([ + { + type: DangerousChangeType.IMPLEMENTED_INTERFACE_ADDED, + description: 'NewInterface added to interfaces implemented by Type1.', + }, + ]); + }); + + it('should detect interfaces added to interfaces', () => { + const oldSchema = buildSchema(` + interface OldInterface + interface NewInterface + + interface Interface1 implements OldInterface + `); + + const newSchema = buildSchema(` + interface OldInterface + interface NewInterface + + interface Interface1 implements OldInterface & NewInterface + `); + + expect(findDangerousChanges(oldSchema, newSchema)).to.deep.equal([ + { + type: DangerousChangeType.IMPLEMENTED_INTERFACE_ADDED, + description: + 'NewInterface added to interfaces implemented by Interface1.', + }, + ]); + }); + + it('should detect if a type was added to a union type', () => { + const oldSchema = buildSchema(` + type Type1 + type Type2 + + union UnionType1 = Type1 + `); + + const newSchema = buildSchema(` + type Type1 + type Type2 + + union UnionType1 = Type1 | Type2 + `); + + expect(findDangerousChanges(oldSchema, newSchema)).to.deep.equal([ + { + type: DangerousChangeType.TYPE_ADDED_TO_UNION, + description: 'Type2 was added to union type UnionType1.', + }, + ]); + }); + + it('should detect if an optional field was added to an input', () => { + const oldSchema = buildSchema(` + input InputType1 { + field1: String + } + `); + + const newSchema = buildSchema(` + input InputType1 { + field1: String + field2: Int + } + `); + + expect(findDangerousChanges(oldSchema, newSchema)).to.deep.equal([ + { + type: DangerousChangeType.OPTIONAL_INPUT_FIELD_ADDED, + description: + 'An optional field field2 on input type InputType1 was added.', + }, + ]); + }); + + it('should find all dangerous changes', () => { + const oldSchema = buildSchema(` + enum EnumType1 { + VALUE0 + VALUE1 + } + + type Type1 { + field1(argThatChangesDefaultValue: String = "test"): String + } + + interface Interface1 + type TypeThatGainsInterface1 + + type TypeInUnion1 + union UnionTypeThatGainsAType = TypeInUnion1 + `); + + const newSchema = buildSchema(` + enum EnumType1 { + VALUE0 + VALUE1 + VALUE2 + } + + type Type1 { + field1(argThatChangesDefaultValue: String = "Test"): String + } + + interface Interface1 + type TypeThatGainsInterface1 implements Interface1 + + type TypeInUnion1 + type TypeInUnion2 + union UnionTypeThatGainsAType = TypeInUnion1 | TypeInUnion2 + `); + + expect(findDangerousChanges(oldSchema, newSchema)).to.deep.equal([ + { + type: DangerousChangeType.VALUE_ADDED_TO_ENUM, + description: 'VALUE2 was added to enum type EnumType1.', + }, + { + type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE, + description: + 'Type1.field1 arg argThatChangesDefaultValue has changed defaultValue from "test" to "Test".', + }, + { + type: DangerousChangeType.IMPLEMENTED_INTERFACE_ADDED, + description: + 'Interface1 added to interfaces implemented by TypeThatGainsInterface1.', + }, + { + type: DangerousChangeType.TYPE_ADDED_TO_UNION, + description: + 'TypeInUnion2 was added to union type UnionTypeThatGainsAType.', + }, + ]); + }); + + it('should detect if an optional field argument was added', () => { + const oldSchema = buildSchema(` + type Type1 { + field1(arg1: String): String + } + `); + + const newSchema = buildSchema(` + type Type1 { + field1(arg1: String, arg2: String): String + } + `); + + expect(findDangerousChanges(oldSchema, newSchema)).to.deep.equal([ + { + type: DangerousChangeType.OPTIONAL_ARG_ADDED, + description: 'An optional arg arg2 on Type1.field1 was added.', + }, + ]); + }); +}); diff --git a/src/utilities/__tests__/getIntrospectionQuery-test.ts b/src/utilities/__tests__/getIntrospectionQuery-test.ts new file mode 100644 index 00000000..e2f5595b --- /dev/null +++ b/src/utilities/__tests__/getIntrospectionQuery-test.ts @@ -0,0 +1,133 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { parse } from '../../language/parser'; + +import { validate } from '../../validation/validate'; + +import { buildSchema } from '../buildASTSchema'; +import type { IntrospectionOptions } from '../getIntrospectionQuery'; +import { getIntrospectionQuery } from '../getIntrospectionQuery'; + +const dummySchema = buildSchema(` + type Query { + dummy: String + } +`); + +function expectIntrospectionQuery(options?: IntrospectionOptions) { + const query = getIntrospectionQuery(options); + + const validationErrors = validate(dummySchema, parse(query)); + expect(validationErrors).to.deep.equal([]); + + return { + toMatch(name: string, times: number = 1): void { + const pattern = toRegExp(name); + + expect(query).to.match(pattern); + expect(query.match(pattern)).to.have.lengthOf(times); + }, + toNotMatch(name: string): void { + expect(query).to.not.match(toRegExp(name)); + }, + }; + + function toRegExp(name: string): RegExp { + return new RegExp('\\b' + name + '\\b', 'g'); + } +} + +describe('getIntrospectionQuery', () => { + it('skip all "description" fields', () => { + expectIntrospectionQuery().toMatch('description', 5); + + expectIntrospectionQuery({ descriptions: true }).toMatch('description', 5); + + expectIntrospectionQuery({ descriptions: false }).toNotMatch('description'); + }); + + it('include "isRepeatable" field on directives', () => { + expectIntrospectionQuery().toNotMatch('isRepeatable'); + + expectIntrospectionQuery({ directiveIsRepeatable: true }).toMatch( + 'isRepeatable', + ); + + expectIntrospectionQuery({ directiveIsRepeatable: false }).toNotMatch( + 'isRepeatable', + ); + }); + + it('include "description" field on schema', () => { + expectIntrospectionQuery().toMatch('description', 5); + + expectIntrospectionQuery({ schemaDescription: false }).toMatch( + 'description', + 5, + ); + expectIntrospectionQuery({ schemaDescription: true }).toMatch( + 'description', + 6, + ); + + expectIntrospectionQuery({ + descriptions: false, + schemaDescription: true, + }).toNotMatch('description'); + }); + + it('include "specifiedBy" field', () => { + expectIntrospectionQuery().toNotMatch('specifiedByURL'); + + expectIntrospectionQuery({ specifiedByUrl: true }).toMatch( + 'specifiedByURL', + ); + + expectIntrospectionQuery({ specifiedByUrl: false }).toNotMatch( + 'specifiedByURL', + ); + }); + + it('include "isDeprecated" field on input values', () => { + expectIntrospectionQuery().toMatch('isDeprecated', 2); + + expectIntrospectionQuery({ inputValueDeprecation: true }).toMatch( + 'isDeprecated', + 3, + ); + + expectIntrospectionQuery({ inputValueDeprecation: false }).toMatch( + 'isDeprecated', + 2, + ); + }); + + it('include "deprecationReason" field on input values', () => { + expectIntrospectionQuery().toMatch('deprecationReason', 2); + + expectIntrospectionQuery({ inputValueDeprecation: true }).toMatch( + 'deprecationReason', + 3, + ); + + expectIntrospectionQuery({ inputValueDeprecation: false }).toMatch( + 'deprecationReason', + 2, + ); + }); + + it('include deprecated input field and args', () => { + expectIntrospectionQuery().toMatch('includeDeprecated: true', 2); + + expectIntrospectionQuery({ inputValueDeprecation: true }).toMatch( + 'includeDeprecated: true', + 5, + ); + + expectIntrospectionQuery({ inputValueDeprecation: false }).toMatch( + 'includeDeprecated: true', + 2, + ); + }); +}); diff --git a/src/utilities/__tests__/getOperationAST-test.ts b/src/utilities/__tests__/getOperationAST-test.ts new file mode 100644 index 00000000..029dd770 --- /dev/null +++ b/src/utilities/__tests__/getOperationAST-test.ts @@ -0,0 +1,68 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { parse } from '../../language/parser'; + +import { getOperationAST } from '../getOperationAST'; + +describe('getOperationAST', () => { + it('Gets an operation from a simple document', () => { + const doc = parse('{ field }'); + expect(getOperationAST(doc)).to.equal(doc.definitions[0]); + }); + + it('Gets an operation from a document with named op (mutation)', () => { + const doc = parse('mutation Test { field }'); + expect(getOperationAST(doc)).to.equal(doc.definitions[0]); + }); + + it('Gets an operation from a document with named op (subscription)', () => { + const doc = parse('subscription Test { field }'); + expect(getOperationAST(doc)).to.equal(doc.definitions[0]); + }); + + it('Does not get missing operation', () => { + const doc = parse('type Foo { field: String }'); + expect(getOperationAST(doc)).to.equal(null); + }); + + it('Does not get ambiguous unnamed operation', () => { + const doc = parse(` + { field } + mutation Test { field } + subscription TestSub { field } + `); + expect(getOperationAST(doc)).to.equal(null); + }); + + it('Does not get ambiguous named operation', () => { + const doc = parse(` + query TestQ { field } + mutation TestM { field } + subscription TestS { field } + `); + expect(getOperationAST(doc)).to.equal(null); + }); + + it('Does not get misnamed operation', () => { + const doc = parse(` + { field } + + query TestQ { field } + mutation TestM { field } + subscription TestS { field } + `); + expect(getOperationAST(doc, 'Unknown')).to.equal(null); + }); + + it('Gets named operation', () => { + const doc = parse(` + query TestQ { field } + mutation TestM { field } + subscription TestS { field } + `); + expect(getOperationAST(doc, 'TestQ')).to.equal(doc.definitions[0]); + expect(getOperationAST(doc, 'TestM')).to.equal(doc.definitions[1]); + expect(getOperationAST(doc, 'TestS')).to.equal(doc.definitions[2]); + }); +}); diff --git a/src/utilities/__tests__/getOperationRootType-test.ts b/src/utilities/__tests__/getOperationRootType-test.ts new file mode 100644 index 00000000..ce683a5a --- /dev/null +++ b/src/utilities/__tests__/getOperationRootType-test.ts @@ -0,0 +1,159 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { invariant } from '../../jsutils/invariant'; + +import type { DocumentNode, OperationDefinitionNode } from '../../language/ast'; +import { Kind } from '../../language/kinds'; +import { parse } from '../../language/parser'; + +import { GraphQLObjectType } from '../../type/definition'; +import { GraphQLString } from '../../type/scalars'; +import { GraphQLSchema } from '../../type/schema'; + +import { getOperationRootType } from '../getOperationRootType'; + +const queryType = new GraphQLObjectType({ + name: 'FooQuery', + fields: () => ({ + field: { type: GraphQLString }, + }), +}); + +const mutationType = new GraphQLObjectType({ + name: 'FooMutation', + fields: () => ({ + field: { type: GraphQLString }, + }), +}); + +const subscriptionType = new GraphQLObjectType({ + name: 'FooSubscription', + fields: () => ({ + field: { type: GraphQLString }, + }), +}); + +function getOperationNode(doc: DocumentNode): OperationDefinitionNode { + const operationNode = doc.definitions[0]; + invariant(operationNode.kind === Kind.OPERATION_DEFINITION); + return operationNode; +} + +describe('Deprecated - getOperationRootType', () => { + it('Gets a Query type for an unnamed OperationDefinitionNode', () => { + const testSchema = new GraphQLSchema({ + query: queryType, + }); + const doc = parse('{ field }'); + const operationNode = getOperationNode(doc); + expect(getOperationRootType(testSchema, operationNode)).to.equal(queryType); + }); + + it('Gets a Query type for an named OperationDefinitionNode', () => { + const testSchema = new GraphQLSchema({ + query: queryType, + }); + + const doc = parse('query Q { field }'); + const operationNode = getOperationNode(doc); + expect(getOperationRootType(testSchema, operationNode)).to.equal(queryType); + }); + + it('Gets a type for OperationTypeDefinitionNodes', () => { + const testSchema = new GraphQLSchema({ + query: queryType, + mutation: mutationType, + subscription: subscriptionType, + }); + + const doc = parse(` + schema { + query: FooQuery + mutation: FooMutation + subscription: FooSubscription + } + `); + + const schemaNode = doc.definitions[0]; + invariant(schemaNode.kind === Kind.SCHEMA_DEFINITION); + const [queryNode, mutationNode, subscriptionNode] = + schemaNode.operationTypes; + + expect(getOperationRootType(testSchema, queryNode)).to.equal(queryType); + expect(getOperationRootType(testSchema, mutationNode)).to.equal( + mutationType, + ); + expect(getOperationRootType(testSchema, subscriptionNode)).to.equal( + subscriptionType, + ); + }); + + it('Gets a Mutation type for an OperationDefinitionNode', () => { + const testSchema = new GraphQLSchema({ + mutation: mutationType, + }); + + const doc = parse('mutation { field }'); + const operationNode = getOperationNode(doc); + expect(getOperationRootType(testSchema, operationNode)).to.equal( + mutationType, + ); + }); + + it('Gets a Subscription type for an OperationDefinitionNode', () => { + const testSchema = new GraphQLSchema({ + subscription: subscriptionType, + }); + + const doc = parse('subscription { field }'); + const operationNode = getOperationNode(doc); + expect(getOperationRootType(testSchema, operationNode)).to.equal( + subscriptionType, + ); + }); + + it('Throws when query type not defined in schema', () => { + const testSchema = new GraphQLSchema({}); + + const doc = parse('query { field }'); + const operationNode = getOperationNode(doc); + expect(() => getOperationRootType(testSchema, operationNode)).to.throw( + 'Schema does not define the required query root type.', + ); + }); + + it('Throws when mutation type not defined in schema', () => { + const testSchema = new GraphQLSchema({}); + + const doc = parse('mutation { field }'); + const operationNode = getOperationNode(doc); + expect(() => getOperationRootType(testSchema, operationNode)).to.throw( + 'Schema is not configured for mutations.', + ); + }); + + it('Throws when subscription type not defined in schema', () => { + const testSchema = new GraphQLSchema({}); + + const doc = parse('subscription { field }'); + const operationNode = getOperationNode(doc); + expect(() => getOperationRootType(testSchema, operationNode)).to.throw( + 'Schema is not configured for subscriptions.', + ); + }); + + it('Throws when operation not a valid operation kind', () => { + const testSchema = new GraphQLSchema({}); + const doc = parse('{ field }'); + const operationNode: OperationDefinitionNode = { + ...getOperationNode(doc), + // @ts-expect-error + operation: 'non_existent_operation', + }; + + expect(() => getOperationRootType(testSchema, operationNode)).to.throw( + 'Can only have query, mutation and subscription operations.', + ); + }); +}); diff --git a/src/utilities/__tests__/introspectionFromSchema-test.ts b/src/utilities/__tests__/introspectionFromSchema-test.ts new file mode 100644 index 00000000..2ba66348 --- /dev/null +++ b/src/utilities/__tests__/introspectionFromSchema-test.ts @@ -0,0 +1,66 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { dedent } from '../../__testUtils__/dedent'; + +import { GraphQLObjectType } from '../../type/definition'; +import { GraphQLString } from '../../type/scalars'; +import { GraphQLSchema } from '../../type/schema'; + +import { buildClientSchema } from '../buildClientSchema'; +import type { IntrospectionQuery } from '../getIntrospectionQuery'; +import { introspectionFromSchema } from '../introspectionFromSchema'; +import { printSchema } from '../printSchema'; + +function introspectionToSDL(introspection: IntrospectionQuery): string { + return printSchema(buildClientSchema(introspection)); +} + +describe('introspectionFromSchema', () => { + const schema = new GraphQLSchema({ + description: 'This is a simple schema', + query: new GraphQLObjectType({ + name: 'Simple', + description: 'This is a simple type', + fields: { + string: { + type: GraphQLString, + description: 'This is a string field', + }, + }, + }), + }); + + it('converts a simple schema', () => { + const introspection = introspectionFromSchema(schema); + + expect(introspectionToSDL(introspection)).to.deep.equal(dedent` + """This is a simple schema""" + schema { + query: Simple + } + + """This is a simple type""" + type Simple { + """This is a string field""" + string: String + } + `); + }); + + it('converts a simple schema without descriptions', () => { + const introspection = introspectionFromSchema(schema, { + descriptions: false, + }); + + expect(introspectionToSDL(introspection)).to.deep.equal(dedent` + schema { + query: Simple + } + + type Simple { + string: String + } + `); + }); +}); diff --git a/src/utilities/__tests__/lexicographicSortSchema-test.ts b/src/utilities/__tests__/lexicographicSortSchema-test.ts new file mode 100644 index 00000000..bce12e3a --- /dev/null +++ b/src/utilities/__tests__/lexicographicSortSchema-test.ts @@ -0,0 +1,359 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { dedent } from '../../__testUtils__/dedent'; + +import { buildSchema } from '../buildASTSchema'; +import { lexicographicSortSchema } from '../lexicographicSortSchema'; +import { printSchema } from '../printSchema'; + +function sortSDL(sdl: string): string { + const schema = buildSchema(sdl); + return printSchema(lexicographicSortSchema(schema)); +} + +describe('lexicographicSortSchema', () => { + it('sort fields', () => { + const sorted = sortSDL(` + input Bar { + barB: String! + barA: String + barC: [String] + } + + interface FooInterface { + fooB: String! + fooA: String + fooC: [String] + } + + type FooType implements FooInterface { + fooC: [String] + fooA: String + fooB: String! + } + + type Query { + dummy(arg: Bar): FooType + } + `); + + expect(sorted).to.equal(dedent` + input Bar { + barA: String + barB: String! + barC: [String] + } + + interface FooInterface { + fooA: String + fooB: String! + fooC: [String] + } + + type FooType implements FooInterface { + fooA: String + fooB: String! + fooC: [String] + } + + type Query { + dummy(arg: Bar): FooType + } + `); + }); + + it('sort implemented interfaces', () => { + const sorted = sortSDL(` + interface FooA { + dummy: String + } + + interface FooB { + dummy: String + } + + interface FooC implements FooB & FooA { + dummy: String + } + + type Query implements FooB & FooA & FooC { + dummy: String + } + `); + + expect(sorted).to.equal(dedent` + interface FooA { + dummy: String + } + + interface FooB { + dummy: String + } + + interface FooC implements FooA & FooB { + dummy: String + } + + type Query implements FooA & FooB & FooC { + dummy: String + } + `); + }); + + it('sort types in union', () => { + const sorted = sortSDL(` + type FooA { + dummy: String + } + + type FooB { + dummy: String + } + + type FooC { + dummy: String + } + + union FooUnion = FooB | FooA | FooC + + type Query { + dummy: FooUnion + } + `); + + expect(sorted).to.equal(dedent` + type FooA { + dummy: String + } + + type FooB { + dummy: String + } + + type FooC { + dummy: String + } + + union FooUnion = FooA | FooB | FooC + + type Query { + dummy: FooUnion + } + `); + }); + + it('sort enum values', () => { + const sorted = sortSDL(` + enum Foo { + B + C + A + } + + type Query { + dummy: Foo + } + `); + + expect(sorted).to.equal(dedent` + enum Foo { + A + B + C + } + + type Query { + dummy: Foo + } + `); + }); + + it('sort field arguments', () => { + const sorted = sortSDL(` + type Query { + dummy(argB: Int!, argA: String, argC: [Float]): ID + } + `); + + expect(sorted).to.equal(dedent` + type Query { + dummy(argA: String, argB: Int!, argC: [Float]): ID + } + `); + }); + + it('sort types', () => { + const sorted = sortSDL(` + type Query { + dummy(arg1: FooF, arg2: FooA, arg3: FooG): FooD + } + + type FooC implements FooE { + dummy: String + } + + enum FooG { + enumValue + } + + scalar FooA + + input FooF { + dummy: String + } + + union FooD = FooC | FooB + + interface FooE { + dummy: String + } + + type FooB { + dummy: String + } + `); + + expect(sorted).to.equal(dedent` + scalar FooA + + type FooB { + dummy: String + } + + type FooC implements FooE { + dummy: String + } + + union FooD = FooB | FooC + + interface FooE { + dummy: String + } + + input FooF { + dummy: String + } + + enum FooG { + enumValue + } + + type Query { + dummy(arg1: FooF, arg2: FooA, arg3: FooG): FooD + } + `); + }); + + it('sort directive arguments', () => { + const sorted = sortSDL(` + directive @test(argC: Float, argA: String, argB: Int) on FIELD + + type Query { + dummy: String + } + `); + + expect(sorted).to.equal(dedent` + directive @test(argA: String, argB: Int, argC: Float) on FIELD + + type Query { + dummy: String + } + `); + }); + + it('sort directive locations', () => { + const sorted = sortSDL(` + directive @test(argC: Float, argA: String, argB: Int) on UNION | FIELD | ENUM + + type Query { + dummy: String + } + `); + + expect(sorted).to.equal(dedent` + directive @test(argA: String, argB: Int, argC: Float) on ENUM | FIELD | UNION + + type Query { + dummy: String + } + `); + }); + + it('sort directives', () => { + const sorted = sortSDL(` + directive @fooC on FIELD + + directive @fooB on UNION + + directive @fooA on ENUM + + type Query { + dummy: String + } + `); + + expect(sorted).to.equal(dedent` + directive @fooA on ENUM + + directive @fooB on UNION + + directive @fooC on FIELD + + type Query { + dummy: String + } + `); + }); + + it('sort recursive types', () => { + const sorted = sortSDL(` + interface FooC { + fooB: FooB + fooA: FooA + fooC: FooC + } + + type FooB implements FooC { + fooB: FooB + fooA: FooA + } + + type FooA implements FooC { + fooB: FooB + fooA: FooA + } + + type Query { + fooC: FooC + fooB: FooB + fooA: FooA + } + `); + + expect(sorted).to.equal(dedent` + type FooA implements FooC { + fooA: FooA + fooB: FooB + } + + type FooB implements FooC { + fooA: FooA + fooB: FooB + } + + interface FooC { + fooA: FooA + fooB: FooB + fooC: FooC + } + + type Query { + fooA: FooA + fooB: FooB + fooC: FooC + } + `); + }); +}); diff --git a/src/utilities/__tests__/printSchema-test.ts b/src/utilities/__tests__/printSchema-test.ts new file mode 100644 index 00000000..84f30fc0 --- /dev/null +++ b/src/utilities/__tests__/printSchema-test.ts @@ -0,0 +1,850 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { dedent, dedentString } from '../../__testUtils__/dedent'; + +import { DirectiveLocation } from '../../language/directiveLocation'; + +import type { GraphQLFieldConfig } from '../../type/definition'; +import { + GraphQLEnumType, + GraphQLInputObjectType, + GraphQLInterfaceType, + GraphQLList, + GraphQLNonNull, + GraphQLObjectType, + GraphQLScalarType, + GraphQLUnionType, +} from '../../type/definition'; +import { GraphQLDirective } from '../../type/directives'; +import { GraphQLBoolean, GraphQLInt, GraphQLString } from '../../type/scalars'; +import { GraphQLSchema } from '../../type/schema'; + +import { buildSchema } from '../buildASTSchema'; +import { printIntrospectionSchema, printSchema } from '../printSchema'; + +function expectPrintedSchema(schema: GraphQLSchema) { + const schemaText = printSchema(schema); + // keep printSchema and buildSchema in sync + expect(printSchema(buildSchema(schemaText))).to.equal(schemaText); + return expect(schemaText); +} + +function buildSingleFieldSchema( + fieldConfig: GraphQLFieldConfig, +) { + const Query = new GraphQLObjectType({ + name: 'Query', + fields: { singleField: fieldConfig }, + }); + return new GraphQLSchema({ query: Query }); +} + +describe('Type System Printer', () => { + it('Prints String Field', () => { + const schema = buildSingleFieldSchema({ type: GraphQLString }); + expectPrintedSchema(schema).to.equal(dedent` + type Query { + singleField: String + } + `); + }); + + it('Prints [String] Field', () => { + const schema = buildSingleFieldSchema({ + type: new GraphQLList(GraphQLString), + }); + + expectPrintedSchema(schema).to.equal(dedent` + type Query { + singleField: [String] + } + `); + }); + + it('Prints String! Field', () => { + const schema = buildSingleFieldSchema({ + type: new GraphQLNonNull(GraphQLString), + }); + + expectPrintedSchema(schema).to.equal(dedent` + type Query { + singleField: String! + } + `); + }); + + it('Prints [String]! Field', () => { + const schema = buildSingleFieldSchema({ + type: new GraphQLNonNull(new GraphQLList(GraphQLString)), + }); + + expectPrintedSchema(schema).to.equal(dedent` + type Query { + singleField: [String]! + } + `); + }); + + it('Prints [String!] Field', () => { + const schema = buildSingleFieldSchema({ + type: new GraphQLList(new GraphQLNonNull(GraphQLString)), + }); + + expectPrintedSchema(schema).to.equal(dedent` + type Query { + singleField: [String!] + } + `); + }); + + it('Prints [String!]! Field', () => { + const schema = buildSingleFieldSchema({ + type: new GraphQLNonNull( + new GraphQLList(new GraphQLNonNull(GraphQLString)), + ), + }); + + expectPrintedSchema(schema).to.equal(dedent` + type Query { + singleField: [String!]! + } + `); + }); + + it('Print Object Field', () => { + const FooType = new GraphQLObjectType({ + name: 'Foo', + fields: { str: { type: GraphQLString } }, + }); + const schema = new GraphQLSchema({ types: [FooType] }); + + expectPrintedSchema(schema).to.equal(dedent` + type Foo { + str: String + } + `); + }); + + it('Prints String Field With Int Arg', () => { + const schema = buildSingleFieldSchema({ + type: GraphQLString, + args: { argOne: { type: GraphQLInt } }, + }); + + expectPrintedSchema(schema).to.equal(dedent` + type Query { + singleField(argOne: Int): String + } + `); + }); + + it('Prints String Field With Int Arg With Default', () => { + const schema = buildSingleFieldSchema({ + type: GraphQLString, + args: { argOne: { type: GraphQLInt, defaultValue: 2 } }, + }); + + expectPrintedSchema(schema).to.equal(dedent` + type Query { + singleField(argOne: Int = 2): String + } + `); + }); + + it('Prints String Field With String Arg With Default', () => { + const schema = buildSingleFieldSchema({ + type: GraphQLString, + args: { argOne: { type: GraphQLString, defaultValue: 'tes\t de\fault' } }, + }); + + expectPrintedSchema(schema).to.equal( + dedentString(String.raw` + type Query { + singleField(argOne: String = "tes\t de\fault"): String + } + `), + ); + }); + + it('Prints String Field With Int Arg With Default Null', () => { + const schema = buildSingleFieldSchema({ + type: GraphQLString, + args: { argOne: { type: GraphQLInt, defaultValue: null } }, + }); + + expectPrintedSchema(schema).to.equal(dedent` + type Query { + singleField(argOne: Int = null): String + } + `); + }); + + it('Prints String Field With Int! Arg', () => { + const schema = buildSingleFieldSchema({ + type: GraphQLString, + args: { argOne: { type: new GraphQLNonNull(GraphQLInt) } }, + }); + + expectPrintedSchema(schema).to.equal(dedent` + type Query { + singleField(argOne: Int!): String + } + `); + }); + + it('Prints String Field With Multiple Args', () => { + const schema = buildSingleFieldSchema({ + type: GraphQLString, + args: { + argOne: { type: GraphQLInt }, + argTwo: { type: GraphQLString }, + }, + }); + + expectPrintedSchema(schema).to.equal(dedent` + type Query { + singleField(argOne: Int, argTwo: String): String + } + `); + }); + + it('Prints String Field With Multiple Args, First is Default', () => { + const schema = buildSingleFieldSchema({ + type: GraphQLString, + args: { + argOne: { type: GraphQLInt, defaultValue: 1 }, + argTwo: { type: GraphQLString }, + argThree: { type: GraphQLBoolean }, + }, + }); + + expectPrintedSchema(schema).to.equal(dedent` + type Query { + singleField(argOne: Int = 1, argTwo: String, argThree: Boolean): String + } + `); + }); + + it('Prints String Field With Multiple Args, Second is Default', () => { + const schema = buildSingleFieldSchema({ + type: GraphQLString, + args: { + argOne: { type: GraphQLInt }, + argTwo: { type: GraphQLString, defaultValue: 'foo' }, + argThree: { type: GraphQLBoolean }, + }, + }); + + expectPrintedSchema(schema).to.equal(dedent` + type Query { + singleField(argOne: Int, argTwo: String = "foo", argThree: Boolean): String + } + `); + }); + + it('Prints String Field With Multiple Args, Last is Default', () => { + const schema = buildSingleFieldSchema({ + type: GraphQLString, + args: { + argOne: { type: GraphQLInt }, + argTwo: { type: GraphQLString }, + argThree: { type: GraphQLBoolean, defaultValue: false }, + }, + }); + + expectPrintedSchema(schema).to.equal(dedent` + type Query { + singleField(argOne: Int, argTwo: String, argThree: Boolean = false): String + } + `); + }); + + it('Prints schema with description', () => { + const schema = new GraphQLSchema({ + description: 'Schema description.', + query: new GraphQLObjectType({ name: 'Query', fields: {} }), + }); + + expectPrintedSchema(schema).to.equal(dedent` + """Schema description.""" + schema { + query: Query + } + + type Query + `); + }); + + it('Prints custom query root types', () => { + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ name: 'CustomType', fields: {} }), + }); + + expectPrintedSchema(schema).to.equal(dedent` + schema { + query: CustomType + } + + type CustomType + `); + }); + + it('Prints custom mutation root types', () => { + const schema = new GraphQLSchema({ + mutation: new GraphQLObjectType({ name: 'CustomType', fields: {} }), + }); + + expectPrintedSchema(schema).to.equal(dedent` + schema { + mutation: CustomType + } + + type CustomType + `); + }); + + it('Prints custom subscription root types', () => { + const schema = new GraphQLSchema({ + subscription: new GraphQLObjectType({ name: 'CustomType', fields: {} }), + }); + + expectPrintedSchema(schema).to.equal(dedent` + schema { + subscription: CustomType + } + + type CustomType + `); + }); + + it('Print Interface', () => { + const FooType = new GraphQLInterfaceType({ + name: 'Foo', + fields: { str: { type: GraphQLString } }, + }); + + const BarType = new GraphQLObjectType({ + name: 'Bar', + fields: { str: { type: GraphQLString } }, + interfaces: [FooType], + }); + + const schema = new GraphQLSchema({ types: [BarType] }); + expectPrintedSchema(schema).to.equal(dedent` + type Bar implements Foo { + str: String + } + + interface Foo { + str: String + } + `); + }); + + it('Print Multiple Interface', () => { + const FooType = new GraphQLInterfaceType({ + name: 'Foo', + fields: { str: { type: GraphQLString } }, + }); + + const BazType = new GraphQLInterfaceType({ + name: 'Baz', + fields: { int: { type: GraphQLInt } }, + }); + + const BarType = new GraphQLObjectType({ + name: 'Bar', + fields: { + str: { type: GraphQLString }, + int: { type: GraphQLInt }, + }, + interfaces: [FooType, BazType], + }); + + const schema = new GraphQLSchema({ types: [BarType] }); + expectPrintedSchema(schema).to.equal(dedent` + type Bar implements Foo & Baz { + str: String + int: Int + } + + interface Foo { + str: String + } + + interface Baz { + int: Int + } + `); + }); + + it('Print Hierarchical Interface', () => { + const FooType = new GraphQLInterfaceType({ + name: 'Foo', + fields: { str: { type: GraphQLString } }, + }); + + const BazType = new GraphQLInterfaceType({ + name: 'Baz', + interfaces: [FooType], + fields: { + int: { type: GraphQLInt }, + str: { type: GraphQLString }, + }, + }); + + const BarType = new GraphQLObjectType({ + name: 'Bar', + fields: { + str: { type: GraphQLString }, + int: { type: GraphQLInt }, + }, + interfaces: [FooType, BazType], + }); + + const Query = new GraphQLObjectType({ + name: 'Query', + fields: { bar: { type: BarType } }, + }); + + const schema = new GraphQLSchema({ query: Query, types: [BarType] }); + expectPrintedSchema(schema).to.equal(dedent` + type Bar implements Foo & Baz { + str: String + int: Int + } + + interface Foo { + str: String + } + + interface Baz implements Foo { + int: Int + str: String + } + + type Query { + bar: Bar + } + `); + }); + + it('Print Unions', () => { + const FooType = new GraphQLObjectType({ + name: 'Foo', + fields: { + bool: { type: GraphQLBoolean }, + }, + }); + + const BarType = new GraphQLObjectType({ + name: 'Bar', + fields: { + str: { type: GraphQLString }, + }, + }); + + const SingleUnion = new GraphQLUnionType({ + name: 'SingleUnion', + types: [FooType], + }); + + const MultipleUnion = new GraphQLUnionType({ + name: 'MultipleUnion', + types: [FooType, BarType], + }); + + const schema = new GraphQLSchema({ types: [SingleUnion, MultipleUnion] }); + expectPrintedSchema(schema).to.equal(dedent` + union SingleUnion = Foo + + type Foo { + bool: Boolean + } + + union MultipleUnion = Foo | Bar + + type Bar { + str: String + } + `); + }); + + it('Print Input Type', () => { + const InputType = new GraphQLInputObjectType({ + name: 'InputType', + fields: { + int: { type: GraphQLInt }, + }, + }); + + const schema = new GraphQLSchema({ types: [InputType] }); + expectPrintedSchema(schema).to.equal(dedent` + input InputType { + int: Int + } + `); + }); + + it('Custom Scalar', () => { + const OddType = new GraphQLScalarType({ name: 'Odd' }); + + const schema = new GraphQLSchema({ types: [OddType] }); + expectPrintedSchema(schema).to.equal(dedent` + scalar Odd + `); + }); + + it('Custom Scalar with specifiedByURL', () => { + const FooType = new GraphQLScalarType({ + name: 'Foo', + specifiedByURL: 'https://example.com/foo_spec', + }); + + const schema = new GraphQLSchema({ types: [FooType] }); + expectPrintedSchema(schema).to.equal(dedent` + scalar Foo @specifiedBy(url: "https://example.com/foo_spec") + `); + }); + + it('Enum', () => { + const RGBType = new GraphQLEnumType({ + name: 'RGB', + values: { + RED: {}, + GREEN: {}, + BLUE: {}, + }, + }); + + const schema = new GraphQLSchema({ types: [RGBType] }); + expectPrintedSchema(schema).to.equal(dedent` + enum RGB { + RED + GREEN + BLUE + } + `); + }); + + it('Prints empty types', () => { + const schema = new GraphQLSchema({ + types: [ + new GraphQLEnumType({ name: 'SomeEnum', values: {} }), + new GraphQLInputObjectType({ name: 'SomeInputObject', fields: {} }), + new GraphQLInterfaceType({ name: 'SomeInterface', fields: {} }), + new GraphQLObjectType({ name: 'SomeObject', fields: {} }), + new GraphQLUnionType({ name: 'SomeUnion', types: [] }), + ], + }); + + expectPrintedSchema(schema).to.equal(dedent` + enum SomeEnum + + input SomeInputObject + + interface SomeInterface + + type SomeObject + + union SomeUnion + `); + }); + + it('Prints custom directives', () => { + const SimpleDirective = new GraphQLDirective({ + name: 'simpleDirective', + locations: [DirectiveLocation.FIELD], + }); + const ComplexDirective = new GraphQLDirective({ + name: 'complexDirective', + description: 'Complex Directive', + args: { + stringArg: { type: GraphQLString }, + intArg: { type: GraphQLInt, defaultValue: -1 }, + }, + isRepeatable: true, + locations: [DirectiveLocation.FIELD, DirectiveLocation.QUERY], + }); + + const schema = new GraphQLSchema({ + directives: [SimpleDirective, ComplexDirective], + }); + expectPrintedSchema(schema).to.equal(dedent` + directive @simpleDirective on FIELD + + """Complex Directive""" + directive @complexDirective(stringArg: String, intArg: Int = -1) repeatable on FIELD | QUERY + `); + }); + + it('Prints an empty description', () => { + const schema = buildSingleFieldSchema({ + type: GraphQLString, + description: '', + }); + + expectPrintedSchema(schema).to.equal(dedent` + type Query { + """""" + singleField: String + } + `); + }); + + it('Prints an description with only whitespace', () => { + const schema = buildSingleFieldSchema({ + type: GraphQLString, + description: ' ', + }); + + expectPrintedSchema(schema).to.equal(dedent` + type Query { + " " + singleField: String + } + `); + }); + + it('One-line prints a short description', () => { + const schema = buildSingleFieldSchema({ + type: GraphQLString, + description: 'This field is awesome', + }); + + expectPrintedSchema(schema).to.equal(dedent` + type Query { + """This field is awesome""" + singleField: String + } + `); + }); + + it('Print Introspection Schema', () => { + const schema = new GraphQLSchema({}); + const output = printIntrospectionSchema(schema); + + expect(output).to.equal(dedent` + """ + Directs the executor to include this field or fragment only when the \`if\` argument is true. + """ + directive @include( + """Included when true.""" + if: Boolean! + ) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT + + """ + Directs the executor to skip this field or fragment when the \`if\` argument is true. + """ + directive @skip( + """Skipped when true.""" + if: Boolean! + ) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT + + """Marks an element of a GraphQL schema as no longer supported.""" + directive @deprecated( + """ + Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/). + """ + reason: String = "No longer supported" + ) on FIELD_DEFINITION | ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION | ENUM_VALUE + + """Exposes a URL that specifies the behavior of this scalar.""" + directive @specifiedBy( + """The URL that specifies the behavior of this scalar.""" + url: String! + ) on SCALAR + + """ + A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations. + """ + type __Schema { + description: String + + """A list of all types supported by this server.""" + types: [__Type!]! + + """The type that query operations will be rooted at.""" + queryType: __Type! + + """ + If this server supports mutation, the type that mutation operations will be rooted at. + """ + mutationType: __Type + + """ + If this server support subscription, the type that subscription operations will be rooted at. + """ + subscriptionType: __Type + + """A list of all directives supported by this server.""" + directives: [__Directive!]! + } + + """ + The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the \`__TypeKind\` enum. + + Depending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional \`specifiedByURL\`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types. + """ + type __Type { + kind: __TypeKind! + name: String + description: String + specifiedByURL: String + fields(includeDeprecated: Boolean = false): [__Field!] + interfaces: [__Type!] + possibleTypes: [__Type!] + enumValues(includeDeprecated: Boolean = false): [__EnumValue!] + inputFields(includeDeprecated: Boolean = false): [__InputValue!] + ofType: __Type + } + + """An enum describing what kind of type a given \`__Type\` is.""" + enum __TypeKind { + """Indicates this type is a scalar.""" + SCALAR + + """ + Indicates this type is an object. \`fields\` and \`interfaces\` are valid fields. + """ + OBJECT + + """ + Indicates this type is an interface. \`fields\`, \`interfaces\`, and \`possibleTypes\` are valid fields. + """ + INTERFACE + + """Indicates this type is a union. \`possibleTypes\` is a valid field.""" + UNION + + """Indicates this type is an enum. \`enumValues\` is a valid field.""" + ENUM + + """ + Indicates this type is an input object. \`inputFields\` is a valid field. + """ + INPUT_OBJECT + + """Indicates this type is a list. \`ofType\` is a valid field.""" + LIST + + """Indicates this type is a non-null. \`ofType\` is a valid field.""" + NON_NULL + } + + """ + Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type. + """ + type __Field { + name: String! + description: String + args(includeDeprecated: Boolean = false): [__InputValue!]! + type: __Type! + isDeprecated: Boolean! + deprecationReason: String + } + + """ + Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value. + """ + type __InputValue { + name: String! + description: String + type: __Type! + + """ + A GraphQL-formatted string representing the default value for this input value. + """ + defaultValue: String + isDeprecated: Boolean! + deprecationReason: String + } + + """ + One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string. + """ + type __EnumValue { + name: String! + description: String + isDeprecated: Boolean! + deprecationReason: String + } + + """ + A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document. + + In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor. + """ + type __Directive { + name: String! + description: String + isRepeatable: Boolean! + locations: [__DirectiveLocation!]! + args(includeDeprecated: Boolean = false): [__InputValue!]! + } + + """ + A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies. + """ + enum __DirectiveLocation { + """Location adjacent to a query operation.""" + QUERY + + """Location adjacent to a mutation operation.""" + MUTATION + + """Location adjacent to a subscription operation.""" + SUBSCRIPTION + + """Location adjacent to a field.""" + FIELD + + """Location adjacent to a fragment definition.""" + FRAGMENT_DEFINITION + + """Location adjacent to a fragment spread.""" + FRAGMENT_SPREAD + + """Location adjacent to an inline fragment.""" + INLINE_FRAGMENT + + """Location adjacent to a variable definition.""" + VARIABLE_DEFINITION + + """Location adjacent to a schema definition.""" + SCHEMA + + """Location adjacent to a scalar definition.""" + SCALAR + + """Location adjacent to an object type definition.""" + OBJECT + + """Location adjacent to a field definition.""" + FIELD_DEFINITION + + """Location adjacent to an argument definition.""" + ARGUMENT_DEFINITION + + """Location adjacent to an interface definition.""" + INTERFACE + + """Location adjacent to a union definition.""" + UNION + + """Location adjacent to an enum definition.""" + ENUM + + """Location adjacent to an enum value definition.""" + ENUM_VALUE + + """Location adjacent to an input object type definition.""" + INPUT_OBJECT + + """Location adjacent to an input object field definition.""" + INPUT_FIELD_DEFINITION + } + `); + }); +}); diff --git a/src/utilities/__tests__/separateOperations-test.ts b/src/utilities/__tests__/separateOperations-test.ts new file mode 100644 index 00000000..2f14bae9 --- /dev/null +++ b/src/utilities/__tests__/separateOperations-test.ts @@ -0,0 +1,258 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { dedent } from '../../__testUtils__/dedent'; + +import { mapValue } from '../../jsutils/mapValue'; + +import { parse } from '../../language/parser'; +import { print } from '../../language/printer'; + +import { separateOperations } from '../separateOperations'; + +describe('separateOperations', () => { + it('separates one AST into multiple, maintaining document order', () => { + const ast = parse(` + { + ...Y + ...X + } + + query One { + foo + bar + ...A + ...X + } + + fragment A on T { + field + ...B + } + + fragment X on T { + fieldX + } + + query Two { + ...A + ...Y + baz + } + + fragment Y on T { + fieldY + } + + fragment B on T { + something + } + `); + + const separatedASTs = mapValue(separateOperations(ast), print); + expect(separatedASTs).to.deep.equal({ + '': dedent` + { + ...Y + ...X + } + + fragment X on T { + fieldX + } + + fragment Y on T { + fieldY + } + `, + One: dedent` + query One { + foo + bar + ...A + ...X + } + + fragment A on T { + field + ...B + } + + fragment X on T { + fieldX + } + + fragment B on T { + something + } + `, + Two: dedent` + fragment A on T { + field + ...B + } + + query Two { + ...A + ...Y + baz + } + + fragment Y on T { + fieldY + } + + fragment B on T { + something + } + `, + }); + }); + + it('survives circular dependencies', () => { + const ast = parse(` + query One { + ...A + } + + fragment A on T { + ...B + } + + fragment B on T { + ...A + } + + query Two { + ...B + } + `); + + const separatedASTs = mapValue(separateOperations(ast), print); + expect(separatedASTs).to.deep.equal({ + One: dedent` + query One { + ...A + } + + fragment A on T { + ...B + } + + fragment B on T { + ...A + } + `, + Two: dedent` + fragment A on T { + ...B + } + + fragment B on T { + ...A + } + + query Two { + ...B + } + `, + }); + }); + + it('distinguish query and fragment names', () => { + const ast = parse(` + { + ...NameClash + } + + fragment NameClash on T { + oneField + } + + query NameClash { + ...ShouldBeSkippedInFirstQuery + } + + fragment ShouldBeSkippedInFirstQuery on T { + twoField + } + `); + + const separatedASTs = mapValue(separateOperations(ast), print); + expect(separatedASTs).to.deep.equal({ + '': dedent` + { + ...NameClash + } + + fragment NameClash on T { + oneField + } + `, + NameClash: dedent` + query NameClash { + ...ShouldBeSkippedInFirstQuery + } + + fragment ShouldBeSkippedInFirstQuery on T { + twoField + } + `, + }); + }); + + it('ignores type definitions', () => { + const ast = parse(` + query Foo { + ...Bar + } + + fragment Bar on T { + baz + } + + scalar Foo + type Bar + `); + + const separatedASTs = mapValue(separateOperations(ast), print); + expect(separatedASTs).to.deep.equal({ + Foo: dedent` + query Foo { + ...Bar + } + + fragment Bar on T { + baz + } + `, + }); + }); + + it('handles unknown fragments', () => { + const ast = parse(` + { + ...Unknown + ...Known + } + + fragment Known on T { + someField + } + `); + + const separatedASTs = mapValue(separateOperations(ast), print); + expect(separatedASTs).to.deep.equal({ + '': dedent` + { + ...Unknown + ...Known + } + + fragment Known on T { + someField + } + `, + }); + }); +}); diff --git a/src/utilities/__tests__/stripIgnoredCharacters-fuzz.ts b/src/utilities/__tests__/stripIgnoredCharacters-fuzz.ts new file mode 100644 index 00000000..29a22ed8 --- /dev/null +++ b/src/utilities/__tests__/stripIgnoredCharacters-fuzz.ts @@ -0,0 +1,51 @@ +import { describe, it } from 'mocha'; + +import { dedent } from '../../__testUtils__/dedent'; +import { genFuzzStrings } from '../../__testUtils__/genFuzzStrings'; +import { inspectStr } from '../../__testUtils__/inspectStr'; + +import { invariant } from '../../jsutils/invariant'; + +import { Lexer } from '../../language/lexer'; +import { Source } from '../../language/source'; + +import { stripIgnoredCharacters } from '../stripIgnoredCharacters'; + +function lexValue(str: string) { + const lexer = new Lexer(new Source(str)); + const value = lexer.advance().value; + + invariant(lexer.advance().kind === '', 'Expected EOF'); + return value; +} + +describe('stripIgnoredCharacters', () => { + it('strips ignored characters inside random block strings', () => { + // Testing with length >7 is taking exponentially more time. However it is + // highly recommended to test with increased limit if you make any change. + for (const fuzzStr of genFuzzStrings({ + allowedChars: ['\n', '\t', ' ', '"', 'a', '\\'], + maxLength: 7, + })) { + const testStr = '"""' + fuzzStr + '"""'; + + let testValue; + try { + testValue = lexValue(testStr); + } catch (e) { + continue; // skip invalid values + } + + const strippedValue = lexValue(stripIgnoredCharacters(testStr)); + + invariant( + testValue === strippedValue, + dedent` + Expected lexValue(stripIgnoredCharacters(${inspectStr(testStr)})) + to equal ${inspectStr(testValue)} + but got ${inspectStr(strippedValue)} + `, + ); + } + }).timeout(20000); +}); diff --git a/src/utilities/__tests__/stripIgnoredCharacters-test.ts b/src/utilities/__tests__/stripIgnoredCharacters-test.ts new file mode 100644 index 00000000..4115742f --- /dev/null +++ b/src/utilities/__tests__/stripIgnoredCharacters-test.ts @@ -0,0 +1,446 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { dedent } from '../../__testUtils__/dedent'; +import { inspectStr } from '../../__testUtils__/inspectStr'; +import { kitchenSinkQuery } from '../../__testUtils__/kitchenSinkQuery'; +import { kitchenSinkSDL } from '../../__testUtils__/kitchenSinkSDL'; + +import { invariant } from '../../jsutils/invariant'; +import type { Maybe } from '../../jsutils/Maybe'; + +import { Lexer } from '../../language/lexer'; +import { parse } from '../../language/parser'; +import { Source } from '../../language/source'; + +import { stripIgnoredCharacters } from '../stripIgnoredCharacters'; + +const ignoredTokens = [ + // UnicodeBOM :: + '\uFEFF', // Byte Order Mark (U+FEFF) + + // WhiteSpace :: + '\t', // Horizontal Tab (U+0009) + ' ', // Space (U+0020) + + // LineTerminator :: + '\n', // "New Line (U+000A)" + '\r', // "Carriage Return (U+000D)" [ lookahead ! "New Line (U+000A)" ] + '\r\n', // "Carriage Return (U+000D)" "New Line (U+000A)" + + // Comment :: + '# "Comment" string\n', // `#` CommentChar* + + // Comma :: + ',', // , +]; + +const punctuatorTokens = [ + '!', + '$', + '(', + ')', + '...', + ':', + '=', + '@', + '[', + ']', + '{', + '|', + '}', +]; + +const nonPunctuatorTokens = [ + 'name_token', // Name + '1', // IntValue + '3.14', // FloatValue + '"some string value"', // StringValue + '"""block\nstring\nvalue"""', // StringValue(BlockString) +]; + +function lexValue(str: string): Maybe { + const lexer = new Lexer(new Source(str)); + const value = lexer.advance().value; + + invariant(lexer.advance().kind === '', 'Expected EOF'); + return value; +} + +function expectStripped(docString: string) { + return { + toEqual(expected: string): void { + const stripped = stripIgnoredCharacters(docString); + + invariant( + stripped === expected, + dedent` + Expected stripIgnoredCharacters(${inspectStr(docString)}) + to equal ${inspectStr(expected)} + but got ${inspectStr(stripped)} + `, + ); + + const strippedTwice = stripIgnoredCharacters(stripped); + + invariant( + stripped === strippedTwice, + dedent` + Expected stripIgnoredCharacters(${inspectStr(stripped)}) + to equal ${inspectStr(stripped)} + but got ${inspectStr(strippedTwice)} + `, + ); + }, + toStayTheSame(): void { + this.toEqual(docString); + }, + }; +} + +describe('stripIgnoredCharacters', () => { + it('strips ignored characters from GraphQL query document', () => { + const query = dedent` + query SomeQuery($foo: String!, $bar: String) { + someField(foo: $foo, bar: $bar) { + a + b { + c + d + } + } + } + `; + + expect(stripIgnoredCharacters(query)).to.equal( + 'query SomeQuery($foo:String!$bar:String){someField(foo:$foo bar:$bar){a b{c d}}}', + ); + }); + + it('accepts Source object', () => { + expect(stripIgnoredCharacters(new Source('{ a }'))).to.equal('{a}'); + }); + + it('strips ignored characters from GraphQL SDL document', () => { + const sdl = dedent` + """ + Type description + """ + type Foo { + """ + Field description + """ + bar: String + } + `; + + expect(stripIgnoredCharacters(sdl)).to.equal( + '"""Type description""" type Foo{"""Field description""" bar:String}', + ); + }); + + it('report document with invalid token', () => { + let caughtError; + + try { + stripIgnoredCharacters('{ foo(arg: "\n"'); + } catch (e) { + caughtError = e; + } + + expect(String(caughtError)).to.equal(dedent` + Syntax Error: Unterminated string. + + GraphQL request:1:13 + 1 | { foo(arg: " + | ^ + 2 | " + `); + }); + + it('strips non-parsable document', () => { + expectStripped('{ foo(arg: "str"').toEqual('{foo(arg:"str"'); + }); + + it('strips documents with only ignored characters', () => { + expectStripped('\n').toEqual(''); + expectStripped(',').toEqual(''); + expectStripped(',,').toEqual(''); + expectStripped('#comment\n, \n').toEqual(''); + + for (const ignored of ignoredTokens) { + expectStripped(ignored).toEqual(''); + + for (const anotherIgnored of ignoredTokens) { + expectStripped(ignored + anotherIgnored).toEqual(''); + } + } + + expectStripped(ignoredTokens.join('')).toEqual(''); + }); + + it('strips leading and trailing ignored tokens', () => { + expectStripped('\n1').toEqual('1'); + expectStripped(',1').toEqual('1'); + expectStripped(',,1').toEqual('1'); + expectStripped('#comment\n, \n1').toEqual('1'); + + expectStripped('1\n').toEqual('1'); + expectStripped('1,').toEqual('1'); + expectStripped('1,,').toEqual('1'); + expectStripped('1#comment\n, \n').toEqual('1'); + + for (const token of [...punctuatorTokens, ...nonPunctuatorTokens]) { + for (const ignored of ignoredTokens) { + expectStripped(ignored + token).toEqual(token); + expectStripped(token + ignored).toEqual(token); + + for (const anotherIgnored of ignoredTokens) { + expectStripped(token + ignored + ignored).toEqual(token); + expectStripped(ignored + anotherIgnored + token).toEqual(token); + } + } + + expectStripped(ignoredTokens.join('') + token).toEqual(token); + expectStripped(token + ignoredTokens.join('')).toEqual(token); + } + }); + + it('strips ignored tokens between punctuator tokens', () => { + expectStripped('[,)').toEqual('[)'); + expectStripped('[\r)').toEqual('[)'); + expectStripped('[\r\r)').toEqual('[)'); + expectStripped('[\r,)').toEqual('[)'); + expectStripped('[,\n)').toEqual('[)'); + + for (const left of punctuatorTokens) { + for (const right of punctuatorTokens) { + for (const ignored of ignoredTokens) { + expectStripped(left + ignored + right).toEqual(left + right); + + for (const anotherIgnored of ignoredTokens) { + expectStripped(left + ignored + anotherIgnored + right).toEqual( + left + right, + ); + } + } + + expectStripped(left + ignoredTokens.join('') + right).toEqual( + left + right, + ); + } + } + }); + + it('strips ignored tokens between punctuator and non-punctuator tokens', () => { + expectStripped('[,1').toEqual('[1'); + expectStripped('[\r1').toEqual('[1'); + expectStripped('[\r\r1').toEqual('[1'); + expectStripped('[\r,1').toEqual('[1'); + expectStripped('[,\n1').toEqual('[1'); + + for (const nonPunctuator of nonPunctuatorTokens) { + for (const punctuator of punctuatorTokens) { + for (const ignored of ignoredTokens) { + expectStripped(punctuator + ignored + nonPunctuator).toEqual( + punctuator + nonPunctuator, + ); + + for (const anotherIgnored of ignoredTokens) { + expectStripped( + punctuator + ignored + anotherIgnored + nonPunctuator, + ).toEqual(punctuator + nonPunctuator); + } + } + + expectStripped( + punctuator + ignoredTokens.join('') + nonPunctuator, + ).toEqual(punctuator + nonPunctuator); + } + } + }); + + it('strips ignored tokens between non-punctuator and punctuator tokens', () => { + expectStripped('1,[').toEqual('1['); + expectStripped('1\r[').toEqual('1['); + expectStripped('1\r\r[').toEqual('1['); + expectStripped('1\r,[').toEqual('1['); + expectStripped('1,\n[').toEqual('1['); + + for (const nonPunctuator of nonPunctuatorTokens) { + for (const punctuator of punctuatorTokens) { + // Special case for that is handled in the below test + if (punctuator === '...') { + continue; + } + + for (const ignored of ignoredTokens) { + expectStripped(nonPunctuator + ignored + punctuator).toEqual( + nonPunctuator + punctuator, + ); + + for (const anotherIgnored of ignoredTokens) { + expectStripped( + nonPunctuator + ignored + anotherIgnored + punctuator, + ).toEqual(nonPunctuator + punctuator); + } + } + + expectStripped( + nonPunctuator + ignoredTokens.join('') + punctuator, + ).toEqual(nonPunctuator + punctuator); + } + } + }); + + it('replace ignored tokens between non-punctuator tokens and spread with space', () => { + expectStripped('a ...').toEqual('a ...'); + expectStripped('1 ...').toEqual('1 ...'); + expectStripped('1 ... ...').toEqual('1 ......'); + + for (const nonPunctuator of nonPunctuatorTokens) { + for (const ignored of ignoredTokens) { + expectStripped(nonPunctuator + ignored + '...').toEqual( + nonPunctuator + ' ...', + ); + + for (const anotherIgnored of ignoredTokens) { + expectStripped( + nonPunctuator + ignored + anotherIgnored + ' ...', + ).toEqual(nonPunctuator + ' ...'); + } + } + + expectStripped(nonPunctuator + ignoredTokens.join('') + '...').toEqual( + nonPunctuator + ' ...', + ); + } + }); + + it('replace ignored tokens between non-punctuator tokens with space', () => { + expectStripped('1 2').toStayTheSame(); + expectStripped('"" ""').toStayTheSame(); + expectStripped('a b').toStayTheSame(); + + expectStripped('a,1').toEqual('a 1'); + expectStripped('a,,1').toEqual('a 1'); + expectStripped('a 1').toEqual('a 1'); + expectStripped('a \t 1').toEqual('a 1'); + + for (const left of nonPunctuatorTokens) { + for (const right of nonPunctuatorTokens) { + for (const ignored of ignoredTokens) { + expectStripped(left + ignored + right).toEqual(left + ' ' + right); + + for (const anotherIgnored of ignoredTokens) { + expectStripped(left + ignored + anotherIgnored + right).toEqual( + left + ' ' + right, + ); + } + } + + expectStripped(left + ignoredTokens.join('') + right).toEqual( + left + ' ' + right, + ); + } + } + }); + + it('does not strip ignored tokens embedded in the string', () => { + expectStripped('" "').toStayTheSame(); + expectStripped('","').toStayTheSame(); + expectStripped('",,"').toStayTheSame(); + expectStripped('",|"').toStayTheSame(); + + for (const ignored of ignoredTokens) { + expectStripped(JSON.stringify(ignored)).toStayTheSame(); + + for (const anotherIgnored of ignoredTokens) { + expectStripped( + JSON.stringify(ignored + anotherIgnored), + ).toStayTheSame(); + } + } + + expectStripped(JSON.stringify(ignoredTokens.join(''))).toStayTheSame(); + }); + + it('does not strip ignored tokens embedded in the block string', () => { + expectStripped('""","""').toStayTheSame(); + expectStripped('""",,"""').toStayTheSame(); + expectStripped('""",|"""').toStayTheSame(); + + const ignoredTokensWithoutFormatting = ignoredTokens.filter( + (token) => !['\n', '\r', '\r\n', '\t', ' '].includes(token), + ); + for (const ignored of ignoredTokensWithoutFormatting) { + expectStripped('"""|' + ignored + '|"""').toStayTheSame(); + + for (const anotherIgnored of ignoredTokensWithoutFormatting) { + expectStripped( + '"""|' + ignored + anotherIgnored + '|"""', + ).toStayTheSame(); + } + } + + expectStripped( + '"""|' + ignoredTokensWithoutFormatting.join('') + '|"""', + ).toStayTheSame(); + }); + + it('strips ignored characters inside block strings', () => { + function expectStrippedString(blockStr: string) { + const originalValue = lexValue(blockStr); + const strippedValue = lexValue(stripIgnoredCharacters(blockStr)); + + invariant( + originalValue === strippedValue, + dedent` + Expected lexValue(stripIgnoredCharacters(${inspectStr(blockStr)})) + to equal ${inspectStr(originalValue)} + but got ${inspectStr(strippedValue)} + `, + ); + return expectStripped(blockStr); + } + + expectStrippedString('""""""').toStayTheSame(); + expectStrippedString('""" """').toEqual('""""""'); + + expectStrippedString('"""a"""').toStayTheSame(); + expectStrippedString('""" a"""').toEqual('""" a"""'); + expectStrippedString('""" a """').toEqual('""" a """'); + + expectStrippedString('"""\n"""').toEqual('""""""'); + expectStrippedString('"""a\nb"""').toEqual('"""a\nb"""'); + expectStrippedString('"""a\rb"""').toEqual('"""a\nb"""'); + expectStrippedString('"""a\r\nb"""').toEqual('"""a\nb"""'); + expectStrippedString('"""a\r\n\nb"""').toEqual('"""a\n\nb"""'); + + expectStrippedString('"""\\\n"""').toStayTheSame(); + expectStrippedString('""""\n"""').toStayTheSame(); + expectStrippedString('"""\\"""\n"""').toEqual('"""\\""""""'); + + expectStrippedString('"""\na\n b"""').toStayTheSame(); + expectStrippedString('"""\n a\n b"""').toEqual('"""a\nb"""'); + expectStrippedString('"""\na\n b\nc"""').toEqual('"""a\n b\nc"""'); + }); + + it('strips kitchen sink query but maintains the exact same AST', () => { + const strippedQuery = stripIgnoredCharacters(kitchenSinkQuery); + expect(stripIgnoredCharacters(strippedQuery)).to.equal(strippedQuery); + + const queryAST = parse(kitchenSinkQuery, { noLocation: true }); + const strippedAST = parse(strippedQuery, { noLocation: true }); + expect(strippedAST).to.deep.equal(queryAST); + }); + + it('strips kitchen sink SDL but maintains the exact same AST', () => { + const strippedSDL = stripIgnoredCharacters(kitchenSinkSDL); + expect(stripIgnoredCharacters(strippedSDL)).to.equal(strippedSDL); + + const sdlAST = parse(kitchenSinkSDL, { noLocation: true }); + const strippedAST = parse(strippedSDL, { noLocation: true }); + expect(strippedAST).to.deep.equal(sdlAST); + }); +}); diff --git a/src/utilities/__tests__/typeComparators-test.ts b/src/utilities/__tests__/typeComparators-test.ts new file mode 100644 index 00000000..f2709bf7 --- /dev/null +++ b/src/utilities/__tests__/typeComparators-test.ts @@ -0,0 +1,160 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import type { GraphQLFieldConfigMap } from '../../type/definition'; +import { + GraphQLInterfaceType, + GraphQLList, + GraphQLNonNull, + GraphQLObjectType, + GraphQLUnionType, +} from '../../type/definition'; +import { GraphQLFloat, GraphQLInt, GraphQLString } from '../../type/scalars'; +import { GraphQLSchema } from '../../type/schema'; + +import { isEqualType, isTypeSubTypeOf } from '../typeComparators'; + +describe('typeComparators', () => { + describe('isEqualType', () => { + it('same reference are equal', () => { + expect(isEqualType(GraphQLString, GraphQLString)).to.equal(true); + }); + + it('int and float are not equal', () => { + expect(isEqualType(GraphQLInt, GraphQLFloat)).to.equal(false); + }); + + it('lists of same type are equal', () => { + expect( + isEqualType(new GraphQLList(GraphQLInt), new GraphQLList(GraphQLInt)), + ).to.equal(true); + }); + + it('lists is not equal to item', () => { + expect(isEqualType(new GraphQLList(GraphQLInt), GraphQLInt)).to.equal( + false, + ); + }); + + it('non-null of same type are equal', () => { + expect( + isEqualType( + new GraphQLNonNull(GraphQLInt), + new GraphQLNonNull(GraphQLInt), + ), + ).to.equal(true); + }); + + it('non-null is not equal to nullable', () => { + expect(isEqualType(new GraphQLNonNull(GraphQLInt), GraphQLInt)).to.equal( + false, + ); + }); + }); + + describe('isTypeSubTypeOf', () => { + function testSchema(fields: GraphQLFieldConfigMap) { + return new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Query', + fields, + }), + }); + } + + it('same reference is subtype', () => { + const schema = testSchema({ field: { type: GraphQLString } }); + expect(isTypeSubTypeOf(schema, GraphQLString, GraphQLString)).to.equal( + true, + ); + }); + + it('int is not subtype of float', () => { + const schema = testSchema({ field: { type: GraphQLString } }); + expect(isTypeSubTypeOf(schema, GraphQLInt, GraphQLFloat)).to.equal(false); + }); + + it('non-null is subtype of nullable', () => { + const schema = testSchema({ field: { type: GraphQLString } }); + expect( + isTypeSubTypeOf(schema, new GraphQLNonNull(GraphQLInt), GraphQLInt), + ).to.equal(true); + }); + + it('nullable is not subtype of non-null', () => { + const schema = testSchema({ field: { type: GraphQLString } }); + expect( + isTypeSubTypeOf(schema, GraphQLInt, new GraphQLNonNull(GraphQLInt)), + ).to.equal(false); + }); + + it('item is not subtype of list', () => { + const schema = testSchema({ field: { type: GraphQLString } }); + expect( + isTypeSubTypeOf(schema, GraphQLInt, new GraphQLList(GraphQLInt)), + ).to.equal(false); + }); + + it('list is not subtype of item', () => { + const schema = testSchema({ field: { type: GraphQLString } }); + expect( + isTypeSubTypeOf(schema, new GraphQLList(GraphQLInt), GraphQLInt), + ).to.equal(false); + }); + + it('member is subtype of union', () => { + const member = new GraphQLObjectType({ + name: 'Object', + fields: { + field: { type: GraphQLString }, + }, + }); + const union = new GraphQLUnionType({ name: 'Union', types: [member] }); + const schema = testSchema({ field: { type: union } }); + expect(isTypeSubTypeOf(schema, member, union)).to.equal(true); + }); + + it('implementing object is subtype of interface', () => { + const iface = new GraphQLInterfaceType({ + name: 'Interface', + fields: { + field: { type: GraphQLString }, + }, + }); + const impl = new GraphQLObjectType({ + name: 'Object', + interfaces: [iface], + fields: { + field: { type: GraphQLString }, + }, + }); + const schema = testSchema({ field: { type: impl } }); + expect(isTypeSubTypeOf(schema, impl, iface)).to.equal(true); + }); + + it('implementing interface is subtype of interface', () => { + const iface = new GraphQLInterfaceType({ + name: 'Interface', + fields: { + field: { type: GraphQLString }, + }, + }); + const iface2 = new GraphQLInterfaceType({ + name: 'Interface2', + interfaces: [iface], + fields: { + field: { type: GraphQLString }, + }, + }); + const impl = new GraphQLObjectType({ + name: 'Object', + interfaces: [iface2, iface], + fields: { + field: { type: GraphQLString }, + }, + }); + const schema = testSchema({ field: { type: impl } }); + expect(isTypeSubTypeOf(schema, iface2, iface)).to.equal(true); + }); + }); +}); diff --git a/src/utilities/__tests__/valueFromAST-test.ts b/src/utilities/__tests__/valueFromAST-test.ts new file mode 100644 index 00000000..a01ed957 --- /dev/null +++ b/src/utilities/__tests__/valueFromAST-test.ts @@ -0,0 +1,265 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { identityFunc } from '../../jsutils/identityFunc'; +import { invariant } from '../../jsutils/invariant'; +import type { ObjMap } from '../../jsutils/ObjMap'; + +import { parseValue } from '../../language/parser'; + +import type { GraphQLInputType } from '../../type/definition'; +import { + GraphQLEnumType, + GraphQLInputObjectType, + GraphQLList, + GraphQLNonNull, + GraphQLScalarType, +} from '../../type/definition'; +import { + GraphQLBoolean, + GraphQLFloat, + GraphQLID, + GraphQLInt, + GraphQLString, +} from '../../type/scalars'; + +import { valueFromAST } from '../valueFromAST'; + +describe('valueFromAST', () => { + function expectValueFrom( + valueText: string, + type: GraphQLInputType, + variables?: ObjMap, + ) { + const ast = parseValue(valueText); + const value = valueFromAST(ast, type, variables); + return expect(value); + } + + it('rejects empty input', () => { + expect(valueFromAST(null, GraphQLBoolean)).to.deep.equal(undefined); + }); + + it('converts according to input coercion rules', () => { + expectValueFrom('true', GraphQLBoolean).to.equal(true); + expectValueFrom('false', GraphQLBoolean).to.equal(false); + expectValueFrom('123', GraphQLInt).to.equal(123); + expectValueFrom('123', GraphQLFloat).to.equal(123); + expectValueFrom('123.456', GraphQLFloat).to.equal(123.456); + expectValueFrom('"abc123"', GraphQLString).to.equal('abc123'); + expectValueFrom('123456', GraphQLID).to.equal('123456'); + expectValueFrom('"123456"', GraphQLID).to.equal('123456'); + }); + + it('does not convert when input coercion rules reject a value', () => { + expectValueFrom('123', GraphQLBoolean).to.equal(undefined); + expectValueFrom('123.456', GraphQLInt).to.equal(undefined); + expectValueFrom('true', GraphQLInt).to.equal(undefined); + expectValueFrom('"123"', GraphQLInt).to.equal(undefined); + expectValueFrom('"123"', GraphQLFloat).to.equal(undefined); + expectValueFrom('123', GraphQLString).to.equal(undefined); + expectValueFrom('true', GraphQLString).to.equal(undefined); + expectValueFrom('123.456', GraphQLString).to.equal(undefined); + }); + + it('convert using parseLiteral from a custom scalar type', () => { + const passthroughScalar = new GraphQLScalarType({ + name: 'PassthroughScalar', + parseLiteral(node) { + invariant(node.kind === 'StringValue'); + return node.value; + }, + parseValue: identityFunc, + }); + + expectValueFrom('"value"', passthroughScalar).to.equal('value'); + + const throwScalar = new GraphQLScalarType({ + name: 'ThrowScalar', + parseLiteral() { + throw new Error('Test'); + }, + parseValue: identityFunc, + }); + + expectValueFrom('value', throwScalar).to.equal(undefined); + + const returnUndefinedScalar = new GraphQLScalarType({ + name: 'ReturnUndefinedScalar', + parseLiteral() { + return undefined; + }, + parseValue: identityFunc, + }); + + expectValueFrom('value', returnUndefinedScalar).to.equal(undefined); + }); + + it('converts enum values according to input coercion rules', () => { + const testEnum = new GraphQLEnumType({ + name: 'TestColor', + values: { + RED: { value: 1 }, + GREEN: { value: 2 }, + BLUE: { value: 3 }, + NULL: { value: null }, + NAN: { value: NaN }, + NO_CUSTOM_VALUE: { value: undefined }, + }, + }); + + expectValueFrom('RED', testEnum).to.equal(1); + expectValueFrom('BLUE', testEnum).to.equal(3); + expectValueFrom('3', testEnum).to.equal(undefined); + expectValueFrom('"BLUE"', testEnum).to.equal(undefined); + expectValueFrom('null', testEnum).to.equal(null); + expectValueFrom('NULL', testEnum).to.equal(null); + expectValueFrom('NULL', new GraphQLNonNull(testEnum)).to.equal(null); + expectValueFrom('NAN', testEnum).to.deep.equal(NaN); + expectValueFrom('NO_CUSTOM_VALUE', testEnum).to.equal('NO_CUSTOM_VALUE'); + }); + + // Boolean! + const nonNullBool = new GraphQLNonNull(GraphQLBoolean); + // [Boolean] + const listOfBool = new GraphQLList(GraphQLBoolean); + // [Boolean!] + const listOfNonNullBool = new GraphQLList(nonNullBool); + // [Boolean]! + const nonNullListOfBool = new GraphQLNonNull(listOfBool); + // [Boolean!]! + const nonNullListOfNonNullBool = new GraphQLNonNull(listOfNonNullBool); + + it('coerces to null unless non-null', () => { + expectValueFrom('null', GraphQLBoolean).to.equal(null); + expectValueFrom('null', nonNullBool).to.equal(undefined); + }); + + it('coerces lists of values', () => { + expectValueFrom('true', listOfBool).to.deep.equal([true]); + expectValueFrom('123', listOfBool).to.equal(undefined); + expectValueFrom('null', listOfBool).to.equal(null); + expectValueFrom('[true, false]', listOfBool).to.deep.equal([true, false]); + expectValueFrom('[true, 123]', listOfBool).to.equal(undefined); + expectValueFrom('[true, null]', listOfBool).to.deep.equal([true, null]); + expectValueFrom('{ true: true }', listOfBool).to.equal(undefined); + }); + + it('coerces non-null lists of values', () => { + expectValueFrom('true', nonNullListOfBool).to.deep.equal([true]); + expectValueFrom('123', nonNullListOfBool).to.equal(undefined); + expectValueFrom('null', nonNullListOfBool).to.equal(undefined); + expectValueFrom('[true, false]', nonNullListOfBool).to.deep.equal([ + true, + false, + ]); + expectValueFrom('[true, 123]', nonNullListOfBool).to.equal(undefined); + expectValueFrom('[true, null]', nonNullListOfBool).to.deep.equal([ + true, + null, + ]); + }); + + it('coerces lists of non-null values', () => { + expectValueFrom('true', listOfNonNullBool).to.deep.equal([true]); + expectValueFrom('123', listOfNonNullBool).to.equal(undefined); + expectValueFrom('null', listOfNonNullBool).to.equal(null); + expectValueFrom('[true, false]', listOfNonNullBool).to.deep.equal([ + true, + false, + ]); + expectValueFrom('[true, 123]', listOfNonNullBool).to.equal(undefined); + expectValueFrom('[true, null]', listOfNonNullBool).to.equal(undefined); + }); + + it('coerces non-null lists of non-null values', () => { + expectValueFrom('true', nonNullListOfNonNullBool).to.deep.equal([true]); + expectValueFrom('123', nonNullListOfNonNullBool).to.equal(undefined); + expectValueFrom('null', nonNullListOfNonNullBool).to.equal(undefined); + expectValueFrom('[true, false]', nonNullListOfNonNullBool).to.deep.equal([ + true, + false, + ]); + expectValueFrom('[true, 123]', nonNullListOfNonNullBool).to.equal( + undefined, + ); + expectValueFrom('[true, null]', nonNullListOfNonNullBool).to.equal( + undefined, + ); + }); + + const testInputObj = new GraphQLInputObjectType({ + name: 'TestInput', + fields: { + int: { type: GraphQLInt, defaultValue: 42 }, + bool: { type: GraphQLBoolean }, + requiredBool: { type: nonNullBool }, + }, + }); + + it('coerces input objects according to input coercion rules', () => { + expectValueFrom('null', testInputObj).to.equal(null); + expectValueFrom('123', testInputObj).to.equal(undefined); + expectValueFrom('[]', testInputObj).to.equal(undefined); + expectValueFrom( + '{ int: 123, requiredBool: false }', + testInputObj, + ).to.deep.equal({ + int: 123, + requiredBool: false, + }); + expectValueFrom( + '{ bool: true, requiredBool: false }', + testInputObj, + ).to.deep.equal({ + int: 42, + bool: true, + requiredBool: false, + }); + expectValueFrom('{ int: true, requiredBool: true }', testInputObj).to.equal( + undefined, + ); + expectValueFrom('{ requiredBool: null }', testInputObj).to.equal(undefined); + expectValueFrom('{ bool: true }', testInputObj).to.equal(undefined); + }); + + it('accepts variable values assuming already coerced', () => { + expectValueFrom('$var', GraphQLBoolean, {}).to.equal(undefined); + expectValueFrom('$var', GraphQLBoolean, { var: true }).to.equal(true); + expectValueFrom('$var', GraphQLBoolean, { var: null }).to.equal(null); + expectValueFrom('$var', nonNullBool, { var: null }).to.equal(undefined); + }); + + it('asserts variables are provided as items in lists', () => { + expectValueFrom('[ $foo ]', listOfBool, {}).to.deep.equal([null]); + expectValueFrom('[ $foo ]', listOfNonNullBool, {}).to.equal(undefined); + expectValueFrom('[ $foo ]', listOfNonNullBool, { + foo: true, + }).to.deep.equal([true]); + // Note: variables are expected to have already been coerced, so we + // do not expect the singleton wrapping behavior for variables. + expectValueFrom('$foo', listOfNonNullBool, { foo: true }).to.equal(true); + expectValueFrom('$foo', listOfNonNullBool, { foo: [true] }).to.deep.equal([ + true, + ]); + }); + + it('omits input object fields for unprovided variables', () => { + expectValueFrom( + '{ int: $foo, bool: $foo, requiredBool: true }', + testInputObj, + {}, + ).to.deep.equal({ int: 42, requiredBool: true }); + + expectValueFrom('{ requiredBool: $foo }', testInputObj, {}).to.equal( + undefined, + ); + + expectValueFrom('{ requiredBool: $foo }', testInputObj, { + foo: true, + }).to.deep.equal({ + int: 42, + requiredBool: true, + }); + }); +}); diff --git a/src/utilities/__tests__/valueFromASTUntyped-test.ts b/src/utilities/__tests__/valueFromASTUntyped-test.ts new file mode 100644 index 00000000..9ad004c4 --- /dev/null +++ b/src/utilities/__tests__/valueFromASTUntyped-test.ts @@ -0,0 +1,67 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import type { Maybe } from '../../jsutils/Maybe'; +import type { ObjMap } from '../../jsutils/ObjMap'; + +import { parseValue } from '../../language/parser'; + +import { valueFromASTUntyped } from '../valueFromASTUntyped'; + +describe('valueFromASTUntyped', () => { + function expectValueFrom( + valueText: string, + variables?: Maybe>, + ) { + const ast = parseValue(valueText); + const value = valueFromASTUntyped(ast, variables); + return expect(value); + } + + it('parses simple values', () => { + expectValueFrom('null').to.equal(null); + expectValueFrom('true').to.equal(true); + expectValueFrom('false').to.equal(false); + expectValueFrom('123').to.equal(123); + expectValueFrom('123.456').to.equal(123.456); + expectValueFrom('"abc123"').to.equal('abc123'); + }); + + it('parses lists of values', () => { + expectValueFrom('[true, false]').to.deep.equal([true, false]); + expectValueFrom('[true, 123.45]').to.deep.equal([true, 123.45]); + expectValueFrom('[true, null]').to.deep.equal([true, null]); + expectValueFrom('[true, ["foo", 1.2]]').to.deep.equal([true, ['foo', 1.2]]); + }); + + it('parses input objects', () => { + expectValueFrom('{ int: 123, bool: false }').to.deep.equal({ + int: 123, + bool: false, + }); + expectValueFrom('{ foo: [ { bar: "baz"} ] }').to.deep.equal({ + foo: [{ bar: 'baz' }], + }); + }); + + it('parses enum values as plain strings', () => { + expectValueFrom('TEST_ENUM_VALUE').to.equal('TEST_ENUM_VALUE'); + expectValueFrom('[TEST_ENUM_VALUE]').to.deep.equal(['TEST_ENUM_VALUE']); + }); + + it('parses variables', () => { + expectValueFrom('$testVariable', { testVariable: 'foo' }).to.equal('foo'); + expectValueFrom('[$testVariable]', { testVariable: 'foo' }).to.deep.equal([ + 'foo', + ]); + expectValueFrom('{a:[$testVariable]}', { + testVariable: 'foo', + }).to.deep.equal({ a: ['foo'] }); + expectValueFrom('$testVariable', { testVariable: null }).to.equal(null); + expectValueFrom('$testVariable', { testVariable: NaN }).to.satisfy( + Number.isNaN, + ); + expectValueFrom('$testVariable', {}).to.equal(undefined); + expectValueFrom('$testVariable', null).to.equal(undefined); + }); +}); diff --git a/src/utilities/assertValidName.ts b/src/utilities/assertValidName.ts new file mode 100644 index 00000000..3e66461a --- /dev/null +++ b/src/utilities/assertValidName.ts @@ -0,0 +1,39 @@ +import { devAssert } from '../jsutils/devAssert'; + +import { GraphQLError } from '../error/GraphQLError'; + +import { assertName } from '../type/assertName'; + +/* c8 ignore start */ +/** + * Upholds the spec rules about naming. + * @deprecated Please use `assertName` instead. Will be removed in v17 + */ +export function assertValidName(name: string): string { + const error = isValidNameError(name); + if (error) { + throw error; + } + return name; +} + +/** + * Returns an Error if a name is invalid. + * @deprecated Please use `assertName` instead. Will be removed in v17 + */ +export function isValidNameError(name: string): GraphQLError | undefined { + devAssert(typeof name === 'string', 'Expected name to be a string.'); + + if (name.startsWith('__')) { + return new GraphQLError( + `Name "${name}" must not begin with "__", which is reserved by GraphQL introspection.`, + ); + } + + try { + assertName(name); + } catch (error) { + return error; + } +} +/* c8 ignore stop */ diff --git a/src/utilities/astFromValue.ts b/src/utilities/astFromValue.ts new file mode 100644 index 00000000..1a880449 --- /dev/null +++ b/src/utilities/astFromValue.ts @@ -0,0 +1,150 @@ +import { inspect } from '../jsutils/inspect'; +import { invariant } from '../jsutils/invariant'; +import { isIterableObject } from '../jsutils/isIterableObject'; +import { isObjectLike } from '../jsutils/isObjectLike'; +import type { Maybe } from '../jsutils/Maybe'; + +import type { ObjectFieldNode, ValueNode } from '../language/ast'; +import { Kind } from '../language/kinds'; + +import type { GraphQLInputType } from '../type/definition'; +import { + isEnumType, + isInputObjectType, + isLeafType, + isListType, + isNonNullType, +} from '../type/definition'; +import { GraphQLID } from '../type/scalars'; + +/** + * Produces a GraphQL Value AST given a JavaScript object. + * Function will match JavaScript/JSON values to GraphQL AST schema format + * by using suggested GraphQLInputType. For example: + * + * astFromValue("value", GraphQLString) + * + * A GraphQL type must be provided, which will be used to interpret different + * JavaScript values. + * + * | JSON Value | GraphQL Value | + * | ------------- | -------------------- | + * | Object | Input Object | + * | Array | List | + * | Boolean | Boolean | + * | String | String / Enum Value | + * | Number | Int / Float | + * | Unknown | Enum Value | + * | null | NullValue | + * + */ +export function astFromValue( + value: unknown, + type: GraphQLInputType, +): Maybe { + if (isNonNullType(type)) { + const astValue = astFromValue(value, type.ofType); + if (astValue?.kind === Kind.NULL) { + return null; + } + return astValue; + } + + // only explicit null, not undefined, NaN + if (value === null) { + return { kind: Kind.NULL }; + } + + // undefined + if (value === undefined) { + return null; + } + + // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but + // the value is not an array, convert the value using the list's item type. + if (isListType(type)) { + const itemType = type.ofType; + if (isIterableObject(value)) { + const valuesNodes = []; + for (const item of value) { + const itemNode = astFromValue(item, itemType); + if (itemNode != null) { + valuesNodes.push(itemNode); + } + } + return { kind: Kind.LIST, values: valuesNodes }; + } + return astFromValue(value, itemType); + } + + // Populate the fields of the input object by creating ASTs from each value + // in the JavaScript object according to the fields in the input type. + if (isInputObjectType(type)) { + if (!isObjectLike(value)) { + return null; + } + const fieldNodes: Array = []; + for (const field of Object.values(type.getFields())) { + const fieldValue = astFromValue(value[field.name], field.type); + if (fieldValue) { + fieldNodes.push({ + kind: Kind.OBJECT_FIELD, + name: { kind: Kind.NAME, value: field.name }, + value: fieldValue, + }); + } + } + return { kind: Kind.OBJECT, fields: fieldNodes }; + } + + if (isLeafType(type)) { + // Since value is an internally represented value, it must be serialized + // to an externally represented value before converting into an AST. + const serialized = type.serialize(value); + if (serialized == null) { + return null; + } + + // Others serialize based on their corresponding JavaScript scalar types. + if (typeof serialized === 'boolean') { + return { kind: Kind.BOOLEAN, value: serialized }; + } + + // JavaScript numbers can be Int or Float values. + if (typeof serialized === 'number' && Number.isFinite(serialized)) { + const stringNum = String(serialized); + return integerStringRegExp.test(stringNum) + ? { kind: Kind.INT, value: stringNum } + : { kind: Kind.FLOAT, value: stringNum }; + } + + if (typeof serialized === 'string') { + // Enum types use Enum literals. + if (isEnumType(type)) { + return { kind: Kind.ENUM, value: serialized }; + } + + // ID types can use Int literals. + if (type === GraphQLID && integerStringRegExp.test(serialized)) { + return { kind: Kind.INT, value: serialized }; + } + + return { + kind: Kind.STRING, + value: serialized, + }; + } + + throw new TypeError(`Cannot convert value to AST: ${inspect(serialized)}.`); + } + /* c8 ignore next 3 */ + // Not reachable, all possible types have been considered. + invariant(false, 'Unexpected input type: ' + inspect(type)); +} + +/** + * IntValue: + * - NegativeSign? 0 + * - NegativeSign? NonZeroDigit ( Digit+ )? + */ +const integerStringRegExp = /^-?(?:0|[1-9][0-9]*)$/; diff --git a/src/utilities/buildASTSchema.ts b/src/utilities/buildASTSchema.ts new file mode 100644 index 00000000..eeff08e6 --- /dev/null +++ b/src/utilities/buildASTSchema.ts @@ -0,0 +1,111 @@ +import { devAssert } from '../jsutils/devAssert'; + +import type { DocumentNode } from '../language/ast'; +import { Kind } from '../language/kinds'; +import type { ParseOptions } from '../language/parser'; +import { parse } from '../language/parser'; +import type { Source } from '../language/source'; + +import { specifiedDirectives } from '../type/directives'; +import type { GraphQLSchemaValidationOptions } from '../type/schema'; +import { GraphQLSchema } from '../type/schema'; + +import { assertValidSDL } from '../validation/validate'; + +import { extendSchemaImpl } from './extendSchema'; + +export interface BuildSchemaOptions extends GraphQLSchemaValidationOptions { + /** + * Set to true to assume the SDL is valid. + * + * Default: false + */ + assumeValidSDL?: boolean; +} + +/** + * This takes the ast of a schema document produced by the parse function in + * src/language/parser.js. + * + * If no schema definition is provided, then it will look for types named Query, + * Mutation and Subscription. + * + * Given that AST it constructs a GraphQLSchema. The resulting schema + * has no resolve methods, so execution will use default resolvers. + */ +export function buildASTSchema( + documentAST: DocumentNode, + options?: BuildSchemaOptions, +): GraphQLSchema { + devAssert( + documentAST != null && documentAST.kind === Kind.DOCUMENT, + 'Must provide valid Document AST.', + ); + + if (options?.assumeValid !== true && options?.assumeValidSDL !== true) { + assertValidSDL(documentAST); + } + + const emptySchemaConfig = { + description: undefined, + types: [], + directives: [], + extensions: Object.create(null), + extensionASTNodes: [], + assumeValid: false, + }; + const config = extendSchemaImpl(emptySchemaConfig, documentAST, options); + + if (config.astNode == null) { + for (const type of config.types) { + switch (type.name) { + // Note: While this could make early assertions to get the correctly + // typed values below, that would throw immediately while type system + // validation with validateSchema() will produce more actionable results. + case 'Query': + // @ts-expect-error validated in `validateSchema` + config.query = type; + break; + case 'Mutation': + // @ts-expect-error validated in `validateSchema` + config.mutation = type; + break; + case 'Subscription': + // @ts-expect-error validated in `validateSchema` + config.subscription = type; + break; + } + } + } + + const directives = [ + ...config.directives, + // If specified directives were not explicitly declared, add them. + ...specifiedDirectives.filter((stdDirective) => + config.directives.every( + (directive) => directive.name !== stdDirective.name, + ), + ), + ]; + + return new GraphQLSchema({ ...config, directives }); +} + +/** + * A helper function to build a GraphQLSchema directly from a source + * document. + */ +export function buildSchema( + source: string | Source, + options?: BuildSchemaOptions & ParseOptions, +): GraphQLSchema { + const document = parse(source, { + noLocation: options?.noLocation, + allowLegacyFragmentVariables: options?.allowLegacyFragmentVariables, + }); + + return buildASTSchema(document, { + assumeValidSDL: options?.assumeValidSDL, + assumeValid: options?.assumeValid, + }); +} diff --git a/src/utilities/buildClientSchema.ts b/src/utilities/buildClientSchema.ts new file mode 100644 index 00000000..18e6110b --- /dev/null +++ b/src/utilities/buildClientSchema.ts @@ -0,0 +1,406 @@ +import { devAssert } from '../jsutils/devAssert'; +import { inspect } from '../jsutils/inspect'; +import { isObjectLike } from '../jsutils/isObjectLike'; +import { keyValMap } from '../jsutils/keyValMap'; + +import { parseValue } from '../language/parser'; + +import type { + GraphQLFieldConfig, + GraphQLFieldConfigMap, + GraphQLNamedType, + GraphQLType, +} from '../type/definition'; +import { + assertInterfaceType, + assertNullableType, + assertObjectType, + GraphQLEnumType, + GraphQLInputObjectType, + GraphQLInterfaceType, + GraphQLList, + GraphQLNonNull, + GraphQLObjectType, + GraphQLScalarType, + GraphQLUnionType, + isInputType, + isOutputType, +} from '../type/definition'; +import { GraphQLDirective } from '../type/directives'; +import { introspectionTypes, TypeKind } from '../type/introspection'; +import { specifiedScalarTypes } from '../type/scalars'; +import type { GraphQLSchemaValidationOptions } from '../type/schema'; +import { GraphQLSchema } from '../type/schema'; + +import type { + IntrospectionDirective, + IntrospectionEnumType, + IntrospectionField, + IntrospectionInputObjectType, + IntrospectionInputValue, + IntrospectionInterfaceType, + IntrospectionNamedTypeRef, + IntrospectionObjectType, + IntrospectionQuery, + IntrospectionScalarType, + IntrospectionType, + IntrospectionTypeRef, + IntrospectionUnionType, +} from './getIntrospectionQuery'; +import { valueFromAST } from './valueFromAST'; + +/** + * Build a GraphQLSchema for use by client tools. + * + * Given the result of a client running the introspection query, creates and + * returns a GraphQLSchema instance which can be then used with all graphql-js + * tools, but cannot be used to execute a query, as introspection does not + * represent the "resolver", "parse" or "serialize" functions or any other + * server-internal mechanisms. + * + * This function expects a complete introspection result. Don't forget to check + * the "errors" field of a server response before calling this function. + */ +export function buildClientSchema( + introspection: IntrospectionQuery, + options?: GraphQLSchemaValidationOptions, +): GraphQLSchema { + devAssert( + isObjectLike(introspection) && isObjectLike(introspection.__schema), + `Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${inspect( + introspection, + )}.`, + ); + + // Get the schema from the introspection result. + const schemaIntrospection = introspection.__schema; + + // Iterate through all types, getting the type definition for each. + const typeMap = keyValMap( + schemaIntrospection.types, + (typeIntrospection) => typeIntrospection.name, + (typeIntrospection) => buildType(typeIntrospection), + ); + + // Include standard types only if they are used. + for (const stdType of [...specifiedScalarTypes, ...introspectionTypes]) { + if (typeMap[stdType.name]) { + typeMap[stdType.name] = stdType; + } + } + + // Get the root Query, Mutation, and Subscription types. + const queryType = schemaIntrospection.queryType + ? getObjectType(schemaIntrospection.queryType) + : null; + + const mutationType = schemaIntrospection.mutationType + ? getObjectType(schemaIntrospection.mutationType) + : null; + + const subscriptionType = schemaIntrospection.subscriptionType + ? getObjectType(schemaIntrospection.subscriptionType) + : null; + + // Get the directives supported by Introspection, assuming empty-set if + // directives were not queried for. + const directives = schemaIntrospection.directives + ? schemaIntrospection.directives.map(buildDirective) + : []; + + // Then produce and return a Schema with these types. + return new GraphQLSchema({ + description: schemaIntrospection.description, + query: queryType, + mutation: mutationType, + subscription: subscriptionType, + types: Object.values(typeMap), + directives, + assumeValid: options?.assumeValid, + }); + + // Given a type reference in introspection, return the GraphQLType instance. + // preferring cached instances before building new instances. + function getType(typeRef: IntrospectionTypeRef): GraphQLType { + if (typeRef.kind === TypeKind.LIST) { + const itemRef = typeRef.ofType; + if (!itemRef) { + throw new Error('Decorated type deeper than introspection query.'); + } + return new GraphQLList(getType(itemRef)); + } + if (typeRef.kind === TypeKind.NON_NULL) { + const nullableRef = typeRef.ofType; + if (!nullableRef) { + throw new Error('Decorated type deeper than introspection query.'); + } + const nullableType = getType(nullableRef); + return new GraphQLNonNull(assertNullableType(nullableType)); + } + return getNamedType(typeRef); + } + + function getNamedType(typeRef: IntrospectionNamedTypeRef): GraphQLNamedType { + const typeName = typeRef.name; + if (!typeName) { + throw new Error(`Unknown type reference: ${inspect(typeRef)}.`); + } + + const type = typeMap[typeName]; + if (!type) { + throw new Error( + `Invalid or incomplete schema, unknown type: ${typeName}. Ensure that a full introspection query is used in order to build a client schema.`, + ); + } + + return type; + } + + function getObjectType( + typeRef: IntrospectionNamedTypeRef, + ): GraphQLObjectType { + return assertObjectType(getNamedType(typeRef)); + } + + function getInterfaceType( + typeRef: IntrospectionNamedTypeRef, + ): GraphQLInterfaceType { + return assertInterfaceType(getNamedType(typeRef)); + } + + // Given a type's introspection result, construct the correct + // GraphQLType instance. + function buildType(type: IntrospectionType): GraphQLNamedType { + // eslint-disable-next-line @typescript-eslint/prefer-optional-chain + if (type != null && type.name != null && type.kind != null) { + // FIXME: Properly type IntrospectionType, it's a breaking change so fix in v17 + // eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check + switch (type.kind) { + case TypeKind.SCALAR: + return buildScalarDef(type); + case TypeKind.OBJECT: + return buildObjectDef(type); + case TypeKind.INTERFACE: + return buildInterfaceDef(type); + case TypeKind.UNION: + return buildUnionDef(type); + case TypeKind.ENUM: + return buildEnumDef(type); + case TypeKind.INPUT_OBJECT: + return buildInputObjectDef(type); + } + } + const typeStr = inspect(type); + throw new Error( + `Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${typeStr}.`, + ); + } + + function buildScalarDef( + scalarIntrospection: IntrospectionScalarType, + ): GraphQLScalarType { + return new GraphQLScalarType({ + name: scalarIntrospection.name, + description: scalarIntrospection.description, + specifiedByURL: scalarIntrospection.specifiedByURL, + }); + } + + function buildImplementationsList( + implementingIntrospection: + | IntrospectionObjectType + | IntrospectionInterfaceType, + ): Array { + // TODO: Temporary workaround until GraphQL ecosystem will fully support + // 'interfaces' on interface types. + if ( + implementingIntrospection.interfaces === null && + implementingIntrospection.kind === TypeKind.INTERFACE + ) { + return []; + } + + if (!implementingIntrospection.interfaces) { + const implementingIntrospectionStr = inspect(implementingIntrospection); + throw new Error( + `Introspection result missing interfaces: ${implementingIntrospectionStr}.`, + ); + } + + return implementingIntrospection.interfaces.map(getInterfaceType); + } + + function buildObjectDef( + objectIntrospection: IntrospectionObjectType, + ): GraphQLObjectType { + return new GraphQLObjectType({ + name: objectIntrospection.name, + description: objectIntrospection.description, + interfaces: () => buildImplementationsList(objectIntrospection), + fields: () => buildFieldDefMap(objectIntrospection), + }); + } + + function buildInterfaceDef( + interfaceIntrospection: IntrospectionInterfaceType, + ): GraphQLInterfaceType { + return new GraphQLInterfaceType({ + name: interfaceIntrospection.name, + description: interfaceIntrospection.description, + interfaces: () => buildImplementationsList(interfaceIntrospection), + fields: () => buildFieldDefMap(interfaceIntrospection), + }); + } + + function buildUnionDef( + unionIntrospection: IntrospectionUnionType, + ): GraphQLUnionType { + if (!unionIntrospection.possibleTypes) { + const unionIntrospectionStr = inspect(unionIntrospection); + throw new Error( + `Introspection result missing possibleTypes: ${unionIntrospectionStr}.`, + ); + } + return new GraphQLUnionType({ + name: unionIntrospection.name, + description: unionIntrospection.description, + types: () => unionIntrospection.possibleTypes.map(getObjectType), + }); + } + + function buildEnumDef( + enumIntrospection: IntrospectionEnumType, + ): GraphQLEnumType { + if (!enumIntrospection.enumValues) { + const enumIntrospectionStr = inspect(enumIntrospection); + throw new Error( + `Introspection result missing enumValues: ${enumIntrospectionStr}.`, + ); + } + return new GraphQLEnumType({ + name: enumIntrospection.name, + description: enumIntrospection.description, + values: keyValMap( + enumIntrospection.enumValues, + (valueIntrospection) => valueIntrospection.name, + (valueIntrospection) => ({ + description: valueIntrospection.description, + deprecationReason: valueIntrospection.deprecationReason, + }), + ), + }); + } + + function buildInputObjectDef( + inputObjectIntrospection: IntrospectionInputObjectType, + ): GraphQLInputObjectType { + if (!inputObjectIntrospection.inputFields) { + const inputObjectIntrospectionStr = inspect(inputObjectIntrospection); + throw new Error( + `Introspection result missing inputFields: ${inputObjectIntrospectionStr}.`, + ); + } + return new GraphQLInputObjectType({ + name: inputObjectIntrospection.name, + description: inputObjectIntrospection.description, + fields: () => buildInputValueDefMap(inputObjectIntrospection.inputFields), + }); + } + + function buildFieldDefMap( + typeIntrospection: IntrospectionObjectType | IntrospectionInterfaceType, + ): GraphQLFieldConfigMap { + if (!typeIntrospection.fields) { + throw new Error( + `Introspection result missing fields: ${inspect(typeIntrospection)}.`, + ); + } + + return keyValMap( + typeIntrospection.fields, + (fieldIntrospection) => fieldIntrospection.name, + buildField, + ); + } + + function buildField( + fieldIntrospection: IntrospectionField, + ): GraphQLFieldConfig { + const type = getType(fieldIntrospection.type); + if (!isOutputType(type)) { + const typeStr = inspect(type); + throw new Error( + `Introspection must provide output type for fields, but received: ${typeStr}.`, + ); + } + + if (!fieldIntrospection.args) { + const fieldIntrospectionStr = inspect(fieldIntrospection); + throw new Error( + `Introspection result missing field args: ${fieldIntrospectionStr}.`, + ); + } + + return { + description: fieldIntrospection.description, + deprecationReason: fieldIntrospection.deprecationReason, + type, + args: buildInputValueDefMap(fieldIntrospection.args), + }; + } + + function buildInputValueDefMap( + inputValueIntrospections: ReadonlyArray, + ) { + return keyValMap( + inputValueIntrospections, + (inputValue) => inputValue.name, + buildInputValue, + ); + } + + function buildInputValue(inputValueIntrospection: IntrospectionInputValue) { + const type = getType(inputValueIntrospection.type); + if (!isInputType(type)) { + const typeStr = inspect(type); + throw new Error( + `Introspection must provide input type for arguments, but received: ${typeStr}.`, + ); + } + + const defaultValue = + inputValueIntrospection.defaultValue != null + ? valueFromAST(parseValue(inputValueIntrospection.defaultValue), type) + : undefined; + return { + description: inputValueIntrospection.description, + type, + defaultValue, + deprecationReason: inputValueIntrospection.deprecationReason, + }; + } + + function buildDirective( + directiveIntrospection: IntrospectionDirective, + ): GraphQLDirective { + if (!directiveIntrospection.args) { + const directiveIntrospectionStr = inspect(directiveIntrospection); + throw new Error( + `Introspection result missing directive args: ${directiveIntrospectionStr}.`, + ); + } + if (!directiveIntrospection.locations) { + const directiveIntrospectionStr = inspect(directiveIntrospection); + throw new Error( + `Introspection result missing directive locations: ${directiveIntrospectionStr}.`, + ); + } + return new GraphQLDirective({ + name: directiveIntrospection.name, + description: directiveIntrospection.description, + isRepeatable: directiveIntrospection.isRepeatable, + locations: directiveIntrospection.locations.slice(), + args: buildInputValueDefMap(directiveIntrospection.args), + }); + } +} diff --git a/src/utilities/coerceInputValue.ts b/src/utilities/coerceInputValue.ts new file mode 100644 index 00000000..07883db8 --- /dev/null +++ b/src/utilities/coerceInputValue.ts @@ -0,0 +1,187 @@ +import { didYouMean } from '../jsutils/didYouMean'; +import { inspect } from '../jsutils/inspect'; +import { invariant } from '../jsutils/invariant'; +import { isIterableObject } from '../jsutils/isIterableObject'; +import { isObjectLike } from '../jsutils/isObjectLike'; +import type { Path } from '../jsutils/Path'; +import { addPath, pathToArray } from '../jsutils/Path'; +import { printPathArray } from '../jsutils/printPathArray'; +import { suggestionList } from '../jsutils/suggestionList'; + +import { GraphQLError } from '../error/GraphQLError'; + +import type { GraphQLInputType } from '../type/definition'; +import { + isInputObjectType, + isLeafType, + isListType, + isNonNullType, +} from '../type/definition'; + +type OnErrorCB = ( + path: ReadonlyArray, + invalidValue: unknown, + error: GraphQLError, +) => void; + +/** + * Coerces a JavaScript value given a GraphQL Input Type. + */ +export function coerceInputValue( + inputValue: unknown, + type: GraphQLInputType, + onError: OnErrorCB = defaultOnError, +): unknown { + return coerceInputValueImpl(inputValue, type, onError, undefined); +} + +function defaultOnError( + path: ReadonlyArray, + invalidValue: unknown, + error: GraphQLError, +): void { + let errorPrefix = 'Invalid value ' + inspect(invalidValue); + if (path.length > 0) { + errorPrefix += ` at "value${printPathArray(path)}"`; + } + error.message = errorPrefix + ': ' + error.message; + throw error; +} + +function coerceInputValueImpl( + inputValue: unknown, + type: GraphQLInputType, + onError: OnErrorCB, + path: Path | undefined, +): unknown { + if (isNonNullType(type)) { + if (inputValue != null) { + return coerceInputValueImpl(inputValue, type.ofType, onError, path); + } + onError( + pathToArray(path), + inputValue, + new GraphQLError( + `Expected non-nullable type "${inspect(type)}" not to be null.`, + ), + ); + return; + } + + if (inputValue == null) { + // Explicitly return the value null. + return null; + } + + if (isListType(type)) { + const itemType = type.ofType; + if (isIterableObject(inputValue)) { + return Array.from(inputValue, (itemValue, index) => { + const itemPath = addPath(path, index, undefined); + return coerceInputValueImpl(itemValue, itemType, onError, itemPath); + }); + } + // Lists accept a non-list value as a list of one. + return [coerceInputValueImpl(inputValue, itemType, onError, path)]; + } + + if (isInputObjectType(type)) { + if (!isObjectLike(inputValue)) { + onError( + pathToArray(path), + inputValue, + new GraphQLError(`Expected type "${type.name}" to be an object.`), + ); + return; + } + + const coercedValue: any = {}; + const fieldDefs = type.getFields(); + + for (const field of Object.values(fieldDefs)) { + const fieldValue = inputValue[field.name]; + + if (fieldValue === undefined) { + if (field.defaultValue !== undefined) { + coercedValue[field.name] = field.defaultValue; + } else if (isNonNullType(field.type)) { + const typeStr = inspect(field.type); + onError( + pathToArray(path), + inputValue, + new GraphQLError( + `Field "${field.name}" of required type "${typeStr}" was not provided.`, + ), + ); + } + continue; + } + + coercedValue[field.name] = coerceInputValueImpl( + fieldValue, + field.type, + onError, + addPath(path, field.name, type.name), + ); + } + + // Ensure every provided field is defined. + for (const fieldName of Object.keys(inputValue)) { + if (!fieldDefs[fieldName]) { + const suggestions = suggestionList( + fieldName, + Object.keys(type.getFields()), + ); + onError( + pathToArray(path), + inputValue, + new GraphQLError( + `Field "${fieldName}" is not defined by type "${type.name}".` + + didYouMean(suggestions), + ), + ); + } + } + return coercedValue; + } + + if (isLeafType(type)) { + let parseResult; + + // Scalars and Enums determine if a input value is valid via parseValue(), + // which can throw to indicate failure. If it throws, maintain a reference + // to the original error. + try { + parseResult = type.parseValue(inputValue); + } catch (error) { + if (error instanceof GraphQLError) { + onError(pathToArray(path), inputValue, error); + } else { + onError( + pathToArray(path), + inputValue, + new GraphQLError( + `Expected type "${type.name}". ` + error.message, + undefined, + undefined, + undefined, + undefined, + error, + ), + ); + } + return; + } + if (parseResult === undefined) { + onError( + pathToArray(path), + inputValue, + new GraphQLError(`Expected type "${type.name}".`), + ); + } + return parseResult; + } + /* c8 ignore next 3 */ + // Not reachable, all possible types have been considered. + invariant(false, 'Unexpected input type: ' + inspect(type)); +} diff --git a/src/utilities/concatAST.ts b/src/utilities/concatAST.ts new file mode 100644 index 00000000..33062f61 --- /dev/null +++ b/src/utilities/concatAST.ts @@ -0,0 +1,17 @@ +import type { DefinitionNode, DocumentNode } from '../language/ast'; +import { Kind } from '../language/kinds'; + +/** + * Provided a collection of ASTs, presumably each from different files, + * concatenate the ASTs together into batched AST, useful for validating many + * GraphQL source files which together represent one conceptual application. + */ +export function concatAST( + documents: ReadonlyArray, +): DocumentNode { + const definitions: Array = []; + for (const doc of documents) { + definitions.push(...doc.definitions); + } + return { kind: Kind.DOCUMENT, definitions }; +} diff --git a/src/utilities/extendSchema.ts b/src/utilities/extendSchema.ts new file mode 100644 index 00000000..998847e9 --- /dev/null +++ b/src/utilities/extendSchema.ts @@ -0,0 +1,684 @@ +import { devAssert } from '../jsutils/devAssert'; +import { inspect } from '../jsutils/inspect'; +import { invariant } from '../jsutils/invariant'; +import { keyMap } from '../jsutils/keyMap'; +import { mapValue } from '../jsutils/mapValue'; +import type { Maybe } from '../jsutils/Maybe'; + +import type { + DirectiveDefinitionNode, + DocumentNode, + EnumTypeDefinitionNode, + EnumTypeExtensionNode, + EnumValueDefinitionNode, + FieldDefinitionNode, + InputObjectTypeDefinitionNode, + InputObjectTypeExtensionNode, + InputValueDefinitionNode, + InterfaceTypeDefinitionNode, + InterfaceTypeExtensionNode, + NamedTypeNode, + ObjectTypeDefinitionNode, + ObjectTypeExtensionNode, + ScalarTypeDefinitionNode, + ScalarTypeExtensionNode, + SchemaDefinitionNode, + SchemaExtensionNode, + TypeDefinitionNode, + TypeNode, + UnionTypeDefinitionNode, + UnionTypeExtensionNode, +} from '../language/ast'; +import { Kind } from '../language/kinds'; +import { + isTypeDefinitionNode, + isTypeExtensionNode, +} from '../language/predicates'; + +import type { + GraphQLArgumentConfig, + GraphQLEnumValueConfigMap, + GraphQLFieldConfig, + GraphQLFieldConfigArgumentMap, + GraphQLFieldConfigMap, + GraphQLInputFieldConfigMap, + GraphQLNamedType, + GraphQLType, +} from '../type/definition'; +import { + GraphQLEnumType, + GraphQLInputObjectType, + GraphQLInterfaceType, + GraphQLList, + GraphQLNonNull, + GraphQLObjectType, + GraphQLScalarType, + GraphQLUnionType, + isEnumType, + isInputObjectType, + isInterfaceType, + isListType, + isNonNullType, + isObjectType, + isScalarType, + isUnionType, +} from '../type/definition'; +import { + GraphQLDeprecatedDirective, + GraphQLDirective, + GraphQLSpecifiedByDirective, +} from '../type/directives'; +import { introspectionTypes, isIntrospectionType } from '../type/introspection'; +import { isSpecifiedScalarType, specifiedScalarTypes } from '../type/scalars'; +import type { + GraphQLSchemaNormalizedConfig, + GraphQLSchemaValidationOptions, +} from '../type/schema'; +import { assertSchema, GraphQLSchema } from '../type/schema'; + +import { assertValidSDLExtension } from '../validation/validate'; + +import { getDirectiveValues } from '../execution/values'; + +import { valueFromAST } from './valueFromAST'; + +interface Options extends GraphQLSchemaValidationOptions { + /** + * Set to true to assume the SDL is valid. + * + * Default: false + */ + assumeValidSDL?: boolean; +} + +/** + * Produces a new schema given an existing schema and a document which may + * contain GraphQL type extensions and definitions. The original schema will + * remain unaltered. + * + * Because a schema represents a graph of references, a schema cannot be + * extended without effectively making an entire copy. We do not know until it's + * too late if subgraphs remain unchanged. + * + * This algorithm copies the provided schema, applying extensions while + * producing the copy. The original schema remains unaltered. + */ +export function extendSchema( + schema: GraphQLSchema, + documentAST: DocumentNode, + options?: Options, +): GraphQLSchema { + assertSchema(schema); + + devAssert( + documentAST != null && documentAST.kind === Kind.DOCUMENT, + 'Must provide valid Document AST.', + ); + + if (options?.assumeValid !== true && options?.assumeValidSDL !== true) { + assertValidSDLExtension(documentAST, schema); + } + + const schemaConfig = schema.toConfig(); + const extendedConfig = extendSchemaImpl(schemaConfig, documentAST, options); + return schemaConfig === extendedConfig + ? schema + : new GraphQLSchema(extendedConfig); +} + +/** + * @internal + */ +export function extendSchemaImpl( + schemaConfig: GraphQLSchemaNormalizedConfig, + documentAST: DocumentNode, + options?: Options, +): GraphQLSchemaNormalizedConfig { + // Collect the type definitions and extensions found in the document. + const typeDefs: Array = []; + const typeExtensionsMap = Object.create(null); + + // New directives and types are separate because a directives and types can + // have the same name. For example, a type named "skip". + const directiveDefs: Array = []; + + let schemaDef: Maybe; + // Schema extensions are collected which may add additional operation types. + const schemaExtensions: Array = []; + + for (const def of documentAST.definitions) { + if (def.kind === Kind.SCHEMA_DEFINITION) { + schemaDef = def; + } else if (def.kind === Kind.SCHEMA_EXTENSION) { + schemaExtensions.push(def); + } else if (isTypeDefinitionNode(def)) { + typeDefs.push(def); + } else if (isTypeExtensionNode(def)) { + const extendedTypeName = def.name.value; + const existingTypeExtensions = typeExtensionsMap[extendedTypeName]; + typeExtensionsMap[extendedTypeName] = existingTypeExtensions + ? existingTypeExtensions.concat([def]) + : [def]; + } else if (def.kind === Kind.DIRECTIVE_DEFINITION) { + directiveDefs.push(def); + } + } + + // If this document contains no new types, extensions, or directives then + // return the same unmodified GraphQLSchema instance. + if ( + Object.keys(typeExtensionsMap).length === 0 && + typeDefs.length === 0 && + directiveDefs.length === 0 && + schemaExtensions.length === 0 && + schemaDef == null + ) { + return schemaConfig; + } + + const typeMap = Object.create(null); + for (const existingType of schemaConfig.types) { + typeMap[existingType.name] = extendNamedType(existingType); + } + + for (const typeNode of typeDefs) { + const name = typeNode.name.value; + typeMap[name] = stdTypeMap[name] ?? buildType(typeNode); + } + + const operationTypes = { + // Get the extended root operation types. + query: schemaConfig.query && replaceNamedType(schemaConfig.query), + mutation: schemaConfig.mutation && replaceNamedType(schemaConfig.mutation), + subscription: + schemaConfig.subscription && replaceNamedType(schemaConfig.subscription), + // Then, incorporate schema definition and all schema extensions. + ...(schemaDef && getOperationTypes([schemaDef])), + ...getOperationTypes(schemaExtensions), + }; + + // Then produce and return a Schema config with these types. + return { + description: schemaDef?.description?.value, + ...operationTypes, + types: Object.values(typeMap), + directives: [ + ...schemaConfig.directives.map(replaceDirective), + ...directiveDefs.map(buildDirective), + ], + extensions: Object.create(null), + astNode: schemaDef ?? schemaConfig.astNode, + extensionASTNodes: schemaConfig.extensionASTNodes.concat(schemaExtensions), + assumeValid: options?.assumeValid ?? false, + }; + + // Below are functions used for producing this schema that have closed over + // this scope and have access to the schema, cache, and newly defined types. + + function replaceType(type: T): T { + if (isListType(type)) { + // @ts-expect-error + return new GraphQLList(replaceType(type.ofType)); + } + if (isNonNullType(type)) { + // @ts-expect-error + return new GraphQLNonNull(replaceType(type.ofType)); + } + // @ts-expect-error FIXME + return replaceNamedType(type); + } + + function replaceNamedType(type: T): T { + // Note: While this could make early assertions to get the correctly + // typed values, that would throw immediately while type system + // validation with validateSchema() will produce more actionable results. + return typeMap[type.name]; + } + + function replaceDirective(directive: GraphQLDirective): GraphQLDirective { + const config = directive.toConfig(); + return new GraphQLDirective({ + ...config, + args: mapValue(config.args, extendArg), + }); + } + + function extendNamedType(type: GraphQLNamedType): GraphQLNamedType { + if (isIntrospectionType(type) || isSpecifiedScalarType(type)) { + // Builtin types are not extended. + return type; + } + if (isScalarType(type)) { + return extendScalarType(type); + } + if (isObjectType(type)) { + return extendObjectType(type); + } + if (isInterfaceType(type)) { + return extendInterfaceType(type); + } + if (isUnionType(type)) { + return extendUnionType(type); + } + if (isEnumType(type)) { + return extendEnumType(type); + } + if (isInputObjectType(type)) { + return extendInputObjectType(type); + } + /* c8 ignore next 3 */ + // Not reachable, all possible type definition nodes have been considered. + invariant(false, 'Unexpected type: ' + inspect(type)); + } + + function extendInputObjectType( + type: GraphQLInputObjectType, + ): GraphQLInputObjectType { + const config = type.toConfig(); + const extensions = typeExtensionsMap[config.name] ?? []; + + return new GraphQLInputObjectType({ + ...config, + fields: () => ({ + ...mapValue(config.fields, (field) => ({ + ...field, + type: replaceType(field.type), + })), + ...buildInputFieldMap(extensions), + }), + extensionASTNodes: config.extensionASTNodes.concat(extensions), + }); + } + + function extendEnumType(type: GraphQLEnumType): GraphQLEnumType { + const config = type.toConfig(); + const extensions = typeExtensionsMap[type.name] ?? []; + + return new GraphQLEnumType({ + ...config, + values: { + ...config.values, + ...buildEnumValueMap(extensions), + }, + extensionASTNodes: config.extensionASTNodes.concat(extensions), + }); + } + + function extendScalarType(type: GraphQLScalarType): GraphQLScalarType { + const config = type.toConfig(); + const extensions = typeExtensionsMap[config.name] ?? []; + + let specifiedByURL = config.specifiedByURL; + for (const extensionNode of extensions) { + specifiedByURL = getSpecifiedByURL(extensionNode) ?? specifiedByURL; + } + + return new GraphQLScalarType({ + ...config, + specifiedByURL, + extensionASTNodes: config.extensionASTNodes.concat(extensions), + }); + } + + function extendObjectType(type: GraphQLObjectType): GraphQLObjectType { + const config = type.toConfig(); + const extensions = typeExtensionsMap[config.name] ?? []; + + return new GraphQLObjectType({ + ...config, + interfaces: () => [ + ...type.getInterfaces().map(replaceNamedType), + ...buildInterfaces(extensions), + ], + fields: () => ({ + ...mapValue(config.fields, extendField), + ...buildFieldMap(extensions), + }), + extensionASTNodes: config.extensionASTNodes.concat(extensions), + }); + } + + function extendInterfaceType( + type: GraphQLInterfaceType, + ): GraphQLInterfaceType { + const config = type.toConfig(); + const extensions = typeExtensionsMap[config.name] ?? []; + + return new GraphQLInterfaceType({ + ...config, + interfaces: () => [ + ...type.getInterfaces().map(replaceNamedType), + ...buildInterfaces(extensions), + ], + fields: () => ({ + ...mapValue(config.fields, extendField), + ...buildFieldMap(extensions), + }), + extensionASTNodes: config.extensionASTNodes.concat(extensions), + }); + } + + function extendUnionType(type: GraphQLUnionType): GraphQLUnionType { + const config = type.toConfig(); + const extensions = typeExtensionsMap[config.name] ?? []; + + return new GraphQLUnionType({ + ...config, + types: () => [ + ...type.getTypes().map(replaceNamedType), + ...buildUnionTypes(extensions), + ], + extensionASTNodes: config.extensionASTNodes.concat(extensions), + }); + } + + function extendField( + field: GraphQLFieldConfig, + ): GraphQLFieldConfig { + return { + ...field, + type: replaceType(field.type), + args: field.args && mapValue(field.args, extendArg), + }; + } + + function extendArg(arg: GraphQLArgumentConfig) { + return { + ...arg, + type: replaceType(arg.type), + }; + } + + function getOperationTypes( + nodes: ReadonlyArray, + ): { + query?: Maybe; + mutation?: Maybe; + subscription?: Maybe; + } { + const opTypes = {}; + for (const node of nodes) { + // FIXME: https://github.com/graphql/graphql-js/issues/2203 + const operationTypesNodes = + /* c8 ignore next */ node.operationTypes ?? []; + + for (const operationType of operationTypesNodes) { + // Note: While this could make early assertions to get the correctly + // typed values below, that would throw immediately while type system + // validation with validateSchema() will produce more actionable results. + // @ts-expect-error + opTypes[operationType.operation] = getNamedType(operationType.type); + } + } + + return opTypes; + } + + function getNamedType(node: NamedTypeNode): GraphQLNamedType { + const name = node.name.value; + const type = stdTypeMap[name] ?? typeMap[name]; + + if (type === undefined) { + throw new Error(`Unknown type: "${name}".`); + } + return type; + } + + function getWrappedType(node: TypeNode): GraphQLType { + if (node.kind === Kind.LIST_TYPE) { + return new GraphQLList(getWrappedType(node.type)); + } + if (node.kind === Kind.NON_NULL_TYPE) { + return new GraphQLNonNull(getWrappedType(node.type)); + } + return getNamedType(node); + } + + function buildDirective(node: DirectiveDefinitionNode): GraphQLDirective { + return new GraphQLDirective({ + name: node.name.value, + description: node.description?.value, + // @ts-expect-error + locations: node.locations.map(({ value }) => value), + isRepeatable: node.repeatable, + args: buildArgumentMap(node.arguments), + astNode: node, + }); + } + + function buildFieldMap( + nodes: ReadonlyArray< + | InterfaceTypeDefinitionNode + | InterfaceTypeExtensionNode + | ObjectTypeDefinitionNode + | ObjectTypeExtensionNode + >, + ): GraphQLFieldConfigMap { + const fieldConfigMap = Object.create(null); + for (const node of nodes) { + // FIXME: https://github.com/graphql/graphql-js/issues/2203 + const nodeFields = /* c8 ignore next */ node.fields ?? []; + + for (const field of nodeFields) { + fieldConfigMap[field.name.value] = { + // Note: While this could make assertions to get the correctly typed + // value, that would throw immediately while type system validation + // with validateSchema() will produce more actionable results. + type: getWrappedType(field.type), + description: field.description?.value, + args: buildArgumentMap(field.arguments), + deprecationReason: getDeprecationReason(field), + astNode: field, + }; + } + } + return fieldConfigMap; + } + + function buildArgumentMap( + args: Maybe>, + ): GraphQLFieldConfigArgumentMap { + // FIXME: https://github.com/graphql/graphql-js/issues/2203 + const argsNodes = /* c8 ignore next */ args ?? []; + + const argConfigMap = Object.create(null); + for (const arg of argsNodes) { + // Note: While this could make assertions to get the correctly typed + // value, that would throw immediately while type system validation + // with validateSchema() will produce more actionable results. + const type: any = getWrappedType(arg.type); + + argConfigMap[arg.name.value] = { + type, + description: arg.description?.value, + defaultValue: valueFromAST(arg.defaultValue, type), + deprecationReason: getDeprecationReason(arg), + astNode: arg, + }; + } + return argConfigMap; + } + + function buildInputFieldMap( + nodes: ReadonlyArray< + InputObjectTypeDefinitionNode | InputObjectTypeExtensionNode + >, + ): GraphQLInputFieldConfigMap { + const inputFieldMap = Object.create(null); + for (const node of nodes) { + // FIXME: https://github.com/graphql/graphql-js/issues/2203 + const fieldsNodes = /* c8 ignore next */ node.fields ?? []; + + for (const field of fieldsNodes) { + // Note: While this could make assertions to get the correctly typed + // value, that would throw immediately while type system validation + // with validateSchema() will produce more actionable results. + const type: any = getWrappedType(field.type); + + inputFieldMap[field.name.value] = { + type, + description: field.description?.value, + defaultValue: valueFromAST(field.defaultValue, type), + deprecationReason: getDeprecationReason(field), + astNode: field, + }; + } + } + return inputFieldMap; + } + + function buildEnumValueMap( + nodes: ReadonlyArray, + ): GraphQLEnumValueConfigMap { + const enumValueMap = Object.create(null); + for (const node of nodes) { + // FIXME: https://github.com/graphql/graphql-js/issues/2203 + const valuesNodes = /* c8 ignore next */ node.values ?? []; + + for (const value of valuesNodes) { + enumValueMap[value.name.value] = { + description: value.description?.value, + deprecationReason: getDeprecationReason(value), + astNode: value, + }; + } + } + return enumValueMap; + } + + function buildInterfaces( + nodes: ReadonlyArray< + | InterfaceTypeDefinitionNode + | InterfaceTypeExtensionNode + | ObjectTypeDefinitionNode + | ObjectTypeExtensionNode + >, + ): Array { + // Note: While this could make assertions to get the correctly typed + // values below, that would throw immediately while type system + // validation with validateSchema() will produce more actionable results. + // @ts-expect-error + return nodes.flatMap( + // FIXME: https://github.com/graphql/graphql-js/issues/2203 + (node) => /* c8 ignore next */ node.interfaces?.map(getNamedType) ?? [], + ); + } + + function buildUnionTypes( + nodes: ReadonlyArray, + ): Array { + // Note: While this could make assertions to get the correctly typed + // values below, that would throw immediately while type system + // validation with validateSchema() will produce more actionable results. + // @ts-expect-error + return nodes.flatMap( + // FIXME: https://github.com/graphql/graphql-js/issues/2203 + (node) => /* c8 ignore next */ node.types?.map(getNamedType) ?? [], + ); + } + + function buildType(astNode: TypeDefinitionNode): GraphQLNamedType { + const name = astNode.name.value; + const extensionASTNodes = typeExtensionsMap[name] ?? []; + + switch (astNode.kind) { + case Kind.OBJECT_TYPE_DEFINITION: { + const allNodes = [astNode, ...extensionASTNodes]; + + return new GraphQLObjectType({ + name, + description: astNode.description?.value, + interfaces: () => buildInterfaces(allNodes), + fields: () => buildFieldMap(allNodes), + astNode, + extensionASTNodes, + }); + } + case Kind.INTERFACE_TYPE_DEFINITION: { + const allNodes = [astNode, ...extensionASTNodes]; + + return new GraphQLInterfaceType({ + name, + description: astNode.description?.value, + interfaces: () => buildInterfaces(allNodes), + fields: () => buildFieldMap(allNodes), + astNode, + extensionASTNodes, + }); + } + case Kind.ENUM_TYPE_DEFINITION: { + const allNodes = [astNode, ...extensionASTNodes]; + + return new GraphQLEnumType({ + name, + description: astNode.description?.value, + values: buildEnumValueMap(allNodes), + astNode, + extensionASTNodes, + }); + } + case Kind.UNION_TYPE_DEFINITION: { + const allNodes = [astNode, ...extensionASTNodes]; + + return new GraphQLUnionType({ + name, + description: astNode.description?.value, + types: () => buildUnionTypes(allNodes), + astNode, + extensionASTNodes, + }); + } + case Kind.SCALAR_TYPE_DEFINITION: { + return new GraphQLScalarType({ + name, + description: astNode.description?.value, + specifiedByURL: getSpecifiedByURL(astNode), + astNode, + extensionASTNodes, + }); + } + case Kind.INPUT_OBJECT_TYPE_DEFINITION: { + const allNodes = [astNode, ...extensionASTNodes]; + + return new GraphQLInputObjectType({ + name, + description: astNode.description?.value, + fields: () => buildInputFieldMap(allNodes), + astNode, + extensionASTNodes, + }); + } + } + } +} + +const stdTypeMap = keyMap( + [...specifiedScalarTypes, ...introspectionTypes], + (type) => type.name, +); + +/** + * Given a field or enum value node, returns the string value for the + * deprecation reason. + */ +function getDeprecationReason( + node: + | EnumValueDefinitionNode + | FieldDefinitionNode + | InputValueDefinitionNode, +): Maybe { + const deprecated = getDirectiveValues(GraphQLDeprecatedDirective, node); + // @ts-expect-error validated by `getDirectiveValues` + return deprecated?.reason; +} + +/** + * Given a scalar node, returns the string value for the specifiedByURL. + */ +function getSpecifiedByURL( + node: ScalarTypeDefinitionNode | ScalarTypeExtensionNode, +): Maybe { + const specifiedBy = getDirectiveValues(GraphQLSpecifiedByDirective, node); + // @ts-expect-error validated by `getDirectiveValues` + return specifiedBy?.url; +} diff --git a/src/utilities/findBreakingChanges.ts b/src/utilities/findBreakingChanges.ts new file mode 100644 index 00000000..b82901f9 --- /dev/null +++ b/src/utilities/findBreakingChanges.ts @@ -0,0 +1,586 @@ +import { inspect } from '../jsutils/inspect'; +import { invariant } from '../jsutils/invariant'; +import { keyMap } from '../jsutils/keyMap'; +import { naturalCompare } from '../jsutils/naturalCompare'; + +import { print } from '../language/printer'; +import { visit } from '../language/visitor'; + +import type { + GraphQLEnumType, + GraphQLField, + GraphQLInputObjectType, + GraphQLInputType, + GraphQLInterfaceType, + GraphQLNamedType, + GraphQLObjectType, + GraphQLType, + GraphQLUnionType, +} from '../type/definition'; +import { + isEnumType, + isInputObjectType, + isInterfaceType, + isListType, + isNamedType, + isNonNullType, + isObjectType, + isRequiredArgument, + isRequiredInputField, + isScalarType, + isUnionType, +} from '../type/definition'; +import { isSpecifiedScalarType } from '../type/scalars'; +import type { GraphQLSchema } from '../type/schema'; + +import { astFromValue } from './astFromValue'; + +export enum BreakingChangeType { + TYPE_REMOVED = 'TYPE_REMOVED', + TYPE_CHANGED_KIND = 'TYPE_CHANGED_KIND', + TYPE_REMOVED_FROM_UNION = 'TYPE_REMOVED_FROM_UNION', + VALUE_REMOVED_FROM_ENUM = 'VALUE_REMOVED_FROM_ENUM', + REQUIRED_INPUT_FIELD_ADDED = 'REQUIRED_INPUT_FIELD_ADDED', + IMPLEMENTED_INTERFACE_REMOVED = 'IMPLEMENTED_INTERFACE_REMOVED', + FIELD_REMOVED = 'FIELD_REMOVED', + FIELD_CHANGED_KIND = 'FIELD_CHANGED_KIND', + REQUIRED_ARG_ADDED = 'REQUIRED_ARG_ADDED', + ARG_REMOVED = 'ARG_REMOVED', + ARG_CHANGED_KIND = 'ARG_CHANGED_KIND', + DIRECTIVE_REMOVED = 'DIRECTIVE_REMOVED', + DIRECTIVE_ARG_REMOVED = 'DIRECTIVE_ARG_REMOVED', + REQUIRED_DIRECTIVE_ARG_ADDED = 'REQUIRED_DIRECTIVE_ARG_ADDED', + DIRECTIVE_REPEATABLE_REMOVED = 'DIRECTIVE_REPEATABLE_REMOVED', + DIRECTIVE_LOCATION_REMOVED = 'DIRECTIVE_LOCATION_REMOVED', +} + +export enum DangerousChangeType { + VALUE_ADDED_TO_ENUM = 'VALUE_ADDED_TO_ENUM', + TYPE_ADDED_TO_UNION = 'TYPE_ADDED_TO_UNION', + OPTIONAL_INPUT_FIELD_ADDED = 'OPTIONAL_INPUT_FIELD_ADDED', + OPTIONAL_ARG_ADDED = 'OPTIONAL_ARG_ADDED', + IMPLEMENTED_INTERFACE_ADDED = 'IMPLEMENTED_INTERFACE_ADDED', + ARG_DEFAULT_VALUE_CHANGE = 'ARG_DEFAULT_VALUE_CHANGE', +} + +export interface BreakingChange { + type: BreakingChangeType; + description: string; +} + +export interface DangerousChange { + type: DangerousChangeType; + description: string; +} + +/** + * Given two schemas, returns an Array containing descriptions of all the types + * of breaking changes covered by the other functions down below. + */ +export function findBreakingChanges( + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema, +): Array { + // @ts-expect-error + return findSchemaChanges(oldSchema, newSchema).filter( + (change) => change.type in BreakingChangeType, + ); +} + +/** + * Given two schemas, returns an Array containing descriptions of all the types + * of potentially dangerous changes covered by the other functions down below. + */ +export function findDangerousChanges( + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema, +): Array { + // @ts-expect-error + return findSchemaChanges(oldSchema, newSchema).filter( + (change) => change.type in DangerousChangeType, + ); +} + +function findSchemaChanges( + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema, +): Array { + return [ + ...findTypeChanges(oldSchema, newSchema), + ...findDirectiveChanges(oldSchema, newSchema), + ]; +} + +function findDirectiveChanges( + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema, +): Array { + const schemaChanges = []; + + const directivesDiff = diff( + oldSchema.getDirectives(), + newSchema.getDirectives(), + ); + + for (const oldDirective of directivesDiff.removed) { + schemaChanges.push({ + type: BreakingChangeType.DIRECTIVE_REMOVED, + description: `${oldDirective.name} was removed.`, + }); + } + + for (const [oldDirective, newDirective] of directivesDiff.persisted) { + const argsDiff = diff(oldDirective.args, newDirective.args); + + for (const newArg of argsDiff.added) { + if (isRequiredArgument(newArg)) { + schemaChanges.push({ + type: BreakingChangeType.REQUIRED_DIRECTIVE_ARG_ADDED, + description: `A required arg ${newArg.name} on directive ${oldDirective.name} was added.`, + }); + } + } + + for (const oldArg of argsDiff.removed) { + schemaChanges.push({ + type: BreakingChangeType.DIRECTIVE_ARG_REMOVED, + description: `${oldArg.name} was removed from ${oldDirective.name}.`, + }); + } + + if (oldDirective.isRepeatable && !newDirective.isRepeatable) { + schemaChanges.push({ + type: BreakingChangeType.DIRECTIVE_REPEATABLE_REMOVED, + description: `Repeatable flag was removed from ${oldDirective.name}.`, + }); + } + + for (const location of oldDirective.locations) { + if (!newDirective.locations.includes(location)) { + schemaChanges.push({ + type: BreakingChangeType.DIRECTIVE_LOCATION_REMOVED, + description: `${location} was removed from ${oldDirective.name}.`, + }); + } + } + } + + return schemaChanges; +} + +function findTypeChanges( + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema, +): Array { + const schemaChanges = []; + + const typesDiff = diff( + Object.values(oldSchema.getTypeMap()), + Object.values(newSchema.getTypeMap()), + ); + + for (const oldType of typesDiff.removed) { + schemaChanges.push({ + type: BreakingChangeType.TYPE_REMOVED, + description: isSpecifiedScalarType(oldType) + ? `Standard scalar ${oldType.name} was removed because it is not referenced anymore.` + : `${oldType.name} was removed.`, + }); + } + + for (const [oldType, newType] of typesDiff.persisted) { + if (isEnumType(oldType) && isEnumType(newType)) { + schemaChanges.push(...findEnumTypeChanges(oldType, newType)); + } else if (isUnionType(oldType) && isUnionType(newType)) { + schemaChanges.push(...findUnionTypeChanges(oldType, newType)); + } else if (isInputObjectType(oldType) && isInputObjectType(newType)) { + schemaChanges.push(...findInputObjectTypeChanges(oldType, newType)); + } else if (isObjectType(oldType) && isObjectType(newType)) { + schemaChanges.push( + ...findFieldChanges(oldType, newType), + ...findImplementedInterfacesChanges(oldType, newType), + ); + } else if (isInterfaceType(oldType) && isInterfaceType(newType)) { + schemaChanges.push( + ...findFieldChanges(oldType, newType), + ...findImplementedInterfacesChanges(oldType, newType), + ); + } else if (oldType.constructor !== newType.constructor) { + schemaChanges.push({ + type: BreakingChangeType.TYPE_CHANGED_KIND, + description: + `${oldType.name} changed from ` + + `${typeKindName(oldType)} to ${typeKindName(newType)}.`, + }); + } + } + + return schemaChanges; +} + +function findInputObjectTypeChanges( + oldType: GraphQLInputObjectType, + newType: GraphQLInputObjectType, +): Array { + const schemaChanges = []; + const fieldsDiff = diff( + Object.values(oldType.getFields()), + Object.values(newType.getFields()), + ); + + for (const newField of fieldsDiff.added) { + if (isRequiredInputField(newField)) { + schemaChanges.push({ + type: BreakingChangeType.REQUIRED_INPUT_FIELD_ADDED, + description: `A required field ${newField.name} on input type ${oldType.name} was added.`, + }); + } else { + schemaChanges.push({ + type: DangerousChangeType.OPTIONAL_INPUT_FIELD_ADDED, + description: `An optional field ${newField.name} on input type ${oldType.name} was added.`, + }); + } + } + + for (const oldField of fieldsDiff.removed) { + schemaChanges.push({ + type: BreakingChangeType.FIELD_REMOVED, + description: `${oldType.name}.${oldField.name} was removed.`, + }); + } + + for (const [oldField, newField] of fieldsDiff.persisted) { + const isSafe = isChangeSafeForInputObjectFieldOrFieldArg( + oldField.type, + newField.type, + ); + if (!isSafe) { + schemaChanges.push({ + type: BreakingChangeType.FIELD_CHANGED_KIND, + description: + `${oldType.name}.${oldField.name} changed type from ` + + `${String(oldField.type)} to ${String(newField.type)}.`, + }); + } + } + + return schemaChanges; +} + +function findUnionTypeChanges( + oldType: GraphQLUnionType, + newType: GraphQLUnionType, +): Array { + const schemaChanges = []; + const possibleTypesDiff = diff(oldType.getTypes(), newType.getTypes()); + + for (const newPossibleType of possibleTypesDiff.added) { + schemaChanges.push({ + type: DangerousChangeType.TYPE_ADDED_TO_UNION, + description: `${newPossibleType.name} was added to union type ${oldType.name}.`, + }); + } + + for (const oldPossibleType of possibleTypesDiff.removed) { + schemaChanges.push({ + type: BreakingChangeType.TYPE_REMOVED_FROM_UNION, + description: `${oldPossibleType.name} was removed from union type ${oldType.name}.`, + }); + } + + return schemaChanges; +} + +function findEnumTypeChanges( + oldType: GraphQLEnumType, + newType: GraphQLEnumType, +): Array { + const schemaChanges = []; + const valuesDiff = diff(oldType.getValues(), newType.getValues()); + + for (const newValue of valuesDiff.added) { + schemaChanges.push({ + type: DangerousChangeType.VALUE_ADDED_TO_ENUM, + description: `${newValue.name} was added to enum type ${oldType.name}.`, + }); + } + + for (const oldValue of valuesDiff.removed) { + schemaChanges.push({ + type: BreakingChangeType.VALUE_REMOVED_FROM_ENUM, + description: `${oldValue.name} was removed from enum type ${oldType.name}.`, + }); + } + + return schemaChanges; +} + +function findImplementedInterfacesChanges( + oldType: GraphQLObjectType | GraphQLInterfaceType, + newType: GraphQLObjectType | GraphQLInterfaceType, +): Array { + const schemaChanges = []; + const interfacesDiff = diff(oldType.getInterfaces(), newType.getInterfaces()); + + for (const newInterface of interfacesDiff.added) { + schemaChanges.push({ + type: DangerousChangeType.IMPLEMENTED_INTERFACE_ADDED, + description: `${newInterface.name} added to interfaces implemented by ${oldType.name}.`, + }); + } + + for (const oldInterface of interfacesDiff.removed) { + schemaChanges.push({ + type: BreakingChangeType.IMPLEMENTED_INTERFACE_REMOVED, + description: `${oldType.name} no longer implements interface ${oldInterface.name}.`, + }); + } + + return schemaChanges; +} + +function findFieldChanges( + oldType: GraphQLObjectType | GraphQLInterfaceType, + newType: GraphQLObjectType | GraphQLInterfaceType, +): Array { + const schemaChanges = []; + const fieldsDiff = diff( + Object.values(oldType.getFields()), + Object.values(newType.getFields()), + ); + + for (const oldField of fieldsDiff.removed) { + schemaChanges.push({ + type: BreakingChangeType.FIELD_REMOVED, + description: `${oldType.name}.${oldField.name} was removed.`, + }); + } + + for (const [oldField, newField] of fieldsDiff.persisted) { + schemaChanges.push(...findArgChanges(oldType, oldField, newField)); + + const isSafe = isChangeSafeForObjectOrInterfaceField( + oldField.type, + newField.type, + ); + if (!isSafe) { + schemaChanges.push({ + type: BreakingChangeType.FIELD_CHANGED_KIND, + description: + `${oldType.name}.${oldField.name} changed type from ` + + `${String(oldField.type)} to ${String(newField.type)}.`, + }); + } + } + + return schemaChanges; +} + +function findArgChanges( + oldType: GraphQLObjectType | GraphQLInterfaceType, + oldField: GraphQLField, + newField: GraphQLField, +): Array { + const schemaChanges = []; + const argsDiff = diff(oldField.args, newField.args); + + for (const oldArg of argsDiff.removed) { + schemaChanges.push({ + type: BreakingChangeType.ARG_REMOVED, + description: `${oldType.name}.${oldField.name} arg ${oldArg.name} was removed.`, + }); + } + + for (const [oldArg, newArg] of argsDiff.persisted) { + const isSafe = isChangeSafeForInputObjectFieldOrFieldArg( + oldArg.type, + newArg.type, + ); + if (!isSafe) { + schemaChanges.push({ + type: BreakingChangeType.ARG_CHANGED_KIND, + description: + `${oldType.name}.${oldField.name} arg ${oldArg.name} has changed type from ` + + `${String(oldArg.type)} to ${String(newArg.type)}.`, + }); + } else if (oldArg.defaultValue !== undefined) { + if (newArg.defaultValue === undefined) { + schemaChanges.push({ + type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE, + description: `${oldType.name}.${oldField.name} arg ${oldArg.name} defaultValue was removed.`, + }); + } else { + // Since we looking only for client's observable changes we should + // compare default values in the same representation as they are + // represented inside introspection. + const oldValueStr = stringifyValue(oldArg.defaultValue, oldArg.type); + const newValueStr = stringifyValue(newArg.defaultValue, newArg.type); + + if (oldValueStr !== newValueStr) { + schemaChanges.push({ + type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE, + description: `${oldType.name}.${oldField.name} arg ${oldArg.name} has changed defaultValue from ${oldValueStr} to ${newValueStr}.`, + }); + } + } + } + } + + for (const newArg of argsDiff.added) { + if (isRequiredArgument(newArg)) { + schemaChanges.push({ + type: BreakingChangeType.REQUIRED_ARG_ADDED, + description: `A required arg ${newArg.name} on ${oldType.name}.${oldField.name} was added.`, + }); + } else { + schemaChanges.push({ + type: DangerousChangeType.OPTIONAL_ARG_ADDED, + description: `An optional arg ${newArg.name} on ${oldType.name}.${oldField.name} was added.`, + }); + } + } + + return schemaChanges; +} + +function isChangeSafeForObjectOrInterfaceField( + oldType: GraphQLType, + newType: GraphQLType, +): boolean { + if (isListType(oldType)) { + return ( + // if they're both lists, make sure the underlying types are compatible + (isListType(newType) && + isChangeSafeForObjectOrInterfaceField( + oldType.ofType, + newType.ofType, + )) || + // moving from nullable to non-null of the same underlying type is safe + (isNonNullType(newType) && + isChangeSafeForObjectOrInterfaceField(oldType, newType.ofType)) + ); + } + + if (isNonNullType(oldType)) { + // if they're both non-null, make sure the underlying types are compatible + return ( + isNonNullType(newType) && + isChangeSafeForObjectOrInterfaceField(oldType.ofType, newType.ofType) + ); + } + + return ( + // if they're both named types, see if their names are equivalent + (isNamedType(newType) && oldType.name === newType.name) || + // moving from nullable to non-null of the same underlying type is safe + (isNonNullType(newType) && + isChangeSafeForObjectOrInterfaceField(oldType, newType.ofType)) + ); +} + +function isChangeSafeForInputObjectFieldOrFieldArg( + oldType: GraphQLType, + newType: GraphQLType, +): boolean { + if (isListType(oldType)) { + // if they're both lists, make sure the underlying types are compatible + return ( + isListType(newType) && + isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType.ofType) + ); + } + + if (isNonNullType(oldType)) { + return ( + // if they're both non-null, make sure the underlying types are + // compatible + (isNonNullType(newType) && + isChangeSafeForInputObjectFieldOrFieldArg( + oldType.ofType, + newType.ofType, + )) || + // moving from non-null to nullable of the same underlying type is safe + (!isNonNullType(newType) && + isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType)) + ); + } + + // if they're both named types, see if their names are equivalent + return isNamedType(newType) && oldType.name === newType.name; +} + +function typeKindName(type: GraphQLNamedType): string { + if (isScalarType(type)) { + return 'a Scalar type'; + } + if (isObjectType(type)) { + return 'an Object type'; + } + if (isInterfaceType(type)) { + return 'an Interface type'; + } + if (isUnionType(type)) { + return 'a Union type'; + } + if (isEnumType(type)) { + return 'an Enum type'; + } + if (isInputObjectType(type)) { + return 'an Input type'; + } + /* c8 ignore next 3 */ + // Not reachable, all possible types have been considered. + invariant(false, 'Unexpected type: ' + inspect(type)); +} + +function stringifyValue(value: unknown, type: GraphQLInputType): string { + const ast = astFromValue(value, type); + invariant(ast != null); + + const sortedAST = visit(ast, { + ObjectValue(objectNode) { + // Make a copy since sort mutates array + const fields = [...objectNode.fields]; + + fields.sort((fieldA, fieldB) => + naturalCompare(fieldA.name.value, fieldB.name.value), + ); + return { ...objectNode, fields }; + }, + }); + + return print(sortedAST); +} + +function diff( + oldArray: ReadonlyArray, + newArray: ReadonlyArray, +): { + added: ReadonlyArray; + removed: ReadonlyArray; + persisted: ReadonlyArray<[T, T]>; +} { + const added: Array = []; + const removed: Array = []; + const persisted: Array<[T, T]> = []; + + const oldMap = keyMap(oldArray, ({ name }) => name); + const newMap = keyMap(newArray, ({ name }) => name); + + for (const oldItem of oldArray) { + const newItem = newMap[oldItem.name]; + if (newItem === undefined) { + removed.push(oldItem); + } else { + persisted.push([oldItem, newItem]); + } + } + + for (const newItem of newArray) { + if (oldMap[newItem.name] === undefined) { + added.push(newItem); + } + } + + return { added, persisted, removed }; +} diff --git a/src/utilities/getIntrospectionQuery.ts b/src/utilities/getIntrospectionQuery.ts new file mode 100644 index 00000000..c21fe9a1 --- /dev/null +++ b/src/utilities/getIntrospectionQuery.ts @@ -0,0 +1,331 @@ +import type { Maybe } from '../jsutils/Maybe'; + +import type { DirectiveLocation } from '../language/directiveLocation'; + +export interface IntrospectionOptions { + /** + * Whether to include descriptions in the introspection result. + * Default: true + */ + descriptions?: boolean; + + /** + * Whether to include `specifiedByURL` in the introspection result. + * Default: false + */ + specifiedByUrl?: boolean; + + /** + * Whether to include `isRepeatable` flag on directives. + * Default: false + */ + directiveIsRepeatable?: boolean; + + /** + * Whether to include `description` field on schema. + * Default: false + */ + schemaDescription?: boolean; + + /** + * Whether target GraphQL server support deprecation of input values. + * Default: false + */ + inputValueDeprecation?: boolean; +} + +/** + * Produce the GraphQL query recommended for a full schema introspection. + * Accepts optional IntrospectionOptions. + */ +export function getIntrospectionQuery(options?: IntrospectionOptions): string { + const optionsWithDefault = { + descriptions: true, + specifiedByUrl: false, + directiveIsRepeatable: false, + schemaDescription: false, + inputValueDeprecation: false, + ...options, + }; + + const descriptions = optionsWithDefault.descriptions ? 'description' : ''; + const specifiedByUrl = optionsWithDefault.specifiedByUrl + ? 'specifiedByURL' + : ''; + const directiveIsRepeatable = optionsWithDefault.directiveIsRepeatable + ? 'isRepeatable' + : ''; + const schemaDescription = optionsWithDefault.schemaDescription + ? descriptions + : ''; + + function inputDeprecation(str: string) { + return optionsWithDefault.inputValueDeprecation ? str : ''; + } + + return ` + query IntrospectionQuery { + __schema { + ${schemaDescription} + queryType { name } + mutationType { name } + subscriptionType { name } + types { + ...FullType + } + directives { + name + ${descriptions} + ${directiveIsRepeatable} + locations + args${inputDeprecation('(includeDeprecated: true)')} { + ...InputValue + } + } + } + } + + fragment FullType on __Type { + kind + name + ${descriptions} + ${specifiedByUrl} + fields(includeDeprecated: true) { + name + ${descriptions} + args${inputDeprecation('(includeDeprecated: true)')} { + ...InputValue + } + type { + ...TypeRef + } + isDeprecated + deprecationReason + } + inputFields${inputDeprecation('(includeDeprecated: true)')} { + ...InputValue + } + interfaces { + ...TypeRef + } + enumValues(includeDeprecated: true) { + name + ${descriptions} + isDeprecated + deprecationReason + } + possibleTypes { + ...TypeRef + } + } + + fragment InputValue on __InputValue { + name + ${descriptions} + type { ...TypeRef } + defaultValue + ${inputDeprecation('isDeprecated')} + ${inputDeprecation('deprecationReason')} + } + + fragment TypeRef on __Type { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + } + } + } + } + } + } + } + } + `; +} + +export interface IntrospectionQuery { + readonly __schema: IntrospectionSchema; +} + +export interface IntrospectionSchema { + readonly description?: Maybe; + readonly queryType: IntrospectionNamedTypeRef; + readonly mutationType: Maybe< + IntrospectionNamedTypeRef + >; + readonly subscriptionType: Maybe< + IntrospectionNamedTypeRef + >; + readonly types: ReadonlyArray; + readonly directives: ReadonlyArray; +} + +export type IntrospectionType = + | IntrospectionScalarType + | IntrospectionObjectType + | IntrospectionInterfaceType + | IntrospectionUnionType + | IntrospectionEnumType + | IntrospectionInputObjectType; + +export type IntrospectionOutputType = + | IntrospectionScalarType + | IntrospectionObjectType + | IntrospectionInterfaceType + | IntrospectionUnionType + | IntrospectionEnumType; + +export type IntrospectionInputType = + | IntrospectionScalarType + | IntrospectionEnumType + | IntrospectionInputObjectType; + +export interface IntrospectionScalarType { + readonly kind: 'SCALAR'; + readonly name: string; + readonly description?: Maybe; + readonly specifiedByURL?: Maybe; +} + +export interface IntrospectionObjectType { + readonly kind: 'OBJECT'; + readonly name: string; + readonly description?: Maybe; + readonly fields: ReadonlyArray; + readonly interfaces: ReadonlyArray< + IntrospectionNamedTypeRef + >; +} + +export interface IntrospectionInterfaceType { + readonly kind: 'INTERFACE'; + readonly name: string; + readonly description?: Maybe; + readonly fields: ReadonlyArray; + readonly interfaces: ReadonlyArray< + IntrospectionNamedTypeRef + >; + readonly possibleTypes: ReadonlyArray< + IntrospectionNamedTypeRef + >; +} + +export interface IntrospectionUnionType { + readonly kind: 'UNION'; + readonly name: string; + readonly description?: Maybe; + readonly possibleTypes: ReadonlyArray< + IntrospectionNamedTypeRef + >; +} + +export interface IntrospectionEnumType { + readonly kind: 'ENUM'; + readonly name: string; + readonly description?: Maybe; + readonly enumValues: ReadonlyArray; +} + +export interface IntrospectionInputObjectType { + readonly kind: 'INPUT_OBJECT'; + readonly name: string; + readonly description?: Maybe; + readonly inputFields: ReadonlyArray; +} + +export interface IntrospectionListTypeRef< + T extends IntrospectionTypeRef = IntrospectionTypeRef, +> { + readonly kind: 'LIST'; + readonly ofType: T; +} + +export interface IntrospectionNonNullTypeRef< + T extends IntrospectionTypeRef = IntrospectionTypeRef, +> { + readonly kind: 'NON_NULL'; + readonly ofType: T; +} + +export type IntrospectionTypeRef = + | IntrospectionNamedTypeRef + | IntrospectionListTypeRef + | IntrospectionNonNullTypeRef< + IntrospectionNamedTypeRef | IntrospectionListTypeRef + >; + +export type IntrospectionOutputTypeRef = + | IntrospectionNamedTypeRef + | IntrospectionListTypeRef + | IntrospectionNonNullTypeRef< + | IntrospectionNamedTypeRef + | IntrospectionListTypeRef + >; + +export type IntrospectionInputTypeRef = + | IntrospectionNamedTypeRef + | IntrospectionListTypeRef + | IntrospectionNonNullTypeRef< + | IntrospectionNamedTypeRef + | IntrospectionListTypeRef + >; + +export interface IntrospectionNamedTypeRef< + T extends IntrospectionType = IntrospectionType, +> { + readonly kind: T['kind']; + readonly name: string; +} + +export interface IntrospectionField { + readonly name: string; + readonly description?: Maybe; + readonly args: ReadonlyArray; + readonly type: IntrospectionOutputTypeRef; + readonly isDeprecated: boolean; + readonly deprecationReason: Maybe; +} + +export interface IntrospectionInputValue { + readonly name: string; + readonly description?: Maybe; + readonly type: IntrospectionInputTypeRef; + readonly defaultValue: Maybe; + readonly isDeprecated?: boolean; + readonly deprecationReason?: Maybe; +} + +export interface IntrospectionEnumValue { + readonly name: string; + readonly description?: Maybe; + readonly isDeprecated: boolean; + readonly deprecationReason: Maybe; +} + +export interface IntrospectionDirective { + readonly name: string; + readonly description?: Maybe; + readonly isRepeatable?: boolean; + readonly locations: ReadonlyArray; + readonly args: ReadonlyArray; +} diff --git a/src/utilities/getOperationAST.ts b/src/utilities/getOperationAST.ts new file mode 100644 index 00000000..8decf943 --- /dev/null +++ b/src/utilities/getOperationAST.ts @@ -0,0 +1,32 @@ +import type { Maybe } from '../jsutils/Maybe'; + +import type { DocumentNode, OperationDefinitionNode } from '../language/ast'; +import { Kind } from '../language/kinds'; + +/** + * Returns an operation AST given a document AST and optionally an operation + * name. If a name is not provided, an operation is only returned if only one is + * provided in the document. + */ +export function getOperationAST( + documentAST: DocumentNode, + operationName?: Maybe, +): Maybe { + let operation = null; + for (const definition of documentAST.definitions) { + if (definition.kind === Kind.OPERATION_DEFINITION) { + if (operationName == null) { + // If no operation name was provided, only return an Operation if there + // is one defined in the document. Upon encountering the second, return + // null. + if (operation) { + return null; + } + operation = definition; + } else if (definition.name?.value === operationName) { + return definition; + } + } + } + return operation; +} diff --git a/src/utilities/getOperationRootType.ts b/src/utilities/getOperationRootType.ts new file mode 100644 index 00000000..86302be8 --- /dev/null +++ b/src/utilities/getOperationRootType.ts @@ -0,0 +1,57 @@ +import { GraphQLError } from '../error/GraphQLError'; + +import type { + OperationDefinitionNode, + OperationTypeDefinitionNode, +} from '../language/ast'; + +import type { GraphQLObjectType } from '../type/definition'; +import type { GraphQLSchema } from '../type/schema'; + +/** + * Extracts the root type of the operation from the schema. + * + * @deprecated Please use `GraphQLSchema.getRootType` instead. Will be removed in v17 + */ +export function getOperationRootType( + schema: GraphQLSchema, + operation: OperationDefinitionNode | OperationTypeDefinitionNode, +): GraphQLObjectType { + if (operation.operation === 'query') { + const queryType = schema.getQueryType(); + if (!queryType) { + throw new GraphQLError( + 'Schema does not define the required query root type.', + operation, + ); + } + return queryType; + } + + if (operation.operation === 'mutation') { + const mutationType = schema.getMutationType(); + if (!mutationType) { + throw new GraphQLError( + 'Schema is not configured for mutations.', + operation, + ); + } + return mutationType; + } + + if (operation.operation === 'subscription') { + const subscriptionType = schema.getSubscriptionType(); + if (!subscriptionType) { + throw new GraphQLError( + 'Schema is not configured for subscriptions.', + operation, + ); + } + return subscriptionType; + } + + throw new GraphQLError( + 'Can only have query, mutation and subscription operations.', + operation, + ); +} diff --git a/src/utilities/index.ts b/src/utilities/index.ts new file mode 100644 index 00000000..452b9752 --- /dev/null +++ b/src/utilities/index.ts @@ -0,0 +1,105 @@ +// Produce the GraphQL query recommended for a full schema introspection. +export { getIntrospectionQuery } from './getIntrospectionQuery'; + +export type { + IntrospectionOptions, + IntrospectionQuery, + IntrospectionSchema, + IntrospectionType, + IntrospectionInputType, + IntrospectionOutputType, + IntrospectionScalarType, + IntrospectionObjectType, + IntrospectionInterfaceType, + IntrospectionUnionType, + IntrospectionEnumType, + IntrospectionInputObjectType, + IntrospectionTypeRef, + IntrospectionInputTypeRef, + IntrospectionOutputTypeRef, + IntrospectionNamedTypeRef, + IntrospectionListTypeRef, + IntrospectionNonNullTypeRef, + IntrospectionField, + IntrospectionInputValue, + IntrospectionEnumValue, + IntrospectionDirective, +} from './getIntrospectionQuery'; + +// Gets the target Operation from a Document. +export { getOperationAST } from './getOperationAST'; + +// Gets the Type for the target Operation AST. +export { getOperationRootType } from './getOperationRootType'; + +// Convert a GraphQLSchema to an IntrospectionQuery. +export { introspectionFromSchema } from './introspectionFromSchema'; + +// Build a GraphQLSchema from an introspection result. +export { buildClientSchema } from './buildClientSchema'; + +// Build a GraphQLSchema from GraphQL Schema language. +export { buildASTSchema, buildSchema } from './buildASTSchema'; +export type { BuildSchemaOptions } from './buildASTSchema'; + +// Extends an existing GraphQLSchema from a parsed GraphQL Schema language AST. +export { extendSchema } from './extendSchema'; + +// Sort a GraphQLSchema. +export { lexicographicSortSchema } from './lexicographicSortSchema'; + +// Print a GraphQLSchema to GraphQL Schema language. +export { + printSchema, + printType, + printIntrospectionSchema, +} from './printSchema'; + +// Create a GraphQLType from a GraphQL language AST. +export { typeFromAST } from './typeFromAST'; + +// Create a JavaScript value from a GraphQL language AST with a type. +export { valueFromAST } from './valueFromAST'; + +// Create a JavaScript value from a GraphQL language AST without a type. +export { valueFromASTUntyped } from './valueFromASTUntyped'; + +// Create a GraphQL language AST from a JavaScript value. +export { astFromValue } from './astFromValue'; + +// A helper to use within recursive-descent visitors which need to be aware of the GraphQL type system. +export { TypeInfo, visitWithTypeInfo } from './TypeInfo'; + +// Coerces a JavaScript value to a GraphQL type, or produces errors. +export { coerceInputValue } from './coerceInputValue'; + +// Concatenates multiple AST together. +export { concatAST } from './concatAST'; + +// Separates an AST into an AST per Operation. +export { separateOperations } from './separateOperations'; + +// Strips characters that are not significant to the validity or execution of a GraphQL document. +export { stripIgnoredCharacters } from './stripIgnoredCharacters'; + +// Comparators for types +export { + isEqualType, + isTypeSubTypeOf, + doTypesOverlap, +} from './typeComparators'; + +// Asserts that a string is a valid GraphQL name +export { assertValidName, isValidNameError } from './assertValidName'; + +// Compares two GraphQLSchemas and detects breaking changes. +export { + BreakingChangeType, + DangerousChangeType, + findBreakingChanges, + findDangerousChanges, +} from './findBreakingChanges'; +export type { BreakingChange, DangerousChange } from './findBreakingChanges'; + +// Wrapper type that contains DocumentNode and types that can be deduced from it. +export type { TypedQueryDocumentNode } from './typedQueryDocumentNode'; diff --git a/src/utilities/introspectionFromSchema.ts b/src/utilities/introspectionFromSchema.ts new file mode 100644 index 00000000..5b933c21 --- /dev/null +++ b/src/utilities/introspectionFromSchema.ts @@ -0,0 +1,40 @@ +import { invariant } from '../jsutils/invariant'; + +import { parse } from '../language/parser'; + +import type { GraphQLSchema } from '../type/schema'; + +import { executeSync } from '../execution/execute'; + +import type { + IntrospectionOptions, + IntrospectionQuery, +} from './getIntrospectionQuery'; +import { getIntrospectionQuery } from './getIntrospectionQuery'; + +/** + * Build an IntrospectionQuery from a GraphQLSchema + * + * IntrospectionQuery is useful for utilities that care about type and field + * relationships, but do not need to traverse through those relationships. + * + * This is the inverse of buildClientSchema. The primary use case is outside + * of the server context, for instance when doing schema comparisons. + */ +export function introspectionFromSchema( + schema: GraphQLSchema, + options?: IntrospectionOptions, +): IntrospectionQuery { + const optionsWithDefaults = { + specifiedByUrl: true, + directiveIsRepeatable: true, + schemaDescription: true, + inputValueDeprecation: true, + ...options, + }; + + const document = parse(getIntrospectionQuery(optionsWithDefaults)); + const result = executeSync({ schema, document }); + invariant(!result.errors && result.data); + return result.data as any; +} diff --git a/src/utilities/lexicographicSortSchema.ts b/src/utilities/lexicographicSortSchema.ts new file mode 100644 index 00000000..26b6908c --- /dev/null +++ b/src/utilities/lexicographicSortSchema.ts @@ -0,0 +1,190 @@ +import { inspect } from '../jsutils/inspect'; +import { invariant } from '../jsutils/invariant'; +import { keyValMap } from '../jsutils/keyValMap'; +import type { Maybe } from '../jsutils/Maybe'; +import { naturalCompare } from '../jsutils/naturalCompare'; +import type { ObjMap } from '../jsutils/ObjMap'; + +import type { + GraphQLFieldConfigArgumentMap, + GraphQLFieldConfigMap, + GraphQLInputFieldConfigMap, + GraphQLNamedType, + GraphQLType, +} from '../type/definition'; +import { + GraphQLEnumType, + GraphQLInputObjectType, + GraphQLInterfaceType, + GraphQLList, + GraphQLNonNull, + GraphQLObjectType, + GraphQLUnionType, + isEnumType, + isInputObjectType, + isInterfaceType, + isListType, + isNonNullType, + isObjectType, + isScalarType, + isUnionType, +} from '../type/definition'; +import { GraphQLDirective } from '../type/directives'; +import { isIntrospectionType } from '../type/introspection'; +import { GraphQLSchema } from '../type/schema'; + +/** + * Sort GraphQLSchema. + * + * This function returns a sorted copy of the given GraphQLSchema. + */ +export function lexicographicSortSchema(schema: GraphQLSchema): GraphQLSchema { + const schemaConfig = schema.toConfig(); + const typeMap = keyValMap( + sortByName(schemaConfig.types), + (type) => type.name, + sortNamedType, + ); + + return new GraphQLSchema({ + ...schemaConfig, + types: Object.values(typeMap), + directives: sortByName(schemaConfig.directives).map(sortDirective), + query: replaceMaybeType(schemaConfig.query), + mutation: replaceMaybeType(schemaConfig.mutation), + subscription: replaceMaybeType(schemaConfig.subscription), + }); + + function replaceType(type: T): T { + if (isListType(type)) { + // @ts-expect-error + return new GraphQLList(replaceType(type.ofType)); + } else if (isNonNullType(type)) { + // @ts-expect-error + return new GraphQLNonNull(replaceType(type.ofType)); + } + // @ts-expect-error FIXME: TS Conversion + return replaceNamedType(type); + } + + function replaceNamedType(type: T): T { + return typeMap[type.name] as T; + } + + function replaceMaybeType( + maybeType: Maybe, + ): Maybe { + return maybeType && replaceNamedType(maybeType); + } + + function sortDirective(directive: GraphQLDirective) { + const config = directive.toConfig(); + return new GraphQLDirective({ + ...config, + locations: sortBy(config.locations, (x) => x), + args: sortArgs(config.args), + }); + } + + function sortArgs(args: GraphQLFieldConfigArgumentMap) { + return sortObjMap(args, (arg) => ({ + ...arg, + type: replaceType(arg.type), + })); + } + + function sortFields(fieldsMap: GraphQLFieldConfigMap) { + return sortObjMap(fieldsMap, (field) => ({ + ...field, + type: replaceType(field.type), + args: field.args && sortArgs(field.args), + })); + } + + function sortInputFields(fieldsMap: GraphQLInputFieldConfigMap) { + return sortObjMap(fieldsMap, (field) => ({ + ...field, + type: replaceType(field.type), + })); + } + + function sortTypes( + array: ReadonlyArray, + ): Array { + return sortByName(array).map(replaceNamedType); + } + + function sortNamedType(type: GraphQLNamedType): GraphQLNamedType { + if (isScalarType(type) || isIntrospectionType(type)) { + return type; + } + if (isObjectType(type)) { + const config = type.toConfig(); + return new GraphQLObjectType({ + ...config, + interfaces: () => sortTypes(config.interfaces), + fields: () => sortFields(config.fields), + }); + } + if (isInterfaceType(type)) { + const config = type.toConfig(); + return new GraphQLInterfaceType({ + ...config, + interfaces: () => sortTypes(config.interfaces), + fields: () => sortFields(config.fields), + }); + } + if (isUnionType(type)) { + const config = type.toConfig(); + return new GraphQLUnionType({ + ...config, + types: () => sortTypes(config.types), + }); + } + if (isEnumType(type)) { + const config = type.toConfig(); + return new GraphQLEnumType({ + ...config, + values: sortObjMap(config.values, (value) => value), + }); + } + if (isInputObjectType(type)) { + const config = type.toConfig(); + return new GraphQLInputObjectType({ + ...config, + fields: () => sortInputFields(config.fields), + }); + } + /* c8 ignore next 3 */ + // Not reachable, all possible types have been considered. + invariant(false, 'Unexpected type: ' + inspect(type)); + } +} + +function sortObjMap( + map: ObjMap, + sortValueFn: (value: T) => R, +): ObjMap { + const sortedMap = Object.create(null); + for (const key of Object.keys(map).sort(naturalCompare)) { + sortedMap[key] = sortValueFn(map[key]); + } + return sortedMap; +} + +function sortByName( + array: ReadonlyArray, +): Array { + return sortBy(array, (obj) => obj.name); +} + +function sortBy( + array: ReadonlyArray, + mapToKey: (item: T) => string, +): Array { + return array.slice().sort((obj1, obj2) => { + const key1 = mapToKey(obj1); + const key2 = mapToKey(obj2); + return naturalCompare(key1, key2); + }); +} diff --git a/src/utilities/printSchema.ts b/src/utilities/printSchema.ts new file mode 100644 index 00000000..83859fee --- /dev/null +++ b/src/utilities/printSchema.ts @@ -0,0 +1,326 @@ +import { inspect } from '../jsutils/inspect'; +import { invariant } from '../jsutils/invariant'; +import type { Maybe } from '../jsutils/Maybe'; + +import { isPrintableAsBlockString } from '../language/blockString'; +import { Kind } from '../language/kinds'; +import { print } from '../language/printer'; + +import type { + GraphQLArgument, + GraphQLEnumType, + GraphQLInputField, + GraphQLInputObjectType, + GraphQLInterfaceType, + GraphQLNamedType, + GraphQLObjectType, + GraphQLScalarType, + GraphQLUnionType, +} from '../type/definition'; +import { + isEnumType, + isInputObjectType, + isInterfaceType, + isObjectType, + isScalarType, + isUnionType, +} from '../type/definition'; +import type { GraphQLDirective } from '../type/directives'; +import { + DEFAULT_DEPRECATION_REASON, + isSpecifiedDirective, +} from '../type/directives'; +import { isIntrospectionType } from '../type/introspection'; +import { isSpecifiedScalarType } from '../type/scalars'; +import type { GraphQLSchema } from '../type/schema'; + +import { astFromValue } from './astFromValue'; + +export function printSchema(schema: GraphQLSchema): string { + return printFilteredSchema( + schema, + (n) => !isSpecifiedDirective(n), + isDefinedType, + ); +} + +export function printIntrospectionSchema(schema: GraphQLSchema): string { + return printFilteredSchema(schema, isSpecifiedDirective, isIntrospectionType); +} + +function isDefinedType(type: GraphQLNamedType): boolean { + return !isSpecifiedScalarType(type) && !isIntrospectionType(type); +} + +function printFilteredSchema( + schema: GraphQLSchema, + directiveFilter: (type: GraphQLDirective) => boolean, + typeFilter: (type: GraphQLNamedType) => boolean, +): string { + const directives = schema.getDirectives().filter(directiveFilter); + const types = Object.values(schema.getTypeMap()).filter(typeFilter); + + return [ + printSchemaDefinition(schema), + ...directives.map((directive) => printDirective(directive)), + ...types.map((type) => printType(type)), + ] + .filter(Boolean) + .join('\n\n'); +} + +function printSchemaDefinition(schema: GraphQLSchema): Maybe { + if (schema.description == null && isSchemaOfCommonNames(schema)) { + return; + } + + const operationTypes = []; + + const queryType = schema.getQueryType(); + if (queryType) { + operationTypes.push(` query: ${queryType.name}`); + } + + const mutationType = schema.getMutationType(); + if (mutationType) { + operationTypes.push(` mutation: ${mutationType.name}`); + } + + const subscriptionType = schema.getSubscriptionType(); + if (subscriptionType) { + operationTypes.push(` subscription: ${subscriptionType.name}`); + } + + return printDescription(schema) + `schema {\n${operationTypes.join('\n')}\n}`; +} + +/** + * GraphQL schema define root types for each type of operation. These types are + * the same as any other type and can be named in any manner, however there is + * a common naming convention: + * + * ```graphql + * schema { + * query: Query + * mutation: Mutation + * subscription: Subscription + * } + * ``` + * + * When using this naming convention, the schema description can be omitted. + */ +function isSchemaOfCommonNames(schema: GraphQLSchema): boolean { + const queryType = schema.getQueryType(); + if (queryType && queryType.name !== 'Query') { + return false; + } + + const mutationType = schema.getMutationType(); + if (mutationType && mutationType.name !== 'Mutation') { + return false; + } + + const subscriptionType = schema.getSubscriptionType(); + if (subscriptionType && subscriptionType.name !== 'Subscription') { + return false; + } + + return true; +} + +export function printType(type: GraphQLNamedType): string { + if (isScalarType(type)) { + return printScalar(type); + } + if (isObjectType(type)) { + return printObject(type); + } + if (isInterfaceType(type)) { + return printInterface(type); + } + if (isUnionType(type)) { + return printUnion(type); + } + if (isEnumType(type)) { + return printEnum(type); + } + if (isInputObjectType(type)) { + return printInputObject(type); + } + /* c8 ignore next 3 */ + // Not reachable, all possible types have been considered. + invariant(false, 'Unexpected type: ' + inspect(type)); +} + +function printScalar(type: GraphQLScalarType): string { + return ( + printDescription(type) + `scalar ${type.name}` + printSpecifiedByURL(type) + ); +} + +function printImplementedInterfaces( + type: GraphQLObjectType | GraphQLInterfaceType, +): string { + const interfaces = type.getInterfaces(); + return interfaces.length + ? ' implements ' + interfaces.map((i) => i.name).join(' & ') + : ''; +} + +function printObject(type: GraphQLObjectType): string { + return ( + printDescription(type) + + `type ${type.name}` + + printImplementedInterfaces(type) + + printFields(type) + ); +} + +function printInterface(type: GraphQLInterfaceType): string { + return ( + printDescription(type) + + `interface ${type.name}` + + printImplementedInterfaces(type) + + printFields(type) + ); +} + +function printUnion(type: GraphQLUnionType): string { + const types = type.getTypes(); + const possibleTypes = types.length ? ' = ' + types.join(' | ') : ''; + return printDescription(type) + 'union ' + type.name + possibleTypes; +} + +function printEnum(type: GraphQLEnumType): string { + const values = type + .getValues() + .map( + (value, i) => + printDescription(value, ' ', !i) + + ' ' + + value.name + + printDeprecated(value.deprecationReason), + ); + + return printDescription(type) + `enum ${type.name}` + printBlock(values); +} + +function printInputObject(type: GraphQLInputObjectType): string { + const fields = Object.values(type.getFields()).map( + (f, i) => printDescription(f, ' ', !i) + ' ' + printInputValue(f), + ); + return printDescription(type) + `input ${type.name}` + printBlock(fields); +} + +function printFields(type: GraphQLObjectType | GraphQLInterfaceType): string { + const fields = Object.values(type.getFields()).map( + (f, i) => + printDescription(f, ' ', !i) + + ' ' + + f.name + + printArgs(f.args, ' ') + + ': ' + + String(f.type) + + printDeprecated(f.deprecationReason), + ); + return printBlock(fields); +} + +function printBlock(items: ReadonlyArray): string { + return items.length !== 0 ? ' {\n' + items.join('\n') + '\n}' : ''; +} + +function printArgs( + args: ReadonlyArray, + indentation: string = '', +): string { + if (args.length === 0) { + return ''; + } + + // If every arg does not have a description, print them on one line. + if (args.every((arg) => !arg.description)) { + return '(' + args.map(printInputValue).join(', ') + ')'; + } + + return ( + '(\n' + + args + .map( + (arg, i) => + printDescription(arg, ' ' + indentation, !i) + + ' ' + + indentation + + printInputValue(arg), + ) + .join('\n') + + '\n' + + indentation + + ')' + ); +} + +function printInputValue(arg: GraphQLInputField): string { + const defaultAST = astFromValue(arg.defaultValue, arg.type); + let argDecl = arg.name + ': ' + String(arg.type); + if (defaultAST) { + argDecl += ` = ${print(defaultAST)}`; + } + return argDecl + printDeprecated(arg.deprecationReason); +} + +function printDirective(directive: GraphQLDirective): string { + return ( + printDescription(directive) + + 'directive @' + + directive.name + + printArgs(directive.args) + + (directive.isRepeatable ? ' repeatable' : '') + + ' on ' + + directive.locations.join(' | ') + ); +} + +function printDeprecated(reason: Maybe): string { + if (reason == null) { + return ''; + } + if (reason !== DEFAULT_DEPRECATION_REASON) { + const astValue = print({ kind: Kind.STRING, value: reason }); + return ` @deprecated(reason: ${astValue})`; + } + return ' @deprecated'; +} + +function printSpecifiedByURL(scalar: GraphQLScalarType): string { + if (scalar.specifiedByURL == null) { + return ''; + } + const astValue = print({ + kind: Kind.STRING, + value: scalar.specifiedByURL, + }); + return ` @specifiedBy(url: ${astValue})`; +} + +function printDescription( + def: { readonly description: Maybe }, + indentation: string = '', + firstInBlock: boolean = true, +): string { + const { description } = def; + if (description == null) { + return ''; + } + + const blockString = print({ + kind: Kind.STRING, + value: description, + block: isPrintableAsBlockString(description), + }); + + const prefix = + indentation && !firstInBlock ? '\n' + indentation : indentation; + + return prefix + blockString.replace(/\n/g, '\n' + indentation) + '\n'; +} diff --git a/src/utilities/separateOperations.ts b/src/utilities/separateOperations.ts new file mode 100644 index 00000000..84a8b774 --- /dev/null +++ b/src/utilities/separateOperations.ts @@ -0,0 +1,98 @@ +import type { ObjMap } from '../jsutils/ObjMap'; + +import type { + DocumentNode, + OperationDefinitionNode, + SelectionSetNode, +} from '../language/ast'; +import { Kind } from '../language/kinds'; +import { visit } from '../language/visitor'; + +/** + * separateOperations accepts a single AST document which may contain many + * operations and fragments and returns a collection of AST documents each of + * which contains a single operation as well the fragment definitions it + * refers to. + */ +export function separateOperations( + documentAST: DocumentNode, +): ObjMap { + const operations: Array = []; + const depGraph: DepGraph = Object.create(null); + + // Populate metadata and build a dependency graph. + for (const definitionNode of documentAST.definitions) { + switch (definitionNode.kind) { + case Kind.OPERATION_DEFINITION: + operations.push(definitionNode); + break; + case Kind.FRAGMENT_DEFINITION: + depGraph[definitionNode.name.value] = collectDependencies( + definitionNode.selectionSet, + ); + break; + default: + // ignore non-executable definitions + } + } + + // For each operation, produce a new synthesized AST which includes only what + // is necessary for completing that operation. + const separatedDocumentASTs = Object.create(null); + for (const operation of operations) { + const dependencies = new Set(); + + for (const fragmentName of collectDependencies(operation.selectionSet)) { + collectTransitiveDependencies(dependencies, depGraph, fragmentName); + } + + // Provides the empty string for anonymous operations. + const operationName = operation.name ? operation.name.value : ''; + + // The list of definition nodes to be included for this operation, sorted + // to retain the same order as the original document. + separatedDocumentASTs[operationName] = { + kind: Kind.DOCUMENT, + definitions: documentAST.definitions.filter( + (node) => + node === operation || + (node.kind === Kind.FRAGMENT_DEFINITION && + dependencies.has(node.name.value)), + ), + }; + } + + return separatedDocumentASTs; +} + +type DepGraph = ObjMap>; + +// From a dependency graph, collects a list of transitive dependencies by +// recursing through a dependency graph. +function collectTransitiveDependencies( + collected: Set, + depGraph: DepGraph, + fromName: string, +): void { + if (!collected.has(fromName)) { + collected.add(fromName); + + const immediateDeps = depGraph[fromName]; + if (immediateDeps !== undefined) { + for (const toName of immediateDeps) { + collectTransitiveDependencies(collected, depGraph, toName); + } + } + } +} + +function collectDependencies(selectionSet: SelectionSetNode): Array { + const dependencies: Array = []; + + visit(selectionSet, { + FragmentSpread(node) { + dependencies.push(node.name.value); + }, + }); + return dependencies; +} diff --git a/src/utilities/stripIgnoredCharacters.ts b/src/utilities/stripIgnoredCharacters.ts new file mode 100644 index 00000000..5eb5c980 --- /dev/null +++ b/src/utilities/stripIgnoredCharacters.ts @@ -0,0 +1,101 @@ +import { printBlockString } from '../language/blockString'; +import { isPunctuatorTokenKind, Lexer } from '../language/lexer'; +import { isSource, Source } from '../language/source'; +import { TokenKind } from '../language/tokenKind'; + +/** + * Strips characters that are not significant to the validity or execution + * of a GraphQL document: + * - UnicodeBOM + * - WhiteSpace + * - LineTerminator + * - Comment + * - Comma + * - BlockString indentation + * + * Note: It is required to have a delimiter character between neighboring + * non-punctuator tokens and this function always uses single space as delimiter. + * + * It is guaranteed that both input and output documents if parsed would result + * in the exact same AST except for nodes location. + * + * Warning: It is guaranteed that this function will always produce stable results. + * However, it's not guaranteed that it will stay the same between different + * releases due to bugfixes or changes in the GraphQL specification. + * + * Query example: + * + * ```graphql + * query SomeQuery($foo: String!, $bar: String) { + * someField(foo: $foo, bar: $bar) { + * a + * b { + * c + * d + * } + * } + * } + * ``` + * + * Becomes: + * + * ```graphql + * query SomeQuery($foo:String!$bar:String){someField(foo:$foo bar:$bar){a b{c d}}} + * ``` + * + * SDL example: + * + * ```graphql + * """ + * Type description + * """ + * type Foo { + * """ + * Field description + * """ + * bar: String + * } + * ``` + * + * Becomes: + * + * ```graphql + * """Type description""" type Foo{"""Field description""" bar:String} + * ``` + */ +export function stripIgnoredCharacters(source: string | Source): string { + const sourceObj = isSource(source) ? source : new Source(source); + + const body = sourceObj.body; + const lexer = new Lexer(sourceObj); + let strippedBody = ''; + + let wasLastAddedTokenNonPunctuator = false; + while (lexer.advance().kind !== TokenKind.EOF) { + const currentToken = lexer.token; + const tokenKind = currentToken.kind; + + /** + * Every two non-punctuator tokens should have space between them. + * Also prevent case of non-punctuator token following by spread resulting + * in invalid token (e.g. `1...` is invalid Float token). + */ + const isNonPunctuator = !isPunctuatorTokenKind(currentToken.kind); + if (wasLastAddedTokenNonPunctuator) { + if (isNonPunctuator || currentToken.kind === TokenKind.SPREAD) { + strippedBody += ' '; + } + } + + const tokenBody = body.slice(currentToken.start, currentToken.end); + if (tokenKind === TokenKind.BLOCK_STRING) { + strippedBody += printBlockString(currentToken.value, { minimize: true }); + } else { + strippedBody += tokenBody; + } + + wasLastAddedTokenNonPunctuator = isNonPunctuator; + } + + return strippedBody; +} diff --git a/src/utilities/typeComparators.ts b/src/utilities/typeComparators.ts new file mode 100644 index 00000000..287be40b --- /dev/null +++ b/src/utilities/typeComparators.ts @@ -0,0 +1,119 @@ +import type { GraphQLCompositeType, GraphQLType } from '../type/definition'; +import { + isAbstractType, + isInterfaceType, + isListType, + isNonNullType, + isObjectType, +} from '../type/definition'; +import type { GraphQLSchema } from '../type/schema'; + +/** + * Provided two types, return true if the types are equal (invariant). + */ +export function isEqualType(typeA: GraphQLType, typeB: GraphQLType): boolean { + // Equivalent types are equal. + if (typeA === typeB) { + return true; + } + + // If either type is non-null, the other must also be non-null. + if (isNonNullType(typeA) && isNonNullType(typeB)) { + return isEqualType(typeA.ofType, typeB.ofType); + } + + // If either type is a list, the other must also be a list. + if (isListType(typeA) && isListType(typeB)) { + return isEqualType(typeA.ofType, typeB.ofType); + } + + // Otherwise the types are not equal. + return false; +} + +/** + * Provided a type and a super type, return true if the first type is either + * equal or a subset of the second super type (covariant). + */ +export function isTypeSubTypeOf( + schema: GraphQLSchema, + maybeSubType: GraphQLType, + superType: GraphQLType, +): boolean { + // Equivalent type is a valid subtype + if (maybeSubType === superType) { + return true; + } + + // If superType is non-null, maybeSubType must also be non-null. + if (isNonNullType(superType)) { + if (isNonNullType(maybeSubType)) { + return isTypeSubTypeOf(schema, maybeSubType.ofType, superType.ofType); + } + return false; + } + if (isNonNullType(maybeSubType)) { + // If superType is nullable, maybeSubType may be non-null or nullable. + return isTypeSubTypeOf(schema, maybeSubType.ofType, superType); + } + + // If superType type is a list, maybeSubType type must also be a list. + if (isListType(superType)) { + if (isListType(maybeSubType)) { + return isTypeSubTypeOf(schema, maybeSubType.ofType, superType.ofType); + } + return false; + } + if (isListType(maybeSubType)) { + // If superType is not a list, maybeSubType must also be not a list. + return false; + } + + // If superType type is an abstract type, check if it is super type of maybeSubType. + // Otherwise, the child type is not a valid subtype of the parent type. + return ( + isAbstractType(superType) && + (isInterfaceType(maybeSubType) || isObjectType(maybeSubType)) && + schema.isSubType(superType, maybeSubType) + ); +} + +/** + * Provided two composite types, determine if they "overlap". Two composite + * types overlap when the Sets of possible concrete types for each intersect. + * + * This is often used to determine if a fragment of a given type could possibly + * be visited in a context of another type. + * + * This function is commutative. + */ +export function doTypesOverlap( + schema: GraphQLSchema, + typeA: GraphQLCompositeType, + typeB: GraphQLCompositeType, +): boolean { + // Equivalent types overlap + if (typeA === typeB) { + return true; + } + + if (isAbstractType(typeA)) { + if (isAbstractType(typeB)) { + // If both types are abstract, then determine if there is any intersection + // between possible concrete types of each. + return schema + .getPossibleTypes(typeA) + .some((type) => schema.isSubType(typeB, type)); + } + // Determine if the latter type is a possible concrete type of the former. + return schema.isSubType(typeA, typeB); + } + + if (isAbstractType(typeB)) { + // Determine if the former type is a possible concrete type of the latter. + return schema.isSubType(typeB, typeA); + } + + // Otherwise the types do not overlap. + return false; +} diff --git a/src/utilities/typeFromAST.ts b/src/utilities/typeFromAST.ts new file mode 100644 index 00000000..7510df10 --- /dev/null +++ b/src/utilities/typeFromAST.ts @@ -0,0 +1,52 @@ +import type { + ListTypeNode, + NamedTypeNode, + NonNullTypeNode, + TypeNode, +} from '../language/ast'; +import { Kind } from '../language/kinds'; + +import type { GraphQLNamedType, GraphQLType } from '../type/definition'; +import { GraphQLList, GraphQLNonNull } from '../type/definition'; +import type { GraphQLSchema } from '../type/schema'; + +/** + * Given a Schema and an AST node describing a type, return a GraphQLType + * definition which applies to that type. For example, if provided the parsed + * AST node for `[User]`, a GraphQLList instance will be returned, containing + * the type called "User" found in the schema. If a type called "User" is not + * found in the schema, then undefined will be returned. + */ +export function typeFromAST( + schema: GraphQLSchema, + typeNode: NamedTypeNode, +): GraphQLNamedType | undefined; +export function typeFromAST( + schema: GraphQLSchema, + typeNode: ListTypeNode, +): GraphQLList | undefined; +export function typeFromAST( + schema: GraphQLSchema, + typeNode: NonNullTypeNode, +): GraphQLNonNull | undefined; +export function typeFromAST( + schema: GraphQLSchema, + typeNode: TypeNode, +): GraphQLType | undefined; +export function typeFromAST( + schema: GraphQLSchema, + typeNode: TypeNode, +): GraphQLType | undefined { + switch (typeNode.kind) { + case Kind.LIST_TYPE: { + const innerType = typeFromAST(schema, typeNode.type); + return innerType && new GraphQLList(innerType); + } + case Kind.NON_NULL_TYPE: { + const innerType = typeFromAST(schema, typeNode.type); + return innerType && new GraphQLNonNull(innerType); + } + case Kind.NAMED_TYPE: + return schema.getType(typeNode.name.value); + } +} diff --git a/src/utilities/typedQueryDocumentNode.ts b/src/utilities/typedQueryDocumentNode.ts new file mode 100644 index 00000000..1bd5cf08 --- /dev/null +++ b/src/utilities/typedQueryDocumentNode.ts @@ -0,0 +1,19 @@ +import type { DocumentNode, ExecutableDefinitionNode } from '../language/ast'; +/** + * Wrapper type that contains DocumentNode and types that can be deduced from it. + */ +export interface TypedQueryDocumentNode< + TResponseData = { [key: string]: any }, + TRequestVariables = { [key: string]: any }, +> extends DocumentNode { + readonly definitions: ReadonlyArray; + // FIXME: remove once TS implements proper way to enforce nominal typing + /** + * This type is used to ensure that the variables you pass in to the query are assignable to Variables + * and that the Result is assignable to whatever you pass your result to. The method is never actually + * implemented, but the type is valid because we list it as optional + */ + __ensureTypesOfVariablesAndResultMatching?: ( + variables: TRequestVariables, + ) => TResponseData; +} diff --git a/src/utilities/valueFromAST.ts b/src/utilities/valueFromAST.ts new file mode 100644 index 00000000..4f0cee6b --- /dev/null +++ b/src/utilities/valueFromAST.ts @@ -0,0 +1,161 @@ +import { inspect } from '../jsutils/inspect'; +import { invariant } from '../jsutils/invariant'; +import { keyMap } from '../jsutils/keyMap'; +import type { Maybe } from '../jsutils/Maybe'; +import type { ObjMap } from '../jsutils/ObjMap'; + +import type { ValueNode } from '../language/ast'; +import { Kind } from '../language/kinds'; + +import type { GraphQLInputType } from '../type/definition'; +import { + isInputObjectType, + isLeafType, + isListType, + isNonNullType, +} from '../type/definition'; + +/** + * Produces a JavaScript value given a GraphQL Value AST. + * + * A GraphQL type must be provided, which will be used to interpret different + * GraphQL Value literals. + * + * Returns `undefined` when the value could not be validly coerced according to + * the provided type. + * + * | GraphQL Value | JSON Value | + * | -------------------- | ------------- | + * | Input Object | Object | + * | List | Array | + * | Boolean | Boolean | + * | String | String | + * | Int / Float | Number | + * | Enum Value | Unknown | + * | NullValue | null | + * + */ +export function valueFromAST( + valueNode: Maybe, + type: GraphQLInputType, + variables?: Maybe>, +): unknown { + if (!valueNode) { + // When there is no node, then there is also no value. + // Importantly, this is different from returning the value null. + return; + } + + if (valueNode.kind === Kind.VARIABLE) { + const variableName = valueNode.name.value; + if (variables == null || variables[variableName] === undefined) { + // No valid return value. + return; + } + const variableValue = variables[variableName]; + if (variableValue === null && isNonNullType(type)) { + return; // Invalid: intentionally return no value. + } + // Note: This does no further checking that this variable is correct. + // This assumes that this query has been validated and the variable + // usage here is of the correct type. + return variableValue; + } + + if (isNonNullType(type)) { + if (valueNode.kind === Kind.NULL) { + return; // Invalid: intentionally return no value. + } + return valueFromAST(valueNode, type.ofType, variables); + } + + if (valueNode.kind === Kind.NULL) { + // This is explicitly returning the value null. + return null; + } + + if (isListType(type)) { + const itemType = type.ofType; + if (valueNode.kind === Kind.LIST) { + const coercedValues = []; + for (const itemNode of valueNode.values) { + if (isMissingVariable(itemNode, variables)) { + // If an array contains a missing variable, it is either coerced to + // null or if the item type is non-null, it considered invalid. + if (isNonNullType(itemType)) { + return; // Invalid: intentionally return no value. + } + coercedValues.push(null); + } else { + const itemValue = valueFromAST(itemNode, itemType, variables); + if (itemValue === undefined) { + return; // Invalid: intentionally return no value. + } + coercedValues.push(itemValue); + } + } + return coercedValues; + } + const coercedValue = valueFromAST(valueNode, itemType, variables); + if (coercedValue === undefined) { + return; // Invalid: intentionally return no value. + } + return [coercedValue]; + } + + if (isInputObjectType(type)) { + if (valueNode.kind !== Kind.OBJECT) { + return; // Invalid: intentionally return no value. + } + const coercedObj = Object.create(null); + const fieldNodes = keyMap(valueNode.fields, (field) => field.name.value); + for (const field of Object.values(type.getFields())) { + const fieldNode = fieldNodes[field.name]; + if (!fieldNode || isMissingVariable(fieldNode.value, variables)) { + if (field.defaultValue !== undefined) { + coercedObj[field.name] = field.defaultValue; + } else if (isNonNullType(field.type)) { + return; // Invalid: intentionally return no value. + } + continue; + } + const fieldValue = valueFromAST(fieldNode.value, field.type, variables); + if (fieldValue === undefined) { + return; // Invalid: intentionally return no value. + } + coercedObj[field.name] = fieldValue; + } + return coercedObj; + } + + if (isLeafType(type)) { + // Scalars and Enums fulfill parsing a literal value via parseLiteral(). + // Invalid values represent a failure to parse correctly, in which case + // no value is returned. + let result; + try { + result = type.parseLiteral(valueNode, variables); + } catch (_error) { + return; // Invalid: intentionally return no value. + } + if (result === undefined) { + return; // Invalid: intentionally return no value. + } + return result; + } + /* c8 ignore next 3 */ + // Not reachable, all possible input types have been considered. + invariant(false, 'Unexpected input type: ' + inspect(type)); +} + +// Returns true if the provided valueNode is a variable which is not defined +// in the set of variables. +function isMissingVariable( + valueNode: ValueNode, + variables: Maybe>, +): boolean { + return ( + valueNode.kind === Kind.VARIABLE && + (variables == null || variables[valueNode.name.value] === undefined) + ); +} diff --git a/src/utilities/valueFromASTUntyped.ts b/src/utilities/valueFromASTUntyped.ts new file mode 100644 index 00000000..05540da3 --- /dev/null +++ b/src/utilities/valueFromASTUntyped.ts @@ -0,0 +1,52 @@ +import { keyValMap } from '../jsutils/keyValMap'; +import type { Maybe } from '../jsutils/Maybe'; +import type { ObjMap } from '../jsutils/ObjMap'; + +import type { ValueNode } from '../language/ast'; +import { Kind } from '../language/kinds'; + +/** + * Produces a JavaScript value given a GraphQL Value AST. + * + * Unlike `valueFromAST()`, no type is provided. The resulting JavaScript value + * will reflect the provided GraphQL value AST. + * + * | GraphQL Value | JavaScript Value | + * | -------------------- | ---------------- | + * | Input Object | Object | + * | List | Array | + * | Boolean | Boolean | + * | String / Enum | String | + * | Int / Float | Number | + * | Null | null | + * + */ +export function valueFromASTUntyped( + valueNode: ValueNode, + variables?: Maybe>, +): unknown { + switch (valueNode.kind) { + case Kind.NULL: + return null; + case Kind.INT: + return parseInt(valueNode.value, 10); + case Kind.FLOAT: + return parseFloat(valueNode.value); + case Kind.STRING: + case Kind.ENUM: + case Kind.BOOLEAN: + return valueNode.value; + case Kind.LIST: + return valueNode.values.map((node) => + valueFromASTUntyped(node, variables), + ); + case Kind.OBJECT: + return keyValMap( + valueNode.fields, + (field) => field.name.value, + (field) => valueFromASTUntyped(field.value, variables), + ); + case Kind.VARIABLE: + return variables?.[valueNode.name.value]; + } +} diff --git a/src/validation/README.md b/src/validation/README.md new file mode 100644 index 00000000..8a4a1c85 --- /dev/null +++ b/src/validation/README.md @@ -0,0 +1,9 @@ +## GraphQL Validation + +The `graphql/validation` module fulfills the Validation phase of fulfilling a +GraphQL result. + +```js +import { validate } from 'graphql/validation'; // ES6 +var GraphQLValidator = require('graphql/validation'); // CommonJS +``` diff --git a/src/validation/ValidationContext.ts b/src/validation/ValidationContext.ts new file mode 100644 index 00000000..f6944a6e --- /dev/null +++ b/src/validation/ValidationContext.ts @@ -0,0 +1,269 @@ +import type { Maybe } from '../jsutils/Maybe'; +import type { ObjMap } from '../jsutils/ObjMap'; + +import type { GraphQLError } from '../error/GraphQLError'; + +import type { + DocumentNode, + FragmentDefinitionNode, + FragmentSpreadNode, + OperationDefinitionNode, + SelectionSetNode, + VariableNode, +} from '../language/ast'; +import { Kind } from '../language/kinds'; +import type { ASTVisitor } from '../language/visitor'; +import { visit } from '../language/visitor'; + +import type { + GraphQLArgument, + GraphQLCompositeType, + GraphQLEnumValue, + GraphQLField, + GraphQLInputType, + GraphQLOutputType, +} from '../type/definition'; +import type { GraphQLDirective } from '../type/directives'; +import type { GraphQLSchema } from '../type/schema'; + +import { TypeInfo, visitWithTypeInfo } from '../utilities/TypeInfo'; + +type NodeWithSelectionSet = OperationDefinitionNode | FragmentDefinitionNode; +interface VariableUsage { + readonly node: VariableNode; + readonly type: Maybe; + readonly defaultValue: Maybe; +} + +/** + * An instance of this class is passed as the "this" context to all validators, + * allowing access to commonly useful contextual information from within a + * validation rule. + */ +export class ASTValidationContext { + private _ast: DocumentNode; + private _onError: (error: GraphQLError) => void; + private _fragments: ObjMap | undefined; + private _fragmentSpreads: Map>; + private _recursivelyReferencedFragments: Map< + OperationDefinitionNode, + Array + >; + + constructor(ast: DocumentNode, onError: (error: GraphQLError) => void) { + this._ast = ast; + this._fragments = undefined; + this._fragmentSpreads = new Map(); + this._recursivelyReferencedFragments = new Map(); + this._onError = onError; + } + + get [Symbol.toStringTag]() { + return 'ASTValidationContext'; + } + + reportError(error: GraphQLError): void { + this._onError(error); + } + + getDocument(): DocumentNode { + return this._ast; + } + + getFragment(name: string): Maybe { + let fragments: ObjMap; + if (this._fragments) { + fragments = this._fragments; + } else { + fragments = Object.create(null); + for (const defNode of this.getDocument().definitions) { + if (defNode.kind === Kind.FRAGMENT_DEFINITION) { + fragments[defNode.name.value] = defNode; + } + } + this._fragments = fragments; + } + return fragments[name]; + } + + getFragmentSpreads( + node: SelectionSetNode, + ): ReadonlyArray { + let spreads = this._fragmentSpreads.get(node); + if (!spreads) { + spreads = []; + const setsToVisit: Array = [node]; + let set: SelectionSetNode | undefined; + while ((set = setsToVisit.pop())) { + for (const selection of set.selections) { + if (selection.kind === Kind.FRAGMENT_SPREAD) { + spreads.push(selection); + } else if (selection.selectionSet) { + setsToVisit.push(selection.selectionSet); + } + } + } + this._fragmentSpreads.set(node, spreads); + } + return spreads; + } + + getRecursivelyReferencedFragments( + operation: OperationDefinitionNode, + ): ReadonlyArray { + let fragments = this._recursivelyReferencedFragments.get(operation); + if (!fragments) { + fragments = []; + const collectedNames = Object.create(null); + const nodesToVisit: Array = [operation.selectionSet]; + let node: SelectionSetNode | undefined; + while ((node = nodesToVisit.pop())) { + for (const spread of this.getFragmentSpreads(node)) { + const fragName = spread.name.value; + if (collectedNames[fragName] !== true) { + collectedNames[fragName] = true; + const fragment = this.getFragment(fragName); + if (fragment) { + fragments.push(fragment); + nodesToVisit.push(fragment.selectionSet); + } + } + } + } + this._recursivelyReferencedFragments.set(operation, fragments); + } + return fragments; + } +} + +export type ASTValidationRule = (context: ASTValidationContext) => ASTVisitor; + +export class SDLValidationContext extends ASTValidationContext { + private _schema: Maybe; + + constructor( + ast: DocumentNode, + schema: Maybe, + onError: (error: GraphQLError) => void, + ) { + super(ast, onError); + this._schema = schema; + } + + get [Symbol.toStringTag]() { + return 'SDLValidationContext'; + } + + getSchema(): Maybe { + return this._schema; + } +} + +export type SDLValidationRule = (context: SDLValidationContext) => ASTVisitor; + +export class ValidationContext extends ASTValidationContext { + private _schema: GraphQLSchema; + private _typeInfo: TypeInfo; + private _variableUsages: Map< + NodeWithSelectionSet, + ReadonlyArray + >; + + private _recursiveVariableUsages: Map< + OperationDefinitionNode, + ReadonlyArray + >; + + constructor( + schema: GraphQLSchema, + ast: DocumentNode, + typeInfo: TypeInfo, + onError: (error: GraphQLError) => void, + ) { + super(ast, onError); + this._schema = schema; + this._typeInfo = typeInfo; + this._variableUsages = new Map(); + this._recursiveVariableUsages = new Map(); + } + + get [Symbol.toStringTag]() { + return 'ValidationContext'; + } + + getSchema(): GraphQLSchema { + return this._schema; + } + + getVariableUsages(node: NodeWithSelectionSet): ReadonlyArray { + let usages = this._variableUsages.get(node); + if (!usages) { + const newUsages: Array = []; + const typeInfo = new TypeInfo(this._schema); + visit( + node, + visitWithTypeInfo(typeInfo, { + VariableDefinition: () => false, + Variable(variable) { + newUsages.push({ + node: variable, + type: typeInfo.getInputType(), + defaultValue: typeInfo.getDefaultValue(), + }); + }, + }), + ); + usages = newUsages; + this._variableUsages.set(node, usages); + } + return usages; + } + + getRecursiveVariableUsages( + operation: OperationDefinitionNode, + ): ReadonlyArray { + let usages = this._recursiveVariableUsages.get(operation); + if (!usages) { + usages = this.getVariableUsages(operation); + for (const frag of this.getRecursivelyReferencedFragments(operation)) { + usages = usages.concat(this.getVariableUsages(frag)); + } + this._recursiveVariableUsages.set(operation, usages); + } + return usages; + } + + getType(): Maybe { + return this._typeInfo.getType(); + } + + getParentType(): Maybe { + return this._typeInfo.getParentType(); + } + + getInputType(): Maybe { + return this._typeInfo.getInputType(); + } + + getParentInputType(): Maybe { + return this._typeInfo.getParentInputType(); + } + + getFieldDef(): Maybe> { + return this._typeInfo.getFieldDef(); + } + + getDirective(): Maybe { + return this._typeInfo.getDirective(); + } + + getArgument(): Maybe { + return this._typeInfo.getArgument(); + } + + getEnumValue(): Maybe { + return this._typeInfo.getEnumValue(); + } +} + +export type ValidationRule = (context: ValidationContext) => ASTVisitor; diff --git a/src/validation/__tests__/ExecutableDefinitionsRule-test.ts b/src/validation/__tests__/ExecutableDefinitionsRule-test.ts new file mode 100644 index 00000000..ec3a1afe --- /dev/null +++ b/src/validation/__tests__/ExecutableDefinitionsRule-test.ts @@ -0,0 +1,94 @@ +import { describe, it } from 'mocha'; + +import { ExecutableDefinitionsRule } from '../rules/ExecutableDefinitionsRule'; + +import { expectValidationErrors } from './harness'; + +function expectErrors(queryStr: string) { + return expectValidationErrors(ExecutableDefinitionsRule, queryStr); +} + +function expectValid(queryStr: string) { + expectErrors(queryStr).toDeepEqual([]); +} + +describe('Validate: Executable definitions', () => { + it('with only operation', () => { + expectValid(` + query Foo { + dog { + name + } + } + `); + }); + + it('with operation and fragment', () => { + expectValid(` + query Foo { + dog { + name + ...Frag + } + } + + fragment Frag on Dog { + name + } + `); + }); + + it('with type definition', () => { + expectErrors(` + query Foo { + dog { + name + } + } + + type Cow { + name: String + } + + extend type Dog { + color: String + } + `).toDeepEqual([ + { + message: 'The "Cow" definition is not executable.', + locations: [{ line: 8, column: 7 }], + }, + { + message: 'The "Dog" definition is not executable.', + locations: [{ line: 12, column: 7 }], + }, + ]); + }); + + it('with schema definition', () => { + expectErrors(` + schema { + query: Query + } + + type Query { + test: String + } + + extend schema @directive + `).toDeepEqual([ + { + message: 'The schema definition is not executable.', + locations: [{ line: 2, column: 7 }], + }, + { + message: 'The "Query" definition is not executable.', + locations: [{ line: 6, column: 7 }], + }, + { + message: 'The schema definition is not executable.', + locations: [{ line: 10, column: 7 }], + }, + ]); + }); +}); diff --git a/src/validation/__tests__/FieldsOnCorrectTypeRule-test.ts b/src/validation/__tests__/FieldsOnCorrectTypeRule-test.ts new file mode 100644 index 00000000..70473fa6 --- /dev/null +++ b/src/validation/__tests__/FieldsOnCorrectTypeRule-test.ts @@ -0,0 +1,447 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { parse } from '../../language/parser'; + +import type { GraphQLSchema } from '../../type/schema'; + +import { buildSchema } from '../../utilities/buildASTSchema'; + +import { FieldsOnCorrectTypeRule } from '../rules/FieldsOnCorrectTypeRule'; +import { validate } from '../validate'; + +import { expectValidationErrorsWithSchema } from './harness'; + +function expectErrors(queryStr: string) { + return expectValidationErrorsWithSchema( + testSchema, + FieldsOnCorrectTypeRule, + queryStr, + ); +} + +function expectValid(queryStr: string) { + expectErrors(queryStr).toDeepEqual([]); +} + +const testSchema = buildSchema(` + interface Pet { + name: String + } + + type Dog implements Pet { + name: String + nickname: String + barkVolume: Int + } + + type Cat implements Pet { + name: String + nickname: String + meowVolume: Int + } + + union CatOrDog = Cat | Dog + + type Human { + name: String + pets: [Pet] + } + + type Query { + human: Human + } +`); + +describe('Validate: Fields on correct type', () => { + it('Object field selection', () => { + expectValid(` + fragment objectFieldSelection on Dog { + __typename + name + } + `); + }); + + it('Aliased object field selection', () => { + expectValid(` + fragment aliasedObjectFieldSelection on Dog { + tn : __typename + otherName : name + } + `); + }); + + it('Interface field selection', () => { + expectValid(` + fragment interfaceFieldSelection on Pet { + __typename + name + } + `); + }); + + it('Aliased interface field selection', () => { + expectValid(` + fragment interfaceFieldSelection on Pet { + otherName : name + } + `); + }); + + it('Lying alias selection', () => { + expectValid(` + fragment lyingAliasSelection on Dog { + name : nickname + } + `); + }); + + it('Ignores fields on unknown type', () => { + expectValid(` + fragment unknownSelection on UnknownType { + unknownField + } + `); + }); + + it('reports errors when type is known again', () => { + expectErrors(` + fragment typeKnownAgain on Pet { + unknown_pet_field { + ... on Cat { + unknown_cat_field + } + } + } + `).toDeepEqual([ + { + message: 'Cannot query field "unknown_pet_field" on type "Pet".', + locations: [{ line: 3, column: 9 }], + }, + { + message: 'Cannot query field "unknown_cat_field" on type "Cat".', + locations: [{ line: 5, column: 13 }], + }, + ]); + }); + + it('Field not defined on fragment', () => { + expectErrors(` + fragment fieldNotDefined on Dog { + meowVolume + } + `).toDeepEqual([ + { + message: + 'Cannot query field "meowVolume" on type "Dog". Did you mean "barkVolume"?', + locations: [{ line: 3, column: 9 }], + }, + ]); + }); + + it('Ignores deeply unknown field', () => { + expectErrors(` + fragment deepFieldNotDefined on Dog { + unknown_field { + deeper_unknown_field + } + } + `).toDeepEqual([ + { + message: 'Cannot query field "unknown_field" on type "Dog".', + locations: [{ line: 3, column: 9 }], + }, + ]); + }); + + it('Sub-field not defined', () => { + expectErrors(` + fragment subFieldNotDefined on Human { + pets { + unknown_field + } + } + `).toDeepEqual([ + { + message: 'Cannot query field "unknown_field" on type "Pet".', + locations: [{ line: 4, column: 11 }], + }, + ]); + }); + + it('Field not defined on inline fragment', () => { + expectErrors(` + fragment fieldNotDefined on Pet { + ... on Dog { + meowVolume + } + } + `).toDeepEqual([ + { + message: + 'Cannot query field "meowVolume" on type "Dog". Did you mean "barkVolume"?', + locations: [{ line: 4, column: 11 }], + }, + ]); + }); + + it('Aliased field target not defined', () => { + expectErrors(` + fragment aliasedFieldTargetNotDefined on Dog { + volume : mooVolume + } + `).toDeepEqual([ + { + message: + 'Cannot query field "mooVolume" on type "Dog". Did you mean "barkVolume"?', + locations: [{ line: 3, column: 9 }], + }, + ]); + }); + + it('Aliased lying field target not defined', () => { + expectErrors(` + fragment aliasedLyingFieldTargetNotDefined on Dog { + barkVolume : kawVolume + } + `).toDeepEqual([ + { + message: + 'Cannot query field "kawVolume" on type "Dog". Did you mean "barkVolume"?', + locations: [{ line: 3, column: 9 }], + }, + ]); + }); + + it('Not defined on interface', () => { + expectErrors(` + fragment notDefinedOnInterface on Pet { + tailLength + } + `).toDeepEqual([ + { + message: 'Cannot query field "tailLength" on type "Pet".', + locations: [{ line: 3, column: 9 }], + }, + ]); + }); + + it('Defined on implementors but not on interface', () => { + expectErrors(` + fragment definedOnImplementorsButNotInterface on Pet { + nickname + } + `).toDeepEqual([ + { + message: + 'Cannot query field "nickname" on type "Pet". Did you mean to use an inline fragment on "Cat" or "Dog"?', + locations: [{ line: 3, column: 9 }], + }, + ]); + }); + + it('Meta field selection on union', () => { + expectValid(` + fragment directFieldSelectionOnUnion on CatOrDog { + __typename + } + `); + }); + + it('Direct field selection on union', () => { + expectErrors(` + fragment directFieldSelectionOnUnion on CatOrDog { + directField + } + `).toDeepEqual([ + { + message: 'Cannot query field "directField" on type "CatOrDog".', + locations: [{ line: 3, column: 9 }], + }, + ]); + }); + + it('Defined on implementors queried on union', () => { + expectErrors(` + fragment definedOnImplementorsQueriedOnUnion on CatOrDog { + name + } + `).toDeepEqual([ + { + message: + 'Cannot query field "name" on type "CatOrDog". Did you mean to use an inline fragment on "Pet", "Cat", or "Dog"?', + locations: [{ line: 3, column: 9 }], + }, + ]); + }); + + it('valid field in inline fragment', () => { + expectValid(` + fragment objectFieldSelection on Pet { + ... on Dog { + name + } + ... { + name + } + } + `); + }); + + describe('Fields on correct type error message', () => { + function expectErrorMessage(schema: GraphQLSchema, queryStr: string) { + const errors = validate(schema, parse(queryStr), [ + FieldsOnCorrectTypeRule, + ]); + expect(errors.length).to.equal(1); + return expect(errors[0].message); + } + + it('Works with no suggestions', () => { + const schema = buildSchema(` + type T { + fieldWithVeryLongNameThatWillNeverBeSuggested: String + } + type Query { t: T } + `); + + expectErrorMessage(schema, '{ t { f } }').to.equal( + 'Cannot query field "f" on type "T".', + ); + }); + + it('Works with no small numbers of type suggestions', () => { + const schema = buildSchema(` + union T = A | B + type Query { t: T } + + type A { f: String } + type B { f: String } + `); + + expectErrorMessage(schema, '{ t { f } }').to.equal( + 'Cannot query field "f" on type "T". Did you mean to use an inline fragment on "A" or "B"?', + ); + }); + + it('Works with no small numbers of field suggestions', () => { + const schema = buildSchema(` + type T { + y: String + z: String + } + type Query { t: T } + `); + + expectErrorMessage(schema, '{ t { f } }').to.equal( + 'Cannot query field "f" on type "T". Did you mean "y" or "z"?', + ); + }); + + it('Only shows one set of suggestions at a time, preferring types', () => { + const schema = buildSchema(` + interface T { + y: String + z: String + } + type Query { t: T } + + type A implements T { + f: String + y: String + z: String + } + type B implements T { + f: String + y: String + z: String + } + `); + + expectErrorMessage(schema, '{ t { f } }').to.equal( + 'Cannot query field "f" on type "T". Did you mean to use an inline fragment on "A" or "B"?', + ); + }); + + it('Sort type suggestions based on inheritance order', () => { + const interfaceSchema = buildSchema(` + interface T { bar: String } + type Query { t: T } + + interface Z implements T { + foo: String + bar: String + } + + interface Y implements Z & T { + foo: String + bar: String + } + + type X implements Y & Z & T { + foo: String + bar: String + } + `); + + expectErrorMessage(interfaceSchema, '{ t { foo } }').to.equal( + 'Cannot query field "foo" on type "T". Did you mean to use an inline fragment on "Z", "Y", or "X"?', + ); + + const unionSchema = buildSchema(` + interface Animal { name: String } + interface Mammal implements Animal { name: String } + + interface Canine implements Animal & Mammal { name: String } + type Dog implements Animal & Mammal & Canine { name: String } + + interface Feline implements Animal & Mammal { name: String } + type Cat implements Animal & Mammal & Feline { name: String } + + union CatOrDog = Cat | Dog + type Query { catOrDog: CatOrDog } + `); + + expectErrorMessage(unionSchema, '{ catOrDog { name } }').to.equal( + 'Cannot query field "name" on type "CatOrDog". Did you mean to use an inline fragment on "Animal", "Mammal", "Canine", "Dog", or "Feline"?', + ); + }); + + it('Limits lots of type suggestions', () => { + const schema = buildSchema(` + union T = A | B | C | D | E | F + type Query { t: T } + + type A { f: String } + type B { f: String } + type C { f: String } + type D { f: String } + type E { f: String } + type F { f: String } + `); + + expectErrorMessage(schema, '{ t { f } }').to.equal( + 'Cannot query field "f" on type "T". Did you mean to use an inline fragment on "A", "B", "C", "D", or "E"?', + ); + }); + + it('Limits lots of field suggestions', () => { + const schema = buildSchema(` + type T { + u: String + v: String + w: String + x: String + y: String + z: String + } + type Query { t: T } + `); + + expectErrorMessage(schema, '{ t { f } }').to.equal( + 'Cannot query field "f" on type "T". Did you mean "u", "v", "w", "x", or "y"?', + ); + }); + }); +}); diff --git a/src/validation/__tests__/FragmentsOnCompositeTypesRule-test.ts b/src/validation/__tests__/FragmentsOnCompositeTypesRule-test.ts new file mode 100644 index 00000000..dc1ed407 --- /dev/null +++ b/src/validation/__tests__/FragmentsOnCompositeTypesRule-test.ts @@ -0,0 +1,126 @@ +import { describe, it } from 'mocha'; + +import { FragmentsOnCompositeTypesRule } from '../rules/FragmentsOnCompositeTypesRule'; + +import { expectValidationErrors } from './harness'; + +function expectErrors(queryStr: string) { + return expectValidationErrors(FragmentsOnCompositeTypesRule, queryStr); +} + +function expectValid(queryStr: string) { + expectErrors(queryStr).toDeepEqual([]); +} + +describe('Validate: Fragments on composite types', () => { + it('object is valid fragment type', () => { + expectValid(` + fragment validFragment on Dog { + barks + } + `); + }); + + it('interface is valid fragment type', () => { + expectValid(` + fragment validFragment on Pet { + name + } + `); + }); + + it('object is valid inline fragment type', () => { + expectValid(` + fragment validFragment on Pet { + ... on Dog { + barks + } + } + `); + }); + + it('interface is valid inline fragment type', () => { + expectValid(` + fragment validFragment on Mammal { + ... on Canine { + name + } + } + `); + }); + + it('inline fragment without type is valid', () => { + expectValid(` + fragment validFragment on Pet { + ... { + name + } + } + `); + }); + + it('union is valid fragment type', () => { + expectValid(` + fragment validFragment on CatOrDog { + __typename + } + `); + }); + + it('scalar is invalid fragment type', () => { + expectErrors(` + fragment scalarFragment on Boolean { + bad + } + `).toDeepEqual([ + { + message: + 'Fragment "scalarFragment" cannot condition on non composite type "Boolean".', + locations: [{ line: 2, column: 34 }], + }, + ]); + }); + + it('enum is invalid fragment type', () => { + expectErrors(` + fragment scalarFragment on FurColor { + bad + } + `).toDeepEqual([ + { + message: + 'Fragment "scalarFragment" cannot condition on non composite type "FurColor".', + locations: [{ line: 2, column: 34 }], + }, + ]); + }); + + it('input object is invalid fragment type', () => { + expectErrors(` + fragment inputFragment on ComplexInput { + stringField + } + `).toDeepEqual([ + { + message: + 'Fragment "inputFragment" cannot condition on non composite type "ComplexInput".', + locations: [{ line: 2, column: 33 }], + }, + ]); + }); + + it('scalar is invalid inline fragment type', () => { + expectErrors(` + fragment invalidFragment on Pet { + ... on String { + barks + } + } + `).toDeepEqual([ + { + message: 'Fragment cannot condition on non composite type "String".', + locations: [{ line: 3, column: 16 }], + }, + ]); + }); +}); diff --git a/src/validation/__tests__/KnownArgumentNamesRule-test.ts b/src/validation/__tests__/KnownArgumentNamesRule-test.ts new file mode 100644 index 00000000..4ce5fd19 --- /dev/null +++ b/src/validation/__tests__/KnownArgumentNamesRule-test.ts @@ -0,0 +1,329 @@ +import { describe, it } from 'mocha'; + +import type { GraphQLSchema } from '../../type/schema'; + +import { buildSchema } from '../../utilities/buildASTSchema'; + +import { + KnownArgumentNamesOnDirectivesRule, + KnownArgumentNamesRule, +} from '../rules/KnownArgumentNamesRule'; + +import { expectSDLValidationErrors, expectValidationErrors } from './harness'; + +function expectErrors(queryStr: string) { + return expectValidationErrors(KnownArgumentNamesRule, queryStr); +} + +function expectValid(queryStr: string) { + expectErrors(queryStr).toDeepEqual([]); +} + +function expectSDLErrors(sdlStr: string, schema?: GraphQLSchema) { + return expectSDLValidationErrors( + schema, + KnownArgumentNamesOnDirectivesRule, + sdlStr, + ); +} + +function expectValidSDL(sdlStr: string) { + expectSDLErrors(sdlStr).toDeepEqual([]); +} + +describe('Validate: Known argument names', () => { + it('single arg is known', () => { + expectValid(` + fragment argOnRequiredArg on Dog { + doesKnowCommand(dogCommand: SIT) + } + `); + }); + + it('multiple args are known', () => { + expectValid(` + fragment multipleArgs on ComplicatedArgs { + multipleReqs(req1: 1, req2: 2) + } + `); + }); + + it('ignores args of unknown fields', () => { + expectValid(` + fragment argOnUnknownField on Dog { + unknownField(unknownArg: SIT) + } + `); + }); + + it('multiple args in reverse order are known', () => { + expectValid(` + fragment multipleArgsReverseOrder on ComplicatedArgs { + multipleReqs(req2: 2, req1: 1) + } + `); + }); + + it('no args on optional arg', () => { + expectValid(` + fragment noArgOnOptionalArg on Dog { + isHouseTrained + } + `); + }); + + it('args are known deeply', () => { + expectValid(` + { + dog { + doesKnowCommand(dogCommand: SIT) + } + human { + pet { + ... on Dog { + doesKnowCommand(dogCommand: SIT) + } + } + } + } + `); + }); + + it('directive args are known', () => { + expectValid(` + { + dog @skip(if: true) + } + `); + }); + + it('field args are invalid', () => { + expectErrors(` + { + dog @skip(unless: true) + } + `).toDeepEqual([ + { + message: 'Unknown argument "unless" on directive "@skip".', + locations: [{ line: 3, column: 19 }], + }, + ]); + }); + + it('directive without args is valid', () => { + expectValid(` + { + dog @onField + } + `); + }); + + it('arg passed to directive without arg is reported', () => { + expectErrors(` + { + dog @onField(if: true) + } + `).toDeepEqual([ + { + message: 'Unknown argument "if" on directive "@onField".', + locations: [{ line: 3, column: 22 }], + }, + ]); + }); + + it('misspelled directive args are reported', () => { + expectErrors(` + { + dog @skip(iff: true) + } + `).toDeepEqual([ + { + message: + 'Unknown argument "iff" on directive "@skip". Did you mean "if"?', + locations: [{ line: 3, column: 19 }], + }, + ]); + }); + + it('invalid arg name', () => { + expectErrors(` + fragment invalidArgName on Dog { + doesKnowCommand(unknown: true) + } + `).toDeepEqual([ + { + message: 'Unknown argument "unknown" on field "Dog.doesKnowCommand".', + locations: [{ line: 3, column: 25 }], + }, + ]); + }); + + it('misspelled arg name is reported', () => { + expectErrors(` + fragment invalidArgName on Dog { + doesKnowCommand(DogCommand: true) + } + `).toDeepEqual([ + { + message: + 'Unknown argument "DogCommand" on field "Dog.doesKnowCommand". Did you mean "dogCommand"?', + locations: [{ line: 3, column: 25 }], + }, + ]); + }); + + it('unknown args amongst known args', () => { + expectErrors(` + fragment oneGoodArgOneInvalidArg on Dog { + doesKnowCommand(whoKnows: 1, dogCommand: SIT, unknown: true) + } + `).toDeepEqual([ + { + message: 'Unknown argument "whoKnows" on field "Dog.doesKnowCommand".', + locations: [{ line: 3, column: 25 }], + }, + { + message: 'Unknown argument "unknown" on field "Dog.doesKnowCommand".', + locations: [{ line: 3, column: 55 }], + }, + ]); + }); + + it('unknown args deeply', () => { + expectErrors(` + { + dog { + doesKnowCommand(unknown: true) + } + human { + pet { + ... on Dog { + doesKnowCommand(unknown: true) + } + } + } + } + `).toDeepEqual([ + { + message: 'Unknown argument "unknown" on field "Dog.doesKnowCommand".', + locations: [{ line: 4, column: 27 }], + }, + { + message: 'Unknown argument "unknown" on field "Dog.doesKnowCommand".', + locations: [{ line: 9, column: 31 }], + }, + ]); + }); + + describe('within SDL', () => { + it('known arg on directive defined inside SDL', () => { + expectValidSDL(` + type Query { + foo: String @test(arg: "") + } + + directive @test(arg: String) on FIELD_DEFINITION + `); + }); + + it('unknown arg on directive defined inside SDL', () => { + expectSDLErrors(` + type Query { + foo: String @test(unknown: "") + } + + directive @test(arg: String) on FIELD_DEFINITION + `).toDeepEqual([ + { + message: 'Unknown argument "unknown" on directive "@test".', + locations: [{ line: 3, column: 29 }], + }, + ]); + }); + + it('misspelled arg name is reported on directive defined inside SDL', () => { + expectSDLErrors(` + type Query { + foo: String @test(agr: "") + } + + directive @test(arg: String) on FIELD_DEFINITION + `).toDeepEqual([ + { + message: + 'Unknown argument "agr" on directive "@test". Did you mean "arg"?', + locations: [{ line: 3, column: 29 }], + }, + ]); + }); + + it('unknown arg on standard directive', () => { + expectSDLErrors(` + type Query { + foo: String @deprecated(unknown: "") + } + `).toDeepEqual([ + { + message: 'Unknown argument "unknown" on directive "@deprecated".', + locations: [{ line: 3, column: 35 }], + }, + ]); + }); + + it('unknown arg on overridden standard directive', () => { + expectSDLErrors(` + type Query { + foo: String @deprecated(reason: "") + } + directive @deprecated(arg: String) on FIELD + `).toDeepEqual([ + { + message: 'Unknown argument "reason" on directive "@deprecated".', + locations: [{ line: 3, column: 35 }], + }, + ]); + }); + + it('unknown arg on directive defined in schema extension', () => { + const schema = buildSchema(` + type Query { + foo: String + } + `); + expectSDLErrors( + ` + directive @test(arg: String) on OBJECT + + extend type Query @test(unknown: "") + `, + schema, + ).toDeepEqual([ + { + message: 'Unknown argument "unknown" on directive "@test".', + locations: [{ line: 4, column: 36 }], + }, + ]); + }); + + it('unknown arg on directive used in schema extension', () => { + const schema = buildSchema(` + directive @test(arg: String) on OBJECT + + type Query { + foo: String + } + `); + expectSDLErrors( + ` + extend type Query @test(unknown: "") + `, + schema, + ).toDeepEqual([ + { + message: 'Unknown argument "unknown" on directive "@test".', + locations: [{ line: 2, column: 35 }], + }, + ]); + }); + }); +}); diff --git a/src/validation/__tests__/KnownDirectivesRule-test.ts b/src/validation/__tests__/KnownDirectivesRule-test.ts new file mode 100644 index 00000000..4cb6e225 --- /dev/null +++ b/src/validation/__tests__/KnownDirectivesRule-test.ts @@ -0,0 +1,452 @@ +import { describe, it } from 'mocha'; + +import type { GraphQLSchema } from '../../type/schema'; + +import { buildSchema } from '../../utilities/buildASTSchema'; + +import { KnownDirectivesRule } from '../rules/KnownDirectivesRule'; + +import { + expectSDLValidationErrors, + expectValidationErrorsWithSchema, +} from './harness'; + +function expectErrors(queryStr: string) { + return expectValidationErrorsWithSchema( + schemaWithDirectives, + KnownDirectivesRule, + queryStr, + ); +} + +function expectValid(queryStr: string) { + expectErrors(queryStr).toDeepEqual([]); +} + +function expectSDLErrors(sdlStr: string, schema?: GraphQLSchema) { + return expectSDLValidationErrors(schema, KnownDirectivesRule, sdlStr); +} + +function expectValidSDL(sdlStr: string, schema?: GraphQLSchema) { + expectSDLErrors(sdlStr, schema).toDeepEqual([]); +} + +const schemaWithDirectives = buildSchema(` + type Query { + dummy: String + } + + directive @onQuery on QUERY + directive @onMutation on MUTATION + directive @onSubscription on SUBSCRIPTION + directive @onField on FIELD + directive @onFragmentDefinition on FRAGMENT_DEFINITION + directive @onFragmentSpread on FRAGMENT_SPREAD + directive @onInlineFragment on INLINE_FRAGMENT + directive @onVariableDefinition on VARIABLE_DEFINITION +`); + +const schemaWithSDLDirectives = buildSchema(` + directive @onSchema on SCHEMA + directive @onScalar on SCALAR + directive @onObject on OBJECT + directive @onFieldDefinition on FIELD_DEFINITION + directive @onArgumentDefinition on ARGUMENT_DEFINITION + directive @onInterface on INTERFACE + directive @onUnion on UNION + directive @onEnum on ENUM + directive @onEnumValue on ENUM_VALUE + directive @onInputObject on INPUT_OBJECT + directive @onInputFieldDefinition on INPUT_FIELD_DEFINITION +`); + +describe('Validate: Known directives', () => { + it('with no directives', () => { + expectValid(` + query Foo { + name + ...Frag + } + + fragment Frag on Dog { + name + } + `); + }); + + it('with standard directives', () => { + expectValid(` + { + human @skip(if: false) { + name + pets { + ... on Dog @include(if: true) { + name + } + } + } + } + `); + }); + + it('with unknown directive', () => { + expectErrors(` + { + human @unknown(directive: "value") { + name + } + } + `).toDeepEqual([ + { + message: 'Unknown directive "@unknown".', + locations: [{ line: 3, column: 15 }], + }, + ]); + }); + + it('with many unknown directives', () => { + expectErrors(` + { + __typename @unknown + human @unknown { + name + pets @unknown { + name + } + } + } + `).toDeepEqual([ + { + message: 'Unknown directive "@unknown".', + locations: [{ line: 3, column: 20 }], + }, + { + message: 'Unknown directive "@unknown".', + locations: [{ line: 4, column: 15 }], + }, + { + message: 'Unknown directive "@unknown".', + locations: [{ line: 6, column: 16 }], + }, + ]); + }); + + it('with well placed directives', () => { + expectValid(` + query ($var: Boolean @onVariableDefinition) @onQuery { + human @onField { + ...Frag @onFragmentSpread + ... @onInlineFragment { + name @onField + } + } + } + + mutation @onMutation { + someField @onField + } + + subscription @onSubscription { + someField @onField + } + + fragment Frag on Human @onFragmentDefinition { + name @onField + } + `); + }); + + it('with misplaced directives', () => { + expectErrors(` + query ($var: Boolean @onQuery) @onMutation { + human @onQuery { + ...Frag @onQuery + ... @onQuery { + name @onQuery + } + } + } + + mutation @onQuery { + someField @onQuery + } + + subscription @onQuery { + someField @onQuery + } + + fragment Frag on Human @onQuery { + name @onQuery + } + `).toDeepEqual([ + { + message: 'Directive "@onQuery" may not be used on VARIABLE_DEFINITION.', + locations: [{ line: 2, column: 28 }], + }, + { + message: 'Directive "@onMutation" may not be used on QUERY.', + locations: [{ line: 2, column: 38 }], + }, + { + message: 'Directive "@onQuery" may not be used on FIELD.', + locations: [{ line: 3, column: 15 }], + }, + { + message: 'Directive "@onQuery" may not be used on FRAGMENT_SPREAD.', + locations: [{ line: 4, column: 19 }], + }, + { + message: 'Directive "@onQuery" may not be used on INLINE_FRAGMENT.', + locations: [{ line: 5, column: 15 }], + }, + { + message: 'Directive "@onQuery" may not be used on FIELD.', + locations: [{ line: 6, column: 18 }], + }, + { + message: 'Directive "@onQuery" may not be used on MUTATION.', + locations: [{ line: 11, column: 16 }], + }, + { + message: 'Directive "@onQuery" may not be used on FIELD.', + locations: [{ column: 19, line: 12 }], + }, + { + message: 'Directive "@onQuery" may not be used on SUBSCRIPTION.', + locations: [{ column: 20, line: 15 }], + }, + { + message: 'Directive "@onQuery" may not be used on FIELD.', + locations: [{ column: 19, line: 16 }], + }, + { + message: 'Directive "@onQuery" may not be used on FRAGMENT_DEFINITION.', + locations: [{ column: 30, line: 19 }], + }, + { + message: 'Directive "@onQuery" may not be used on FIELD.', + locations: [{ column: 14, line: 20 }], + }, + ]); + }); + + describe('within SDL', () => { + it('with directive defined inside SDL', () => { + expectValidSDL(` + type Query { + foo: String @test + } + + directive @test on FIELD_DEFINITION + `); + }); + + it('with standard directive', () => { + expectValidSDL(` + type Query { + foo: String @deprecated + } + `); + }); + + it('with overridden standard directive', () => { + expectValidSDL(` + schema @deprecated { + query: Query + } + directive @deprecated on SCHEMA + `); + }); + + it('with directive defined in schema extension', () => { + const schema = buildSchema(` + type Query { + foo: String + } + `); + expectValidSDL( + ` + directive @test on OBJECT + + extend type Query @test + `, + schema, + ); + }); + + it('with directive used in schema extension', () => { + const schema = buildSchema(` + directive @test on OBJECT + + type Query { + foo: String + } + `); + expectValidSDL( + ` + extend type Query @test + `, + schema, + ); + }); + + it('with unknown directive in schema extension', () => { + const schema = buildSchema(` + type Query { + foo: String + } + `); + expectSDLErrors( + ` + extend type Query @unknown + `, + schema, + ).toDeepEqual([ + { + message: 'Unknown directive "@unknown".', + locations: [{ line: 2, column: 29 }], + }, + ]); + }); + + it('with well placed directives', () => { + expectValidSDL( + ` + type MyObj implements MyInterface @onObject { + myField(myArg: Int @onArgumentDefinition): String @onFieldDefinition + } + + extend type MyObj @onObject + + scalar MyScalar @onScalar + + extend scalar MyScalar @onScalar + + interface MyInterface @onInterface { + myField(myArg: Int @onArgumentDefinition): String @onFieldDefinition + } + + extend interface MyInterface @onInterface + + union MyUnion @onUnion = MyObj | Other + + extend union MyUnion @onUnion + + enum MyEnum @onEnum { + MY_VALUE @onEnumValue + } + + extend enum MyEnum @onEnum + + input MyInput @onInputObject { + myField: Int @onInputFieldDefinition + } + + extend input MyInput @onInputObject + + schema @onSchema { + query: MyQuery + } + + extend schema @onSchema + `, + schemaWithSDLDirectives, + ); + }); + + it('with misplaced directives', () => { + expectSDLErrors( + ` + type MyObj implements MyInterface @onInterface { + myField(myArg: Int @onInputFieldDefinition): String @onInputFieldDefinition + } + + scalar MyScalar @onEnum + + interface MyInterface @onObject { + myField(myArg: Int @onInputFieldDefinition): String @onInputFieldDefinition + } + + union MyUnion @onEnumValue = MyObj | Other + + enum MyEnum @onScalar { + MY_VALUE @onUnion + } + + input MyInput @onEnum { + myField: Int @onArgumentDefinition + } + + schema @onObject { + query: MyQuery + } + + extend schema @onObject + `, + schemaWithSDLDirectives, + ).toDeepEqual([ + { + message: 'Directive "@onInterface" may not be used on OBJECT.', + locations: [{ line: 2, column: 45 }], + }, + { + message: + 'Directive "@onInputFieldDefinition" may not be used on ARGUMENT_DEFINITION.', + locations: [{ line: 3, column: 32 }], + }, + { + message: + 'Directive "@onInputFieldDefinition" may not be used on FIELD_DEFINITION.', + locations: [{ line: 3, column: 65 }], + }, + { + message: 'Directive "@onEnum" may not be used on SCALAR.', + locations: [{ line: 6, column: 27 }], + }, + { + message: 'Directive "@onObject" may not be used on INTERFACE.', + locations: [{ line: 8, column: 33 }], + }, + { + message: + 'Directive "@onInputFieldDefinition" may not be used on ARGUMENT_DEFINITION.', + locations: [{ line: 9, column: 32 }], + }, + { + message: + 'Directive "@onInputFieldDefinition" may not be used on FIELD_DEFINITION.', + locations: [{ line: 9, column: 65 }], + }, + { + message: 'Directive "@onEnumValue" may not be used on UNION.', + locations: [{ line: 12, column: 25 }], + }, + { + message: 'Directive "@onScalar" may not be used on ENUM.', + locations: [{ line: 14, column: 23 }], + }, + { + message: 'Directive "@onUnion" may not be used on ENUM_VALUE.', + locations: [{ line: 15, column: 22 }], + }, + { + message: 'Directive "@onEnum" may not be used on INPUT_OBJECT.', + locations: [{ line: 18, column: 25 }], + }, + { + message: + 'Directive "@onArgumentDefinition" may not be used on INPUT_FIELD_DEFINITION.', + locations: [{ line: 19, column: 26 }], + }, + { + message: 'Directive "@onObject" may not be used on SCHEMA.', + locations: [{ line: 22, column: 18 }], + }, + { + message: 'Directive "@onObject" may not be used on SCHEMA.', + locations: [{ line: 26, column: 25 }], + }, + ]); + }); + }); +}); diff --git a/src/validation/__tests__/KnownFragmentNamesRule-test.ts b/src/validation/__tests__/KnownFragmentNamesRule-test.ts new file mode 100644 index 00000000..c4257678 --- /dev/null +++ b/src/validation/__tests__/KnownFragmentNamesRule-test.ts @@ -0,0 +1,71 @@ +import { describe, it } from 'mocha'; + +import { KnownFragmentNamesRule } from '../rules/KnownFragmentNamesRule'; + +import { expectValidationErrors } from './harness'; + +function expectErrors(queryStr: string) { + return expectValidationErrors(KnownFragmentNamesRule, queryStr); +} + +function expectValid(queryStr: string) { + expectErrors(queryStr).toDeepEqual([]); +} + +describe('Validate: Known fragment names', () => { + it('known fragment names are valid', () => { + expectValid(` + { + human(id: 4) { + ...HumanFields1 + ... on Human { + ...HumanFields2 + } + ... { + name + } + } + } + fragment HumanFields1 on Human { + name + ...HumanFields3 + } + fragment HumanFields2 on Human { + name + } + fragment HumanFields3 on Human { + name + } + `); + }); + + it('unknown fragment names are invalid', () => { + expectErrors(` + { + human(id: 4) { + ...UnknownFragment1 + ... on Human { + ...UnknownFragment2 + } + } + } + fragment HumanFields on Human { + name + ...UnknownFragment3 + } + `).toDeepEqual([ + { + message: 'Unknown fragment "UnknownFragment1".', + locations: [{ line: 4, column: 14 }], + }, + { + message: 'Unknown fragment "UnknownFragment2".', + locations: [{ line: 6, column: 16 }], + }, + { + message: 'Unknown fragment "UnknownFragment3".', + locations: [{ line: 12, column: 12 }], + }, + ]); + }); +}); diff --git a/src/validation/__tests__/KnownTypeNamesRule-test.ts b/src/validation/__tests__/KnownTypeNamesRule-test.ts new file mode 100644 index 00000000..34f0ca71 --- /dev/null +++ b/src/validation/__tests__/KnownTypeNamesRule-test.ts @@ -0,0 +1,362 @@ +import { describe, it } from 'mocha'; + +import type { GraphQLSchema } from '../../type/schema'; + +import { buildSchema } from '../../utilities/buildASTSchema'; + +import { KnownTypeNamesRule } from '../rules/KnownTypeNamesRule'; + +import { + expectSDLValidationErrors, + expectValidationErrors, + expectValidationErrorsWithSchema, +} from './harness'; + +function expectErrors(queryStr: string) { + return expectValidationErrors(KnownTypeNamesRule, queryStr); +} + +function expectErrorsWithSchema(schema: GraphQLSchema, queryStr: string) { + return expectValidationErrorsWithSchema(schema, KnownTypeNamesRule, queryStr); +} + +function expectValid(queryStr: string) { + expectErrors(queryStr).toDeepEqual([]); +} + +function expectSDLErrors(sdlStr: string, schema?: GraphQLSchema) { + return expectSDLValidationErrors(schema, KnownTypeNamesRule, sdlStr); +} + +function expectValidSDL(sdlStr: string, schema?: GraphQLSchema) { + expectSDLErrors(sdlStr, schema).toDeepEqual([]); +} + +describe('Validate: Known type names', () => { + it('known type names are valid', () => { + expectValid(` + query Foo( + $var: String + $required: [Int!]! + $introspectionType: __EnumValue + ) { + user(id: 4) { + pets { ... on Pet { name }, ...PetFields, ... { name } } + } + } + + fragment PetFields on Pet { + name + } + `); + }); + + it('unknown type names are invalid', () => { + expectErrors(` + query Foo($var: [JumbledUpLetters!]!) { + user(id: 4) { + name + pets { ... on Badger { name }, ...PetFields } + } + } + fragment PetFields on Peat { + name + } + `).toDeepEqual([ + { + message: 'Unknown type "JumbledUpLetters".', + locations: [{ line: 2, column: 24 }], + }, + { + message: 'Unknown type "Badger".', + locations: [{ line: 5, column: 25 }], + }, + { + message: 'Unknown type "Peat". Did you mean "Pet" or "Cat"?', + locations: [{ line: 8, column: 29 }], + }, + ]); + }); + + it('references to standard scalars that are missing in schema', () => { + const schema = buildSchema('type Query { foo: String }'); + const query = ` + query ($id: ID, $float: Float, $int: Int) { + __typename + } + `; + expectErrorsWithSchema(schema, query).toDeepEqual([ + { + message: 'Unknown type "ID".', + locations: [{ line: 2, column: 19 }], + }, + { + message: 'Unknown type "Float".', + locations: [{ line: 2, column: 31 }], + }, + { + message: 'Unknown type "Int".', + locations: [{ line: 2, column: 44 }], + }, + ]); + }); + + describe('within SDL', () => { + it('use standard types', () => { + expectValidSDL(` + type Query { + string: String + int: Int + float: Float + boolean: Boolean + id: ID + introspectionType: __EnumValue + } + `); + }); + + it('reference types defined inside the same document', () => { + expectValidSDL(` + union SomeUnion = SomeObject | AnotherObject + + type SomeObject implements SomeInterface { + someScalar(arg: SomeInputObject): SomeScalar + } + + type AnotherObject { + foo(arg: SomeInputObject): String + } + + type SomeInterface { + someScalar(arg: SomeInputObject): SomeScalar + } + + input SomeInputObject { + someScalar: SomeScalar + } + + scalar SomeScalar + + type RootQuery { + someInterface: SomeInterface + someUnion: SomeUnion + someScalar: SomeScalar + someObject: SomeObject + } + + schema { + query: RootQuery + } + `); + }); + + it('unknown type references', () => { + expectSDLErrors(` + type A + type B + + type SomeObject implements C { + e(d: D): E + } + + union SomeUnion = F | G + + interface SomeInterface { + i(h: H): I + } + + input SomeInput { + j: J + } + + directive @SomeDirective(k: K) on QUERY + + schema { + query: L + mutation: M + subscription: N + } + `).toDeepEqual([ + { + message: 'Unknown type "C". Did you mean "A" or "B"?', + locations: [{ line: 5, column: 36 }], + }, + { + message: 'Unknown type "D". Did you mean "A", "B", or "ID"?', + locations: [{ line: 6, column: 16 }], + }, + { + message: 'Unknown type "E". Did you mean "A" or "B"?', + locations: [{ line: 6, column: 20 }], + }, + { + message: 'Unknown type "F". Did you mean "A" or "B"?', + locations: [{ line: 9, column: 27 }], + }, + { + message: 'Unknown type "G". Did you mean "A" or "B"?', + locations: [{ line: 9, column: 31 }], + }, + { + message: 'Unknown type "H". Did you mean "A" or "B"?', + locations: [{ line: 12, column: 16 }], + }, + { + message: 'Unknown type "I". Did you mean "A", "B", or "ID"?', + locations: [{ line: 12, column: 20 }], + }, + { + message: 'Unknown type "J". Did you mean "A" or "B"?', + locations: [{ line: 16, column: 14 }], + }, + { + message: 'Unknown type "K". Did you mean "A" or "B"?', + locations: [{ line: 19, column: 37 }], + }, + { + message: 'Unknown type "L". Did you mean "A" or "B"?', + locations: [{ line: 22, column: 18 }], + }, + { + message: 'Unknown type "M". Did you mean "A" or "B"?', + locations: [{ line: 23, column: 21 }], + }, + { + message: 'Unknown type "N". Did you mean "A" or "B"?', + locations: [{ line: 24, column: 25 }], + }, + ]); + }); + + it('does not consider non-type definitions', () => { + expectSDLErrors(` + query Foo { __typename } + fragment Foo on Query { __typename } + directive @Foo on QUERY + + type Query { + foo: Foo + } + `).toDeepEqual([ + { + message: 'Unknown type "Foo".', + locations: [{ line: 7, column: 16 }], + }, + ]); + }); + + it('reference standard types inside extension document', () => { + const schema = buildSchema('type Foo'); + const sdl = ` + type SomeType { + string: String + int: Int + float: Float + boolean: Boolean + id: ID + introspectionType: __EnumValue + } + `; + + expectValidSDL(sdl, schema); + }); + + it('reference types inside extension document', () => { + const schema = buildSchema('type Foo'); + const sdl = ` + type QueryRoot { + foo: Foo + bar: Bar + } + + scalar Bar + + schema { + query: QueryRoot + } + `; + + expectValidSDL(sdl, schema); + }); + + it('unknown type references inside extension document', () => { + const schema = buildSchema('type A'); + const sdl = ` + type B + + type SomeObject implements C { + e(d: D): E + } + + union SomeUnion = F | G + + interface SomeInterface { + i(h: H): I + } + + input SomeInput { + j: J + } + + directive @SomeDirective(k: K) on QUERY + + schema { + query: L + mutation: M + subscription: N + } + `; + + expectSDLErrors(sdl, schema).toDeepEqual([ + { + message: 'Unknown type "C". Did you mean "A" or "B"?', + locations: [{ line: 4, column: 36 }], + }, + { + message: 'Unknown type "D". Did you mean "A", "B", or "ID"?', + locations: [{ line: 5, column: 16 }], + }, + { + message: 'Unknown type "E". Did you mean "A" or "B"?', + locations: [{ line: 5, column: 20 }], + }, + { + message: 'Unknown type "F". Did you mean "A" or "B"?', + locations: [{ line: 8, column: 27 }], + }, + { + message: 'Unknown type "G". Did you mean "A" or "B"?', + locations: [{ line: 8, column: 31 }], + }, + { + message: 'Unknown type "H". Did you mean "A" or "B"?', + locations: [{ line: 11, column: 16 }], + }, + { + message: 'Unknown type "I". Did you mean "A", "B", or "ID"?', + locations: [{ line: 11, column: 20 }], + }, + { + message: 'Unknown type "J". Did you mean "A" or "B"?', + locations: [{ line: 15, column: 14 }], + }, + { + message: 'Unknown type "K". Did you mean "A" or "B"?', + locations: [{ line: 18, column: 37 }], + }, + { + message: 'Unknown type "L". Did you mean "A" or "B"?', + locations: [{ line: 21, column: 18 }], + }, + { + message: 'Unknown type "M". Did you mean "A" or "B"?', + locations: [{ line: 22, column: 21 }], + }, + { + message: 'Unknown type "N". Did you mean "A" or "B"?', + locations: [{ line: 23, column: 25 }], + }, + ]); + }); + }); +}); diff --git a/src/validation/__tests__/LoneAnonymousOperationRule-test.ts b/src/validation/__tests__/LoneAnonymousOperationRule-test.ts new file mode 100644 index 00000000..a50ef1bd --- /dev/null +++ b/src/validation/__tests__/LoneAnonymousOperationRule-test.ts @@ -0,0 +1,106 @@ +import { describe, it } from 'mocha'; + +import { LoneAnonymousOperationRule } from '../rules/LoneAnonymousOperationRule'; + +import { expectValidationErrors } from './harness'; + +function expectErrors(queryStr: string) { + return expectValidationErrors(LoneAnonymousOperationRule, queryStr); +} + +function expectValid(queryStr: string) { + expectErrors(queryStr).toDeepEqual([]); +} + +describe('Validate: Anonymous operation must be alone', () => { + it('no operations', () => { + expectValid(` + fragment fragA on Type { + field + } + `); + }); + + it('one anon operation', () => { + expectValid(` + { + field + } + `); + }); + + it('multiple named operations', () => { + expectValid(` + query Foo { + field + } + + query Bar { + field + } + `); + }); + + it('anon operation with fragment', () => { + expectValid(` + { + ...Foo + } + fragment Foo on Type { + field + } + `); + }); + + it('multiple anon operations', () => { + expectErrors(` + { + fieldA + } + { + fieldB + } + `).toDeepEqual([ + { + message: 'This anonymous operation must be the only defined operation.', + locations: [{ line: 2, column: 7 }], + }, + { + message: 'This anonymous operation must be the only defined operation.', + locations: [{ line: 5, column: 7 }], + }, + ]); + }); + + it('anon operation with a mutation', () => { + expectErrors(` + { + fieldA + } + mutation Foo { + fieldB + } + `).toDeepEqual([ + { + message: 'This anonymous operation must be the only defined operation.', + locations: [{ line: 2, column: 7 }], + }, + ]); + }); + + it('anon operation with a subscription', () => { + expectErrors(` + { + fieldA + } + subscription Foo { + fieldB + } + `).toDeepEqual([ + { + message: 'This anonymous operation must be the only defined operation.', + locations: [{ line: 2, column: 7 }], + }, + ]); + }); +}); diff --git a/src/validation/__tests__/LoneSchemaDefinitionRule-test.ts b/src/validation/__tests__/LoneSchemaDefinitionRule-test.ts new file mode 100644 index 00000000..3f2ea895 --- /dev/null +++ b/src/validation/__tests__/LoneSchemaDefinitionRule-test.ts @@ -0,0 +1,158 @@ +import { describe, it } from 'mocha'; + +import type { GraphQLSchema } from '../../type/schema'; + +import { buildSchema } from '../../utilities/buildASTSchema'; + +import { LoneSchemaDefinitionRule } from '../rules/LoneSchemaDefinitionRule'; + +import { expectSDLValidationErrors } from './harness'; + +function expectSDLErrors(sdlStr: string, schema?: GraphQLSchema) { + return expectSDLValidationErrors(schema, LoneSchemaDefinitionRule, sdlStr); +} + +function expectValidSDL(sdlStr: string, schema?: GraphQLSchema) { + expectSDLErrors(sdlStr, schema).toDeepEqual([]); +} + +describe('Validate: Schema definition should be alone', () => { + it('no schema', () => { + expectValidSDL(` + type Query { + foo: String + } + `); + }); + + it('one schema definition', () => { + expectValidSDL(` + schema { + query: Foo + } + + type Foo { + foo: String + } + `); + }); + + it('multiple schema definitions', () => { + expectSDLErrors(` + schema { + query: Foo + } + + type Foo { + foo: String + } + + schema { + mutation: Foo + } + + schema { + subscription: Foo + } + `).toDeepEqual([ + { + message: 'Must provide only one schema definition.', + locations: [{ line: 10, column: 7 }], + }, + { + message: 'Must provide only one schema definition.', + locations: [{ line: 14, column: 7 }], + }, + ]); + }); + + it('define schema in schema extension', () => { + const schema = buildSchema(` + type Foo { + foo: String + } + `); + + expectSDLErrors( + ` + schema { + query: Foo + } + `, + schema, + ).toDeepEqual([]); + }); + + it('redefine schema in schema extension', () => { + const schema = buildSchema(` + schema { + query: Foo + } + + type Foo { + foo: String + } + `); + + expectSDLErrors( + ` + schema { + mutation: Foo + } + `, + schema, + ).toDeepEqual([ + { + message: 'Cannot define a new schema within a schema extension.', + locations: [{ line: 2, column: 9 }], + }, + ]); + }); + + it('redefine implicit schema in schema extension', () => { + const schema = buildSchema(` + type Query { + fooField: Foo + } + + type Foo { + foo: String + } + `); + + expectSDLErrors( + ` + schema { + mutation: Foo + } + `, + schema, + ).toDeepEqual([ + { + message: 'Cannot define a new schema within a schema extension.', + locations: [{ line: 2, column: 9 }], + }, + ]); + }); + + it('extend schema in schema extension', () => { + const schema = buildSchema(` + type Query { + fooField: Foo + } + + type Foo { + foo: String + } + `); + + expectValidSDL( + ` + extend schema { + mutation: Foo + } + `, + schema, + ); + }); +}); diff --git a/src/validation/__tests__/NoDeprecatedCustomRule-test.ts b/src/validation/__tests__/NoDeprecatedCustomRule-test.ts new file mode 100644 index 00000000..512edb27 --- /dev/null +++ b/src/validation/__tests__/NoDeprecatedCustomRule-test.ts @@ -0,0 +1,272 @@ +import { describe, it } from 'mocha'; + +import { buildSchema } from '../../utilities/buildASTSchema'; + +import { NoDeprecatedCustomRule } from '../rules/custom/NoDeprecatedCustomRule'; + +import { expectValidationErrorsWithSchema } from './harness'; + +function buildAssertion(sdlStr: string) { + const schema = buildSchema(sdlStr); + return { expectErrors, expectValid }; + + function expectErrors(queryStr: string) { + return expectValidationErrorsWithSchema( + schema, + NoDeprecatedCustomRule, + queryStr, + ); + } + + function expectValid(queryStr: string) { + expectErrors(queryStr).toDeepEqual([]); + } +} + +describe('Validate: no deprecated', () => { + describe('no deprecated fields', () => { + const { expectValid, expectErrors } = buildAssertion(` + type Query { + normalField: String + deprecatedField: String @deprecated(reason: "Some field reason.") + } + `); + + it('ignores fields that are not deprecated', () => { + expectValid(` + { + normalField + } + `); + }); + + it('ignores unknown fields', () => { + expectValid(` + { + unknownField + } + + fragment UnknownFragment on UnknownType { + deprecatedField + } + `); + }); + + it('reports error when a deprecated field is selected', () => { + const message = + 'The field Query.deprecatedField is deprecated. Some field reason.'; + + expectErrors(` + { + deprecatedField + } + + fragment QueryFragment on Query { + deprecatedField + } + `).toDeepEqual([ + { message, locations: [{ line: 3, column: 11 }] }, + { message, locations: [{ line: 7, column: 11 }] }, + ]); + }); + }); + + describe('no deprecated arguments on fields', () => { + const { expectValid, expectErrors } = buildAssertion(` + type Query { + someField( + normalArg: String, + deprecatedArg: String @deprecated(reason: "Some arg reason."), + ): String + } + `); + + it('ignores arguments that are not deprecated', () => { + expectValid(` + { + normalField(normalArg: "") + } + `); + }); + + it('ignores unknown arguments', () => { + expectValid(` + { + someField(unknownArg: "") + unknownField(deprecatedArg: "") + } + `); + }); + + it('reports error when a deprecated argument is used', () => { + expectErrors(` + { + someField(deprecatedArg: "") + } + `).toDeepEqual([ + { + message: + 'Field "Query.someField" argument "deprecatedArg" is deprecated. Some arg reason.', + locations: [{ line: 3, column: 21 }], + }, + ]); + }); + }); + + describe('no deprecated arguments on directives', () => { + const { expectValid, expectErrors } = buildAssertion(` + type Query { + someField: String + } + + directive @someDirective( + normalArg: String, + deprecatedArg: String @deprecated(reason: "Some arg reason."), + ) on FIELD + `); + + it('ignores arguments that are not deprecated', () => { + expectValid(` + { + someField @someDirective(normalArg: "") + } + `); + }); + + it('ignores unknown arguments', () => { + expectValid(` + { + someField @someDirective(unknownArg: "") + someField @unknownDirective(deprecatedArg: "") + } + `); + }); + + it('reports error when a deprecated argument is used', () => { + expectErrors(` + { + someField @someDirective(deprecatedArg: "") + } + `).toDeepEqual([ + { + message: + 'Directive "@someDirective" argument "deprecatedArg" is deprecated. Some arg reason.', + locations: [{ line: 3, column: 36 }], + }, + ]); + }); + }); + + describe('no deprecated input fields', () => { + const { expectValid, expectErrors } = buildAssertion(` + input InputType { + normalField: String + deprecatedField: String @deprecated(reason: "Some input field reason.") + } + + type Query { + someField(someArg: InputType): String + } + + directive @someDirective(someArg: InputType) on FIELD + `); + + it('ignores input fields that are not deprecated', () => { + expectValid(` + { + someField( + someArg: { normalField: "" } + ) @someDirective(someArg: { normalField: "" }) + } + `); + }); + + it('ignores unknown input fields', () => { + expectValid(` + { + someField( + someArg: { unknownField: "" } + ) + + someField( + unknownArg: { unknownField: "" } + ) + + unknownField( + unknownArg: { unknownField: "" } + ) + } + `); + }); + + it('reports error when a deprecated input field is used', () => { + const message = + 'The input field InputType.deprecatedField is deprecated. Some input field reason.'; + + expectErrors(` + { + someField( + someArg: { deprecatedField: "" } + ) @someDirective(someArg: { deprecatedField: "" }) + } + `).toDeepEqual([ + { message, locations: [{ line: 4, column: 24 }] }, + { message, locations: [{ line: 5, column: 39 }] }, + ]); + }); + }); + + describe('no deprecated enum values', () => { + const { expectValid, expectErrors } = buildAssertion(` + enum EnumType { + NORMAL_VALUE + DEPRECATED_VALUE @deprecated(reason: "Some enum reason.") + } + + type Query { + someField(enumArg: EnumType): String + } + `); + + it('ignores enum values that are not deprecated', () => { + expectValid(` + { + normalField(enumArg: NORMAL_VALUE) + } + `); + }); + + it('ignores unknown enum values', () => { + expectValid(` + query ( + $unknownValue: EnumType = UNKNOWN_VALUE + $unknownType: UnknownType = UNKNOWN_VALUE + ) { + someField(enumArg: UNKNOWN_VALUE) + someField(unknownArg: UNKNOWN_VALUE) + unknownField(unknownArg: UNKNOWN_VALUE) + } + + fragment SomeFragment on Query { + someField(enumArg: UNKNOWN_VALUE) + } + `); + }); + + it('reports error when a deprecated enum value is used', () => { + const message = + 'The enum value "EnumType.DEPRECATED_VALUE" is deprecated. Some enum reason.'; + + expectErrors(` + query ( + $variable: EnumType = DEPRECATED_VALUE + ) { + someField(enumArg: DEPRECATED_VALUE) + } + `).toDeepEqual([ + { message, locations: [{ line: 3, column: 33 }] }, + { message, locations: [{ line: 5, column: 30 }] }, + ]); + }); + }); +}); diff --git a/src/validation/__tests__/NoFragmentCyclesRule-test.ts b/src/validation/__tests__/NoFragmentCyclesRule-test.ts new file mode 100644 index 00000000..08ac4cb4 --- /dev/null +++ b/src/validation/__tests__/NoFragmentCyclesRule-test.ts @@ -0,0 +1,260 @@ +import { describe, it } from 'mocha'; + +import { NoFragmentCyclesRule } from '../rules/NoFragmentCyclesRule'; + +import { expectValidationErrors } from './harness'; + +function expectErrors(queryStr: string) { + return expectValidationErrors(NoFragmentCyclesRule, queryStr); +} + +function expectValid(queryStr: string) { + expectErrors(queryStr).toDeepEqual([]); +} + +describe('Validate: No circular fragment spreads', () => { + it('single reference is valid', () => { + expectValid(` + fragment fragA on Dog { ...fragB } + fragment fragB on Dog { name } + `); + }); + + it('spreading twice is not circular', () => { + expectValid(` + fragment fragA on Dog { ...fragB, ...fragB } + fragment fragB on Dog { name } + `); + }); + + it('spreading twice indirectly is not circular', () => { + expectValid(` + fragment fragA on Dog { ...fragB, ...fragC } + fragment fragB on Dog { ...fragC } + fragment fragC on Dog { name } + `); + }); + + it('double spread within abstract types', () => { + expectValid(` + fragment nameFragment on Pet { + ... on Dog { name } + ... on Cat { name } + } + + fragment spreadsInAnon on Pet { + ... on Dog { ...nameFragment } + ... on Cat { ...nameFragment } + } + `); + }); + + it('does not false positive on unknown fragment', () => { + expectValid(` + fragment nameFragment on Pet { + ...UnknownFragment + } + `); + }); + + it('spreading recursively within field fails', () => { + expectErrors(` + fragment fragA on Human { relatives { ...fragA } }, + `).toDeepEqual([ + { + message: 'Cannot spread fragment "fragA" within itself.', + locations: [{ line: 2, column: 45 }], + }, + ]); + }); + + it('no spreading itself directly', () => { + expectErrors(` + fragment fragA on Dog { ...fragA } + `).toDeepEqual([ + { + message: 'Cannot spread fragment "fragA" within itself.', + locations: [{ line: 2, column: 31 }], + }, + ]); + }); + + it('no spreading itself directly within inline fragment', () => { + expectErrors(` + fragment fragA on Pet { + ... on Dog { + ...fragA + } + } + `).toDeepEqual([ + { + message: 'Cannot spread fragment "fragA" within itself.', + locations: [{ line: 4, column: 11 }], + }, + ]); + }); + + it('no spreading itself indirectly', () => { + expectErrors(` + fragment fragA on Dog { ...fragB } + fragment fragB on Dog { ...fragA } + `).toDeepEqual([ + { + message: 'Cannot spread fragment "fragA" within itself via "fragB".', + locations: [ + { line: 2, column: 31 }, + { line: 3, column: 31 }, + ], + }, + ]); + }); + + it('no spreading itself indirectly reports opposite order', () => { + expectErrors(` + fragment fragB on Dog { ...fragA } + fragment fragA on Dog { ...fragB } + `).toDeepEqual([ + { + message: 'Cannot spread fragment "fragB" within itself via "fragA".', + locations: [ + { line: 2, column: 31 }, + { line: 3, column: 31 }, + ], + }, + ]); + }); + + it('no spreading itself indirectly within inline fragment', () => { + expectErrors(` + fragment fragA on Pet { + ... on Dog { + ...fragB + } + } + fragment fragB on Pet { + ... on Dog { + ...fragA + } + } + `).toDeepEqual([ + { + message: 'Cannot spread fragment "fragA" within itself via "fragB".', + locations: [ + { line: 4, column: 11 }, + { line: 9, column: 11 }, + ], + }, + ]); + }); + + it('no spreading itself deeply', () => { + expectErrors(` + fragment fragA on Dog { ...fragB } + fragment fragB on Dog { ...fragC } + fragment fragC on Dog { ...fragO } + fragment fragX on Dog { ...fragY } + fragment fragY on Dog { ...fragZ } + fragment fragZ on Dog { ...fragO } + fragment fragO on Dog { ...fragP } + fragment fragP on Dog { ...fragA, ...fragX } + `).toDeepEqual([ + { + message: + 'Cannot spread fragment "fragA" within itself via "fragB", "fragC", "fragO", "fragP".', + locations: [ + { line: 2, column: 31 }, + { line: 3, column: 31 }, + { line: 4, column: 31 }, + { line: 8, column: 31 }, + { line: 9, column: 31 }, + ], + }, + { + message: + 'Cannot spread fragment "fragO" within itself via "fragP", "fragX", "fragY", "fragZ".', + locations: [ + { line: 8, column: 31 }, + { line: 9, column: 41 }, + { line: 5, column: 31 }, + { line: 6, column: 31 }, + { line: 7, column: 31 }, + ], + }, + ]); + }); + + it('no spreading itself deeply two paths', () => { + expectErrors(` + fragment fragA on Dog { ...fragB, ...fragC } + fragment fragB on Dog { ...fragA } + fragment fragC on Dog { ...fragA } + `).toDeepEqual([ + { + message: 'Cannot spread fragment "fragA" within itself via "fragB".', + locations: [ + { line: 2, column: 31 }, + { line: 3, column: 31 }, + ], + }, + { + message: 'Cannot spread fragment "fragA" within itself via "fragC".', + locations: [ + { line: 2, column: 41 }, + { line: 4, column: 31 }, + ], + }, + ]); + }); + + it('no spreading itself deeply two paths -- alt traverse order', () => { + expectErrors(` + fragment fragA on Dog { ...fragC } + fragment fragB on Dog { ...fragC } + fragment fragC on Dog { ...fragA, ...fragB } + `).toDeepEqual([ + { + message: 'Cannot spread fragment "fragA" within itself via "fragC".', + locations: [ + { line: 2, column: 31 }, + { line: 4, column: 31 }, + ], + }, + { + message: 'Cannot spread fragment "fragC" within itself via "fragB".', + locations: [ + { line: 4, column: 41 }, + { line: 3, column: 31 }, + ], + }, + ]); + }); + + it('no spreading itself deeply and immediately', () => { + expectErrors(` + fragment fragA on Dog { ...fragB } + fragment fragB on Dog { ...fragB, ...fragC } + fragment fragC on Dog { ...fragA, ...fragB } + `).toDeepEqual([ + { + message: 'Cannot spread fragment "fragB" within itself.', + locations: [{ line: 3, column: 31 }], + }, + { + message: + 'Cannot spread fragment "fragA" within itself via "fragB", "fragC".', + locations: [ + { line: 2, column: 31 }, + { line: 3, column: 41 }, + { line: 4, column: 31 }, + ], + }, + { + message: 'Cannot spread fragment "fragB" within itself via "fragC".', + locations: [ + { line: 3, column: 41 }, + { line: 4, column: 41 }, + ], + }, + ]); + }); +}); diff --git a/src/validation/__tests__/NoSchemaIntrospectionCustomRule-test.ts b/src/validation/__tests__/NoSchemaIntrospectionCustomRule-test.ts new file mode 100644 index 00000000..cd681a7e --- /dev/null +++ b/src/validation/__tests__/NoSchemaIntrospectionCustomRule-test.ts @@ -0,0 +1,140 @@ +import { describe, it } from 'mocha'; + +import { buildSchema } from '../../utilities/buildASTSchema'; + +import { NoSchemaIntrospectionCustomRule } from '../rules/custom/NoSchemaIntrospectionCustomRule'; + +import { expectValidationErrorsWithSchema } from './harness'; + +function expectErrors(queryStr: string) { + return expectValidationErrorsWithSchema( + schema, + NoSchemaIntrospectionCustomRule, + queryStr, + ); +} + +function expectValid(queryStr: string) { + expectErrors(queryStr).toDeepEqual([]); +} + +const schema = buildSchema(` + type Query { + someQuery: SomeType + } + + type SomeType { + someField: String + introspectionField: __EnumValue + } +`); + +describe('Validate: Prohibit introspection queries', () => { + it('ignores valid fields including __typename', () => { + expectValid(` + { + someQuery { + __typename + someField + } + } + `); + }); + + it('ignores fields not in the schema', () => { + expectValid(` + { + __introspect + } + `); + }); + + it('reports error when a field with an introspection type is requested', () => { + expectErrors(` + { + __schema { + queryType { + name + } + } + } + `).toDeepEqual([ + { + message: + 'GraphQL introspection has been disabled, but the requested query contained the field "__schema".', + locations: [{ line: 3, column: 9 }], + }, + { + message: + 'GraphQL introspection has been disabled, but the requested query contained the field "queryType".', + locations: [{ line: 4, column: 11 }], + }, + ]); + }); + + it('reports error when a field with an introspection type is requested and aliased', () => { + expectErrors(` + { + s: __schema { + queryType { + name + } + } + } + `).toDeepEqual([ + { + message: + 'GraphQL introspection has been disabled, but the requested query contained the field "__schema".', + locations: [{ line: 3, column: 9 }], + }, + { + message: + 'GraphQL introspection has been disabled, but the requested query contained the field "queryType".', + locations: [{ line: 4, column: 11 }], + }, + ]); + }); + + it('reports error when using a fragment with a field with an introspection type', () => { + expectErrors(` + { + ...QueryFragment + } + + fragment QueryFragment on Query { + __schema { + queryType { + name + } + } + } + `).toDeepEqual([ + { + message: + 'GraphQL introspection has been disabled, but the requested query contained the field "__schema".', + locations: [{ line: 7, column: 9 }], + }, + { + message: + 'GraphQL introspection has been disabled, but the requested query contained the field "queryType".', + locations: [{ line: 8, column: 11 }], + }, + ]); + }); + + it('reports error for non-standard introspection fields', () => { + expectErrors(` + { + someQuery { + introspectionField + } + } + `).toDeepEqual([ + { + message: + 'GraphQL introspection has been disabled, but the requested query contained the field "introspectionField".', + locations: [{ line: 4, column: 11 }], + }, + ]); + }); +}); diff --git a/src/validation/__tests__/NoUndefinedVariablesRule-test.ts b/src/validation/__tests__/NoUndefinedVariablesRule-test.ts new file mode 100644 index 00000000..e027d4a4 --- /dev/null +++ b/src/validation/__tests__/NoUndefinedVariablesRule-test.ts @@ -0,0 +1,407 @@ +import { describe, it } from 'mocha'; + +import { NoUndefinedVariablesRule } from '../rules/NoUndefinedVariablesRule'; + +import { expectValidationErrors } from './harness'; + +function expectErrors(queryStr: string) { + return expectValidationErrors(NoUndefinedVariablesRule, queryStr); +} + +function expectValid(queryStr: string) { + expectErrors(queryStr).toDeepEqual([]); +} + +describe('Validate: No undefined variables', () => { + it('all variables defined', () => { + expectValid(` + query Foo($a: String, $b: String, $c: String) { + field(a: $a, b: $b, c: $c) + } + `); + }); + + it('all variables deeply defined', () => { + expectValid(` + query Foo($a: String, $b: String, $c: String) { + field(a: $a) { + field(b: $b) { + field(c: $c) + } + } + } + `); + }); + + it('all variables deeply in inline fragments defined', () => { + expectValid(` + query Foo($a: String, $b: String, $c: String) { + ... on Type { + field(a: $a) { + field(b: $b) { + ... on Type { + field(c: $c) + } + } + } + } + } + `); + }); + + it('all variables in fragments deeply defined', () => { + expectValid(` + query Foo($a: String, $b: String, $c: String) { + ...FragA + } + fragment FragA on Type { + field(a: $a) { + ...FragB + } + } + fragment FragB on Type { + field(b: $b) { + ...FragC + } + } + fragment FragC on Type { + field(c: $c) + } + `); + }); + + it('variable within single fragment defined in multiple operations', () => { + expectValid(` + query Foo($a: String) { + ...FragA + } + query Bar($a: String) { + ...FragA + } + fragment FragA on Type { + field(a: $a) + } + `); + }); + + it('variable within fragments defined in operations', () => { + expectValid(` + query Foo($a: String) { + ...FragA + } + query Bar($b: String) { + ...FragB + } + fragment FragA on Type { + field(a: $a) + } + fragment FragB on Type { + field(b: $b) + } + `); + }); + + it('variable within recursive fragment defined', () => { + expectValid(` + query Foo($a: String) { + ...FragA + } + fragment FragA on Type { + field(a: $a) { + ...FragA + } + } + `); + }); + + it('variable not defined', () => { + expectErrors(` + query Foo($a: String, $b: String, $c: String) { + field(a: $a, b: $b, c: $c, d: $d) + } + `).toDeepEqual([ + { + message: 'Variable "$d" is not defined by operation "Foo".', + locations: [ + { line: 3, column: 39 }, + { line: 2, column: 7 }, + ], + }, + ]); + }); + + it('variable not defined by un-named query', () => { + expectErrors(` + { + field(a: $a) + } + `).toDeepEqual([ + { + message: 'Variable "$a" is not defined.', + locations: [ + { line: 3, column: 18 }, + { line: 2, column: 7 }, + ], + }, + ]); + }); + + it('multiple variables not defined', () => { + expectErrors(` + query Foo($b: String) { + field(a: $a, b: $b, c: $c) + } + `).toDeepEqual([ + { + message: 'Variable "$a" is not defined by operation "Foo".', + locations: [ + { line: 3, column: 18 }, + { line: 2, column: 7 }, + ], + }, + { + message: 'Variable "$c" is not defined by operation "Foo".', + locations: [ + { line: 3, column: 32 }, + { line: 2, column: 7 }, + ], + }, + ]); + }); + + it('variable in fragment not defined by un-named query', () => { + expectErrors(` + { + ...FragA + } + fragment FragA on Type { + field(a: $a) + } + `).toDeepEqual([ + { + message: 'Variable "$a" is not defined.', + locations: [ + { line: 6, column: 18 }, + { line: 2, column: 7 }, + ], + }, + ]); + }); + + it('variable in fragment not defined by operation', () => { + expectErrors(` + query Foo($a: String, $b: String) { + ...FragA + } + fragment FragA on Type { + field(a: $a) { + ...FragB + } + } + fragment FragB on Type { + field(b: $b) { + ...FragC + } + } + fragment FragC on Type { + field(c: $c) + } + `).toDeepEqual([ + { + message: 'Variable "$c" is not defined by operation "Foo".', + locations: [ + { line: 16, column: 18 }, + { line: 2, column: 7 }, + ], + }, + ]); + }); + + it('multiple variables in fragments not defined', () => { + expectErrors(` + query Foo($b: String) { + ...FragA + } + fragment FragA on Type { + field(a: $a) { + ...FragB + } + } + fragment FragB on Type { + field(b: $b) { + ...FragC + } + } + fragment FragC on Type { + field(c: $c) + } + `).toDeepEqual([ + { + message: 'Variable "$a" is not defined by operation "Foo".', + locations: [ + { line: 6, column: 18 }, + { line: 2, column: 7 }, + ], + }, + { + message: 'Variable "$c" is not defined by operation "Foo".', + locations: [ + { line: 16, column: 18 }, + { line: 2, column: 7 }, + ], + }, + ]); + }); + + it('single variable in fragment not defined by multiple operations', () => { + expectErrors(` + query Foo($a: String) { + ...FragAB + } + query Bar($a: String) { + ...FragAB + } + fragment FragAB on Type { + field(a: $a, b: $b) + } + `).toDeepEqual([ + { + message: 'Variable "$b" is not defined by operation "Foo".', + locations: [ + { line: 9, column: 25 }, + { line: 2, column: 7 }, + ], + }, + { + message: 'Variable "$b" is not defined by operation "Bar".', + locations: [ + { line: 9, column: 25 }, + { line: 5, column: 7 }, + ], + }, + ]); + }); + + it('variables in fragment not defined by multiple operations', () => { + expectErrors(` + query Foo($b: String) { + ...FragAB + } + query Bar($a: String) { + ...FragAB + } + fragment FragAB on Type { + field(a: $a, b: $b) + } + `).toDeepEqual([ + { + message: 'Variable "$a" is not defined by operation "Foo".', + locations: [ + { line: 9, column: 18 }, + { line: 2, column: 7 }, + ], + }, + { + message: 'Variable "$b" is not defined by operation "Bar".', + locations: [ + { line: 9, column: 25 }, + { line: 5, column: 7 }, + ], + }, + ]); + }); + + it('variable in fragment used by other operation', () => { + expectErrors(` + query Foo($b: String) { + ...FragA + } + query Bar($a: String) { + ...FragB + } + fragment FragA on Type { + field(a: $a) + } + fragment FragB on Type { + field(b: $b) + } + `).toDeepEqual([ + { + message: 'Variable "$a" is not defined by operation "Foo".', + locations: [ + { line: 9, column: 18 }, + { line: 2, column: 7 }, + ], + }, + { + message: 'Variable "$b" is not defined by operation "Bar".', + locations: [ + { line: 12, column: 18 }, + { line: 5, column: 7 }, + ], + }, + ]); + }); + + it('multiple undefined variables produce multiple errors', () => { + expectErrors(` + query Foo($b: String) { + ...FragAB + } + query Bar($a: String) { + ...FragAB + } + fragment FragAB on Type { + field1(a: $a, b: $b) + ...FragC + field3(a: $a, b: $b) + } + fragment FragC on Type { + field2(c: $c) + } + `).toDeepEqual([ + { + message: 'Variable "$a" is not defined by operation "Foo".', + locations: [ + { line: 9, column: 19 }, + { line: 2, column: 7 }, + ], + }, + { + message: 'Variable "$a" is not defined by operation "Foo".', + locations: [ + { line: 11, column: 19 }, + { line: 2, column: 7 }, + ], + }, + { + message: 'Variable "$c" is not defined by operation "Foo".', + locations: [ + { line: 14, column: 19 }, + { line: 2, column: 7 }, + ], + }, + { + message: 'Variable "$b" is not defined by operation "Bar".', + locations: [ + { line: 9, column: 26 }, + { line: 5, column: 7 }, + ], + }, + { + message: 'Variable "$b" is not defined by operation "Bar".', + locations: [ + { line: 11, column: 26 }, + { line: 5, column: 7 }, + ], + }, + { + message: 'Variable "$c" is not defined by operation "Bar".', + locations: [ + { line: 14, column: 19 }, + { line: 5, column: 7 }, + ], + }, + ]); + }); +}); diff --git a/src/validation/__tests__/NoUnusedFragmentsRule-test.ts b/src/validation/__tests__/NoUnusedFragmentsRule-test.ts new file mode 100644 index 00000000..abeee19e --- /dev/null +++ b/src/validation/__tests__/NoUnusedFragmentsRule-test.ts @@ -0,0 +1,163 @@ +import { describe, it } from 'mocha'; + +import { NoUnusedFragmentsRule } from '../rules/NoUnusedFragmentsRule'; + +import { expectValidationErrors } from './harness'; + +function expectErrors(queryStr: string) { + return expectValidationErrors(NoUnusedFragmentsRule, queryStr); +} + +function expectValid(queryStr: string) { + expectErrors(queryStr).toDeepEqual([]); +} + +describe('Validate: No unused fragments', () => { + it('all fragment names are used', () => { + expectValid(` + { + human(id: 4) { + ...HumanFields1 + ... on Human { + ...HumanFields2 + } + } + } + fragment HumanFields1 on Human { + name + ...HumanFields3 + } + fragment HumanFields2 on Human { + name + } + fragment HumanFields3 on Human { + name + } + `); + }); + + it('all fragment names are used by multiple operations', () => { + expectValid(` + query Foo { + human(id: 4) { + ...HumanFields1 + } + } + query Bar { + human(id: 4) { + ...HumanFields2 + } + } + fragment HumanFields1 on Human { + name + ...HumanFields3 + } + fragment HumanFields2 on Human { + name + } + fragment HumanFields3 on Human { + name + } + `); + }); + + it('contains unknown fragments', () => { + expectErrors(` + query Foo { + human(id: 4) { + ...HumanFields1 + } + } + query Bar { + human(id: 4) { + ...HumanFields2 + } + } + fragment HumanFields1 on Human { + name + ...HumanFields3 + } + fragment HumanFields2 on Human { + name + } + fragment HumanFields3 on Human { + name + } + fragment Unused1 on Human { + name + } + fragment Unused2 on Human { + name + } + `).toDeepEqual([ + { + message: 'Fragment "Unused1" is never used.', + locations: [{ line: 22, column: 7 }], + }, + { + message: 'Fragment "Unused2" is never used.', + locations: [{ line: 25, column: 7 }], + }, + ]); + }); + + it('contains unknown fragments with ref cycle', () => { + expectErrors(` + query Foo { + human(id: 4) { + ...HumanFields1 + } + } + query Bar { + human(id: 4) { + ...HumanFields2 + } + } + fragment HumanFields1 on Human { + name + ...HumanFields3 + } + fragment HumanFields2 on Human { + name + } + fragment HumanFields3 on Human { + name + } + fragment Unused1 on Human { + name + ...Unused2 + } + fragment Unused2 on Human { + name + ...Unused1 + } + `).toDeepEqual([ + { + message: 'Fragment "Unused1" is never used.', + locations: [{ line: 22, column: 7 }], + }, + { + message: 'Fragment "Unused2" is never used.', + locations: [{ line: 26, column: 7 }], + }, + ]); + }); + + it('contains unknown and undef fragments', () => { + expectErrors(` + query Foo { + human(id: 4) { + ...bar + } + } + fragment foo on Human { + name + } + `).toDeepEqual([ + { + message: 'Fragment "foo" is never used.', + locations: [{ line: 7, column: 7 }], + }, + ]); + }); +}); diff --git a/src/validation/__tests__/NoUnusedVariablesRule-test.ts b/src/validation/__tests__/NoUnusedVariablesRule-test.ts new file mode 100644 index 00000000..6be63cd2 --- /dev/null +++ b/src/validation/__tests__/NoUnusedVariablesRule-test.ts @@ -0,0 +1,233 @@ +import { describe, it } from 'mocha'; + +import { NoUnusedVariablesRule } from '../rules/NoUnusedVariablesRule'; + +import { expectValidationErrors } from './harness'; + +function expectErrors(queryStr: string) { + return expectValidationErrors(NoUnusedVariablesRule, queryStr); +} + +function expectValid(queryStr: string) { + expectErrors(queryStr).toDeepEqual([]); +} + +describe('Validate: No unused variables', () => { + it('uses all variables', () => { + expectValid(` + query ($a: String, $b: String, $c: String) { + field(a: $a, b: $b, c: $c) + } + `); + }); + + it('uses all variables deeply', () => { + expectValid(` + query Foo($a: String, $b: String, $c: String) { + field(a: $a) { + field(b: $b) { + field(c: $c) + } + } + } + `); + }); + + it('uses all variables deeply in inline fragments', () => { + expectValid(` + query Foo($a: String, $b: String, $c: String) { + ... on Type { + field(a: $a) { + field(b: $b) { + ... on Type { + field(c: $c) + } + } + } + } + } + `); + }); + + it('uses all variables in fragments', () => { + expectValid(` + query Foo($a: String, $b: String, $c: String) { + ...FragA + } + fragment FragA on Type { + field(a: $a) { + ...FragB + } + } + fragment FragB on Type { + field(b: $b) { + ...FragC + } + } + fragment FragC on Type { + field(c: $c) + } + `); + }); + + it('variable used by fragment in multiple operations', () => { + expectValid(` + query Foo($a: String) { + ...FragA + } + query Bar($b: String) { + ...FragB + } + fragment FragA on Type { + field(a: $a) + } + fragment FragB on Type { + field(b: $b) + } + `); + }); + + it('variable used by recursive fragment', () => { + expectValid(` + query Foo($a: String) { + ...FragA + } + fragment FragA on Type { + field(a: $a) { + ...FragA + } + } + `); + }); + + it('variable not used', () => { + expectErrors(` + query ($a: String, $b: String, $c: String) { + field(a: $a, b: $b) + } + `).toDeepEqual([ + { + message: 'Variable "$c" is never used.', + locations: [{ line: 2, column: 38 }], + }, + ]); + }); + + it('multiple variables not used', () => { + expectErrors(` + query Foo($a: String, $b: String, $c: String) { + field(b: $b) + } + `).toDeepEqual([ + { + message: 'Variable "$a" is never used in operation "Foo".', + locations: [{ line: 2, column: 17 }], + }, + { + message: 'Variable "$c" is never used in operation "Foo".', + locations: [{ line: 2, column: 41 }], + }, + ]); + }); + + it('variable not used in fragments', () => { + expectErrors(` + query Foo($a: String, $b: String, $c: String) { + ...FragA + } + fragment FragA on Type { + field(a: $a) { + ...FragB + } + } + fragment FragB on Type { + field(b: $b) { + ...FragC + } + } + fragment FragC on Type { + field + } + `).toDeepEqual([ + { + message: 'Variable "$c" is never used in operation "Foo".', + locations: [{ line: 2, column: 41 }], + }, + ]); + }); + + it('multiple variables not used in fragments', () => { + expectErrors(` + query Foo($a: String, $b: String, $c: String) { + ...FragA + } + fragment FragA on Type { + field { + ...FragB + } + } + fragment FragB on Type { + field(b: $b) { + ...FragC + } + } + fragment FragC on Type { + field + } + `).toDeepEqual([ + { + message: 'Variable "$a" is never used in operation "Foo".', + locations: [{ line: 2, column: 17 }], + }, + { + message: 'Variable "$c" is never used in operation "Foo".', + locations: [{ line: 2, column: 41 }], + }, + ]); + }); + + it('variable not used by unreferenced fragment', () => { + expectErrors(` + query Foo($b: String) { + ...FragA + } + fragment FragA on Type { + field(a: $a) + } + fragment FragB on Type { + field(b: $b) + } + `).toDeepEqual([ + { + message: 'Variable "$b" is never used in operation "Foo".', + locations: [{ line: 2, column: 17 }], + }, + ]); + }); + + it('variable not used by fragment used by other operation', () => { + expectErrors(` + query Foo($b: String) { + ...FragA + } + query Bar($a: String) { + ...FragB + } + fragment FragA on Type { + field(a: $a) + } + fragment FragB on Type { + field(b: $b) + } + `).toDeepEqual([ + { + message: 'Variable "$b" is never used in operation "Foo".', + locations: [{ line: 2, column: 17 }], + }, + { + message: 'Variable "$a" is never used in operation "Bar".', + locations: [{ line: 5, column: 17 }], + }, + ]); + }); +}); diff --git a/src/validation/__tests__/OverlappingFieldsCanBeMergedRule-test.ts b/src/validation/__tests__/OverlappingFieldsCanBeMergedRule-test.ts new file mode 100644 index 00000000..9d864902 --- /dev/null +++ b/src/validation/__tests__/OverlappingFieldsCanBeMergedRule-test.ts @@ -0,0 +1,1096 @@ +import { describe, it } from 'mocha'; + +import type { GraphQLSchema } from '../../type/schema'; + +import { buildSchema } from '../../utilities/buildASTSchema'; + +import { OverlappingFieldsCanBeMergedRule } from '../rules/OverlappingFieldsCanBeMergedRule'; + +import { + expectValidationErrors, + expectValidationErrorsWithSchema, +} from './harness'; + +function expectErrors(queryStr: string) { + return expectValidationErrors(OverlappingFieldsCanBeMergedRule, queryStr); +} + +function expectValid(queryStr: string) { + expectErrors(queryStr).toDeepEqual([]); +} + +function expectErrorsWithSchema(schema: GraphQLSchema, queryStr: string) { + return expectValidationErrorsWithSchema( + schema, + OverlappingFieldsCanBeMergedRule, + queryStr, + ); +} + +function expectValidWithSchema(schema: GraphQLSchema, queryStr: string) { + expectErrorsWithSchema(schema, queryStr).toDeepEqual([]); +} + +describe('Validate: Overlapping fields can be merged', () => { + it('unique fields', () => { + expectValid(` + fragment uniqueFields on Dog { + name + nickname + } + `); + }); + + it('identical fields', () => { + expectValid(` + fragment mergeIdenticalFields on Dog { + name + name + } + `); + }); + + it('identical fields with identical args', () => { + expectValid(` + fragment mergeIdenticalFieldsWithIdenticalArgs on Dog { + doesKnowCommand(dogCommand: SIT) + doesKnowCommand(dogCommand: SIT) + } + `); + }); + + it('identical fields with identical directives', () => { + expectValid(` + fragment mergeSameFieldsWithSameDirectives on Dog { + name @include(if: true) + name @include(if: true) + } + `); + }); + + it('different args with different aliases', () => { + expectValid(` + fragment differentArgsWithDifferentAliases on Dog { + knowsSit: doesKnowCommand(dogCommand: SIT) + knowsDown: doesKnowCommand(dogCommand: DOWN) + } + `); + }); + + it('different directives with different aliases', () => { + expectValid(` + fragment differentDirectivesWithDifferentAliases on Dog { + nameIfTrue: name @include(if: true) + nameIfFalse: name @include(if: false) + } + `); + }); + + it('different skip/include directives accepted', () => { + // Note: Differing skip/include directives don't create an ambiguous return + // value and are acceptable in conditions where differing runtime values + // may have the same desired effect of including or skipping a field. + expectValid(` + fragment differentDirectivesWithDifferentAliases on Dog { + name @include(if: true) + name @include(if: false) + } + `); + }); + + it('Same aliases with different field targets', () => { + expectErrors(` + fragment sameAliasesWithDifferentFieldTargets on Dog { + fido: name + fido: nickname + } + `).toDeepEqual([ + { + message: + 'Fields "fido" conflict because "name" and "nickname" are different fields. Use different aliases on the fields to fetch both if this was intentional.', + locations: [ + { line: 3, column: 9 }, + { line: 4, column: 9 }, + ], + }, + ]); + }); + + it('Same aliases allowed on non-overlapping fields', () => { + // This is valid since no object can be both a "Dog" and a "Cat", thus + // these fields can never overlap. + expectValid(` + fragment sameAliasesWithDifferentFieldTargets on Pet { + ... on Dog { + name + } + ... on Cat { + name: nickname + } + } + `); + }); + + it('Alias masking direct field access', () => { + expectErrors(` + fragment aliasMaskingDirectFieldAccess on Dog { + name: nickname + name + } + `).toDeepEqual([ + { + message: + 'Fields "name" conflict because "nickname" and "name" are different fields. Use different aliases on the fields to fetch both if this was intentional.', + locations: [ + { line: 3, column: 9 }, + { line: 4, column: 9 }, + ], + }, + ]); + }); + + it('different args, second adds an argument', () => { + expectErrors(` + fragment conflictingArgs on Dog { + doesKnowCommand + doesKnowCommand(dogCommand: HEEL) + } + `).toDeepEqual([ + { + message: + 'Fields "doesKnowCommand" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.', + locations: [ + { line: 3, column: 9 }, + { line: 4, column: 9 }, + ], + }, + ]); + }); + + it('different args, second missing an argument', () => { + expectErrors(` + fragment conflictingArgs on Dog { + doesKnowCommand(dogCommand: SIT) + doesKnowCommand + } + `).toDeepEqual([ + { + message: + 'Fields "doesKnowCommand" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.', + locations: [ + { line: 3, column: 9 }, + { line: 4, column: 9 }, + ], + }, + ]); + }); + + it('conflicting arg values', () => { + expectErrors(` + fragment conflictingArgs on Dog { + doesKnowCommand(dogCommand: SIT) + doesKnowCommand(dogCommand: HEEL) + } + `).toDeepEqual([ + { + message: + 'Fields "doesKnowCommand" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.', + locations: [ + { line: 3, column: 9 }, + { line: 4, column: 9 }, + ], + }, + ]); + }); + + it('conflicting arg names', () => { + expectErrors(` + fragment conflictingArgs on Dog { + isAtLocation(x: 0) + isAtLocation(y: 0) + } + `).toDeepEqual([ + { + message: + 'Fields "isAtLocation" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.', + locations: [ + { line: 3, column: 9 }, + { line: 4, column: 9 }, + ], + }, + ]); + }); + + it('allows different args where no conflict is possible', () => { + // This is valid since no object can be both a "Dog" and a "Cat", thus + // these fields can never overlap. + expectValid(` + fragment conflictingArgs on Pet { + ... on Dog { + name(surname: true) + } + ... on Cat { + name + } + } + `); + }); + + it('encounters conflict in fragments', () => { + expectErrors(` + { + ...A + ...B + } + fragment A on Type { + x: a + } + fragment B on Type { + x: b + } + `).toDeepEqual([ + { + message: + 'Fields "x" conflict because "a" and "b" are different fields. Use different aliases on the fields to fetch both if this was intentional.', + locations: [ + { line: 7, column: 9 }, + { line: 10, column: 9 }, + ], + }, + ]); + }); + + it('reports each conflict once', () => { + expectErrors(` + { + f1 { + ...A + ...B + } + f2 { + ...B + ...A + } + f3 { + ...A + ...B + x: c + } + } + fragment A on Type { + x: a + } + fragment B on Type { + x: b + } + `).toDeepEqual([ + { + message: + 'Fields "x" conflict because "a" and "b" are different fields. Use different aliases on the fields to fetch both if this was intentional.', + locations: [ + { line: 18, column: 9 }, + { line: 21, column: 9 }, + ], + }, + { + message: + 'Fields "x" conflict because "c" and "a" are different fields. Use different aliases on the fields to fetch both if this was intentional.', + locations: [ + { line: 14, column: 11 }, + { line: 18, column: 9 }, + ], + }, + { + message: + 'Fields "x" conflict because "c" and "b" are different fields. Use different aliases on the fields to fetch both if this was intentional.', + locations: [ + { line: 14, column: 11 }, + { line: 21, column: 9 }, + ], + }, + ]); + }); + + it('deep conflict', () => { + expectErrors(` + { + field { + x: a + }, + field { + x: b + } + } + `).toDeepEqual([ + { + message: + 'Fields "field" conflict because subfields "x" conflict because "a" and "b" are different fields. Use different aliases on the fields to fetch both if this was intentional.', + locations: [ + { line: 3, column: 9 }, + { line: 4, column: 11 }, + { line: 6, column: 9 }, + { line: 7, column: 11 }, + ], + }, + ]); + }); + + it('deep conflict with multiple issues', () => { + expectErrors(` + { + field { + x: a + y: c + }, + field { + x: b + y: d + } + } + `).toDeepEqual([ + { + message: + 'Fields "field" conflict because subfields "x" conflict because "a" and "b" are different fields and subfields "y" conflict because "c" and "d" are different fields. Use different aliases on the fields to fetch both if this was intentional.', + locations: [ + { line: 3, column: 9 }, + { line: 4, column: 11 }, + { line: 5, column: 11 }, + { line: 7, column: 9 }, + { line: 8, column: 11 }, + { line: 9, column: 11 }, + ], + }, + ]); + }); + + it('very deep conflict', () => { + expectErrors(` + { + field { + deepField { + x: a + } + }, + field { + deepField { + x: b + } + } + } + `).toDeepEqual([ + { + message: + 'Fields "field" conflict because subfields "deepField" conflict because subfields "x" conflict because "a" and "b" are different fields. Use different aliases on the fields to fetch both if this was intentional.', + locations: [ + { line: 3, column: 9 }, + { line: 4, column: 11 }, + { line: 5, column: 13 }, + { line: 8, column: 9 }, + { line: 9, column: 11 }, + { line: 10, column: 13 }, + ], + }, + ]); + }); + + it('reports deep conflict to nearest common ancestor', () => { + expectErrors(` + { + field { + deepField { + x: a + } + deepField { + x: b + } + }, + field { + deepField { + y + } + } + } + `).toDeepEqual([ + { + message: + 'Fields "deepField" conflict because subfields "x" conflict because "a" and "b" are different fields. Use different aliases on the fields to fetch both if this was intentional.', + locations: [ + { line: 4, column: 11 }, + { line: 5, column: 13 }, + { line: 7, column: 11 }, + { line: 8, column: 13 }, + ], + }, + ]); + }); + + it('reports deep conflict to nearest common ancestor in fragments', () => { + expectErrors(` + { + field { + ...F + } + field { + ...F + } + } + fragment F on T { + deepField { + deeperField { + x: a + } + deeperField { + x: b + } + }, + deepField { + deeperField { + y + } + } + } + `).toDeepEqual([ + { + message: + 'Fields "deeperField" conflict because subfields "x" conflict because "a" and "b" are different fields. Use different aliases on the fields to fetch both if this was intentional.', + locations: [ + { line: 12, column: 11 }, + { line: 13, column: 13 }, + { line: 15, column: 11 }, + { line: 16, column: 13 }, + ], + }, + ]); + }); + + it('reports deep conflict in nested fragments', () => { + expectErrors(` + { + field { + ...F + } + field { + ...I + } + } + fragment F on T { + x: a + ...G + } + fragment G on T { + y: c + } + fragment I on T { + y: d + ...J + } + fragment J on T { + x: b + } + `).toDeepEqual([ + { + message: + 'Fields "field" conflict because subfields "x" conflict because "a" and "b" are different fields and subfields "y" conflict because "c" and "d" are different fields. Use different aliases on the fields to fetch both if this was intentional.', + locations: [ + { line: 3, column: 9 }, + { line: 11, column: 9 }, + { line: 15, column: 9 }, + { line: 6, column: 9 }, + { line: 22, column: 9 }, + { line: 18, column: 9 }, + ], + }, + ]); + }); + + it('ignores unknown fragments', () => { + expectValid(` + { + field + ...Unknown + ...Known + } + + fragment Known on T { + field + ...OtherUnknown + } + `); + }); + + describe('return types must be unambiguous', () => { + const schema = buildSchema(` + interface SomeBox { + deepBox: SomeBox + unrelatedField: String + } + + type StringBox implements SomeBox { + scalar: String + deepBox: StringBox + unrelatedField: String + listStringBox: [StringBox] + stringBox: StringBox + intBox: IntBox + } + + type IntBox implements SomeBox { + scalar: Int + deepBox: IntBox + unrelatedField: String + listStringBox: [StringBox] + stringBox: StringBox + intBox: IntBox + } + + interface NonNullStringBox1 { + scalar: String! + } + + type NonNullStringBox1Impl implements SomeBox & NonNullStringBox1 { + scalar: String! + unrelatedField: String + deepBox: SomeBox + } + + interface NonNullStringBox2 { + scalar: String! + } + + type NonNullStringBox2Impl implements SomeBox & NonNullStringBox2 { + scalar: String! + unrelatedField: String + deepBox: SomeBox + } + + type Connection { + edges: [Edge] + } + + type Edge { + node: Node + } + + type Node { + id: ID + name: String + } + + type Query { + someBox: SomeBox + connection: Connection + } + `); + + it('conflicting return types which potentially overlap', () => { + // This is invalid since an object could potentially be both the Object + // type IntBox and the interface type NonNullStringBox1. While that + // condition does not exist in the current schema, the schema could + // expand in the future to allow this. Thus it is invalid. + expectErrorsWithSchema( + schema, + ` + { + someBox { + ...on IntBox { + scalar + } + ...on NonNullStringBox1 { + scalar + } + } + } + `, + ).toDeepEqual([ + { + message: + 'Fields "scalar" conflict because they return conflicting types "Int" and "String!". Use different aliases on the fields to fetch both if this was intentional.', + locations: [ + { line: 5, column: 17 }, + { line: 8, column: 17 }, + ], + }, + ]); + }); + + it('compatible return shapes on different return types', () => { + // In this case `deepBox` returns `SomeBox` in the first usage, and + // `StringBox` in the second usage. These return types are not the same! + // however this is valid because the return *shapes* are compatible. + expectValidWithSchema( + schema, + ` + { + someBox { + ... on SomeBox { + deepBox { + unrelatedField + } + } + ... on StringBox { + deepBox { + unrelatedField + } + } + } + } + `, + ); + }); + + it('disallows differing return types despite no overlap', () => { + expectErrorsWithSchema( + schema, + ` + { + someBox { + ... on IntBox { + scalar + } + ... on StringBox { + scalar + } + } + } + `, + ).toDeepEqual([ + { + message: + 'Fields "scalar" conflict because they return conflicting types "Int" and "String". Use different aliases on the fields to fetch both if this was intentional.', + locations: [ + { line: 5, column: 17 }, + { line: 8, column: 17 }, + ], + }, + ]); + }); + + it('reports correctly when a non-exclusive follows an exclusive', () => { + expectErrorsWithSchema( + schema, + ` + { + someBox { + ... on IntBox { + deepBox { + ...X + } + } + } + someBox { + ... on StringBox { + deepBox { + ...Y + } + } + } + memoed: someBox { + ... on IntBox { + deepBox { + ...X + } + } + } + memoed: someBox { + ... on StringBox { + deepBox { + ...Y + } + } + } + other: someBox { + ...X + } + other: someBox { + ...Y + } + } + fragment X on SomeBox { + scalar + } + fragment Y on SomeBox { + scalar: unrelatedField + } + `, + ).toDeepEqual([ + { + message: + 'Fields "other" conflict because subfields "scalar" conflict because "scalar" and "unrelatedField" are different fields. Use different aliases on the fields to fetch both if this was intentional.', + locations: [ + { line: 31, column: 13 }, + { line: 39, column: 13 }, + { line: 34, column: 13 }, + { line: 42, column: 13 }, + ], + }, + ]); + }); + + it('disallows differing return type nullability despite no overlap', () => { + expectErrorsWithSchema( + schema, + ` + { + someBox { + ... on NonNullStringBox1 { + scalar + } + ... on StringBox { + scalar + } + } + } + `, + ).toDeepEqual([ + { + message: + 'Fields "scalar" conflict because they return conflicting types "String!" and "String". Use different aliases on the fields to fetch both if this was intentional.', + locations: [ + { line: 5, column: 17 }, + { line: 8, column: 17 }, + ], + }, + ]); + }); + + it('disallows differing return type list despite no overlap', () => { + expectErrorsWithSchema( + schema, + ` + { + someBox { + ... on IntBox { + box: listStringBox { + scalar + } + } + ... on StringBox { + box: stringBox { + scalar + } + } + } + } + `, + ).toDeepEqual([ + { + message: + 'Fields "box" conflict because they return conflicting types "[StringBox]" and "StringBox". Use different aliases on the fields to fetch both if this was intentional.', + locations: [ + { line: 5, column: 17 }, + { line: 10, column: 17 }, + ], + }, + ]); + + expectErrorsWithSchema( + schema, + ` + { + someBox { + ... on IntBox { + box: stringBox { + scalar + } + } + ... on StringBox { + box: listStringBox { + scalar + } + } + } + } + `, + ).toDeepEqual([ + { + message: + 'Fields "box" conflict because they return conflicting types "StringBox" and "[StringBox]". Use different aliases on the fields to fetch both if this was intentional.', + locations: [ + { line: 5, column: 17 }, + { line: 10, column: 17 }, + ], + }, + ]); + }); + + it('disallows differing subfields', () => { + expectErrorsWithSchema( + schema, + ` + { + someBox { + ... on IntBox { + box: stringBox { + val: scalar + val: unrelatedField + } + } + ... on StringBox { + box: stringBox { + val: scalar + } + } + } + } + `, + ).toDeepEqual([ + { + message: + 'Fields "val" conflict because "scalar" and "unrelatedField" are different fields. Use different aliases on the fields to fetch both if this was intentional.', + locations: [ + { line: 6, column: 19 }, + { line: 7, column: 19 }, + ], + }, + ]); + }); + + it('disallows differing deep return types despite no overlap', () => { + expectErrorsWithSchema( + schema, + ` + { + someBox { + ... on IntBox { + box: stringBox { + scalar + } + } + ... on StringBox { + box: intBox { + scalar + } + } + } + } + `, + ).toDeepEqual([ + { + message: + 'Fields "box" conflict because subfields "scalar" conflict because they return conflicting types "String" and "Int". Use different aliases on the fields to fetch both if this was intentional.', + locations: [ + { line: 5, column: 17 }, + { line: 6, column: 19 }, + { line: 10, column: 17 }, + { line: 11, column: 19 }, + ], + }, + ]); + }); + + it('allows non-conflicting overlapping types', () => { + expectValidWithSchema( + schema, + ` + { + someBox { + ... on IntBox { + scalar: unrelatedField + } + ... on StringBox { + scalar + } + } + } + `, + ); + }); + + it('same wrapped scalar return types', () => { + expectValidWithSchema( + schema, + ` + { + someBox { + ...on NonNullStringBox1 { + scalar + } + ...on NonNullStringBox2 { + scalar + } + } + } + `, + ); + }); + + it('allows inline fragments without type condition', () => { + expectValidWithSchema( + schema, + ` + { + a + ... { + a + } + } + `, + ); + }); + + it('compares deep types including list', () => { + expectErrorsWithSchema( + schema, + ` + { + connection { + ...edgeID + edges { + node { + id: name + } + } + } + } + + fragment edgeID on Connection { + edges { + node { + id + } + } + } + `, + ).toDeepEqual([ + { + message: + 'Fields "edges" conflict because subfields "node" conflict because subfields "id" conflict because "name" and "id" are different fields. Use different aliases on the fields to fetch both if this was intentional.', + locations: [ + { line: 5, column: 15 }, + { line: 6, column: 17 }, + { line: 7, column: 19 }, + { line: 14, column: 13 }, + { line: 15, column: 15 }, + { line: 16, column: 17 }, + ], + }, + ]); + }); + + it('ignores unknown types', () => { + expectValidWithSchema( + schema, + ` + { + someBox { + ...on UnknownType { + scalar + } + ...on NonNullStringBox2 { + scalar + } + } + } + `, + ); + }); + + it('works for field names that are JS keywords', () => { + const schemaWithKeywords = buildSchema(` + type Foo { + constructor: String + } + + type Query { + foo: Foo + } + `); + + expectValidWithSchema( + schemaWithKeywords, + ` + { + foo { + constructor + } + } + `, + ); + }); + }); + + it('does not infinite loop on recursive fragment', () => { + expectValid(` + { + ...fragA + } + + fragment fragA on Human { name, relatives { name, ...fragA } } + `); + }); + + it('does not infinite loop on immediately recursive fragment', () => { + expectValid(` + { + ...fragA + } + + fragment fragA on Human { name, ...fragA } + `); + }); + + it('does not infinite loop on recursive fragment with a field named after fragment', () => { + expectValid(` + { + ...fragA + fragA + } + + fragment fragA on Query { ...fragA } + `); + }); + + it('finds invalid cases even with field named after fragment', () => { + expectErrors(` + { + fragA + ...fragA + } + + fragment fragA on Type { + fragA: b + } + `).toDeepEqual([ + { + message: + 'Fields "fragA" conflict because "fragA" and "b" are different fields. Use different aliases on the fields to fetch both if this was intentional.', + locations: [ + { line: 3, column: 9 }, + { line: 8, column: 9 }, + ], + }, + ]); + }); + + it('does not infinite loop on transitively recursive fragment', () => { + expectValid(` + { + ...fragA + fragB + } + + fragment fragA on Human { name, ...fragB } + fragment fragB on Human { name, ...fragC } + fragment fragC on Human { name, ...fragA } + `); + }); + + it('finds invalid case even with immediately recursive fragment', () => { + expectErrors(` + fragment sameAliasesWithDifferentFieldTargets on Dog { + ...sameAliasesWithDifferentFieldTargets + fido: name + fido: nickname + } + `).toDeepEqual([ + { + message: + 'Fields "fido" conflict because "name" and "nickname" are different fields. Use different aliases on the fields to fetch both if this was intentional.', + locations: [ + { line: 4, column: 9 }, + { line: 5, column: 9 }, + ], + }, + ]); + }); +}); diff --git a/src/validation/__tests__/PossibleFragmentSpreadsRule-test.ts b/src/validation/__tests__/PossibleFragmentSpreadsRule-test.ts new file mode 100644 index 00000000..3e52f234 --- /dev/null +++ b/src/validation/__tests__/PossibleFragmentSpreadsRule-test.ts @@ -0,0 +1,303 @@ +import { describe, it } from 'mocha'; + +import { buildSchema } from '../../utilities/buildASTSchema'; + +import { PossibleFragmentSpreadsRule } from '../rules/PossibleFragmentSpreadsRule'; + +import { expectValidationErrorsWithSchema } from './harness'; + +function expectErrors(queryStr: string) { + return expectValidationErrorsWithSchema( + testSchema, + PossibleFragmentSpreadsRule, + queryStr, + ); +} + +function expectValid(queryStr: string) { + expectErrors(queryStr).toDeepEqual([]); +} + +const testSchema = buildSchema(` + interface Being { + name: String + } + + interface Pet implements Being { + name: String + } + + type Dog implements Being & Pet { + name: String + barkVolume: Int + } + + type Cat implements Being & Pet { + name: String + meowVolume: Int + } + + union CatOrDog = Cat | Dog + + interface Intelligent { + iq: Int + } + + type Human implements Being & Intelligent { + name: String + pets: [Pet] + iq: Int + } + + type Alien implements Being & Intelligent { + name: String + iq: Int + } + + union DogOrHuman = Dog | Human + + union HumanOrAlien = Human | Alien + + type Query { + catOrDog: CatOrDog + dogOrHuman: DogOrHuman + humanOrAlien: HumanOrAlien + } +`); + +describe('Validate: Possible fragment spreads', () => { + it('of the same object', () => { + expectValid(` + fragment objectWithinObject on Dog { ...dogFragment } + fragment dogFragment on Dog { barkVolume } + `); + }); + + it('of the same object with inline fragment', () => { + expectValid(` + fragment objectWithinObjectAnon on Dog { ... on Dog { barkVolume } } + `); + }); + + it('object into an implemented interface', () => { + expectValid(` + fragment objectWithinInterface on Pet { ...dogFragment } + fragment dogFragment on Dog { barkVolume } + `); + }); + + it('object into containing union', () => { + expectValid(` + fragment objectWithinUnion on CatOrDog { ...dogFragment } + fragment dogFragment on Dog { barkVolume } + `); + }); + + it('union into contained object', () => { + expectValid(` + fragment unionWithinObject on Dog { ...catOrDogFragment } + fragment catOrDogFragment on CatOrDog { __typename } + `); + }); + + it('union into overlapping interface', () => { + expectValid(` + fragment unionWithinInterface on Pet { ...catOrDogFragment } + fragment catOrDogFragment on CatOrDog { __typename } + `); + }); + + it('union into overlapping union', () => { + expectValid(` + fragment unionWithinUnion on DogOrHuman { ...catOrDogFragment } + fragment catOrDogFragment on CatOrDog { __typename } + `); + }); + + it('interface into implemented object', () => { + expectValid(` + fragment interfaceWithinObject on Dog { ...petFragment } + fragment petFragment on Pet { name } + `); + }); + + it('interface into overlapping interface', () => { + expectValid(` + fragment interfaceWithinInterface on Pet { ...beingFragment } + fragment beingFragment on Being { name } + `); + }); + + it('interface into overlapping interface in inline fragment', () => { + expectValid(` + fragment interfaceWithinInterface on Pet { ... on Being { name } } + `); + }); + + it('interface into overlapping union', () => { + expectValid(` + fragment interfaceWithinUnion on CatOrDog { ...petFragment } + fragment petFragment on Pet { name } + `); + }); + + it('ignores incorrect type (caught by FragmentsOnCompositeTypesRule)', () => { + expectValid(` + fragment petFragment on Pet { ...badInADifferentWay } + fragment badInADifferentWay on String { name } + `); + }); + + it('ignores unknown fragments (caught by KnownFragmentNamesRule)', () => { + expectValid(` + fragment petFragment on Pet { ...UnknownFragment } + `); + }); + + it('different object into object', () => { + expectErrors(` + fragment invalidObjectWithinObject on Cat { ...dogFragment } + fragment dogFragment on Dog { barkVolume } + `).toDeepEqual([ + { + message: + 'Fragment "dogFragment" cannot be spread here as objects of type "Cat" can never be of type "Dog".', + locations: [{ line: 2, column: 51 }], + }, + ]); + }); + + it('different object into object in inline fragment', () => { + expectErrors(` + fragment invalidObjectWithinObjectAnon on Cat { + ... on Dog { barkVolume } + } + `).toDeepEqual([ + { + message: + 'Fragment cannot be spread here as objects of type "Cat" can never be of type "Dog".', + locations: [{ line: 3, column: 9 }], + }, + ]); + }); + + it('object into not implementing interface', () => { + expectErrors(` + fragment invalidObjectWithinInterface on Pet { ...humanFragment } + fragment humanFragment on Human { pets { name } } + `).toDeepEqual([ + { + message: + 'Fragment "humanFragment" cannot be spread here as objects of type "Pet" can never be of type "Human".', + locations: [{ line: 2, column: 54 }], + }, + ]); + }); + + it('object into not containing union', () => { + expectErrors(` + fragment invalidObjectWithinUnion on CatOrDog { ...humanFragment } + fragment humanFragment on Human { pets { name } } + `).toDeepEqual([ + { + message: + 'Fragment "humanFragment" cannot be spread here as objects of type "CatOrDog" can never be of type "Human".', + locations: [{ line: 2, column: 55 }], + }, + ]); + }); + + it('union into not contained object', () => { + expectErrors(` + fragment invalidUnionWithinObject on Human { ...catOrDogFragment } + fragment catOrDogFragment on CatOrDog { __typename } + `).toDeepEqual([ + { + message: + 'Fragment "catOrDogFragment" cannot be spread here as objects of type "Human" can never be of type "CatOrDog".', + locations: [{ line: 2, column: 52 }], + }, + ]); + }); + + it('union into non overlapping interface', () => { + expectErrors(` + fragment invalidUnionWithinInterface on Pet { ...humanOrAlienFragment } + fragment humanOrAlienFragment on HumanOrAlien { __typename } + `).toDeepEqual([ + { + message: + 'Fragment "humanOrAlienFragment" cannot be spread here as objects of type "Pet" can never be of type "HumanOrAlien".', + locations: [{ line: 2, column: 53 }], + }, + ]); + }); + + it('union into non overlapping union', () => { + expectErrors(` + fragment invalidUnionWithinUnion on CatOrDog { ...humanOrAlienFragment } + fragment humanOrAlienFragment on HumanOrAlien { __typename } + `).toDeepEqual([ + { + message: + 'Fragment "humanOrAlienFragment" cannot be spread here as objects of type "CatOrDog" can never be of type "HumanOrAlien".', + locations: [{ line: 2, column: 54 }], + }, + ]); + }); + + it('interface into non implementing object', () => { + expectErrors(` + fragment invalidInterfaceWithinObject on Cat { ...intelligentFragment } + fragment intelligentFragment on Intelligent { iq } + `).toDeepEqual([ + { + message: + 'Fragment "intelligentFragment" cannot be spread here as objects of type "Cat" can never be of type "Intelligent".', + locations: [{ line: 2, column: 54 }], + }, + ]); + }); + + it('interface into non overlapping interface', () => { + expectErrors(` + fragment invalidInterfaceWithinInterface on Pet { + ...intelligentFragment + } + fragment intelligentFragment on Intelligent { iq } + `).toDeepEqual([ + { + message: + 'Fragment "intelligentFragment" cannot be spread here as objects of type "Pet" can never be of type "Intelligent".', + locations: [{ line: 3, column: 9 }], + }, + ]); + }); + + it('interface into non overlapping interface in inline fragment', () => { + expectErrors(` + fragment invalidInterfaceWithinInterfaceAnon on Pet { + ...on Intelligent { iq } + } + `).toDeepEqual([ + { + message: + 'Fragment cannot be spread here as objects of type "Pet" can never be of type "Intelligent".', + locations: [{ line: 3, column: 9 }], + }, + ]); + }); + + it('interface into non overlapping union', () => { + expectErrors(` + fragment invalidInterfaceWithinUnion on HumanOrAlien { ...petFragment } + fragment petFragment on Pet { name } + `).toDeepEqual([ + { + message: + 'Fragment "petFragment" cannot be spread here as objects of type "HumanOrAlien" can never be of type "Pet".', + locations: [{ line: 2, column: 62 }], + }, + ]); + }); +}); diff --git a/src/validation/__tests__/PossibleTypeExtensionsRule-test.ts b/src/validation/__tests__/PossibleTypeExtensionsRule-test.ts new file mode 100644 index 00000000..e29c097b --- /dev/null +++ b/src/validation/__tests__/PossibleTypeExtensionsRule-test.ts @@ -0,0 +1,271 @@ +import { describe, it } from 'mocha'; + +import type { GraphQLSchema } from '../../type/schema'; + +import { buildSchema } from '../../utilities/buildASTSchema'; + +import { PossibleTypeExtensionsRule } from '../rules/PossibleTypeExtensionsRule'; + +import { expectSDLValidationErrors } from './harness'; + +function expectSDLErrors(sdlStr: string, schema?: GraphQLSchema) { + return expectSDLValidationErrors(schema, PossibleTypeExtensionsRule, sdlStr); +} + +function expectValidSDL(sdlStr: string, schema?: GraphQLSchema) { + expectSDLErrors(sdlStr, schema).toDeepEqual([]); +} + +describe('Validate: Possible type extensions', () => { + it('no extensions', () => { + expectValidSDL(` + scalar FooScalar + type FooObject + interface FooInterface + union FooUnion + enum FooEnum + input FooInputObject + `); + }); + + it('one extension per type', () => { + expectValidSDL(` + scalar FooScalar + type FooObject + interface FooInterface + union FooUnion + enum FooEnum + input FooInputObject + + extend scalar FooScalar @dummy + extend type FooObject @dummy + extend interface FooInterface @dummy + extend union FooUnion @dummy + extend enum FooEnum @dummy + extend input FooInputObject @dummy + `); + }); + + it('many extensions per type', () => { + expectValidSDL(` + scalar FooScalar + type FooObject + interface FooInterface + union FooUnion + enum FooEnum + input FooInputObject + + extend scalar FooScalar @dummy + extend type FooObject @dummy + extend interface FooInterface @dummy + extend union FooUnion @dummy + extend enum FooEnum @dummy + extend input FooInputObject @dummy + + extend scalar FooScalar @dummy + extend type FooObject @dummy + extend interface FooInterface @dummy + extend union FooUnion @dummy + extend enum FooEnum @dummy + extend input FooInputObject @dummy + `); + }); + + it('extending unknown type', () => { + const message = + 'Cannot extend type "Unknown" because it is not defined. Did you mean "Known"?'; + + expectSDLErrors(` + type Known + + extend scalar Unknown @dummy + extend type Unknown @dummy + extend interface Unknown @dummy + extend union Unknown @dummy + extend enum Unknown @dummy + extend input Unknown @dummy + `).toDeepEqual([ + { message, locations: [{ line: 4, column: 21 }] }, + { message, locations: [{ line: 5, column: 19 }] }, + { message, locations: [{ line: 6, column: 24 }] }, + { message, locations: [{ line: 7, column: 20 }] }, + { message, locations: [{ line: 8, column: 19 }] }, + { message, locations: [{ line: 9, column: 20 }] }, + ]); + }); + + it('does not consider non-type definitions', () => { + const message = 'Cannot extend type "Foo" because it is not defined.'; + + expectSDLErrors(` + query Foo { __typename } + fragment Foo on Query { __typename } + directive @Foo on SCHEMA + + extend scalar Foo @dummy + extend type Foo @dummy + extend interface Foo @dummy + extend union Foo @dummy + extend enum Foo @dummy + extend input Foo @dummy + `).toDeepEqual([ + { message, locations: [{ line: 6, column: 21 }] }, + { message, locations: [{ line: 7, column: 19 }] }, + { message, locations: [{ line: 8, column: 24 }] }, + { message, locations: [{ line: 9, column: 20 }] }, + { message, locations: [{ line: 10, column: 19 }] }, + { message, locations: [{ line: 11, column: 20 }] }, + ]); + }); + + it('extending with different kinds', () => { + expectSDLErrors(` + scalar FooScalar + type FooObject + interface FooInterface + union FooUnion + enum FooEnum + input FooInputObject + + extend type FooScalar @dummy + extend interface FooObject @dummy + extend union FooInterface @dummy + extend enum FooUnion @dummy + extend input FooEnum @dummy + extend scalar FooInputObject @dummy + `).toDeepEqual([ + { + message: 'Cannot extend non-object type "FooScalar".', + locations: [ + { line: 2, column: 7 }, + { line: 9, column: 7 }, + ], + }, + { + message: 'Cannot extend non-interface type "FooObject".', + locations: [ + { line: 3, column: 7 }, + { line: 10, column: 7 }, + ], + }, + { + message: 'Cannot extend non-union type "FooInterface".', + locations: [ + { line: 4, column: 7 }, + { line: 11, column: 7 }, + ], + }, + { + message: 'Cannot extend non-enum type "FooUnion".', + locations: [ + { line: 5, column: 7 }, + { line: 12, column: 7 }, + ], + }, + { + message: 'Cannot extend non-input object type "FooEnum".', + locations: [ + { line: 6, column: 7 }, + { line: 13, column: 7 }, + ], + }, + { + message: 'Cannot extend non-scalar type "FooInputObject".', + locations: [ + { line: 7, column: 7 }, + { line: 14, column: 7 }, + ], + }, + ]); + }); + + it('extending types within existing schema', () => { + const schema = buildSchema(` + scalar FooScalar + type FooObject + interface FooInterface + union FooUnion + enum FooEnum + input FooInputObject + `); + const sdl = ` + extend scalar FooScalar @dummy + extend type FooObject @dummy + extend interface FooInterface @dummy + extend union FooUnion @dummy + extend enum FooEnum @dummy + extend input FooInputObject @dummy + `; + + expectValidSDL(sdl, schema); + }); + + it('extending unknown types within existing schema', () => { + const schema = buildSchema('type Known'); + const sdl = ` + extend scalar Unknown @dummy + extend type Unknown @dummy + extend interface Unknown @dummy + extend union Unknown @dummy + extend enum Unknown @dummy + extend input Unknown @dummy + `; + + const message = + 'Cannot extend type "Unknown" because it is not defined. Did you mean "Known"?'; + expectSDLErrors(sdl, schema).toDeepEqual([ + { message, locations: [{ line: 2, column: 21 }] }, + { message, locations: [{ line: 3, column: 19 }] }, + { message, locations: [{ line: 4, column: 24 }] }, + { message, locations: [{ line: 5, column: 20 }] }, + { message, locations: [{ line: 6, column: 19 }] }, + { message, locations: [{ line: 7, column: 20 }] }, + ]); + }); + + it('extending types with different kinds within existing schema', () => { + const schema = buildSchema(` + scalar FooScalar + type FooObject + interface FooInterface + union FooUnion + enum FooEnum + input FooInputObject + `); + const sdl = ` + extend type FooScalar @dummy + extend interface FooObject @dummy + extend union FooInterface @dummy + extend enum FooUnion @dummy + extend input FooEnum @dummy + extend scalar FooInputObject @dummy + `; + + expectSDLErrors(sdl, schema).toDeepEqual([ + { + message: 'Cannot extend non-object type "FooScalar".', + locations: [{ line: 2, column: 7 }], + }, + { + message: 'Cannot extend non-interface type "FooObject".', + locations: [{ line: 3, column: 7 }], + }, + { + message: 'Cannot extend non-union type "FooInterface".', + locations: [{ line: 4, column: 7 }], + }, + { + message: 'Cannot extend non-enum type "FooUnion".', + locations: [{ line: 5, column: 7 }], + }, + { + message: 'Cannot extend non-input object type "FooEnum".', + locations: [{ line: 6, column: 7 }], + }, + { + message: 'Cannot extend non-scalar type "FooInputObject".', + locations: [{ line: 7, column: 7 }], + }, + ]); + }); +}); diff --git a/src/validation/__tests__/ProvidedRequiredArgumentsRule-test.ts b/src/validation/__tests__/ProvidedRequiredArgumentsRule-test.ts new file mode 100644 index 00000000..23a27257 --- /dev/null +++ b/src/validation/__tests__/ProvidedRequiredArgumentsRule-test.ts @@ -0,0 +1,356 @@ +import { describe, it } from 'mocha'; + +import type { GraphQLSchema } from '../../type/schema'; + +import { buildSchema } from '../../utilities/buildASTSchema'; + +import { + ProvidedRequiredArgumentsOnDirectivesRule, + ProvidedRequiredArgumentsRule, +} from '../rules/ProvidedRequiredArgumentsRule'; + +import { expectSDLValidationErrors, expectValidationErrors } from './harness'; + +function expectErrors(queryStr: string) { + return expectValidationErrors(ProvidedRequiredArgumentsRule, queryStr); +} + +function expectValid(queryStr: string) { + expectErrors(queryStr).toDeepEqual([]); +} + +function expectSDLErrors(sdlStr: string, schema?: GraphQLSchema) { + return expectSDLValidationErrors( + schema, + ProvidedRequiredArgumentsOnDirectivesRule, + sdlStr, + ); +} + +function expectValidSDL(sdlStr: string) { + expectSDLErrors(sdlStr).toDeepEqual([]); +} + +describe('Validate: Provided required arguments', () => { + it('ignores unknown arguments', () => { + expectValid(` + { + dog { + isHouseTrained(unknownArgument: true) + } + } + `); + }); + + describe('Valid non-nullable value', () => { + it('Arg on optional arg', () => { + expectValid(` + { + dog { + isHouseTrained(atOtherHomes: true) + } + } + `); + }); + + it('No Arg on optional arg', () => { + expectValid(` + { + dog { + isHouseTrained + } + } + `); + }); + + it('No arg on non-null field with default', () => { + expectValid(` + { + complicatedArgs { + nonNullFieldWithDefault + } + } + `); + }); + + it('Multiple args', () => { + expectValid(` + { + complicatedArgs { + multipleReqs(req1: 1, req2: 2) + } + } + `); + }); + + it('Multiple args reverse order', () => { + expectValid(` + { + complicatedArgs { + multipleReqs(req2: 2, req1: 1) + } + } + `); + }); + + it('No args on multiple optional', () => { + expectValid(` + { + complicatedArgs { + multipleOpts + } + } + `); + }); + + it('One arg on multiple optional', () => { + expectValid(` + { + complicatedArgs { + multipleOpts(opt1: 1) + } + } + `); + }); + + it('Second arg on multiple optional', () => { + expectValid(` + { + complicatedArgs { + multipleOpts(opt2: 1) + } + } + `); + }); + + it('Multiple required args on mixedList', () => { + expectValid(` + { + complicatedArgs { + multipleOptAndReq(req1: 3, req2: 4) + } + } + `); + }); + + it('Multiple required and one optional arg on mixedList', () => { + expectValid(` + { + complicatedArgs { + multipleOptAndReq(req1: 3, req2: 4, opt1: 5) + } + } + `); + }); + + it('All required and optional args on mixedList', () => { + expectValid(` + { + complicatedArgs { + multipleOptAndReq(req1: 3, req2: 4, opt1: 5, opt2: 6) + } + } + `); + }); + }); + + describe('Invalid non-nullable value', () => { + it('Missing one non-nullable argument', () => { + expectErrors(` + { + complicatedArgs { + multipleReqs(req2: 2) + } + } + `).toDeepEqual([ + { + message: + 'Field "multipleReqs" argument "req1" of type "Int!" is required, but it was not provided.', + locations: [{ line: 4, column: 13 }], + }, + ]); + }); + + it('Missing multiple non-nullable arguments', () => { + expectErrors(` + { + complicatedArgs { + multipleReqs + } + } + `).toDeepEqual([ + { + message: + 'Field "multipleReqs" argument "req1" of type "Int!" is required, but it was not provided.', + locations: [{ line: 4, column: 13 }], + }, + { + message: + 'Field "multipleReqs" argument "req2" of type "Int!" is required, but it was not provided.', + locations: [{ line: 4, column: 13 }], + }, + ]); + }); + + it('Incorrect value and missing argument', () => { + expectErrors(` + { + complicatedArgs { + multipleReqs(req1: "one") + } + } + `).toDeepEqual([ + { + message: + 'Field "multipleReqs" argument "req2" of type "Int!" is required, but it was not provided.', + locations: [{ line: 4, column: 13 }], + }, + ]); + }); + }); + + describe('Directive arguments', () => { + it('ignores unknown directives', () => { + expectValid(` + { + dog @unknown + } + `); + }); + + it('with directives of valid types', () => { + expectValid(` + { + dog @include(if: true) { + name + } + human @skip(if: false) { + name + } + } + `); + }); + + it('with directive with missing types', () => { + expectErrors(` + { + dog @include { + name @skip + } + } + `).toDeepEqual([ + { + message: + 'Directive "@include" argument "if" of type "Boolean!" is required, but it was not provided.', + locations: [{ line: 3, column: 15 }], + }, + { + message: + 'Directive "@skip" argument "if" of type "Boolean!" is required, but it was not provided.', + locations: [{ line: 4, column: 18 }], + }, + ]); + }); + }); + + describe('within SDL', () => { + it('Missing optional args on directive defined inside SDL', () => { + expectValidSDL(` + type Query { + foo: String @test + } + + directive @test(arg1: String, arg2: String! = "") on FIELD_DEFINITION + `); + }); + + it('Missing arg on directive defined inside SDL', () => { + expectSDLErrors(` + type Query { + foo: String @test + } + + directive @test(arg: String!) on FIELD_DEFINITION + `).toDeepEqual([ + { + message: + 'Directive "@test" argument "arg" of type "String!" is required, but it was not provided.', + locations: [{ line: 3, column: 23 }], + }, + ]); + }); + + it('Missing arg on standard directive', () => { + expectSDLErrors(` + type Query { + foo: String @include + } + `).toDeepEqual([ + { + message: + 'Directive "@include" argument "if" of type "Boolean!" is required, but it was not provided.', + locations: [{ line: 3, column: 23 }], + }, + ]); + }); + + it('Missing arg on overridden standard directive', () => { + expectSDLErrors(` + type Query { + foo: String @deprecated + } + directive @deprecated(reason: String!) on FIELD + `).toDeepEqual([ + { + message: + 'Directive "@deprecated" argument "reason" of type "String!" is required, but it was not provided.', + locations: [{ line: 3, column: 23 }], + }, + ]); + }); + + it('Missing arg on directive defined in schema extension', () => { + const schema = buildSchema(` + type Query { + foo: String + } + `); + expectSDLErrors( + ` + directive @test(arg: String!) on OBJECT + + extend type Query @test + `, + schema, + ).toDeepEqual([ + { + message: + 'Directive "@test" argument "arg" of type "String!" is required, but it was not provided.', + locations: [{ line: 4, column: 30 }], + }, + ]); + }); + + it('Missing arg on directive used in schema extension', () => { + const schema = buildSchema(` + directive @test(arg: String!) on OBJECT + + type Query { + foo: String + } + `); + expectSDLErrors( + ` + extend type Query @test + `, + schema, + ).toDeepEqual([ + { + message: + 'Directive "@test" argument "arg" of type "String!" is required, but it was not provided.', + locations: [{ line: 2, column: 29 }], + }, + ]); + }); + }); +}); diff --git a/src/validation/__tests__/ScalarLeafsRule-test.ts b/src/validation/__tests__/ScalarLeafsRule-test.ts new file mode 100644 index 00000000..b10cf01e --- /dev/null +++ b/src/validation/__tests__/ScalarLeafsRule-test.ts @@ -0,0 +1,129 @@ +import { describe, it } from 'mocha'; + +import { ScalarLeafsRule } from '../rules/ScalarLeafsRule'; + +import { expectValidationErrors } from './harness'; + +function expectErrors(queryStr: string) { + return expectValidationErrors(ScalarLeafsRule, queryStr); +} + +function expectValid(queryStr: string) { + expectErrors(queryStr).toDeepEqual([]); +} + +describe('Validate: Scalar leafs', () => { + it('valid scalar selection', () => { + expectValid(` + fragment scalarSelection on Dog { + barks + } + `); + }); + + it('object type missing selection', () => { + expectErrors(` + query directQueryOnObjectWithoutSubFields { + human + } + `).toDeepEqual([ + { + message: + 'Field "human" of type "Human" must have a selection of subfields. Did you mean "human { ... }"?', + locations: [{ line: 3, column: 9 }], + }, + ]); + }); + + it('interface type missing selection', () => { + expectErrors(` + { + human { pets } + } + `).toDeepEqual([ + { + message: + 'Field "pets" of type "[Pet]" must have a selection of subfields. Did you mean "pets { ... }"?', + locations: [{ line: 3, column: 17 }], + }, + ]); + }); + + it('valid scalar selection with args', () => { + expectValid(` + fragment scalarSelectionWithArgs on Dog { + doesKnowCommand(dogCommand: SIT) + } + `); + }); + + it('scalar selection not allowed on Boolean', () => { + expectErrors(` + fragment scalarSelectionsNotAllowedOnBoolean on Dog { + barks { sinceWhen } + } + `).toDeepEqual([ + { + message: + 'Field "barks" must not have a selection since type "Boolean" has no subfields.', + locations: [{ line: 3, column: 15 }], + }, + ]); + }); + + it('scalar selection not allowed on Enum', () => { + expectErrors(` + fragment scalarSelectionsNotAllowedOnEnum on Cat { + furColor { inHexDec } + } + `).toDeepEqual([ + { + message: + 'Field "furColor" must not have a selection since type "FurColor" has no subfields.', + locations: [{ line: 3, column: 18 }], + }, + ]); + }); + + it('scalar selection not allowed with args', () => { + expectErrors(` + fragment scalarSelectionsNotAllowedWithArgs on Dog { + doesKnowCommand(dogCommand: SIT) { sinceWhen } + } + `).toDeepEqual([ + { + message: + 'Field "doesKnowCommand" must not have a selection since type "Boolean" has no subfields.', + locations: [{ line: 3, column: 42 }], + }, + ]); + }); + + it('Scalar selection not allowed with directives', () => { + expectErrors(` + fragment scalarSelectionsNotAllowedWithDirectives on Dog { + name @include(if: true) { isAlsoHumanName } + } + `).toDeepEqual([ + { + message: + 'Field "name" must not have a selection since type "String" has no subfields.', + locations: [{ line: 3, column: 33 }], + }, + ]); + }); + + it('Scalar selection not allowed with directives and args', () => { + expectErrors(` + fragment scalarSelectionsNotAllowedWithDirectivesAndArgs on Dog { + doesKnowCommand(dogCommand: SIT) @include(if: true) { sinceWhen } + } + `).toDeepEqual([ + { + message: + 'Field "doesKnowCommand" must not have a selection since type "Boolean" has no subfields.', + locations: [{ line: 3, column: 61 }], + }, + ]); + }); +}); diff --git a/src/validation/__tests__/SingleFieldSubscriptionsRule-test.ts b/src/validation/__tests__/SingleFieldSubscriptionsRule-test.ts new file mode 100644 index 00000000..e0d37892 --- /dev/null +++ b/src/validation/__tests__/SingleFieldSubscriptionsRule-test.ts @@ -0,0 +1,306 @@ +import { describe, it } from 'mocha'; + +import { buildSchema } from '../../utilities/buildASTSchema'; + +import { SingleFieldSubscriptionsRule } from '../rules/SingleFieldSubscriptionsRule'; + +import { expectValidationErrorsWithSchema } from './harness'; + +function expectErrors(queryStr: string) { + return expectValidationErrorsWithSchema( + schema, + SingleFieldSubscriptionsRule, + queryStr, + ); +} + +function expectValid(queryStr: string) { + expectErrors(queryStr).toDeepEqual([]); +} + +const schema = buildSchema(` + type Message { + body: String + sender: String + } + + type SubscriptionRoot { + importantEmails: [String] + notImportantEmails: [String] + moreImportantEmails: [String] + spamEmails: [String] + deletedEmails: [String] + newMessage: Message + } + + type QueryRoot { + dummy: String + } + + schema { + query: QueryRoot + subscription: SubscriptionRoot + } +`); + +describe('Validate: Subscriptions with single field', () => { + it('valid subscription', () => { + expectValid(` + subscription ImportantEmails { + importantEmails + } + `); + }); + + it('valid subscription with fragment', () => { + // From https://spec.graphql.org/draft/#example-13061 + expectValid(` + subscription sub { + ...newMessageFields + } + + fragment newMessageFields on SubscriptionRoot { + newMessage { + body + sender + } + } + `); + }); + + it('valid subscription with fragment and field', () => { + // From https://spec.graphql.org/draft/#example-13061 + expectValid(` + subscription sub { + newMessage { + body + } + ...newMessageFields + } + + fragment newMessageFields on SubscriptionRoot { + newMessage { + body + sender + } + } + `); + }); + + it('fails with more than one root field', () => { + expectErrors(` + subscription ImportantEmails { + importantEmails + notImportantEmails + } + `).toDeepEqual([ + { + message: + 'Subscription "ImportantEmails" must select only one top level field.', + locations: [{ line: 4, column: 9 }], + }, + ]); + }); + + it('fails with more than one root field including introspection', () => { + expectErrors(` + subscription ImportantEmails { + importantEmails + __typename + } + `).toDeepEqual([ + { + message: + 'Subscription "ImportantEmails" must select only one top level field.', + locations: [{ line: 4, column: 9 }], + }, + { + message: + 'Subscription "ImportantEmails" must not select an introspection top level field.', + locations: [{ line: 4, column: 9 }], + }, + ]); + }); + + it('fails with more than one root field including aliased introspection via fragment', () => { + expectErrors(` + subscription ImportantEmails { + importantEmails + ...Introspection + } + fragment Introspection on SubscriptionRoot { + typename: __typename + } + `).toDeepEqual([ + { + message: + 'Subscription "ImportantEmails" must select only one top level field.', + locations: [{ line: 7, column: 9 }], + }, + { + message: + 'Subscription "ImportantEmails" must not select an introspection top level field.', + locations: [{ line: 7, column: 9 }], + }, + ]); + }); + + it('fails with many more than one root field', () => { + expectErrors(` + subscription ImportantEmails { + importantEmails + notImportantEmails + spamEmails + } + `).toDeepEqual([ + { + message: + 'Subscription "ImportantEmails" must select only one top level field.', + locations: [ + { line: 4, column: 9 }, + { line: 5, column: 9 }, + ], + }, + ]); + }); + + it('fails with many more than one root field via fragments', () => { + expectErrors(` + subscription ImportantEmails { + importantEmails + ... { + more: moreImportantEmails + } + ...NotImportantEmails + } + fragment NotImportantEmails on SubscriptionRoot { + notImportantEmails + deleted: deletedEmails + ...SpamEmails + } + fragment SpamEmails on SubscriptionRoot { + spamEmails + } + `).toDeepEqual([ + { + message: + 'Subscription "ImportantEmails" must select only one top level field.', + locations: [ + { line: 5, column: 11 }, + { line: 10, column: 9 }, + { line: 11, column: 9 }, + { line: 15, column: 9 }, + ], + }, + ]); + }); + + it('does not infinite loop on recursive fragments', () => { + expectErrors(` + subscription NoInfiniteLoop { + ...A + } + fragment A on SubscriptionRoot { + ...A + } + `).toDeepEqual([]); + }); + + it('fails with many more than one root field via fragments (anonymous)', () => { + expectErrors(` + subscription { + importantEmails + ... { + more: moreImportantEmails + ...NotImportantEmails + } + ...NotImportantEmails + } + fragment NotImportantEmails on SubscriptionRoot { + notImportantEmails + deleted: deletedEmails + ... { + ... { + archivedEmails + } + } + ...SpamEmails + } + fragment SpamEmails on SubscriptionRoot { + spamEmails + ...NonExistentFragment + } + `).toDeepEqual([ + { + message: 'Anonymous Subscription must select only one top level field.', + locations: [ + { line: 5, column: 11 }, + { line: 11, column: 9 }, + { line: 12, column: 9 }, + { line: 15, column: 13 }, + { line: 21, column: 9 }, + ], + }, + ]); + }); + + it('fails with more than one root field in anonymous subscriptions', () => { + expectErrors(` + subscription { + importantEmails + notImportantEmails + } + `).toDeepEqual([ + { + message: 'Anonymous Subscription must select only one top level field.', + locations: [{ line: 4, column: 9 }], + }, + ]); + }); + + it('fails with introspection field', () => { + expectErrors(` + subscription ImportantEmails { + __typename + } + `).toDeepEqual([ + { + message: + 'Subscription "ImportantEmails" must not select an introspection top level field.', + locations: [{ line: 3, column: 9 }], + }, + ]); + }); + + it('fails with introspection field in anonymous subscription', () => { + expectErrors(` + subscription { + __typename + } + `).toDeepEqual([ + { + message: + 'Anonymous Subscription must not select an introspection top level field.', + locations: [{ line: 3, column: 9 }], + }, + ]); + }); + + it('skips if not subscription type', () => { + const emptySchema = buildSchema(` + type Query { + dummy: String + } + `); + + expectValidationErrorsWithSchema( + emptySchema, + SingleFieldSubscriptionsRule, + ` + subscription { + __typename + } + `, + ).toDeepEqual([]); + }); +}); diff --git a/src/validation/__tests__/UniqueArgumentDefinitionNamesRule-test.ts b/src/validation/__tests__/UniqueArgumentDefinitionNamesRule-test.ts new file mode 100644 index 00000000..cf63202b --- /dev/null +++ b/src/validation/__tests__/UniqueArgumentDefinitionNamesRule-test.ts @@ -0,0 +1,174 @@ +import { describe, it } from 'mocha'; + +import { UniqueArgumentDefinitionNamesRule } from '../rules/UniqueArgumentDefinitionNamesRule'; + +import { expectSDLValidationErrors } from './harness'; + +function expectSDLErrors(sdlStr: string) { + return expectSDLValidationErrors( + undefined, + UniqueArgumentDefinitionNamesRule, + sdlStr, + ); +} + +function expectValidSDL(sdlStr: string) { + expectSDLErrors(sdlStr).toDeepEqual([]); +} + +describe('Validate: Unique argument definition names', () => { + it('no args', () => { + expectValidSDL(` + type SomeObject { + someField: String + } + + interface SomeInterface { + someField: String + } + + directive @someDirective on QUERY + `); + }); + + it('one argument', () => { + expectValidSDL(` + type SomeObject { + someField(foo: String): String + } + + interface SomeInterface { + someField(foo: String): String + } + + extend type SomeObject { + anotherField(foo: String): String + } + + extend interface SomeInterface { + anotherField(foo: String): String + } + + directive @someDirective(foo: String) on QUERY + `); + }); + + it('multiple arguments', () => { + expectValidSDL(` + type SomeObject { + someField( + foo: String + bar: String + ): String + } + + interface SomeInterface { + someField( + foo: String + bar: String + ): String + } + + extend type SomeObject { + anotherField( + foo: String + bar: String + ): String + } + + extend interface SomeInterface { + anotherField( + foo: String + bar: String + ): String + } + + directive @someDirective( + foo: String + bar: String + ) on QUERY + `); + }); + + it('duplicating arguments', () => { + expectSDLErrors(` + type SomeObject { + someField( + foo: String + bar: String + foo: String + ): String + } + + interface SomeInterface { + someField( + foo: String + bar: String + foo: String + ): String + } + + extend type SomeObject { + anotherField( + foo: String + bar: String + bar: String + ): String + } + + extend interface SomeInterface { + anotherField( + bar: String + foo: String + foo: String + ): String + } + + directive @someDirective( + foo: String + bar: String + foo: String + ) on QUERY + `).toDeepEqual([ + { + message: + 'Argument "SomeObject.someField(foo:)" can only be defined once.', + locations: [ + { line: 4, column: 11 }, + { line: 6, column: 11 }, + ], + }, + { + message: + 'Argument "SomeInterface.someField(foo:)" can only be defined once.', + locations: [ + { line: 12, column: 11 }, + { line: 14, column: 11 }, + ], + }, + { + message: + 'Argument "SomeObject.anotherField(bar:)" can only be defined once.', + locations: [ + { line: 21, column: 11 }, + { line: 22, column: 11 }, + ], + }, + { + message: + 'Argument "SomeInterface.anotherField(foo:)" can only be defined once.', + locations: [ + { line: 29, column: 11 }, + { line: 30, column: 11 }, + ], + }, + { + message: 'Argument "@someDirective(foo:)" can only be defined once.', + locations: [ + { line: 35, column: 9 }, + { line: 37, column: 9 }, + ], + }, + ]); + }); +}); diff --git a/src/validation/__tests__/UniqueArgumentNamesRule-test.ts b/src/validation/__tests__/UniqueArgumentNamesRule-test.ts new file mode 100644 index 00000000..f5709e32 --- /dev/null +++ b/src/validation/__tests__/UniqueArgumentNamesRule-test.ts @@ -0,0 +1,154 @@ +import { describe, it } from 'mocha'; + +import { UniqueArgumentNamesRule } from '../rules/UniqueArgumentNamesRule'; + +import { expectValidationErrors } from './harness'; + +function expectErrors(queryStr: string) { + return expectValidationErrors(UniqueArgumentNamesRule, queryStr); +} + +function expectValid(queryStr: string) { + expectErrors(queryStr).toDeepEqual([]); +} + +describe('Validate: Unique argument names', () => { + it('no arguments on field', () => { + expectValid(` + { + field + } + `); + }); + + it('no arguments on directive', () => { + expectValid(` + { + field @directive + } + `); + }); + + it('argument on field', () => { + expectValid(` + { + field(arg: "value") + } + `); + }); + + it('argument on directive', () => { + expectValid(` + { + field @directive(arg: "value") + } + `); + }); + + it('same argument on two fields', () => { + expectValid(` + { + one: field(arg: "value") + two: field(arg: "value") + } + `); + }); + + it('same argument on field and directive', () => { + expectValid(` + { + field(arg: "value") @directive(arg: "value") + } + `); + }); + + it('same argument on two directives', () => { + expectValid(` + { + field @directive1(arg: "value") @directive2(arg: "value") + } + `); + }); + + it('multiple field arguments', () => { + expectValid(` + { + field(arg1: "value", arg2: "value", arg3: "value") + } + `); + }); + + it('multiple directive arguments', () => { + expectValid(` + { + field @directive(arg1: "value", arg2: "value", arg3: "value") + } + `); + }); + + it('duplicate field arguments', () => { + expectErrors(` + { + field(arg1: "value", arg1: "value") + } + `).toDeepEqual([ + { + message: 'There can be only one argument named "arg1".', + locations: [ + { line: 3, column: 15 }, + { line: 3, column: 30 }, + ], + }, + ]); + }); + + it('many duplicate field arguments', () => { + expectErrors(` + { + field(arg1: "value", arg1: "value", arg1: "value") + } + `).toDeepEqual([ + { + message: 'There can be only one argument named "arg1".', + locations: [ + { line: 3, column: 15 }, + { line: 3, column: 30 }, + { line: 3, column: 45 }, + ], + }, + ]); + }); + + it('duplicate directive arguments', () => { + expectErrors(` + { + field @directive(arg1: "value", arg1: "value") + } + `).toDeepEqual([ + { + message: 'There can be only one argument named "arg1".', + locations: [ + { line: 3, column: 26 }, + { line: 3, column: 41 }, + ], + }, + ]); + }); + + it('many duplicate directive arguments', () => { + expectErrors(` + { + field @directive(arg1: "value", arg1: "value", arg1: "value") + } + `).toDeepEqual([ + { + message: 'There can be only one argument named "arg1".', + locations: [ + { line: 3, column: 26 }, + { line: 3, column: 41 }, + { line: 3, column: 56 }, + ], + }, + ]); + }); +}); diff --git a/src/validation/__tests__/UniqueDirectiveNamesRule-test.ts b/src/validation/__tests__/UniqueDirectiveNamesRule-test.ts new file mode 100644 index 00000000..a632af28 --- /dev/null +++ b/src/validation/__tests__/UniqueDirectiveNamesRule-test.ts @@ -0,0 +1,101 @@ +import { describe, it } from 'mocha'; + +import type { GraphQLSchema } from '../../type/schema'; + +import { buildSchema } from '../../utilities/buildASTSchema'; + +import { UniqueDirectiveNamesRule } from '../rules/UniqueDirectiveNamesRule'; + +import { expectSDLValidationErrors } from './harness'; + +function expectSDLErrors(sdlStr: string, schema?: GraphQLSchema) { + return expectSDLValidationErrors(schema, UniqueDirectiveNamesRule, sdlStr); +} + +function expectValidSDL(sdlStr: string, schema?: GraphQLSchema) { + expectSDLErrors(sdlStr, schema).toDeepEqual([]); +} + +describe('Validate: Unique directive names', () => { + it('no directive', () => { + expectValidSDL(` + type Foo + `); + }); + + it('one directive', () => { + expectValidSDL(` + directive @foo on SCHEMA + `); + }); + + it('many directives', () => { + expectValidSDL(` + directive @foo on SCHEMA + directive @bar on SCHEMA + directive @baz on SCHEMA + `); + }); + + it('directive and non-directive definitions named the same', () => { + expectValidSDL(` + query foo { __typename } + fragment foo on foo { __typename } + type foo + + directive @foo on SCHEMA + `); + }); + + it('directives named the same', () => { + expectSDLErrors(` + directive @foo on SCHEMA + + directive @foo on SCHEMA + `).toDeepEqual([ + { + message: 'There can be only one directive named "@foo".', + locations: [ + { line: 2, column: 18 }, + { line: 4, column: 18 }, + ], + }, + ]); + }); + + it('adding new directive to existing schema', () => { + const schema = buildSchema('directive @foo on SCHEMA'); + + expectValidSDL('directive @bar on SCHEMA', schema); + }); + + it('adding new directive with standard name to existing schema', () => { + const schema = buildSchema('type foo'); + + expectSDLErrors('directive @skip on SCHEMA', schema).toDeepEqual([ + { + message: + 'Directive "@skip" already exists in the schema. It cannot be redefined.', + locations: [{ line: 1, column: 12 }], + }, + ]); + }); + + it('adding new directive to existing schema with same-named type', () => { + const schema = buildSchema('type foo'); + + expectValidSDL('directive @foo on SCHEMA', schema); + }); + + it('adding conflicting directives to existing schema', () => { + const schema = buildSchema('directive @foo on SCHEMA'); + + expectSDLErrors('directive @foo on SCHEMA', schema).toDeepEqual([ + { + message: + 'Directive "@foo" already exists in the schema. It cannot be redefined.', + locations: [{ line: 1, column: 12 }], + }, + ]); + }); +}); diff --git a/src/validation/__tests__/UniqueDirectivesPerLocationRule-test.ts b/src/validation/__tests__/UniqueDirectivesPerLocationRule-test.ts new file mode 100644 index 00000000..d57a3df6 --- /dev/null +++ b/src/validation/__tests__/UniqueDirectivesPerLocationRule-test.ts @@ -0,0 +1,394 @@ +import { describe, it } from 'mocha'; + +import { parse } from '../../language/parser'; + +import type { GraphQLSchema } from '../../type/schema'; + +import { extendSchema } from '../../utilities/extendSchema'; + +import { UniqueDirectivesPerLocationRule } from '../rules/UniqueDirectivesPerLocationRule'; + +import { + expectSDLValidationErrors, + expectValidationErrorsWithSchema, + testSchema, +} from './harness'; + +const extensionSDL = ` + directive @directive on FIELD | FRAGMENT_DEFINITION + directive @directiveA on FIELD | FRAGMENT_DEFINITION + directive @directiveB on FIELD | FRAGMENT_DEFINITION + directive @repeatable repeatable on FIELD | FRAGMENT_DEFINITION +`; +const schemaWithDirectives = extendSchema(testSchema, parse(extensionSDL)); + +function expectErrors(queryStr: string) { + return expectValidationErrorsWithSchema( + schemaWithDirectives, + UniqueDirectivesPerLocationRule, + queryStr, + ); +} + +function expectValid(queryStr: string) { + expectErrors(queryStr).toDeepEqual([]); +} + +function expectSDLErrors(sdlStr: string, schema?: GraphQLSchema) { + return expectSDLValidationErrors( + schema, + UniqueDirectivesPerLocationRule, + sdlStr, + ); +} + +describe('Validate: Directives Are Unique Per Location', () => { + it('no directives', () => { + expectValid(` + fragment Test on Type { + field + } + `); + }); + + it('unique directives in different locations', () => { + expectValid(` + fragment Test on Type @directiveA { + field @directiveB + } + `); + }); + + it('unique directives in same locations', () => { + expectValid(` + fragment Test on Type @directiveA @directiveB { + field @directiveA @directiveB + } + `); + }); + + it('same directives in different locations', () => { + expectValid(` + fragment Test on Type @directiveA { + field @directiveA + } + `); + }); + + it('same directives in similar locations', () => { + expectValid(` + fragment Test on Type { + field @directive + field @directive + } + `); + }); + + it('repeatable directives in same location', () => { + expectValid(` + fragment Test on Type @repeatable @repeatable { + field @repeatable @repeatable + } + `); + }); + + it('unknown directives must be ignored', () => { + expectValid(` + type Test @unknown @unknown { + field: String! @unknown @unknown + } + + extend type Test @unknown { + anotherField: String! + } + `); + }); + + it('duplicate directives in one location', () => { + expectErrors(` + fragment Test on Type { + field @directive @directive + } + `).toDeepEqual([ + { + message: + 'The directive "@directive" can only be used once at this location.', + locations: [ + { line: 3, column: 15 }, + { line: 3, column: 26 }, + ], + }, + ]); + }); + + it('many duplicate directives in one location', () => { + expectErrors(` + fragment Test on Type { + field @directive @directive @directive + } + `).toDeepEqual([ + { + message: + 'The directive "@directive" can only be used once at this location.', + locations: [ + { line: 3, column: 15 }, + { line: 3, column: 26 }, + ], + }, + { + message: + 'The directive "@directive" can only be used once at this location.', + locations: [ + { line: 3, column: 15 }, + { line: 3, column: 37 }, + ], + }, + ]); + }); + + it('different duplicate directives in one location', () => { + expectErrors(` + fragment Test on Type { + field @directiveA @directiveB @directiveA @directiveB + } + `).toDeepEqual([ + { + message: + 'The directive "@directiveA" can only be used once at this location.', + locations: [ + { line: 3, column: 15 }, + { line: 3, column: 39 }, + ], + }, + { + message: + 'The directive "@directiveB" can only be used once at this location.', + locations: [ + { line: 3, column: 27 }, + { line: 3, column: 51 }, + ], + }, + ]); + }); + + it('duplicate directives in many locations', () => { + expectErrors(` + fragment Test on Type @directive @directive { + field @directive @directive + } + `).toDeepEqual([ + { + message: + 'The directive "@directive" can only be used once at this location.', + locations: [ + { line: 2, column: 29 }, + { line: 2, column: 40 }, + ], + }, + { + message: + 'The directive "@directive" can only be used once at this location.', + locations: [ + { line: 3, column: 15 }, + { line: 3, column: 26 }, + ], + }, + ]); + }); + + it('duplicate directives on SDL definitions', () => { + expectSDLErrors(` + directive @nonRepeatable on + SCHEMA | SCALAR | OBJECT | INTERFACE | UNION | INPUT_OBJECT + + schema @nonRepeatable @nonRepeatable { query: Dummy } + + scalar TestScalar @nonRepeatable @nonRepeatable + type TestObject @nonRepeatable @nonRepeatable + interface TestInterface @nonRepeatable @nonRepeatable + union TestUnion @nonRepeatable @nonRepeatable + input TestInput @nonRepeatable @nonRepeatable + `).toDeepEqual([ + { + message: + 'The directive "@nonRepeatable" can only be used once at this location.', + locations: [ + { line: 5, column: 14 }, + { line: 5, column: 29 }, + ], + }, + { + message: + 'The directive "@nonRepeatable" can only be used once at this location.', + locations: [ + { line: 7, column: 25 }, + { line: 7, column: 40 }, + ], + }, + { + message: + 'The directive "@nonRepeatable" can only be used once at this location.', + locations: [ + { line: 8, column: 23 }, + { line: 8, column: 38 }, + ], + }, + { + message: + 'The directive "@nonRepeatable" can only be used once at this location.', + locations: [ + { line: 9, column: 31 }, + { line: 9, column: 46 }, + ], + }, + { + message: + 'The directive "@nonRepeatable" can only be used once at this location.', + locations: [ + { line: 10, column: 23 }, + { line: 10, column: 38 }, + ], + }, + { + message: + 'The directive "@nonRepeatable" can only be used once at this location.', + locations: [ + { line: 11, column: 23 }, + { line: 11, column: 38 }, + ], + }, + ]); + }); + + it('duplicate directives on SDL extensions', () => { + expectSDLErrors(` + directive @nonRepeatable on + SCHEMA | SCALAR | OBJECT | INTERFACE | UNION | INPUT_OBJECT + + extend schema @nonRepeatable @nonRepeatable + + extend scalar TestScalar @nonRepeatable @nonRepeatable + extend type TestObject @nonRepeatable @nonRepeatable + extend interface TestInterface @nonRepeatable @nonRepeatable + extend union TestUnion @nonRepeatable @nonRepeatable + extend input TestInput @nonRepeatable @nonRepeatable + `).toDeepEqual([ + { + message: + 'The directive "@nonRepeatable" can only be used once at this location.', + locations: [ + { line: 5, column: 21 }, + { line: 5, column: 36 }, + ], + }, + { + message: + 'The directive "@nonRepeatable" can only be used once at this location.', + locations: [ + { line: 7, column: 32 }, + { line: 7, column: 47 }, + ], + }, + { + message: + 'The directive "@nonRepeatable" can only be used once at this location.', + locations: [ + { line: 8, column: 30 }, + { line: 8, column: 45 }, + ], + }, + { + message: + 'The directive "@nonRepeatable" can only be used once at this location.', + locations: [ + { line: 9, column: 38 }, + { line: 9, column: 53 }, + ], + }, + { + message: + 'The directive "@nonRepeatable" can only be used once at this location.', + locations: [ + { line: 10, column: 30 }, + { line: 10, column: 45 }, + ], + }, + { + message: + 'The directive "@nonRepeatable" can only be used once at this location.', + locations: [ + { line: 11, column: 30 }, + { line: 11, column: 45 }, + ], + }, + ]); + }); + + it('duplicate directives between SDL definitions and extensions', () => { + expectSDLErrors(` + directive @nonRepeatable on SCHEMA + + schema @nonRepeatable { query: Dummy } + extend schema @nonRepeatable + `).toDeepEqual([ + { + message: + 'The directive "@nonRepeatable" can only be used once at this location.', + locations: [ + { line: 4, column: 14 }, + { line: 5, column: 21 }, + ], + }, + ]); + + expectSDLErrors(` + directive @nonRepeatable on SCALAR + + scalar TestScalar @nonRepeatable + extend scalar TestScalar @nonRepeatable + scalar TestScalar @nonRepeatable + `).toDeepEqual([ + { + message: + 'The directive "@nonRepeatable" can only be used once at this location.', + locations: [ + { line: 4, column: 25 }, + { line: 5, column: 32 }, + ], + }, + { + message: + 'The directive "@nonRepeatable" can only be used once at this location.', + locations: [ + { line: 4, column: 25 }, + { line: 6, column: 25 }, + ], + }, + ]); + + expectSDLErrors(` + directive @nonRepeatable on OBJECT + + extend type TestObject @nonRepeatable + type TestObject @nonRepeatable + extend type TestObject @nonRepeatable + `).toDeepEqual([ + { + message: + 'The directive "@nonRepeatable" can only be used once at this location.', + locations: [ + { line: 4, column: 30 }, + { line: 5, column: 23 }, + ], + }, + { + message: + 'The directive "@nonRepeatable" can only be used once at this location.', + locations: [ + { line: 4, column: 30 }, + { line: 6, column: 30 }, + ], + }, + ]); + }); +}); diff --git a/src/validation/__tests__/UniqueEnumValueNamesRule-test.ts b/src/validation/__tests__/UniqueEnumValueNamesRule-test.ts new file mode 100644 index 00000000..17a71a6e --- /dev/null +++ b/src/validation/__tests__/UniqueEnumValueNamesRule-test.ts @@ -0,0 +1,194 @@ +import { describe, it } from 'mocha'; + +import type { GraphQLSchema } from '../../type/schema'; + +import { buildSchema } from '../../utilities/buildASTSchema'; + +import { UniqueEnumValueNamesRule } from '../rules/UniqueEnumValueNamesRule'; + +import { expectSDLValidationErrors } from './harness'; + +function expectSDLErrors(sdlStr: string, schema?: GraphQLSchema) { + return expectSDLValidationErrors(schema, UniqueEnumValueNamesRule, sdlStr); +} + +function expectValidSDL(sdlStr: string, schema?: GraphQLSchema) { + expectSDLErrors(sdlStr, schema).toDeepEqual([]); +} + +describe('Validate: Unique enum value names', () => { + it('no values', () => { + expectValidSDL(` + enum SomeEnum + `); + }); + + it('one value', () => { + expectValidSDL(` + enum SomeEnum { + FOO + } + `); + }); + + it('multiple values', () => { + expectValidSDL(` + enum SomeEnum { + FOO + BAR + } + `); + }); + + it('duplicate values inside the same enum definition', () => { + expectSDLErrors(` + enum SomeEnum { + FOO + BAR + FOO + } + `).toDeepEqual([ + { + message: 'Enum value "SomeEnum.FOO" can only be defined once.', + locations: [ + { line: 3, column: 9 }, + { line: 5, column: 9 }, + ], + }, + ]); + }); + + it('extend enum with new value', () => { + expectValidSDL(` + enum SomeEnum { + FOO + } + extend enum SomeEnum { + BAR + } + extend enum SomeEnum { + BAZ + } + `); + }); + + it('extend enum with duplicate value', () => { + expectSDLErrors(` + extend enum SomeEnum { + FOO + } + enum SomeEnum { + FOO + } + `).toDeepEqual([ + { + message: 'Enum value "SomeEnum.FOO" can only be defined once.', + locations: [ + { line: 3, column: 9 }, + { line: 6, column: 9 }, + ], + }, + ]); + }); + + it('duplicate value inside extension', () => { + expectSDLErrors(` + enum SomeEnum + extend enum SomeEnum { + FOO + BAR + FOO + } + `).toDeepEqual([ + { + message: 'Enum value "SomeEnum.FOO" can only be defined once.', + locations: [ + { line: 4, column: 9 }, + { line: 6, column: 9 }, + ], + }, + ]); + }); + + it('duplicate value inside different extensions', () => { + expectSDLErrors(` + enum SomeEnum + extend enum SomeEnum { + FOO + } + extend enum SomeEnum { + FOO + } + `).toDeepEqual([ + { + message: 'Enum value "SomeEnum.FOO" can only be defined once.', + locations: [ + { line: 4, column: 9 }, + { line: 7, column: 9 }, + ], + }, + ]); + }); + + it('adding new value to the type inside existing schema', () => { + const schema = buildSchema('enum SomeEnum'); + const sdl = ` + extend enum SomeEnum { + FOO + } + `; + + expectValidSDL(sdl, schema); + }); + + it('adding conflicting value to existing schema twice', () => { + const schema = buildSchema(` + enum SomeEnum { + FOO + } + `); + const sdl = ` + extend enum SomeEnum { + FOO + } + extend enum SomeEnum { + FOO + } + `; + + expectSDLErrors(sdl, schema).toDeepEqual([ + { + message: + 'Enum value "SomeEnum.FOO" already exists in the schema. It cannot also be defined in this type extension.', + locations: [{ line: 3, column: 9 }], + }, + { + message: + 'Enum value "SomeEnum.FOO" already exists in the schema. It cannot also be defined in this type extension.', + locations: [{ line: 6, column: 9 }], + }, + ]); + }); + + it('adding enum values to existing schema twice', () => { + const schema = buildSchema('enum SomeEnum'); + const sdl = ` + extend enum SomeEnum { + FOO + } + extend enum SomeEnum { + FOO + } + `; + + expectSDLErrors(sdl, schema).toDeepEqual([ + { + message: 'Enum value "SomeEnum.FOO" can only be defined once.', + locations: [ + { line: 3, column: 9 }, + { line: 6, column: 9 }, + ], + }, + ]); + }); +}); diff --git a/src/validation/__tests__/UniqueFieldDefinitionNamesRule-test.ts b/src/validation/__tests__/UniqueFieldDefinitionNamesRule-test.ts new file mode 100644 index 00000000..441e85d3 --- /dev/null +++ b/src/validation/__tests__/UniqueFieldDefinitionNamesRule-test.ts @@ -0,0 +1,435 @@ +import { describe, it } from 'mocha'; + +import type { GraphQLSchema } from '../../type/schema'; + +import { buildSchema } from '../../utilities/buildASTSchema'; + +import { UniqueFieldDefinitionNamesRule } from '../rules/UniqueFieldDefinitionNamesRule'; + +import { expectSDLValidationErrors } from './harness'; + +function expectSDLErrors(sdlStr: string, schema?: GraphQLSchema) { + return expectSDLValidationErrors( + schema, + UniqueFieldDefinitionNamesRule, + sdlStr, + ); +} + +function expectValidSDL(sdlStr: string, schema?: GraphQLSchema) { + expectSDLErrors(sdlStr, schema).toDeepEqual([]); +} + +describe('Validate: Unique field definition names', () => { + it('no fields', () => { + expectValidSDL(` + type SomeObject + interface SomeInterface + input SomeInputObject + `); + }); + + it('one field', () => { + expectValidSDL(` + type SomeObject { + foo: String + } + + interface SomeInterface { + foo: String + } + + input SomeInputObject { + foo: String + } + `); + }); + + it('multiple fields', () => { + expectValidSDL(` + type SomeObject { + foo: String + bar: String + } + + interface SomeInterface { + foo: String + bar: String + } + + input SomeInputObject { + foo: String + bar: String + } + `); + }); + + it('duplicate fields inside the same type definition', () => { + expectSDLErrors(` + type SomeObject { + foo: String + bar: String + foo: String + } + + interface SomeInterface { + foo: String + bar: String + foo: String + } + + input SomeInputObject { + foo: String + bar: String + foo: String + } + `).toDeepEqual([ + { + message: 'Field "SomeObject.foo" can only be defined once.', + locations: [ + { line: 3, column: 9 }, + { line: 5, column: 9 }, + ], + }, + { + message: 'Field "SomeInterface.foo" can only be defined once.', + locations: [ + { line: 9, column: 9 }, + { line: 11, column: 9 }, + ], + }, + { + message: 'Field "SomeInputObject.foo" can only be defined once.', + locations: [ + { line: 15, column: 9 }, + { line: 17, column: 9 }, + ], + }, + ]); + }); + + it('extend type with new field', () => { + expectValidSDL(` + type SomeObject { + foo: String + } + extend type SomeObject { + bar: String + } + extend type SomeObject { + baz: String + } + + interface SomeInterface { + foo: String + } + extend interface SomeInterface { + bar: String + } + extend interface SomeInterface { + baz: String + } + + input SomeInputObject { + foo: String + } + extend input SomeInputObject { + bar: String + } + extend input SomeInputObject { + baz: String + } + `); + }); + + it('extend type with duplicate field', () => { + expectSDLErrors(` + extend type SomeObject { + foo: String + } + type SomeObject { + foo: String + } + + extend interface SomeInterface { + foo: String + } + interface SomeInterface { + foo: String + } + + extend input SomeInputObject { + foo: String + } + input SomeInputObject { + foo: String + } + `).toDeepEqual([ + { + message: 'Field "SomeObject.foo" can only be defined once.', + locations: [ + { line: 3, column: 9 }, + { line: 6, column: 9 }, + ], + }, + { + message: 'Field "SomeInterface.foo" can only be defined once.', + locations: [ + { line: 10, column: 9 }, + { line: 13, column: 9 }, + ], + }, + { + message: 'Field "SomeInputObject.foo" can only be defined once.', + locations: [ + { line: 17, column: 9 }, + { line: 20, column: 9 }, + ], + }, + ]); + }); + + it('duplicate field inside extension', () => { + expectSDLErrors(` + type SomeObject + extend type SomeObject { + foo: String + bar: String + foo: String + } + + interface SomeInterface + extend interface SomeInterface { + foo: String + bar: String + foo: String + } + + input SomeInputObject + extend input SomeInputObject { + foo: String + bar: String + foo: String + } + `).toDeepEqual([ + { + message: 'Field "SomeObject.foo" can only be defined once.', + locations: [ + { line: 4, column: 9 }, + { line: 6, column: 9 }, + ], + }, + { + message: 'Field "SomeInterface.foo" can only be defined once.', + locations: [ + { line: 11, column: 9 }, + { line: 13, column: 9 }, + ], + }, + { + message: 'Field "SomeInputObject.foo" can only be defined once.', + locations: [ + { line: 18, column: 9 }, + { line: 20, column: 9 }, + ], + }, + ]); + }); + + it('duplicate field inside different extensions', () => { + expectSDLErrors(` + type SomeObject + extend type SomeObject { + foo: String + } + extend type SomeObject { + foo: String + } + + interface SomeInterface + extend interface SomeInterface { + foo: String + } + extend interface SomeInterface { + foo: String + } + + input SomeInputObject + extend input SomeInputObject { + foo: String + } + extend input SomeInputObject { + foo: String + } + `).toDeepEqual([ + { + message: 'Field "SomeObject.foo" can only be defined once.', + locations: [ + { line: 4, column: 9 }, + { line: 7, column: 9 }, + ], + }, + { + message: 'Field "SomeInterface.foo" can only be defined once.', + locations: [ + { line: 12, column: 9 }, + { line: 15, column: 9 }, + ], + }, + { + message: 'Field "SomeInputObject.foo" can only be defined once.', + locations: [ + { line: 20, column: 9 }, + { line: 23, column: 9 }, + ], + }, + ]); + }); + + it('adding new field to the type inside existing schema', () => { + const schema = buildSchema(` + type SomeObject + interface SomeInterface + input SomeInputObject + `); + const sdl = ` + extend type SomeObject { + foo: String + } + + extend interface SomeInterface { + foo: String + } + + extend input SomeInputObject { + foo: String + } + `; + + expectValidSDL(sdl, schema); + }); + + it('adding conflicting fields to existing schema twice', () => { + const schema = buildSchema(` + type SomeObject { + foo: String + } + + interface SomeInterface { + foo: String + } + + input SomeInputObject { + foo: String + } + `); + const sdl = ` + extend type SomeObject { + foo: String + } + extend interface SomeInterface { + foo: String + } + extend input SomeInputObject { + foo: String + } + + extend type SomeObject { + foo: String + } + extend interface SomeInterface { + foo: String + } + extend input SomeInputObject { + foo: String + } + `; + + expectSDLErrors(sdl, schema).toDeepEqual([ + { + message: + 'Field "SomeObject.foo" already exists in the schema. It cannot also be defined in this type extension.', + locations: [{ line: 3, column: 9 }], + }, + { + message: + 'Field "SomeInterface.foo" already exists in the schema. It cannot also be defined in this type extension.', + locations: [{ line: 6, column: 9 }], + }, + { + message: + 'Field "SomeInputObject.foo" already exists in the schema. It cannot also be defined in this type extension.', + locations: [{ line: 9, column: 9 }], + }, + { + message: + 'Field "SomeObject.foo" already exists in the schema. It cannot also be defined in this type extension.', + locations: [{ line: 13, column: 9 }], + }, + { + message: + 'Field "SomeInterface.foo" already exists in the schema. It cannot also be defined in this type extension.', + locations: [{ line: 16, column: 9 }], + }, + { + message: + 'Field "SomeInputObject.foo" already exists in the schema. It cannot also be defined in this type extension.', + locations: [{ line: 19, column: 9 }], + }, + ]); + }); + + it('adding fields to existing schema twice', () => { + const schema = buildSchema(` + type SomeObject + interface SomeInterface + input SomeInputObject + `); + const sdl = ` + extend type SomeObject { + foo: String + } + extend type SomeObject { + foo: String + } + + extend interface SomeInterface { + foo: String + } + extend interface SomeInterface { + foo: String + } + + extend input SomeInputObject { + foo: String + } + extend input SomeInputObject { + foo: String + } + `; + + expectSDLErrors(sdl, schema).toDeepEqual([ + { + message: 'Field "SomeObject.foo" can only be defined once.', + locations: [ + { line: 3, column: 9 }, + { line: 6, column: 9 }, + ], + }, + { + message: 'Field "SomeInterface.foo" can only be defined once.', + locations: [ + { line: 10, column: 9 }, + { line: 13, column: 9 }, + ], + }, + { + message: 'Field "SomeInputObject.foo" can only be defined once.', + locations: [ + { line: 17, column: 9 }, + { line: 20, column: 9 }, + ], + }, + ]); + }); +}); diff --git a/src/validation/__tests__/UniqueFragmentNamesRule-test.ts b/src/validation/__tests__/UniqueFragmentNamesRule-test.ts new file mode 100644 index 00000000..2a693a67 --- /dev/null +++ b/src/validation/__tests__/UniqueFragmentNamesRule-test.ts @@ -0,0 +1,119 @@ +import { describe, it } from 'mocha'; + +import { UniqueFragmentNamesRule } from '../rules/UniqueFragmentNamesRule'; + +import { expectValidationErrors } from './harness'; + +function expectErrors(queryStr: string) { + return expectValidationErrors(UniqueFragmentNamesRule, queryStr); +} + +function expectValid(queryStr: string) { + expectErrors(queryStr).toDeepEqual([]); +} + +describe('Validate: Unique fragment names', () => { + it('no fragments', () => { + expectValid(` + { + field + } + `); + }); + + it('one fragment', () => { + expectValid(` + { + ...fragA + } + + fragment fragA on Type { + field + } + `); + }); + + it('many fragments', () => { + expectValid(` + { + ...fragA + ...fragB + ...fragC + } + fragment fragA on Type { + fieldA + } + fragment fragB on Type { + fieldB + } + fragment fragC on Type { + fieldC + } + `); + }); + + it('inline fragments are always unique', () => { + expectValid(` + { + ...on Type { + fieldA + } + ...on Type { + fieldB + } + } + `); + }); + + it('fragment and operation named the same', () => { + expectValid(` + query Foo { + ...Foo + } + fragment Foo on Type { + field + } + `); + }); + + it('fragments named the same', () => { + expectErrors(` + { + ...fragA + } + fragment fragA on Type { + fieldA + } + fragment fragA on Type { + fieldB + } + `).toDeepEqual([ + { + message: 'There can be only one fragment named "fragA".', + locations: [ + { line: 5, column: 16 }, + { line: 8, column: 16 }, + ], + }, + ]); + }); + + it('fragments named the same without being referenced', () => { + expectErrors(` + fragment fragA on Type { + fieldA + } + fragment fragA on Type { + fieldB + } + `).toDeepEqual([ + { + message: 'There can be only one fragment named "fragA".', + locations: [ + { line: 2, column: 16 }, + { line: 5, column: 16 }, + ], + }, + ]); + }); +}); diff --git a/src/validation/__tests__/UniqueInputFieldNamesRule-test.ts b/src/validation/__tests__/UniqueInputFieldNamesRule-test.ts new file mode 100644 index 00000000..33e4a2db --- /dev/null +++ b/src/validation/__tests__/UniqueInputFieldNamesRule-test.ts @@ -0,0 +1,110 @@ +import { describe, it } from 'mocha'; + +import { UniqueInputFieldNamesRule } from '../rules/UniqueInputFieldNamesRule'; + +import { expectValidationErrors } from './harness'; + +function expectErrors(queryStr: string) { + return expectValidationErrors(UniqueInputFieldNamesRule, queryStr); +} + +function expectValid(queryStr: string) { + expectErrors(queryStr).toDeepEqual([]); +} + +describe('Validate: Unique input field names', () => { + it('input object with fields', () => { + expectValid(` + { + field(arg: { f: true }) + } + `); + }); + + it('same input object within two args', () => { + expectValid(` + { + field(arg1: { f: true }, arg2: { f: true }) + } + `); + }); + + it('multiple input object fields', () => { + expectValid(` + { + field(arg: { f1: "value", f2: "value", f3: "value" }) + } + `); + }); + + it('allows for nested input objects with similar fields', () => { + expectValid(` + { + field(arg: { + deep: { + deep: { + id: 1 + } + id: 1 + } + id: 1 + }) + } + `); + }); + + it('duplicate input object fields', () => { + expectErrors(` + { + field(arg: { f1: "value", f1: "value" }) + } + `).toDeepEqual([ + { + message: 'There can be only one input field named "f1".', + locations: [ + { line: 3, column: 22 }, + { line: 3, column: 35 }, + ], + }, + ]); + }); + + it('many duplicate input object fields', () => { + expectErrors(` + { + field(arg: { f1: "value", f1: "value", f1: "value" }) + } + `).toDeepEqual([ + { + message: 'There can be only one input field named "f1".', + locations: [ + { line: 3, column: 22 }, + { line: 3, column: 35 }, + ], + }, + { + message: 'There can be only one input field named "f1".', + locations: [ + { line: 3, column: 22 }, + { line: 3, column: 48 }, + ], + }, + ]); + }); + + it('nested duplicate input object fields', () => { + expectErrors(` + { + field(arg: { f1: {f2: "value", f2: "value" }}) + } + `).toDeepEqual([ + { + message: 'There can be only one input field named "f2".', + locations: [ + { line: 3, column: 27 }, + { line: 3, column: 40 }, + ], + }, + ]); + }); +}); diff --git a/src/validation/__tests__/UniqueOperationNamesRule-test.ts b/src/validation/__tests__/UniqueOperationNamesRule-test.ts new file mode 100644 index 00000000..f84abda6 --- /dev/null +++ b/src/validation/__tests__/UniqueOperationNamesRule-test.ts @@ -0,0 +1,135 @@ +import { describe, it } from 'mocha'; + +import { UniqueOperationNamesRule } from '../rules/UniqueOperationNamesRule'; + +import { expectValidationErrors } from './harness'; + +function expectErrors(queryStr: string) { + return expectValidationErrors(UniqueOperationNamesRule, queryStr); +} + +function expectValid(queryStr: string) { + expectErrors(queryStr).toDeepEqual([]); +} + +describe('Validate: Unique operation names', () => { + it('no operations', () => { + expectValid(` + fragment fragA on Type { + field + } + `); + }); + + it('one anon operation', () => { + expectValid(` + { + field + } + `); + }); + + it('one named operation', () => { + expectValid(` + query Foo { + field + } + `); + }); + + it('multiple operations', () => { + expectValid(` + query Foo { + field + } + + query Bar { + field + } + `); + }); + + it('multiple operations of different types', () => { + expectValid(` + query Foo { + field + } + + mutation Bar { + field + } + + subscription Baz { + field + } + `); + }); + + it('fragment and operation named the same', () => { + expectValid(` + query Foo { + ...Foo + } + fragment Foo on Type { + field + } + `); + }); + + it('multiple operations of same name', () => { + expectErrors(` + query Foo { + fieldA + } + query Foo { + fieldB + } + `).toDeepEqual([ + { + message: 'There can be only one operation named "Foo".', + locations: [ + { line: 2, column: 13 }, + { line: 5, column: 13 }, + ], + }, + ]); + }); + + it('multiple ops of same name of different types (mutation)', () => { + expectErrors(` + query Foo { + fieldA + } + mutation Foo { + fieldB + } + `).toDeepEqual([ + { + message: 'There can be only one operation named "Foo".', + locations: [ + { line: 2, column: 13 }, + { line: 5, column: 16 }, + ], + }, + ]); + }); + + it('multiple ops of same name of different types (subscription)', () => { + expectErrors(` + query Foo { + fieldA + } + subscription Foo { + fieldB + } + `).toDeepEqual([ + { + message: 'There can be only one operation named "Foo".', + locations: [ + { line: 2, column: 13 }, + { line: 5, column: 20 }, + ], + }, + ]); + }); +}); diff --git a/src/validation/__tests__/UniqueOperationTypesRule-test.ts b/src/validation/__tests__/UniqueOperationTypesRule-test.ts new file mode 100644 index 00000000..61e819b0 --- /dev/null +++ b/src/validation/__tests__/UniqueOperationTypesRule-test.ts @@ -0,0 +1,384 @@ +import { describe, it } from 'mocha'; + +import type { GraphQLSchema } from '../../type/schema'; + +import { buildSchema } from '../../utilities/buildASTSchema'; + +import { UniqueOperationTypesRule } from '../rules/UniqueOperationTypesRule'; + +import { expectSDLValidationErrors } from './harness'; + +function expectSDLErrors(sdlStr: string, schema?: GraphQLSchema) { + return expectSDLValidationErrors(schema, UniqueOperationTypesRule, sdlStr); +} + +function expectValidSDL(sdlStr: string, schema?: GraphQLSchema) { + expectSDLErrors(sdlStr, schema).toDeepEqual([]); +} + +describe('Validate: Unique operation types', () => { + it('no schema definition', () => { + expectValidSDL(` + type Foo + `); + }); + + it('schema definition with all types', () => { + expectValidSDL(` + type Foo + + schema { + query: Foo + mutation: Foo + subscription: Foo + } + `); + }); + + it('schema definition with single extension', () => { + expectValidSDL(` + type Foo + + schema { query: Foo } + + extend schema { + mutation: Foo + subscription: Foo + } + `); + }); + + it('schema definition with separate extensions', () => { + expectValidSDL(` + type Foo + + schema { query: Foo } + extend schema { mutation: Foo } + extend schema { subscription: Foo } + `); + }); + + it('extend schema before definition', () => { + expectValidSDL(` + type Foo + + extend schema { mutation: Foo } + extend schema { subscription: Foo } + + schema { query: Foo } + `); + }); + + it('duplicate operation types inside single schema definition', () => { + expectSDLErrors(` + type Foo + + schema { + query: Foo + mutation: Foo + subscription: Foo + + query: Foo + mutation: Foo + subscription: Foo + } + `).toDeepEqual([ + { + message: 'There can be only one query type in schema.', + locations: [ + { line: 5, column: 9 }, + { line: 9, column: 9 }, + ], + }, + { + message: 'There can be only one mutation type in schema.', + locations: [ + { line: 6, column: 9 }, + { line: 10, column: 9 }, + ], + }, + { + message: 'There can be only one subscription type in schema.', + locations: [ + { line: 7, column: 9 }, + { line: 11, column: 9 }, + ], + }, + ]); + }); + + it('duplicate operation types inside schema extension', () => { + expectSDLErrors(` + type Foo + + schema { + query: Foo + mutation: Foo + subscription: Foo + } + + extend schema { + query: Foo + mutation: Foo + subscription: Foo + } + `).toDeepEqual([ + { + message: 'There can be only one query type in schema.', + locations: [ + { line: 5, column: 9 }, + { line: 11, column: 9 }, + ], + }, + { + message: 'There can be only one mutation type in schema.', + locations: [ + { line: 6, column: 9 }, + { line: 12, column: 9 }, + ], + }, + { + message: 'There can be only one subscription type in schema.', + locations: [ + { line: 7, column: 9 }, + { line: 13, column: 9 }, + ], + }, + ]); + }); + + it('duplicate operation types inside schema extension twice', () => { + expectSDLErrors(` + type Foo + + schema { + query: Foo + mutation: Foo + subscription: Foo + } + + extend schema { + query: Foo + mutation: Foo + subscription: Foo + } + + extend schema { + query: Foo + mutation: Foo + subscription: Foo + } + `).toDeepEqual([ + { + message: 'There can be only one query type in schema.', + locations: [ + { line: 5, column: 9 }, + { line: 11, column: 9 }, + ], + }, + { + message: 'There can be only one mutation type in schema.', + locations: [ + { line: 6, column: 9 }, + { line: 12, column: 9 }, + ], + }, + { + message: 'There can be only one subscription type in schema.', + locations: [ + { line: 7, column: 9 }, + { line: 13, column: 9 }, + ], + }, + { + message: 'There can be only one query type in schema.', + locations: [ + { line: 5, column: 9 }, + { line: 17, column: 9 }, + ], + }, + { + message: 'There can be only one mutation type in schema.', + locations: [ + { line: 6, column: 9 }, + { line: 18, column: 9 }, + ], + }, + { + message: 'There can be only one subscription type in schema.', + locations: [ + { line: 7, column: 9 }, + { line: 19, column: 9 }, + ], + }, + ]); + }); + + it('duplicate operation types inside second schema extension', () => { + expectSDLErrors(` + type Foo + + schema { + query: Foo + } + + extend schema { + mutation: Foo + subscription: Foo + } + + extend schema { + query: Foo + mutation: Foo + subscription: Foo + } + `).toDeepEqual([ + { + message: 'There can be only one query type in schema.', + locations: [ + { line: 5, column: 9 }, + { line: 14, column: 9 }, + ], + }, + { + message: 'There can be only one mutation type in schema.', + locations: [ + { line: 9, column: 9 }, + { line: 15, column: 9 }, + ], + }, + { + message: 'There can be only one subscription type in schema.', + locations: [ + { line: 10, column: 9 }, + { line: 16, column: 9 }, + ], + }, + ]); + }); + + it('define schema inside extension SDL', () => { + const schema = buildSchema('type Foo'); + const sdl = ` + schema { + query: Foo + mutation: Foo + subscription: Foo + } + `; + + expectValidSDL(sdl, schema); + }); + + it('define and extend schema inside extension SDL', () => { + const schema = buildSchema('type Foo'); + const sdl = ` + schema { query: Foo } + extend schema { mutation: Foo } + extend schema { subscription: Foo } + `; + + expectValidSDL(sdl, schema); + }); + + it('adding new operation types to existing schema', () => { + const schema = buildSchema('type Query'); + const sdl = ` + extend schema { mutation: Foo } + extend schema { subscription: Foo } + `; + + expectValidSDL(sdl, schema); + }); + + it('adding conflicting operation types to existing schema', () => { + const schema = buildSchema(` + type Query + type Mutation + type Subscription + + type Foo + `); + + const sdl = ` + extend schema { + query: Foo + mutation: Foo + subscription: Foo + } + `; + + expectSDLErrors(sdl, schema).toDeepEqual([ + { + message: + 'Type for query already defined in the schema. It cannot be redefined.', + locations: [{ line: 3, column: 9 }], + }, + { + message: + 'Type for mutation already defined in the schema. It cannot be redefined.', + locations: [{ line: 4, column: 9 }], + }, + { + message: + 'Type for subscription already defined in the schema. It cannot be redefined.', + locations: [{ line: 5, column: 9 }], + }, + ]); + }); + + it('adding conflicting operation types to existing schema twice', () => { + const schema = buildSchema(` + type Query + type Mutation + type Subscription + `); + + const sdl = ` + extend schema { + query: Foo + mutation: Foo + subscription: Foo + } + + extend schema { + query: Foo + mutation: Foo + subscription: Foo + } + `; + + expectSDLErrors(sdl, schema).toDeepEqual([ + { + message: + 'Type for query already defined in the schema. It cannot be redefined.', + locations: [{ line: 3, column: 9 }], + }, + { + message: + 'Type for mutation already defined in the schema. It cannot be redefined.', + locations: [{ line: 4, column: 9 }], + }, + { + message: + 'Type for subscription already defined in the schema. It cannot be redefined.', + locations: [{ line: 5, column: 9 }], + }, + { + message: + 'Type for query already defined in the schema. It cannot be redefined.', + locations: [{ line: 9, column: 9 }], + }, + { + message: + 'Type for mutation already defined in the schema. It cannot be redefined.', + locations: [{ line: 10, column: 9 }], + }, + { + message: + 'Type for subscription already defined in the schema. It cannot be redefined.', + locations: [{ line: 11, column: 9 }], + }, + ]); + }); +}); diff --git a/src/validation/__tests__/UniqueTypeNamesRule-test.ts b/src/validation/__tests__/UniqueTypeNamesRule-test.ts new file mode 100644 index 00000000..5478467d --- /dev/null +++ b/src/validation/__tests__/UniqueTypeNamesRule-test.ts @@ -0,0 +1,162 @@ +import { describe, it } from 'mocha'; + +import type { GraphQLSchema } from '../../type/schema'; + +import { buildSchema } from '../../utilities/buildASTSchema'; + +import { UniqueTypeNamesRule } from '../rules/UniqueTypeNamesRule'; + +import { expectSDLValidationErrors } from './harness'; + +function expectSDLErrors(sdlStr: string, schema?: GraphQLSchema) { + return expectSDLValidationErrors(schema, UniqueTypeNamesRule, sdlStr); +} + +function expectValidSDL(sdlStr: string, schema?: GraphQLSchema) { + expectSDLErrors(sdlStr, schema).toDeepEqual([]); +} + +describe('Validate: Unique type names', () => { + it('no types', () => { + expectValidSDL(` + directive @test on SCHEMA + `); + }); + + it('one type', () => { + expectValidSDL(` + type Foo + `); + }); + + it('many types', () => { + expectValidSDL(` + type Foo + type Bar + type Baz + `); + }); + + it('type and non-type definitions named the same', () => { + expectValidSDL(` + query Foo { __typename } + fragment Foo on Query { __typename } + directive @Foo on SCHEMA + + type Foo + `); + }); + + it('types named the same', () => { + expectSDLErrors(` + type Foo + + scalar Foo + type Foo + interface Foo + union Foo + enum Foo + input Foo + `).toDeepEqual([ + { + message: 'There can be only one type named "Foo".', + locations: [ + { line: 2, column: 12 }, + { line: 4, column: 14 }, + ], + }, + { + message: 'There can be only one type named "Foo".', + locations: [ + { line: 2, column: 12 }, + { line: 5, column: 12 }, + ], + }, + { + message: 'There can be only one type named "Foo".', + locations: [ + { line: 2, column: 12 }, + { line: 6, column: 17 }, + ], + }, + { + message: 'There can be only one type named "Foo".', + locations: [ + { line: 2, column: 12 }, + { line: 7, column: 13 }, + ], + }, + { + message: 'There can be only one type named "Foo".', + locations: [ + { line: 2, column: 12 }, + { line: 8, column: 12 }, + ], + }, + { + message: 'There can be only one type named "Foo".', + locations: [ + { line: 2, column: 12 }, + { line: 9, column: 13 }, + ], + }, + ]); + }); + + it('adding new type to existing schema', () => { + const schema = buildSchema('type Foo'); + + expectValidSDL('type Bar', schema); + }); + + it('adding new type to existing schema with same-named directive', () => { + const schema = buildSchema('directive @Foo on SCHEMA'); + + expectValidSDL('type Foo', schema); + }); + + it('adding conflicting types to existing schema', () => { + const schema = buildSchema('type Foo'); + const sdl = ` + scalar Foo + type Foo + interface Foo + union Foo + enum Foo + input Foo + `; + + expectSDLErrors(sdl, schema).toDeepEqual([ + { + message: + 'Type "Foo" already exists in the schema. It cannot also be defined in this type definition.', + locations: [{ line: 2, column: 14 }], + }, + { + message: + 'Type "Foo" already exists in the schema. It cannot also be defined in this type definition.', + locations: [{ line: 3, column: 12 }], + }, + { + message: + 'Type "Foo" already exists in the schema. It cannot also be defined in this type definition.', + locations: [{ line: 4, column: 17 }], + }, + { + message: + 'Type "Foo" already exists in the schema. It cannot also be defined in this type definition.', + locations: [{ line: 5, column: 13 }], + }, + { + message: + 'Type "Foo" already exists in the schema. It cannot also be defined in this type definition.', + locations: [{ line: 6, column: 12 }], + }, + { + message: + 'Type "Foo" already exists in the schema. It cannot also be defined in this type definition.', + locations: [{ line: 7, column: 13 }], + }, + ]); + }); +}); diff --git a/src/validation/__tests__/UniqueVariableNamesRule-test.ts b/src/validation/__tests__/UniqueVariableNamesRule-test.ts new file mode 100644 index 00000000..9d51b621 --- /dev/null +++ b/src/validation/__tests__/UniqueVariableNamesRule-test.ts @@ -0,0 +1,53 @@ +import { describe, it } from 'mocha'; + +import { UniqueVariableNamesRule } from '../rules/UniqueVariableNamesRule'; + +import { expectValidationErrors } from './harness'; + +function expectErrors(queryStr: string) { + return expectValidationErrors(UniqueVariableNamesRule, queryStr); +} + +function expectValid(queryStr: string) { + expectErrors(queryStr).toDeepEqual([]); +} + +describe('Validate: Unique variable names', () => { + it('unique variable names', () => { + expectValid(` + query A($x: Int, $y: String) { __typename } + query B($x: String, $y: Int) { __typename } + `); + }); + + it('duplicate variable names', () => { + expectErrors(` + query A($x: Int, $x: Int, $x: String) { __typename } + query B($x: String, $x: Int) { __typename } + query C($x: Int, $x: Int) { __typename } + `).toDeepEqual([ + { + message: 'There can be only one variable named "$x".', + locations: [ + { line: 2, column: 16 }, + { line: 2, column: 25 }, + { line: 2, column: 34 }, + ], + }, + { + message: 'There can be only one variable named "$x".', + locations: [ + { line: 3, column: 16 }, + { line: 3, column: 28 }, + ], + }, + { + message: 'There can be only one variable named "$x".', + locations: [ + { line: 4, column: 16 }, + { line: 4, column: 25 }, + ], + }, + ]); + }); +}); diff --git a/src/validation/__tests__/ValidationContext-test.ts b/src/validation/__tests__/ValidationContext-test.ts new file mode 100644 index 00000000..159aa305 --- /dev/null +++ b/src/validation/__tests__/ValidationContext-test.ts @@ -0,0 +1,40 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { identityFunc } from '../../jsutils/identityFunc'; + +import { parse } from '../../language/parser'; + +import { GraphQLSchema } from '../../type/schema'; + +import { TypeInfo } from '../../utilities/TypeInfo'; + +import { + ASTValidationContext, + SDLValidationContext, + ValidationContext, +} from '../ValidationContext'; + +describe('ValidationContext', () => { + it('can be Object.toStringified', () => { + const schema = new GraphQLSchema({}); + const typeInfo = new TypeInfo(schema); + const ast = parse('{ foo }'); + const onError = identityFunc; + + const astContext = new ASTValidationContext(ast, onError); + expect(Object.prototype.toString.call(astContext)).to.equal( + '[object ASTValidationContext]', + ); + + const sdlContext = new SDLValidationContext(ast, schema, onError); + expect(Object.prototype.toString.call(sdlContext)).to.equal( + '[object SDLValidationContext]', + ); + + const context = new ValidationContext(schema, ast, typeInfo, onError); + expect(Object.prototype.toString.call(context)).to.equal( + '[object ValidationContext]', + ); + }); +}); diff --git a/src/validation/__tests__/ValuesOfCorrectTypeRule-test.ts b/src/validation/__tests__/ValuesOfCorrectTypeRule-test.ts new file mode 100644 index 00000000..76b03035 --- /dev/null +++ b/src/validation/__tests__/ValuesOfCorrectTypeRule-test.ts @@ -0,0 +1,1201 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { expectJSON } from '../../__testUtils__/expectJSON'; + +import { inspect } from '../../jsutils/inspect'; + +import { parse } from '../../language/parser'; + +import { GraphQLObjectType, GraphQLScalarType } from '../../type/definition'; +import { GraphQLString } from '../../type/scalars'; +import { GraphQLSchema } from '../../type/schema'; + +import { ValuesOfCorrectTypeRule } from '../rules/ValuesOfCorrectTypeRule'; +import { validate } from '../validate'; + +import { + expectValidationErrors, + expectValidationErrorsWithSchema, +} from './harness'; + +function expectErrors(queryStr: string) { + return expectValidationErrors(ValuesOfCorrectTypeRule, queryStr); +} + +function expectErrorsWithSchema(schema: GraphQLSchema, queryStr: string) { + return expectValidationErrorsWithSchema( + schema, + ValuesOfCorrectTypeRule, + queryStr, + ); +} + +function expectValid(queryStr: string) { + expectErrors(queryStr).toDeepEqual([]); +} + +function expectValidWithSchema(schema: GraphQLSchema, queryStr: string) { + expectErrorsWithSchema(schema, queryStr).toDeepEqual([]); +} + +describe('Validate: Values of correct type', () => { + describe('Valid values', () => { + it('Good int value', () => { + expectValid(` + { + complicatedArgs { + intArgField(intArg: 2) + } + } + `); + }); + + it('Good negative int value', () => { + expectValid(` + { + complicatedArgs { + intArgField(intArg: -2) + } + } + `); + }); + + it('Good boolean value', () => { + expectValid(` + { + complicatedArgs { + booleanArgField(booleanArg: true) + } + } + `); + }); + + it('Good string value', () => { + expectValid(` + { + complicatedArgs { + stringArgField(stringArg: "foo") + } + } + `); + }); + + it('Good float value', () => { + expectValid(` + { + complicatedArgs { + floatArgField(floatArg: 1.1) + } + } + `); + }); + + it('Good negative float value', () => { + expectValid(` + { + complicatedArgs { + floatArgField(floatArg: -1.1) + } + } + `); + }); + + it('Int into Float', () => { + expectValid(` + { + complicatedArgs { + floatArgField(floatArg: 1) + } + } + `); + }); + + it('Int into ID', () => { + expectValid(` + { + complicatedArgs { + idArgField(idArg: 1) + } + } + `); + }); + + it('String into ID', () => { + expectValid(` + { + complicatedArgs { + idArgField(idArg: "someIdString") + } + } + `); + }); + + it('Good enum value', () => { + expectValid(` + { + dog { + doesKnowCommand(dogCommand: SIT) + } + } + `); + }); + + it('Enum with undefined value', () => { + expectValid(` + { + complicatedArgs { + enumArgField(enumArg: UNKNOWN) + } + } + `); + }); + + it('Enum with null value', () => { + expectValid(` + { + complicatedArgs { + enumArgField(enumArg: NO_FUR) + } + } + `); + }); + + it('null into nullable type', () => { + expectValid(` + { + complicatedArgs { + intArgField(intArg: null) + } + } + `); + + expectValid(` + { + dog(a: null, b: null, c:{ requiredField: true, intField: null }) { + name + } + } + `); + }); + }); + + describe('Invalid String values', () => { + it('Int into String', () => { + expectErrors(` + { + complicatedArgs { + stringArgField(stringArg: 1) + } + } + `).toDeepEqual([ + { + message: 'String cannot represent a non string value: 1', + locations: [{ line: 4, column: 39 }], + }, + ]); + }); + + it('Float into String', () => { + expectErrors(` + { + complicatedArgs { + stringArgField(stringArg: 1.0) + } + } + `).toDeepEqual([ + { + message: 'String cannot represent a non string value: 1.0', + locations: [{ line: 4, column: 39 }], + }, + ]); + }); + + it('Boolean into String', () => { + expectErrors(` + { + complicatedArgs { + stringArgField(stringArg: true) + } + } + `).toDeepEqual([ + { + message: 'String cannot represent a non string value: true', + locations: [{ line: 4, column: 39 }], + }, + ]); + }); + + it('Unquoted String into String', () => { + expectErrors(` + { + complicatedArgs { + stringArgField(stringArg: BAR) + } + } + `).toDeepEqual([ + { + message: 'String cannot represent a non string value: BAR', + locations: [{ line: 4, column: 39 }], + }, + ]); + }); + }); + + describe('Invalid Int values', () => { + it('String into Int', () => { + expectErrors(` + { + complicatedArgs { + intArgField(intArg: "3") + } + } + `).toDeepEqual([ + { + message: 'Int cannot represent non-integer value: "3"', + locations: [{ line: 4, column: 33 }], + }, + ]); + }); + + it('Big Int into Int', () => { + expectErrors(` + { + complicatedArgs { + intArgField(intArg: 829384293849283498239482938) + } + } + `).toDeepEqual([ + { + message: + 'Int cannot represent non 32-bit signed integer value: 829384293849283498239482938', + locations: [{ line: 4, column: 33 }], + }, + ]); + }); + + it('Unquoted String into Int', () => { + expectErrors(` + { + complicatedArgs { + intArgField(intArg: FOO) + } + } + `).toDeepEqual([ + { + message: 'Int cannot represent non-integer value: FOO', + locations: [{ line: 4, column: 33 }], + }, + ]); + }); + + it('Simple Float into Int', () => { + expectErrors(` + { + complicatedArgs { + intArgField(intArg: 3.0) + } + } + `).toDeepEqual([ + { + message: 'Int cannot represent non-integer value: 3.0', + locations: [{ line: 4, column: 33 }], + }, + ]); + }); + + it('Float into Int', () => { + expectErrors(` + { + complicatedArgs { + intArgField(intArg: 3.333) + } + } + `).toDeepEqual([ + { + message: 'Int cannot represent non-integer value: 3.333', + locations: [{ line: 4, column: 33 }], + }, + ]); + }); + }); + + describe('Invalid Float values', () => { + it('String into Float', () => { + expectErrors(` + { + complicatedArgs { + floatArgField(floatArg: "3.333") + } + } + `).toDeepEqual([ + { + message: 'Float cannot represent non numeric value: "3.333"', + locations: [{ line: 4, column: 37 }], + }, + ]); + }); + + it('Boolean into Float', () => { + expectErrors(` + { + complicatedArgs { + floatArgField(floatArg: true) + } + } + `).toDeepEqual([ + { + message: 'Float cannot represent non numeric value: true', + locations: [{ line: 4, column: 37 }], + }, + ]); + }); + + it('Unquoted into Float', () => { + expectErrors(` + { + complicatedArgs { + floatArgField(floatArg: FOO) + } + } + `).toDeepEqual([ + { + message: 'Float cannot represent non numeric value: FOO', + locations: [{ line: 4, column: 37 }], + }, + ]); + }); + }); + + describe('Invalid Boolean value', () => { + it('Int into Boolean', () => { + expectErrors(` + { + complicatedArgs { + booleanArgField(booleanArg: 2) + } + } + `).toDeepEqual([ + { + message: 'Boolean cannot represent a non boolean value: 2', + locations: [{ line: 4, column: 41 }], + }, + ]); + }); + + it('Float into Boolean', () => { + expectErrors(` + { + complicatedArgs { + booleanArgField(booleanArg: 1.0) + } + } + `).toDeepEqual([ + { + message: 'Boolean cannot represent a non boolean value: 1.0', + locations: [{ line: 4, column: 41 }], + }, + ]); + }); + + it('String into Boolean', () => { + expectErrors(` + { + complicatedArgs { + booleanArgField(booleanArg: "true") + } + } + `).toDeepEqual([ + { + message: 'Boolean cannot represent a non boolean value: "true"', + locations: [{ line: 4, column: 41 }], + }, + ]); + }); + + it('Unquoted into Boolean', () => { + expectErrors(` + { + complicatedArgs { + booleanArgField(booleanArg: TRUE) + } + } + `).toDeepEqual([ + { + message: 'Boolean cannot represent a non boolean value: TRUE', + locations: [{ line: 4, column: 41 }], + }, + ]); + }); + }); + + describe('Invalid ID value', () => { + it('Float into ID', () => { + expectErrors(` + { + complicatedArgs { + idArgField(idArg: 1.0) + } + } + `).toDeepEqual([ + { + message: + 'ID cannot represent a non-string and non-integer value: 1.0', + locations: [{ line: 4, column: 31 }], + }, + ]); + }); + + it('Boolean into ID', () => { + expectErrors(` + { + complicatedArgs { + idArgField(idArg: true) + } + } + `).toDeepEqual([ + { + message: + 'ID cannot represent a non-string and non-integer value: true', + locations: [{ line: 4, column: 31 }], + }, + ]); + }); + + it('Unquoted into ID', () => { + expectErrors(` + { + complicatedArgs { + idArgField(idArg: SOMETHING) + } + } + `).toDeepEqual([ + { + message: + 'ID cannot represent a non-string and non-integer value: SOMETHING', + locations: [{ line: 4, column: 31 }], + }, + ]); + }); + }); + + describe('Invalid Enum value', () => { + it('Int into Enum', () => { + expectErrors(` + { + dog { + doesKnowCommand(dogCommand: 2) + } + } + `).toDeepEqual([ + { + message: 'Enum "DogCommand" cannot represent non-enum value: 2.', + locations: [{ line: 4, column: 41 }], + }, + ]); + }); + + it('Float into Enum', () => { + expectErrors(` + { + dog { + doesKnowCommand(dogCommand: 1.0) + } + } + `).toDeepEqual([ + { + message: 'Enum "DogCommand" cannot represent non-enum value: 1.0.', + locations: [{ line: 4, column: 41 }], + }, + ]); + }); + + it('String into Enum', () => { + expectErrors(` + { + dog { + doesKnowCommand(dogCommand: "SIT") + } + } + `).toDeepEqual([ + { + message: + 'Enum "DogCommand" cannot represent non-enum value: "SIT". Did you mean the enum value "SIT"?', + locations: [{ line: 4, column: 41 }], + }, + ]); + }); + + it('Boolean into Enum', () => { + expectErrors(` + { + dog { + doesKnowCommand(dogCommand: true) + } + } + `).toDeepEqual([ + { + message: 'Enum "DogCommand" cannot represent non-enum value: true.', + locations: [{ line: 4, column: 41 }], + }, + ]); + }); + + it('Unknown Enum Value into Enum', () => { + expectErrors(` + { + dog { + doesKnowCommand(dogCommand: JUGGLE) + } + } + `).toDeepEqual([ + { + message: 'Value "JUGGLE" does not exist in "DogCommand" enum.', + locations: [{ line: 4, column: 41 }], + }, + ]); + }); + + it('Different case Enum Value into Enum', () => { + expectErrors(` + { + dog { + doesKnowCommand(dogCommand: sit) + } + } + `).toDeepEqual([ + { + message: + 'Value "sit" does not exist in "DogCommand" enum. Did you mean the enum value "SIT"?', + locations: [{ line: 4, column: 41 }], + }, + ]); + }); + }); + + describe('Valid List value', () => { + it('Good list value', () => { + expectValid(` + { + complicatedArgs { + stringListArgField(stringListArg: ["one", null, "two"]) + } + } + `); + }); + + it('Empty list value', () => { + expectValid(` + { + complicatedArgs { + stringListArgField(stringListArg: []) + } + } + `); + }); + + it('Null value', () => { + expectValid(` + { + complicatedArgs { + stringListArgField(stringListArg: null) + } + } + `); + }); + + it('Single value into List', () => { + expectValid(` + { + complicatedArgs { + stringListArgField(stringListArg: "one") + } + } + `); + }); + }); + + describe('Invalid List value', () => { + it('Incorrect item type', () => { + expectErrors(` + { + complicatedArgs { + stringListArgField(stringListArg: ["one", 2]) + } + } + `).toDeepEqual([ + { + message: 'String cannot represent a non string value: 2', + locations: [{ line: 4, column: 55 }], + }, + ]); + }); + + it('Single value of incorrect type', () => { + expectErrors(` + { + complicatedArgs { + stringListArgField(stringListArg: 1) + } + } + `).toDeepEqual([ + { + message: 'String cannot represent a non string value: 1', + locations: [{ line: 4, column: 47 }], + }, + ]); + }); + }); + + describe('Valid non-nullable value', () => { + it('Arg on optional arg', () => { + expectValid(` + { + dog { + isHouseTrained(atOtherHomes: true) + } + } + `); + }); + + it('No Arg on optional arg', () => { + expectValid(` + { + dog { + isHouseTrained + } + } + `); + }); + + it('Multiple args', () => { + expectValid(` + { + complicatedArgs { + multipleReqs(req1: 1, req2: 2) + } + } + `); + }); + + it('Multiple args reverse order', () => { + expectValid(` + { + complicatedArgs { + multipleReqs(req2: 2, req1: 1) + } + } + `); + }); + + it('No args on multiple optional', () => { + expectValid(` + { + complicatedArgs { + multipleOpts + } + } + `); + }); + + it('One arg on multiple optional', () => { + expectValid(` + { + complicatedArgs { + multipleOpts(opt1: 1) + } + } + `); + }); + + it('Second arg on multiple optional', () => { + expectValid(` + { + complicatedArgs { + multipleOpts(opt2: 1) + } + } + `); + }); + + it('Multiple required args on mixedList', () => { + expectValid(` + { + complicatedArgs { + multipleOptAndReq(req1: 3, req2: 4) + } + } + `); + }); + + it('Multiple required and one optional arg on mixedList', () => { + expectValid(` + { + complicatedArgs { + multipleOptAndReq(req1: 3, req2: 4, opt1: 5) + } + } + `); + }); + + it('All required and optional args on mixedList', () => { + expectValid(` + { + complicatedArgs { + multipleOptAndReq(req1: 3, req2: 4, opt1: 5, opt2: 6) + } + } + `); + }); + }); + + describe('Invalid non-nullable value', () => { + it('Incorrect value type', () => { + expectErrors(` + { + complicatedArgs { + multipleReqs(req2: "two", req1: "one") + } + } + `).toDeepEqual([ + { + message: 'Int cannot represent non-integer value: "two"', + locations: [{ line: 4, column: 32 }], + }, + { + message: 'Int cannot represent non-integer value: "one"', + locations: [{ line: 4, column: 45 }], + }, + ]); + }); + + it('Incorrect value and missing argument (ProvidedRequiredArgumentsRule)', () => { + expectErrors(` + { + complicatedArgs { + multipleReqs(req1: "one") + } + } + `).toDeepEqual([ + { + message: 'Int cannot represent non-integer value: "one"', + locations: [{ line: 4, column: 32 }], + }, + ]); + }); + + it('Null value', () => { + expectErrors(` + { + complicatedArgs { + multipleReqs(req1: null) + } + } + `).toDeepEqual([ + { + message: 'Expected value of type "Int!", found null.', + locations: [{ line: 4, column: 32 }], + }, + ]); + }); + }); + + describe('Valid input object value', () => { + it('Optional arg, despite required field in type', () => { + expectValid(` + { + complicatedArgs { + complexArgField + } + } + `); + }); + + it('Partial object, only required', () => { + expectValid(` + { + complicatedArgs { + complexArgField(complexArg: { requiredField: true }) + } + } + `); + }); + + it('Partial object, required field can be falsy', () => { + expectValid(` + { + complicatedArgs { + complexArgField(complexArg: { requiredField: false }) + } + } + `); + }); + + it('Partial object, including required', () => { + expectValid(` + { + complicatedArgs { + complexArgField(complexArg: { requiredField: true, intField: 4 }) + } + } + `); + }); + + it('Full object', () => { + expectValid(` + { + complicatedArgs { + complexArgField(complexArg: { + requiredField: true, + intField: 4, + stringField: "foo", + booleanField: false, + stringListField: ["one", "two"] + }) + } + } + `); + }); + + it('Full object with fields in different order', () => { + expectValid(` + { + complicatedArgs { + complexArgField(complexArg: { + stringListField: ["one", "two"], + booleanField: false, + requiredField: true, + stringField: "foo", + intField: 4, + }) + } + } + `); + }); + }); + + describe('Invalid input object value', () => { + it('Partial object, missing required', () => { + expectErrors(` + { + complicatedArgs { + complexArgField(complexArg: { intField: 4 }) + } + } + `).toDeepEqual([ + { + message: + 'Field "ComplexInput.requiredField" of required type "Boolean!" was not provided.', + locations: [{ line: 4, column: 41 }], + }, + ]); + }); + + it('Partial object, invalid field type', () => { + expectErrors(` + { + complicatedArgs { + complexArgField(complexArg: { + stringListField: ["one", 2], + requiredField: true, + }) + } + } + `).toDeepEqual([ + { + message: 'String cannot represent a non string value: 2', + locations: [{ line: 5, column: 40 }], + }, + ]); + }); + + it('Partial object, null to non-null field', () => { + expectErrors(` + { + complicatedArgs { + complexArgField(complexArg: { + requiredField: true, + nonNullField: null, + }) + } + } + `).toDeepEqual([ + { + message: 'Expected value of type "Boolean!", found null.', + locations: [{ line: 6, column: 29 }], + }, + ]); + }); + + it('Partial object, unknown field arg', () => { + expectErrors(` + { + complicatedArgs { + complexArgField(complexArg: { + requiredField: true, + invalidField: "value" + }) + } + } + `).toDeepEqual([ + { + message: + 'Field "invalidField" is not defined by type "ComplexInput". Did you mean "intField"?', + locations: [{ line: 6, column: 15 }], + }, + ]); + }); + + it('reports original error for custom scalar which throws', () => { + const customScalar = new GraphQLScalarType({ + name: 'Invalid', + parseValue(value) { + throw new Error( + `Invalid scalar is always invalid: ${inspect(value)}`, + ); + }, + }); + + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Query', + fields: { + invalidArg: { + type: GraphQLString, + args: { arg: { type: customScalar } }, + }, + }, + }), + }); + + const doc = parse('{ invalidArg(arg: 123) }'); + const errors = validate(schema, doc, [ValuesOfCorrectTypeRule]); + + expectJSON(errors).toDeepEqual([ + { + message: + 'Expected value of type "Invalid", found 123; Invalid scalar is always invalid: 123', + locations: [{ line: 1, column: 19 }], + }, + ]); + + expect(errors[0]).to.have.nested.property( + 'originalError.message', + 'Invalid scalar is always invalid: 123', + ); + }); + + it('reports error for custom scalar that returns undefined', () => { + const customScalar = new GraphQLScalarType({ + name: 'CustomScalar', + parseValue() { + return undefined; + }, + }); + + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Query', + fields: { + invalidArg: { + type: GraphQLString, + args: { arg: { type: customScalar } }, + }, + }, + }), + }); + + expectErrorsWithSchema(schema, '{ invalidArg(arg: 123) }').toDeepEqual([ + { + message: 'Expected value of type "CustomScalar", found 123.', + locations: [{ line: 1, column: 19 }], + }, + ]); + }); + + it('allows custom scalar to accept complex literals', () => { + const customScalar = new GraphQLScalarType({ name: 'Any' }); + const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Query', + fields: { + anyArg: { + type: GraphQLString, + args: { arg: { type: customScalar } }, + }, + }, + }), + }); + + expectValidWithSchema( + schema, + ` + { + test1: anyArg(arg: 123) + test2: anyArg(arg: "abc") + test3: anyArg(arg: [123, "abc"]) + test4: anyArg(arg: {deep: [123, "abc"]}) + } + `, + ); + }); + }); + + describe('Directive arguments', () => { + it('with directives of valid types', () => { + expectValid(` + { + dog @include(if: true) { + name + } + human @skip(if: false) { + name + } + } + `); + }); + + it('with directive with incorrect types', () => { + expectErrors(` + { + dog @include(if: "yes") { + name @skip(if: ENUM) + } + } + `).toDeepEqual([ + { + message: 'Boolean cannot represent a non boolean value: "yes"', + locations: [{ line: 3, column: 28 }], + }, + { + message: 'Boolean cannot represent a non boolean value: ENUM', + locations: [{ line: 4, column: 28 }], + }, + ]); + }); + }); + + describe('Variable default values', () => { + it('variables with valid default values', () => { + expectValid(` + query WithDefaultValues( + $a: Int = 1, + $b: String = "ok", + $c: ComplexInput = { requiredField: true, intField: 3 } + $d: Int! = 123 + ) { + dog { name } + } + `); + }); + + it('variables with valid default null values', () => { + expectValid(` + query WithDefaultValues( + $a: Int = null, + $b: String = null, + $c: ComplexInput = { requiredField: true, intField: null } + ) { + dog { name } + } + `); + }); + + it('variables with invalid default null values', () => { + expectErrors(` + query WithDefaultValues( + $a: Int! = null, + $b: String! = null, + $c: ComplexInput = { requiredField: null, intField: null } + ) { + dog { name } + } + `).toDeepEqual([ + { + message: 'Expected value of type "Int!", found null.', + locations: [{ line: 3, column: 22 }], + }, + { + message: 'Expected value of type "String!", found null.', + locations: [{ line: 4, column: 25 }], + }, + { + message: 'Expected value of type "Boolean!", found null.', + locations: [{ line: 5, column: 47 }], + }, + ]); + }); + + it('variables with invalid default values', () => { + expectErrors(` + query InvalidDefaultValues( + $a: Int = "one", + $b: String = 4, + $c: ComplexInput = "NotVeryComplex" + ) { + dog { name } + } + `).toDeepEqual([ + { + message: 'Int cannot represent non-integer value: "one"', + locations: [{ line: 3, column: 21 }], + }, + { + message: 'String cannot represent a non string value: 4', + locations: [{ line: 4, column: 24 }], + }, + { + message: + 'Expected value of type "ComplexInput", found "NotVeryComplex".', + locations: [{ line: 5, column: 30 }], + }, + ]); + }); + + it('variables with complex invalid default values', () => { + expectErrors(` + query WithDefaultValues( + $a: ComplexInput = { requiredField: 123, intField: "abc" } + ) { + dog { name } + } + `).toDeepEqual([ + { + message: 'Boolean cannot represent a non boolean value: 123', + locations: [{ line: 3, column: 47 }], + }, + { + message: 'Int cannot represent non-integer value: "abc"', + locations: [{ line: 3, column: 62 }], + }, + ]); + }); + + it('complex variables missing required field', () => { + expectErrors(` + query MissingRequiredField($a: ComplexInput = {intField: 3}) { + dog { name } + } + `).toDeepEqual([ + { + message: + 'Field "ComplexInput.requiredField" of required type "Boolean!" was not provided.', + locations: [{ line: 2, column: 55 }], + }, + ]); + }); + + it('list variables with invalid item', () => { + expectErrors(` + query InvalidItem($a: [String] = ["one", 2]) { + dog { name } + } + `).toDeepEqual([ + { + message: 'String cannot represent a non string value: 2', + locations: [{ line: 2, column: 50 }], + }, + ]); + }); + }); +}); diff --git a/src/validation/__tests__/VariablesAreInputTypesRule-test.ts b/src/validation/__tests__/VariablesAreInputTypesRule-test.ts new file mode 100644 index 00000000..7b754fd7 --- /dev/null +++ b/src/validation/__tests__/VariablesAreInputTypesRule-test.ts @@ -0,0 +1,52 @@ +import { describe, it } from 'mocha'; + +import { VariablesAreInputTypesRule } from '../rules/VariablesAreInputTypesRule'; + +import { expectValidationErrors } from './harness'; + +function expectErrors(queryStr: string) { + return expectValidationErrors(VariablesAreInputTypesRule, queryStr); +} + +function expectValid(queryStr: string) { + expectErrors(queryStr).toDeepEqual([]); +} + +describe('Validate: Variables are input types', () => { + it('unknown types are ignored', () => { + expectValid(` + query Foo($a: Unknown, $b: [[Unknown!]]!) { + field(a: $a, b: $b) + } + `); + }); + + it('input types are valid', () => { + expectValid(` + query Foo($a: String, $b: [Boolean!]!, $c: ComplexInput) { + field(a: $a, b: $b, c: $c) + } + `); + }); + + it('output types are invalid', () => { + expectErrors(` + query Foo($a: Dog, $b: [[CatOrDog!]]!, $c: Pet) { + field(a: $a, b: $b, c: $c) + } + `).toDeepEqual([ + { + locations: [{ line: 2, column: 21 }], + message: 'Variable "$a" cannot be non-input type "Dog".', + }, + { + locations: [{ line: 2, column: 30 }], + message: 'Variable "$b" cannot be non-input type "[[CatOrDog!]]!".', + }, + { + locations: [{ line: 2, column: 50 }], + message: 'Variable "$c" cannot be non-input type "Pet".', + }, + ]); + }); +}); diff --git a/src/validation/__tests__/VariablesInAllowedPositionRule-test.ts b/src/validation/__tests__/VariablesInAllowedPositionRule-test.ts new file mode 100644 index 00000000..090f1680 --- /dev/null +++ b/src/validation/__tests__/VariablesInAllowedPositionRule-test.ts @@ -0,0 +1,360 @@ +import { describe, it } from 'mocha'; + +import { VariablesInAllowedPositionRule } from '../rules/VariablesInAllowedPositionRule'; + +import { expectValidationErrors } from './harness'; + +function expectErrors(queryStr: string) { + return expectValidationErrors(VariablesInAllowedPositionRule, queryStr); +} + +function expectValid(queryStr: string) { + expectErrors(queryStr).toDeepEqual([]); +} + +describe('Validate: Variables are in allowed positions', () => { + it('Boolean => Boolean', () => { + expectValid(` + query Query($booleanArg: Boolean) + { + complicatedArgs { + booleanArgField(booleanArg: $booleanArg) + } + } + `); + }); + + it('Boolean => Boolean within fragment', () => { + expectValid(` + fragment booleanArgFrag on ComplicatedArgs { + booleanArgField(booleanArg: $booleanArg) + } + query Query($booleanArg: Boolean) + { + complicatedArgs { + ...booleanArgFrag + } + } + `); + + expectValid(` + query Query($booleanArg: Boolean) + { + complicatedArgs { + ...booleanArgFrag + } + } + fragment booleanArgFrag on ComplicatedArgs { + booleanArgField(booleanArg: $booleanArg) + } + `); + }); + + it('Boolean! => Boolean', () => { + expectValid(` + query Query($nonNullBooleanArg: Boolean!) + { + complicatedArgs { + booleanArgField(booleanArg: $nonNullBooleanArg) + } + } + `); + }); + + it('Boolean! => Boolean within fragment', () => { + expectValid(` + fragment booleanArgFrag on ComplicatedArgs { + booleanArgField(booleanArg: $nonNullBooleanArg) + } + + query Query($nonNullBooleanArg: Boolean!) + { + complicatedArgs { + ...booleanArgFrag + } + } + `); + }); + + it('[String] => [String]', () => { + expectValid(` + query Query($stringListVar: [String]) + { + complicatedArgs { + stringListArgField(stringListArg: $stringListVar) + } + } + `); + }); + + it('[String!] => [String]', () => { + expectValid(` + query Query($stringListVar: [String!]) + { + complicatedArgs { + stringListArgField(stringListArg: $stringListVar) + } + } + `); + }); + + it('String => [String] in item position', () => { + expectValid(` + query Query($stringVar: String) + { + complicatedArgs { + stringListArgField(stringListArg: [$stringVar]) + } + } + `); + }); + + it('String! => [String] in item position', () => { + expectValid(` + query Query($stringVar: String!) + { + complicatedArgs { + stringListArgField(stringListArg: [$stringVar]) + } + } + `); + }); + + it('ComplexInput => ComplexInput', () => { + expectValid(` + query Query($complexVar: ComplexInput) + { + complicatedArgs { + complexArgField(complexArg: $complexVar) + } + } + `); + }); + + it('ComplexInput => ComplexInput in field position', () => { + expectValid(` + query Query($boolVar: Boolean = false) + { + complicatedArgs { + complexArgField(complexArg: {requiredArg: $boolVar}) + } + } + `); + }); + + it('Boolean! => Boolean! in directive', () => { + expectValid(` + query Query($boolVar: Boolean!) + { + dog @include(if: $boolVar) + } + `); + }); + + it('Int => Int!', () => { + expectErrors(` + query Query($intArg: Int) { + complicatedArgs { + nonNullIntArgField(nonNullIntArg: $intArg) + } + } + `).toDeepEqual([ + { + message: + 'Variable "$intArg" of type "Int" used in position expecting type "Int!".', + locations: [ + { line: 2, column: 19 }, + { line: 4, column: 45 }, + ], + }, + ]); + }); + + it('Int => Int! within fragment', () => { + expectErrors(` + fragment nonNullIntArgFieldFrag on ComplicatedArgs { + nonNullIntArgField(nonNullIntArg: $intArg) + } + + query Query($intArg: Int) { + complicatedArgs { + ...nonNullIntArgFieldFrag + } + } + `).toDeepEqual([ + { + message: + 'Variable "$intArg" of type "Int" used in position expecting type "Int!".', + locations: [ + { line: 6, column: 19 }, + { line: 3, column: 43 }, + ], + }, + ]); + }); + + it('Int => Int! within nested fragment', () => { + expectErrors(` + fragment outerFrag on ComplicatedArgs { + ...nonNullIntArgFieldFrag + } + + fragment nonNullIntArgFieldFrag on ComplicatedArgs { + nonNullIntArgField(nonNullIntArg: $intArg) + } + + query Query($intArg: Int) { + complicatedArgs { + ...outerFrag + } + } + `).toDeepEqual([ + { + message: + 'Variable "$intArg" of type "Int" used in position expecting type "Int!".', + locations: [ + { line: 10, column: 19 }, + { line: 7, column: 43 }, + ], + }, + ]); + }); + + it('String over Boolean', () => { + expectErrors(` + query Query($stringVar: String) { + complicatedArgs { + booleanArgField(booleanArg: $stringVar) + } + } + `).toDeepEqual([ + { + message: + 'Variable "$stringVar" of type "String" used in position expecting type "Boolean".', + locations: [ + { line: 2, column: 19 }, + { line: 4, column: 39 }, + ], + }, + ]); + }); + + it('String => [String]', () => { + expectErrors(` + query Query($stringVar: String) { + complicatedArgs { + stringListArgField(stringListArg: $stringVar) + } + } + `).toDeepEqual([ + { + message: + 'Variable "$stringVar" of type "String" used in position expecting type "[String]".', + locations: [ + { line: 2, column: 19 }, + { line: 4, column: 45 }, + ], + }, + ]); + }); + + it('Boolean => Boolean! in directive', () => { + expectErrors(` + query Query($boolVar: Boolean) { + dog @include(if: $boolVar) + } + `).toDeepEqual([ + { + message: + 'Variable "$boolVar" of type "Boolean" used in position expecting type "Boolean!".', + locations: [ + { line: 2, column: 19 }, + { line: 3, column: 26 }, + ], + }, + ]); + }); + + it('String => Boolean! in directive', () => { + expectErrors(` + query Query($stringVar: String) { + dog @include(if: $stringVar) + } + `).toDeepEqual([ + { + message: + 'Variable "$stringVar" of type "String" used in position expecting type "Boolean!".', + locations: [ + { line: 2, column: 19 }, + { line: 3, column: 26 }, + ], + }, + ]); + }); + + it('[String] => [String!]', () => { + expectErrors(` + query Query($stringListVar: [String]) + { + complicatedArgs { + stringListNonNullArgField(stringListNonNullArg: $stringListVar) + } + } + `).toDeepEqual([ + { + message: + 'Variable "$stringListVar" of type "[String]" used in position expecting type "[String!]".', + locations: [ + { line: 2, column: 19 }, + { line: 5, column: 59 }, + ], + }, + ]); + }); + + describe('Allows optional (nullable) variables with default values', () => { + it('Int => Int! fails when variable provides null default value', () => { + expectErrors(` + query Query($intVar: Int = null) { + complicatedArgs { + nonNullIntArgField(nonNullIntArg: $intVar) + } + } + `).toDeepEqual([ + { + message: + 'Variable "$intVar" of type "Int" used in position expecting type "Int!".', + locations: [ + { line: 2, column: 21 }, + { line: 4, column: 47 }, + ], + }, + ]); + }); + + it('Int => Int! when variable provides non-null default value', () => { + expectValid(` + query Query($intVar: Int = 1) { + complicatedArgs { + nonNullIntArgField(nonNullIntArg: $intVar) + } + }`); + }); + + it('Int => Int! when optional argument provides default value', () => { + expectValid(` + query Query($intVar: Int) { + complicatedArgs { + nonNullFieldWithDefault(nonNullIntArg: $intVar) + } + }`); + }); + + it('Boolean => Boolean! in directive with default value with option', () => { + expectValid(` + query Query($boolVar: Boolean = false) { + dog @include(if: $boolVar) + }`); + }); + }); +}); diff --git a/src/validation/__tests__/harness.ts b/src/validation/__tests__/harness.ts new file mode 100644 index 00000000..661256c5 --- /dev/null +++ b/src/validation/__tests__/harness.ts @@ -0,0 +1,143 @@ +import { expectJSON } from '../../__testUtils__/expectJSON'; + +import type { Maybe } from '../../jsutils/Maybe'; + +import { parse } from '../../language/parser'; + +import type { GraphQLSchema } from '../../type/schema'; + +import { buildSchema } from '../../utilities/buildASTSchema'; + +import { validate, validateSDL } from '../validate'; +import type { SDLValidationRule, ValidationRule } from '../ValidationContext'; + +export const testSchema: GraphQLSchema = buildSchema(` + interface Mammal { + mother: Mammal + father: Mammal + } + + interface Pet { + name(surname: Boolean): String + } + + interface Canine implements Mammal { + name(surname: Boolean): String + mother: Canine + father: Canine + } + + enum DogCommand { + SIT + HEEL + DOWN + } + + type Dog implements Pet & Mammal & Canine { + name(surname: Boolean): String + nickname: String + barkVolume: Int + barks: Boolean + doesKnowCommand(dogCommand: DogCommand): Boolean + isHouseTrained(atOtherHomes: Boolean = true): Boolean + isAtLocation(x: Int, y: Int): Boolean + mother: Dog + father: Dog + } + + type Cat implements Pet { + name(surname: Boolean): String + nickname: String + meows: Boolean + meowsVolume: Int + furColor: FurColor + } + + union CatOrDog = Cat | Dog + + type Human { + name(surname: Boolean): String + pets: [Pet] + relatives: [Human] + } + + enum FurColor { + BROWN + BLACK + TAN + SPOTTED + NO_FUR + UNKNOWN + } + + input ComplexInput { + requiredField: Boolean! + nonNullField: Boolean! = false + intField: Int + stringField: String + booleanField: Boolean + stringListField: [String] + } + + type ComplicatedArgs { + # TODO List + # TODO Coercion + # TODO NotNulls + intArgField(intArg: Int): String + nonNullIntArgField(nonNullIntArg: Int!): String + stringArgField(stringArg: String): String + booleanArgField(booleanArg: Boolean): String + enumArgField(enumArg: FurColor): String + floatArgField(floatArg: Float): String + idArgField(idArg: ID): String + stringListArgField(stringListArg: [String]): String + stringListNonNullArgField(stringListNonNullArg: [String!]): String + complexArgField(complexArg: ComplexInput): String + multipleReqs(req1: Int!, req2: Int!): String + nonNullFieldWithDefault(arg: Int! = 0): String + multipleOpts(opt1: Int = 0, opt2: Int = 0): String + multipleOptAndReq(req1: Int!, req2: Int!, opt1: Int = 0, opt2: Int = 0): String + } + + type QueryRoot { + human(id: ID): Human + dog: Dog + cat: Cat + pet: Pet + catOrDog: CatOrDog + complicatedArgs: ComplicatedArgs + } + + schema { + query: QueryRoot + } + + directive @onField on FIELD +`); + +export function expectValidationErrorsWithSchema( + schema: GraphQLSchema, + rule: ValidationRule, + queryStr: string, +): any { + const doc = parse(queryStr); + const errors = validate(schema, doc, [rule]); + return expectJSON(errors); +} + +export function expectValidationErrors( + rule: ValidationRule, + queryStr: string, +): any { + return expectValidationErrorsWithSchema(testSchema, rule, queryStr); +} + +export function expectSDLValidationErrors( + schema: Maybe, + rule: SDLValidationRule, + sdlStr: string, +): any { + const doc = parse(sdlStr); + const errors = validateSDL(doc, schema, [rule]); + return expectJSON(errors); +} diff --git a/src/validation/__tests__/validation-test.ts b/src/validation/__tests__/validation-test.ts new file mode 100644 index 00000000..e5b13183 --- /dev/null +++ b/src/validation/__tests__/validation-test.ts @@ -0,0 +1,181 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import { expectJSON } from '../../__testUtils__/expectJSON'; + +import { GraphQLError } from '../../error/GraphQLError'; + +import type { DirectiveNode } from '../../language/ast'; +import { parse } from '../../language/parser'; + +import { buildSchema } from '../../utilities/buildASTSchema'; +import { TypeInfo } from '../../utilities/TypeInfo'; + +import { validate } from '../validate'; +import type { ValidationContext } from '../ValidationContext'; + +import { testSchema } from './harness'; + +describe('Validate: Supports full validation', () => { + it('rejects invalid documents', () => { + // @ts-expect-error (expects a DocumentNode as a second parameter) + expect(() => validate(testSchema, null)).to.throw('Must provide document.'); + }); + + it('validates queries', () => { + const doc = parse(` + query { + human { + pets { + ... on Cat { + meowsVolume + } + ... on Dog { + barkVolume + } + } + } + } + `); + + const errors = validate(testSchema, doc); + expectJSON(errors).toDeepEqual([]); + }); + + it('detects unknown fields', () => { + const doc = parse(` + { + unknown + } + `); + + const errors = validate(testSchema, doc); + expectJSON(errors).toDeepEqual([ + { + locations: [{ line: 3, column: 9 }], + message: 'Cannot query field "unknown" on type "QueryRoot".', + }, + ]); + }); + + it('Deprecated: validates using a custom TypeInfo', () => { + // This TypeInfo will never return a valid field. + const typeInfo = new TypeInfo(testSchema, null, () => null); + + const doc = parse(` + query { + human { + pets { + ... on Cat { + meowsVolume + } + ... on Dog { + barkVolume + } + } + } + } + `); + + const errors = validate(testSchema, doc, undefined, undefined, typeInfo); + const errorMessages = errors.map((error) => error.message); + + expect(errorMessages).to.deep.equal([ + 'Cannot query field "human" on type "QueryRoot". Did you mean "human"?', + 'Cannot query field "meowsVolume" on type "Cat". Did you mean "meowsVolume"?', + 'Cannot query field "barkVolume" on type "Dog". Did you mean "barkVolume"?', + ]); + }); + + it('validates using a custom rule', () => { + const schema = buildSchema(` + directive @custom(arg: String) on FIELD + + type Query { + foo: String + } + `); + + const doc = parse(` + query { + name @custom + } + `); + + function customRule(context: ValidationContext) { + return { + Directive(node: DirectiveNode) { + const directiveDef = context.getDirective(); + const error = new GraphQLError( + 'Reporting directive: ' + String(directiveDef), + node, + ); + context.reportError(error); + }, + }; + } + + const errors = validate(schema, doc, [customRule]); + expectJSON(errors).toDeepEqual([ + { + message: 'Reporting directive: @custom', + locations: [{ line: 3, column: 14 }], + }, + ]); + }); +}); + +describe('Validate: Limit maximum number of validation errors', () => { + const query = ` + { + firstUnknownField + secondUnknownField + thirdUnknownField + } + `; + const doc = parse(query, { noLocation: true }); + + function validateDocument(options: { maxErrors?: number }) { + return validate(testSchema, doc, undefined, options); + } + + function invalidFieldError(fieldName: string) { + return { + message: `Cannot query field "${fieldName}" on type "QueryRoot".`, + }; + } + + it('when maxErrors is equal to number of errors', () => { + const errors = validateDocument({ maxErrors: 3 }); + expectJSON(errors).toDeepEqual([ + invalidFieldError('firstUnknownField'), + invalidFieldError('secondUnknownField'), + invalidFieldError('thirdUnknownField'), + ]); + }); + + it('when maxErrors is less than number of errors', () => { + const errors = validateDocument({ maxErrors: 2 }); + expectJSON(errors).toDeepEqual([ + invalidFieldError('firstUnknownField'), + invalidFieldError('secondUnknownField'), + { + message: + 'Too many validation errors, error limit reached. Validation aborted.', + }, + ]); + }); + + it('passthrough exceptions from rules', () => { + function customRule() { + return { + Field() { + throw new Error('Error from custom rule!'); + }, + }; + } + expect(() => + validate(testSchema, doc, [customRule], { maxErrors: 1 }), + ).to.throw(/^Error from custom rule!$/); + }); +}); diff --git a/src/validation/index.ts b/src/validation/index.ts new file mode 100644 index 00000000..58cc012e --- /dev/null +++ b/src/validation/index.ts @@ -0,0 +1,99 @@ +export { validate } from './validate'; + +export { ValidationContext } from './ValidationContext'; +export type { ValidationRule } from './ValidationContext'; + +// All validation rules in the GraphQL Specification. +export { specifiedRules } from './specifiedRules'; + +// Spec Section: "Executable Definitions" +export { ExecutableDefinitionsRule } from './rules/ExecutableDefinitionsRule'; + +// Spec Section: "Field Selections on Objects, Interfaces, and Unions Types" +export { FieldsOnCorrectTypeRule } from './rules/FieldsOnCorrectTypeRule'; + +// Spec Section: "Fragments on Composite Types" +export { FragmentsOnCompositeTypesRule } from './rules/FragmentsOnCompositeTypesRule'; + +// Spec Section: "Argument Names" +export { KnownArgumentNamesRule } from './rules/KnownArgumentNamesRule'; + +// Spec Section: "Directives Are Defined" +export { KnownDirectivesRule } from './rules/KnownDirectivesRule'; + +// Spec Section: "Fragment spread target defined" +export { KnownFragmentNamesRule } from './rules/KnownFragmentNamesRule'; + +// Spec Section: "Fragment Spread Type Existence" +export { KnownTypeNamesRule } from './rules/KnownTypeNamesRule'; + +// Spec Section: "Lone Anonymous Operation" +export { LoneAnonymousOperationRule } from './rules/LoneAnonymousOperationRule'; + +// Spec Section: "Fragments must not form cycles" +export { NoFragmentCyclesRule } from './rules/NoFragmentCyclesRule'; + +// Spec Section: "All Variable Used Defined" +export { NoUndefinedVariablesRule } from './rules/NoUndefinedVariablesRule'; + +// Spec Section: "Fragments must be used" +export { NoUnusedFragmentsRule } from './rules/NoUnusedFragmentsRule'; + +// Spec Section: "All Variables Used" +export { NoUnusedVariablesRule } from './rules/NoUnusedVariablesRule'; + +// Spec Section: "Field Selection Merging" +export { OverlappingFieldsCanBeMergedRule } from './rules/OverlappingFieldsCanBeMergedRule'; + +// Spec Section: "Fragment spread is possible" +export { PossibleFragmentSpreadsRule } from './rules/PossibleFragmentSpreadsRule'; + +// Spec Section: "Argument Optionality" +export { ProvidedRequiredArgumentsRule } from './rules/ProvidedRequiredArgumentsRule'; + +// Spec Section: "Leaf Field Selections" +export { ScalarLeafsRule } from './rules/ScalarLeafsRule'; + +// Spec Section: "Subscriptions with Single Root Field" +export { SingleFieldSubscriptionsRule } from './rules/SingleFieldSubscriptionsRule'; + +// Spec Section: "Argument Uniqueness" +export { UniqueArgumentNamesRule } from './rules/UniqueArgumentNamesRule'; + +// Spec Section: "Directives Are Unique Per Location" +export { UniqueDirectivesPerLocationRule } from './rules/UniqueDirectivesPerLocationRule'; + +// Spec Section: "Fragment Name Uniqueness" +export { UniqueFragmentNamesRule } from './rules/UniqueFragmentNamesRule'; + +// Spec Section: "Input Object Field Uniqueness" +export { UniqueInputFieldNamesRule } from './rules/UniqueInputFieldNamesRule'; + +// Spec Section: "Operation Name Uniqueness" +export { UniqueOperationNamesRule } from './rules/UniqueOperationNamesRule'; + +// Spec Section: "Variable Uniqueness" +export { UniqueVariableNamesRule } from './rules/UniqueVariableNamesRule'; + +// Spec Section: "Values Type Correctness" +export { ValuesOfCorrectTypeRule } from './rules/ValuesOfCorrectTypeRule'; + +// Spec Section: "Variables are Input Types" +export { VariablesAreInputTypesRule } from './rules/VariablesAreInputTypesRule'; + +// Spec Section: "All Variable Usages Are Allowed" +export { VariablesInAllowedPositionRule } from './rules/VariablesInAllowedPositionRule'; + +// SDL-specific validation rules +export { LoneSchemaDefinitionRule } from './rules/LoneSchemaDefinitionRule'; +export { UniqueOperationTypesRule } from './rules/UniqueOperationTypesRule'; +export { UniqueTypeNamesRule } from './rules/UniqueTypeNamesRule'; +export { UniqueEnumValueNamesRule } from './rules/UniqueEnumValueNamesRule'; +export { UniqueFieldDefinitionNamesRule } from './rules/UniqueFieldDefinitionNamesRule'; +export { UniqueArgumentDefinitionNamesRule } from './rules/UniqueArgumentDefinitionNamesRule'; +export { UniqueDirectiveNamesRule } from './rules/UniqueDirectiveNamesRule'; +export { PossibleTypeExtensionsRule } from './rules/PossibleTypeExtensionsRule'; + +// Optional rules not defined by the GraphQL Specification +export { NoDeprecatedCustomRule } from './rules/custom/NoDeprecatedCustomRule'; +export { NoSchemaIntrospectionCustomRule } from './rules/custom/NoSchemaIntrospectionCustomRule'; diff --git a/src/validation/rules/ExecutableDefinitionsRule.ts b/src/validation/rules/ExecutableDefinitionsRule.ts new file mode 100644 index 00000000..8c4ec3d8 --- /dev/null +++ b/src/validation/rules/ExecutableDefinitionsRule.ts @@ -0,0 +1,40 @@ +import { GraphQLError } from '../../error/GraphQLError'; + +import { Kind } from '../../language/kinds'; +import { isExecutableDefinitionNode } from '../../language/predicates'; +import type { ASTVisitor } from '../../language/visitor'; + +import type { ASTValidationContext } from '../ValidationContext'; + +/** + * Executable definitions + * + * A GraphQL document is only valid for execution if all definitions are either + * operation or fragment definitions. + * + * See https://spec.graphql.org/draft/#sec-Executable-Definitions + */ +export function ExecutableDefinitionsRule( + context: ASTValidationContext, +): ASTVisitor { + return { + Document(node) { + for (const definition of node.definitions) { + if (!isExecutableDefinitionNode(definition)) { + const defName = + definition.kind === Kind.SCHEMA_DEFINITION || + definition.kind === Kind.SCHEMA_EXTENSION + ? 'schema' + : '"' + definition.name.value + '"'; + context.reportError( + new GraphQLError( + `The ${defName} definition is not executable.`, + definition, + ), + ); + } + } + return false; + }, + }; +} diff --git a/src/validation/rules/FieldsOnCorrectTypeRule.ts b/src/validation/rules/FieldsOnCorrectTypeRule.ts new file mode 100644 index 00000000..e9d220ef --- /dev/null +++ b/src/validation/rules/FieldsOnCorrectTypeRule.ts @@ -0,0 +1,144 @@ +import { didYouMean } from '../../jsutils/didYouMean'; +import { naturalCompare } from '../../jsutils/naturalCompare'; +import { suggestionList } from '../../jsutils/suggestionList'; + +import { GraphQLError } from '../../error/GraphQLError'; + +import type { FieldNode } from '../../language/ast'; +import type { ASTVisitor } from '../../language/visitor'; + +import type { + GraphQLInterfaceType, + GraphQLObjectType, + GraphQLOutputType, +} from '../../type/definition'; +import { + isAbstractType, + isInterfaceType, + isObjectType, +} from '../../type/definition'; +import type { GraphQLSchema } from '../../type/schema'; + +import type { ValidationContext } from '../ValidationContext'; + +/** + * Fields on correct type + * + * A GraphQL document is only valid if all fields selected are defined by the + * parent type, or are an allowed meta field such as __typename. + * + * See https://spec.graphql.org/draft/#sec-Field-Selections + */ +export function FieldsOnCorrectTypeRule( + context: ValidationContext, +): ASTVisitor { + return { + Field(node: FieldNode) { + const type = context.getParentType(); + if (type) { + const fieldDef = context.getFieldDef(); + if (!fieldDef) { + // This field doesn't exist, lets look for suggestions. + const schema = context.getSchema(); + const fieldName = node.name.value; + + // First determine if there are any suggested types to condition on. + let suggestion = didYouMean( + 'to use an inline fragment on', + getSuggestedTypeNames(schema, type, fieldName), + ); + + // If there are no suggested types, then perhaps this was a typo? + if (suggestion === '') { + suggestion = didYouMean(getSuggestedFieldNames(type, fieldName)); + } + + // Report an error, including helpful suggestions. + context.reportError( + new GraphQLError( + `Cannot query field "${fieldName}" on type "${type.name}".` + + suggestion, + node, + ), + ); + } + } + }, + }; +} + +/** + * Go through all of the implementations of type, as well as the interfaces that + * they implement. If any of those types include the provided field, suggest them, + * sorted by how often the type is referenced. + */ +function getSuggestedTypeNames( + schema: GraphQLSchema, + type: GraphQLOutputType, + fieldName: string, +): Array { + if (!isAbstractType(type)) { + // Must be an Object type, which does not have possible fields. + return []; + } + + const suggestedTypes: Set = + new Set(); + const usageCount = Object.create(null); + for (const possibleType of schema.getPossibleTypes(type)) { + if (!possibleType.getFields()[fieldName]) { + continue; + } + + // This object type defines this field. + suggestedTypes.add(possibleType); + usageCount[possibleType.name] = 1; + + for (const possibleInterface of possibleType.getInterfaces()) { + if (!possibleInterface.getFields()[fieldName]) { + continue; + } + + // This interface type defines this field. + suggestedTypes.add(possibleInterface); + usageCount[possibleInterface.name] = + (usageCount[possibleInterface.name] ?? 0) + 1; + } + } + + return [...suggestedTypes] + .sort((typeA, typeB) => { + // Suggest both interface and object types based on how common they are. + const usageCountDiff = usageCount[typeB.name] - usageCount[typeA.name]; + if (usageCountDiff !== 0) { + return usageCountDiff; + } + + // Suggest super types first followed by subtypes + if (isInterfaceType(typeA) && schema.isSubType(typeA, typeB)) { + return -1; + } + if (isInterfaceType(typeB) && schema.isSubType(typeB, typeA)) { + return 1; + } + + return naturalCompare(typeA.name, typeB.name); + }) + .map((x) => x.name); +} + +/** + * For the field name provided, determine if there are any similar field names + * that may be the result of a typo. + */ +function getSuggestedFieldNames( + type: GraphQLOutputType, + fieldName: string, +): Array { + if (isObjectType(type) || isInterfaceType(type)) { + const possibleFieldNames = Object.keys(type.getFields()); + return suggestionList(fieldName, possibleFieldNames); + } + // Otherwise, must be a Union type, which does not define fields. + return []; +} diff --git a/src/validation/rules/FragmentsOnCompositeTypesRule.ts b/src/validation/rules/FragmentsOnCompositeTypesRule.ts new file mode 100644 index 00000000..6fe51db9 --- /dev/null +++ b/src/validation/rules/FragmentsOnCompositeTypesRule.ts @@ -0,0 +1,53 @@ +import { GraphQLError } from '../../error/GraphQLError'; + +import { print } from '../../language/printer'; +import type { ASTVisitor } from '../../language/visitor'; + +import { isCompositeType } from '../../type/definition'; + +import { typeFromAST } from '../../utilities/typeFromAST'; + +import type { ValidationContext } from '../ValidationContext'; + +/** + * Fragments on composite type + * + * Fragments use a type condition to determine if they apply, since fragments + * can only be spread into a composite type (object, interface, or union), the + * type condition must also be a composite type. + * + * See https://spec.graphql.org/draft/#sec-Fragments-On-Composite-Types + */ +export function FragmentsOnCompositeTypesRule( + context: ValidationContext, +): ASTVisitor { + return { + InlineFragment(node) { + const typeCondition = node.typeCondition; + if (typeCondition) { + const type = typeFromAST(context.getSchema(), typeCondition); + if (type && !isCompositeType(type)) { + const typeStr = print(typeCondition); + context.reportError( + new GraphQLError( + `Fragment cannot condition on non composite type "${typeStr}".`, + typeCondition, + ), + ); + } + } + }, + FragmentDefinition(node) { + const type = typeFromAST(context.getSchema(), node.typeCondition); + if (type && !isCompositeType(type)) { + const typeStr = print(node.typeCondition); + context.reportError( + new GraphQLError( + `Fragment "${node.name.value}" cannot condition on non composite type "${typeStr}".`, + node.typeCondition, + ), + ); + } + }, + }; +} diff --git a/src/validation/rules/KnownArgumentNamesRule.ts b/src/validation/rules/KnownArgumentNamesRule.ts new file mode 100644 index 00000000..5f5c4c70 --- /dev/null +++ b/src/validation/rules/KnownArgumentNamesRule.ts @@ -0,0 +1,101 @@ +import { didYouMean } from '../../jsutils/didYouMean'; +import { suggestionList } from '../../jsutils/suggestionList'; + +import { GraphQLError } from '../../error/GraphQLError'; + +import { Kind } from '../../language/kinds'; +import type { ASTVisitor } from '../../language/visitor'; + +import { specifiedDirectives } from '../../type/directives'; + +import type { + SDLValidationContext, + ValidationContext, +} from '../ValidationContext'; + +/** + * Known argument names + * + * A GraphQL field is only valid if all supplied arguments are defined by + * that field. + * + * See https://spec.graphql.org/draft/#sec-Argument-Names + * See https://spec.graphql.org/draft/#sec-Directives-Are-In-Valid-Locations + */ +export function KnownArgumentNamesRule(context: ValidationContext): ASTVisitor { + return { + // eslint-disable-next-line new-cap + ...KnownArgumentNamesOnDirectivesRule(context), + Argument(argNode) { + const argDef = context.getArgument(); + const fieldDef = context.getFieldDef(); + const parentType = context.getParentType(); + + if (!argDef && fieldDef && parentType) { + const argName = argNode.name.value; + const knownArgsNames = fieldDef.args.map((arg) => arg.name); + const suggestions = suggestionList(argName, knownArgsNames); + context.reportError( + new GraphQLError( + `Unknown argument "${argName}" on field "${parentType.name}.${fieldDef.name}".` + + didYouMean(suggestions), + argNode, + ), + ); + } + }, + }; +} + +/** + * @internal + */ +export function KnownArgumentNamesOnDirectivesRule( + context: ValidationContext | SDLValidationContext, +): ASTVisitor { + const directiveArgs = Object.create(null); + + const schema = context.getSchema(); + const definedDirectives = schema + ? schema.getDirectives() + : specifiedDirectives; + for (const directive of definedDirectives) { + directiveArgs[directive.name] = directive.args.map((arg) => arg.name); + } + + const astDefinitions = context.getDocument().definitions; + for (const def of astDefinitions) { + if (def.kind === Kind.DIRECTIVE_DEFINITION) { + // FIXME: https://github.com/graphql/graphql-js/issues/2203 + /* c8 ignore next */ + const argsNodes = def.arguments ?? []; + + directiveArgs[def.name.value] = argsNodes.map((arg) => arg.name.value); + } + } + + return { + Directive(directiveNode) { + const directiveName = directiveNode.name.value; + const knownArgs = directiveArgs[directiveName]; + + if (directiveNode.arguments && knownArgs) { + for (const argNode of directiveNode.arguments) { + const argName = argNode.name.value; + if (!knownArgs.includes(argName)) { + const suggestions = suggestionList(argName, knownArgs); + context.reportError( + new GraphQLError( + `Unknown argument "${argName}" on directive "@${directiveName}".` + + didYouMean(suggestions), + argNode, + ), + ); + } + } + } + + return false; + }, + }; +} diff --git a/src/validation/rules/KnownDirectivesRule.ts b/src/validation/rules/KnownDirectivesRule.ts new file mode 100644 index 00000000..2b5b4811 --- /dev/null +++ b/src/validation/rules/KnownDirectivesRule.ts @@ -0,0 +1,141 @@ +import { inspect } from '../../jsutils/inspect'; +import { invariant } from '../../jsutils/invariant'; + +import { GraphQLError } from '../../error/GraphQLError'; + +import type { ASTNode } from '../../language/ast'; +import { OperationTypeNode } from '../../language/ast'; +import { DirectiveLocation } from '../../language/directiveLocation'; +import { Kind } from '../../language/kinds'; +import type { ASTVisitor } from '../../language/visitor'; + +import { specifiedDirectives } from '../../type/directives'; + +import type { + SDLValidationContext, + ValidationContext, +} from '../ValidationContext'; + +/** + * Known directives + * + * A GraphQL document is only valid if all `@directives` are known by the + * schema and legally positioned. + * + * See https://spec.graphql.org/draft/#sec-Directives-Are-Defined + */ +export function KnownDirectivesRule( + context: ValidationContext | SDLValidationContext, +): ASTVisitor { + const locationsMap = Object.create(null); + + const schema = context.getSchema(); + const definedDirectives = schema + ? schema.getDirectives() + : specifiedDirectives; + for (const directive of definedDirectives) { + locationsMap[directive.name] = directive.locations; + } + + const astDefinitions = context.getDocument().definitions; + for (const def of astDefinitions) { + if (def.kind === Kind.DIRECTIVE_DEFINITION) { + locationsMap[def.name.value] = def.locations.map((name) => name.value); + } + } + + return { + Directive(node, _key, _parent, _path, ancestors) { + const name = node.name.value; + const locations = locationsMap[name]; + + if (!locations) { + context.reportError( + new GraphQLError(`Unknown directive "@${name}".`, node), + ); + return; + } + + const candidateLocation = getDirectiveLocationForASTPath(ancestors); + if (candidateLocation && !locations.includes(candidateLocation)) { + context.reportError( + new GraphQLError( + `Directive "@${name}" may not be used on ${candidateLocation}.`, + node, + ), + ); + } + }, + }; +} + +function getDirectiveLocationForASTPath( + ancestors: ReadonlyArray>, +): DirectiveLocation | undefined { + const appliedTo = ancestors[ancestors.length - 1]; + invariant('kind' in appliedTo); + + switch (appliedTo.kind) { + case Kind.OPERATION_DEFINITION: + return getDirectiveLocationForOperation(appliedTo.operation); + case Kind.FIELD: + return DirectiveLocation.FIELD; + case Kind.FRAGMENT_SPREAD: + return DirectiveLocation.FRAGMENT_SPREAD; + case Kind.INLINE_FRAGMENT: + return DirectiveLocation.INLINE_FRAGMENT; + case Kind.FRAGMENT_DEFINITION: + return DirectiveLocation.FRAGMENT_DEFINITION; + case Kind.VARIABLE_DEFINITION: + return DirectiveLocation.VARIABLE_DEFINITION; + case Kind.SCHEMA_DEFINITION: + case Kind.SCHEMA_EXTENSION: + return DirectiveLocation.SCHEMA; + case Kind.SCALAR_TYPE_DEFINITION: + case Kind.SCALAR_TYPE_EXTENSION: + return DirectiveLocation.SCALAR; + case Kind.OBJECT_TYPE_DEFINITION: + case Kind.OBJECT_TYPE_EXTENSION: + return DirectiveLocation.OBJECT; + case Kind.FIELD_DEFINITION: + return DirectiveLocation.FIELD_DEFINITION; + case Kind.INTERFACE_TYPE_DEFINITION: + case Kind.INTERFACE_TYPE_EXTENSION: + return DirectiveLocation.INTERFACE; + case Kind.UNION_TYPE_DEFINITION: + case Kind.UNION_TYPE_EXTENSION: + return DirectiveLocation.UNION; + case Kind.ENUM_TYPE_DEFINITION: + case Kind.ENUM_TYPE_EXTENSION: + return DirectiveLocation.ENUM; + case Kind.ENUM_VALUE_DEFINITION: + return DirectiveLocation.ENUM_VALUE; + case Kind.INPUT_OBJECT_TYPE_DEFINITION: + case Kind.INPUT_OBJECT_TYPE_EXTENSION: + return DirectiveLocation.INPUT_OBJECT; + case Kind.INPUT_VALUE_DEFINITION: { + const parentNode = ancestors[ancestors.length - 3]; + invariant('kind' in parentNode); + return parentNode.kind === Kind.INPUT_OBJECT_TYPE_DEFINITION + ? DirectiveLocation.INPUT_FIELD_DEFINITION + : DirectiveLocation.ARGUMENT_DEFINITION; + } + // Not reachable, all possible types have been considered. + /* c8 ignore next */ + default: + invariant(false, 'Unexpected kind: ' + inspect(appliedTo.kind)); + } +} + +function getDirectiveLocationForOperation( + operation: OperationTypeNode, +): DirectiveLocation { + switch (operation) { + case OperationTypeNode.QUERY: + return DirectiveLocation.QUERY; + case OperationTypeNode.MUTATION: + return DirectiveLocation.MUTATION; + case OperationTypeNode.SUBSCRIPTION: + return DirectiveLocation.SUBSCRIPTION; + } +} diff --git a/src/validation/rules/KnownFragmentNamesRule.ts b/src/validation/rules/KnownFragmentNamesRule.ts new file mode 100644 index 00000000..78fb2446 --- /dev/null +++ b/src/validation/rules/KnownFragmentNamesRule.ts @@ -0,0 +1,27 @@ +import { GraphQLError } from '../../error/GraphQLError'; + +import type { ASTVisitor } from '../../language/visitor'; + +import type { ValidationContext } from '../ValidationContext'; + +/** + * Known fragment names + * + * A GraphQL document is only valid if all `...Fragment` fragment spreads refer + * to fragments defined in the same document. + * + * See https://spec.graphql.org/draft/#sec-Fragment-spread-target-defined + */ +export function KnownFragmentNamesRule(context: ValidationContext): ASTVisitor { + return { + FragmentSpread(node) { + const fragmentName = node.name.value; + const fragment = context.getFragment(fragmentName); + if (!fragment) { + context.reportError( + new GraphQLError(`Unknown fragment "${fragmentName}".`, node.name), + ); + } + }, + }; +} diff --git a/src/validation/rules/KnownTypeNamesRule.ts b/src/validation/rules/KnownTypeNamesRule.ts new file mode 100644 index 00000000..4802610a --- /dev/null +++ b/src/validation/rules/KnownTypeNamesRule.ts @@ -0,0 +1,82 @@ +import { didYouMean } from '../../jsutils/didYouMean'; +import { suggestionList } from '../../jsutils/suggestionList'; + +import { GraphQLError } from '../../error/GraphQLError'; + +import type { ASTNode } from '../../language/ast'; +import { + isTypeDefinitionNode, + isTypeSystemDefinitionNode, + isTypeSystemExtensionNode, +} from '../../language/predicates'; +import type { ASTVisitor } from '../../language/visitor'; + +import { introspectionTypes } from '../../type/introspection'; +import { specifiedScalarTypes } from '../../type/scalars'; + +import type { + SDLValidationContext, + ValidationContext, +} from '../ValidationContext'; + +/** + * Known type names + * + * A GraphQL document is only valid if referenced types (specifically + * variable definitions and fragment conditions) are defined by the type schema. + * + * See https://spec.graphql.org/draft/#sec-Fragment-Spread-Type-Existence + */ +export function KnownTypeNamesRule( + context: ValidationContext | SDLValidationContext, +): ASTVisitor { + const schema = context.getSchema(); + const existingTypesMap = schema ? schema.getTypeMap() : Object.create(null); + + const definedTypes = Object.create(null); + for (const def of context.getDocument().definitions) { + if (isTypeDefinitionNode(def)) { + definedTypes[def.name.value] = true; + } + } + + const typeNames = [ + ...Object.keys(existingTypesMap), + ...Object.keys(definedTypes), + ]; + + return { + NamedType(node, _1, parent, _2, ancestors) { + const typeName = node.name.value; + if (!existingTypesMap[typeName] && !definedTypes[typeName]) { + const definitionNode = ancestors[2] ?? parent; + const isSDL = definitionNode != null && isSDLNode(definitionNode); + if (isSDL && standardTypeNames.includes(typeName)) { + return; + } + + const suggestedTypes = suggestionList( + typeName, + isSDL ? standardTypeNames.concat(typeNames) : typeNames, + ); + context.reportError( + new GraphQLError( + `Unknown type "${typeName}".` + didYouMean(suggestedTypes), + node, + ), + ); + } + }, + }; +} + +const standardTypeNames = [...specifiedScalarTypes, ...introspectionTypes].map( + (type) => type.name, +); + +function isSDLNode(value: ASTNode | ReadonlyArray): boolean { + return ( + 'kind' in value && + (isTypeSystemDefinitionNode(value) || isTypeSystemExtensionNode(value)) + ); +} diff --git a/src/validation/rules/LoneAnonymousOperationRule.ts b/src/validation/rules/LoneAnonymousOperationRule.ts new file mode 100644 index 00000000..ddd537dd --- /dev/null +++ b/src/validation/rules/LoneAnonymousOperationRule.ts @@ -0,0 +1,37 @@ +import { GraphQLError } from '../../error/GraphQLError'; + +import { Kind } from '../../language/kinds'; +import type { ASTVisitor } from '../../language/visitor'; + +import type { ASTValidationContext } from '../ValidationContext'; + +/** + * Lone anonymous operation + * + * A GraphQL document is only valid if when it contains an anonymous operation + * (the query short-hand) that it contains only that one operation definition. + * + * See https://spec.graphql.org/draft/#sec-Lone-Anonymous-Operation + */ +export function LoneAnonymousOperationRule( + context: ASTValidationContext, +): ASTVisitor { + let operationCount = 0; + return { + Document(node) { + operationCount = node.definitions.filter( + (definition) => definition.kind === Kind.OPERATION_DEFINITION, + ).length; + }, + OperationDefinition(node) { + if (!node.name && operationCount > 1) { + context.reportError( + new GraphQLError( + 'This anonymous operation must be the only defined operation.', + node, + ), + ); + } + }, + }; +} diff --git a/src/validation/rules/LoneSchemaDefinitionRule.ts b/src/validation/rules/LoneSchemaDefinitionRule.ts new file mode 100644 index 00000000..df962387 --- /dev/null +++ b/src/validation/rules/LoneSchemaDefinitionRule.ts @@ -0,0 +1,43 @@ +import { GraphQLError } from '../../error/GraphQLError'; + +import type { ASTVisitor } from '../../language/visitor'; + +import type { SDLValidationContext } from '../ValidationContext'; + +/** + * Lone Schema definition + * + * A GraphQL document is only valid if it contains only one schema definition. + */ +export function LoneSchemaDefinitionRule( + context: SDLValidationContext, +): ASTVisitor { + const oldSchema = context.getSchema(); + const alreadyDefined = + oldSchema?.astNode ?? + oldSchema?.getQueryType() ?? + oldSchema?.getMutationType() ?? + oldSchema?.getSubscriptionType(); + + let schemaDefinitionsCount = 0; + return { + SchemaDefinition(node) { + if (alreadyDefined) { + context.reportError( + new GraphQLError( + 'Cannot define a new schema within a schema extension.', + node, + ), + ); + return; + } + + if (schemaDefinitionsCount > 0) { + context.reportError( + new GraphQLError('Must provide only one schema definition.', node), + ); + } + ++schemaDefinitionsCount; + }, + }; +} diff --git a/src/validation/rules/NoFragmentCyclesRule.ts b/src/validation/rules/NoFragmentCyclesRule.ts new file mode 100644 index 00000000..0a33f450 --- /dev/null +++ b/src/validation/rules/NoFragmentCyclesRule.ts @@ -0,0 +1,90 @@ +import type { ObjMap } from '../../jsutils/ObjMap'; + +import { GraphQLError } from '../../error/GraphQLError'; + +import type { + FragmentDefinitionNode, + FragmentSpreadNode, +} from '../../language/ast'; +import type { ASTVisitor } from '../../language/visitor'; + +import type { ASTValidationContext } from '../ValidationContext'; + +/** + * No fragment cycles + * + * The graph of fragment spreads must not form any cycles including spreading itself. + * Otherwise an operation could infinitely spread or infinitely execute on cycles in the underlying data. + * + * See https://spec.graphql.org/draft/#sec-Fragment-spreads-must-not-form-cycles + */ +export function NoFragmentCyclesRule( + context: ASTValidationContext, +): ASTVisitor { + // Tracks already visited fragments to maintain O(N) and to ensure that cycles + // are not redundantly reported. + const visitedFrags: ObjMap = Object.create(null); + + // Array of AST nodes used to produce meaningful errors + const spreadPath: Array = []; + + // Position in the spread path + const spreadPathIndexByName: ObjMap = Object.create(null); + + return { + OperationDefinition: () => false, + FragmentDefinition(node) { + detectCycleRecursive(node); + return false; + }, + }; + + // This does a straight-forward DFS to find cycles. + // It does not terminate when a cycle was found but continues to explore + // the graph to find all possible cycles. + function detectCycleRecursive(fragment: FragmentDefinitionNode): void { + if (visitedFrags[fragment.name.value]) { + return; + } + + const fragmentName = fragment.name.value; + visitedFrags[fragmentName] = true; + + const spreadNodes = context.getFragmentSpreads(fragment.selectionSet); + if (spreadNodes.length === 0) { + return; + } + + spreadPathIndexByName[fragmentName] = spreadPath.length; + + for (const spreadNode of spreadNodes) { + const spreadName = spreadNode.name.value; + const cycleIndex = spreadPathIndexByName[spreadName]; + + spreadPath.push(spreadNode); + if (cycleIndex === undefined) { + const spreadFragment = context.getFragment(spreadName); + if (spreadFragment) { + detectCycleRecursive(spreadFragment); + } + } else { + const cyclePath = spreadPath.slice(cycleIndex); + const viaPath = cyclePath + .slice(0, -1) + .map((s) => '"' + s.name.value + '"') + .join(', '); + + context.reportError( + new GraphQLError( + `Cannot spread fragment "${spreadName}" within itself` + + (viaPath !== '' ? ` via ${viaPath}.` : '.'), + cyclePath, + ), + ); + } + spreadPath.pop(); + } + + spreadPathIndexByName[fragmentName] = undefined; + } +} diff --git a/src/validation/rules/NoUndefinedVariablesRule.ts b/src/validation/rules/NoUndefinedVariablesRule.ts new file mode 100644 index 00000000..36bfe049 --- /dev/null +++ b/src/validation/rules/NoUndefinedVariablesRule.ts @@ -0,0 +1,47 @@ +import { GraphQLError } from '../../error/GraphQLError'; + +import type { ASTVisitor } from '../../language/visitor'; + +import type { ValidationContext } from '../ValidationContext'; + +/** + * No undefined variables + * + * A GraphQL operation is only valid if all variables encountered, both directly + * and via fragment spreads, are defined by that operation. + * + * See https://spec.graphql.org/draft/#sec-All-Variable-Uses-Defined + */ +export function NoUndefinedVariablesRule( + context: ValidationContext, +): ASTVisitor { + let variableNameDefined = Object.create(null); + + return { + OperationDefinition: { + enter() { + variableNameDefined = Object.create(null); + }, + leave(operation) { + const usages = context.getRecursiveVariableUsages(operation); + + for (const { node } of usages) { + const varName = node.name.value; + if (variableNameDefined[varName] !== true) { + context.reportError( + new GraphQLError( + operation.name + ? `Variable "$${varName}" is not defined by operation "${operation.name.value}".` + : `Variable "$${varName}" is not defined.`, + [node, operation], + ), + ); + } + } + }, + }, + VariableDefinition(node) { + variableNameDefined[node.variable.name.value] = true; + }, + }; +} diff --git a/src/validation/rules/NoUnusedFragmentsRule.ts b/src/validation/rules/NoUnusedFragmentsRule.ts new file mode 100644 index 00000000..20479454 --- /dev/null +++ b/src/validation/rules/NoUnusedFragmentsRule.ts @@ -0,0 +1,59 @@ +import { GraphQLError } from '../../error/GraphQLError'; + +import type { + FragmentDefinitionNode, + OperationDefinitionNode, +} from '../../language/ast'; +import type { ASTVisitor } from '../../language/visitor'; + +import type { ASTValidationContext } from '../ValidationContext'; + +/** + * No unused fragments + * + * A GraphQL document is only valid if all fragment definitions are spread + * within operations, or spread within other fragments spread within operations. + * + * See https://spec.graphql.org/draft/#sec-Fragments-Must-Be-Used + */ +export function NoUnusedFragmentsRule( + context: ASTValidationContext, +): ASTVisitor { + const operationDefs: Array = []; + const fragmentDefs: Array = []; + + return { + OperationDefinition(node) { + operationDefs.push(node); + return false; + }, + FragmentDefinition(node) { + fragmentDefs.push(node); + return false; + }, + Document: { + leave() { + const fragmentNameUsed = Object.create(null); + for (const operation of operationDefs) { + for (const fragment of context.getRecursivelyReferencedFragments( + operation, + )) { + fragmentNameUsed[fragment.name.value] = true; + } + } + + for (const fragmentDef of fragmentDefs) { + const fragName = fragmentDef.name.value; + if (fragmentNameUsed[fragName] !== true) { + context.reportError( + new GraphQLError( + `Fragment "${fragName}" is never used.`, + fragmentDef, + ), + ); + } + } + }, + }, + }; +} diff --git a/src/validation/rules/NoUnusedVariablesRule.ts b/src/validation/rules/NoUnusedVariablesRule.ts new file mode 100644 index 00000000..b81fd078 --- /dev/null +++ b/src/validation/rules/NoUnusedVariablesRule.ts @@ -0,0 +1,51 @@ +import { GraphQLError } from '../../error/GraphQLError'; + +import type { VariableDefinitionNode } from '../../language/ast'; +import type { ASTVisitor } from '../../language/visitor'; + +import type { ValidationContext } from '../ValidationContext'; + +/** + * No unused variables + * + * A GraphQL operation is only valid if all variables defined by an operation + * are used, either directly or within a spread fragment. + * + * See https://spec.graphql.org/draft/#sec-All-Variables-Used + */ +export function NoUnusedVariablesRule(context: ValidationContext): ASTVisitor { + let variableDefs: Array = []; + + return { + OperationDefinition: { + enter() { + variableDefs = []; + }, + leave(operation) { + const variableNameUsed = Object.create(null); + const usages = context.getRecursiveVariableUsages(operation); + + for (const { node } of usages) { + variableNameUsed[node.name.value] = true; + } + + for (const variableDef of variableDefs) { + const variableName = variableDef.variable.name.value; + if (variableNameUsed[variableName] !== true) { + context.reportError( + new GraphQLError( + operation.name + ? `Variable "$${variableName}" is never used in operation "${operation.name.value}".` + : `Variable "$${variableName}" is never used.`, + variableDef, + ), + ); + } + } + }, + }, + VariableDefinition(def) { + variableDefs.push(def); + }, + }; +} diff --git a/src/validation/rules/OverlappingFieldsCanBeMergedRule.ts b/src/validation/rules/OverlappingFieldsCanBeMergedRule.ts new file mode 100644 index 00000000..5796da6f --- /dev/null +++ b/src/validation/rules/OverlappingFieldsCanBeMergedRule.ts @@ -0,0 +1,837 @@ +import { inspect } from '../../jsutils/inspect'; +import type { Maybe } from '../../jsutils/Maybe'; +import type { ObjMap } from '../../jsutils/ObjMap'; + +import { GraphQLError } from '../../error/GraphQLError'; + +import type { + ArgumentNode, + FieldNode, + FragmentDefinitionNode, + SelectionSetNode, + ValueNode, +} from '../../language/ast'; +import { Kind } from '../../language/kinds'; +import { print } from '../../language/printer'; +import type { ASTVisitor } from '../../language/visitor'; + +import type { + GraphQLField, + GraphQLNamedType, + GraphQLOutputType, +} from '../../type/definition'; +import { + getNamedType, + isInterfaceType, + isLeafType, + isListType, + isNonNullType, + isObjectType, +} from '../../type/definition'; + +import { typeFromAST } from '../../utilities/typeFromAST'; + +import type { ValidationContext } from '../ValidationContext'; + +function reasonMessage(reason: ConflictReasonMessage): string { + if (Array.isArray(reason)) { + return reason + .map( + ([responseName, subReason]) => + `subfields "${responseName}" conflict because ` + + reasonMessage(subReason), + ) + .join(' and '); + } + return reason; +} + +/** + * Overlapping fields can be merged + * + * A selection set is only valid if all fields (including spreading any + * fragments) either correspond to distinct response names or can be merged + * without ambiguity. + * + * See https://spec.graphql.org/draft/#sec-Field-Selection-Merging + */ +export function OverlappingFieldsCanBeMergedRule( + context: ValidationContext, +): ASTVisitor { + // A memoization for when two fragments are compared "between" each other for + // conflicts. Two fragments may be compared many times, so memoizing this can + // dramatically improve the performance of this validator. + const comparedFragmentPairs = new PairSet(); + + // A cache for the "field map" and list of fragment names found in any given + // selection set. Selection sets may be asked for this information multiple + // times, so this improves the performance of this validator. + const cachedFieldsAndFragmentNames = new Map(); + + return { + SelectionSet(selectionSet) { + const conflicts = findConflictsWithinSelectionSet( + context, + cachedFieldsAndFragmentNames, + comparedFragmentPairs, + context.getParentType(), + selectionSet, + ); + for (const [[responseName, reason], fields1, fields2] of conflicts) { + const reasonMsg = reasonMessage(reason); + context.reportError( + new GraphQLError( + `Fields "${responseName}" conflict because ${reasonMsg}. Use different aliases on the fields to fetch both if this was intentional.`, + fields1.concat(fields2), + ), + ); + } + }, + }; +} + +type Conflict = [ConflictReason, Array, Array]; +// Field name and reason. +type ConflictReason = [string, ConflictReasonMessage]; +// Reason is a string, or a nested list of conflicts. +type ConflictReasonMessage = string | Array; +// Tuple defining a field node in a context. +type NodeAndDef = [ + Maybe, + FieldNode, + Maybe>, +]; +// Map of array of those. +type NodeAndDefCollection = ObjMap>; +type FragmentNames = Array; +type FieldsAndFragmentNames = readonly [NodeAndDefCollection, FragmentNames]; + +/** + * Algorithm: + * + * Conflicts occur when two fields exist in a query which will produce the same + * response name, but represent differing values, thus creating a conflict. + * The algorithm below finds all conflicts via making a series of comparisons + * between fields. In order to compare as few fields as possible, this makes + * a series of comparisons "within" sets of fields and "between" sets of fields. + * + * Given any selection set, a collection produces both a set of fields by + * also including all inline fragments, as well as a list of fragments + * referenced by fragment spreads. + * + * A) Each selection set represented in the document first compares "within" its + * collected set of fields, finding any conflicts between every pair of + * overlapping fields. + * Note: This is the *only time* that a the fields "within" a set are compared + * to each other. After this only fields "between" sets are compared. + * + * B) Also, if any fragment is referenced in a selection set, then a + * comparison is made "between" the original set of fields and the + * referenced fragment. + * + * C) Also, if multiple fragments are referenced, then comparisons + * are made "between" each referenced fragment. + * + * D) When comparing "between" a set of fields and a referenced fragment, first + * a comparison is made between each field in the original set of fields and + * each field in the the referenced set of fields. + * + * E) Also, if any fragment is referenced in the referenced selection set, + * then a comparison is made "between" the original set of fields and the + * referenced fragment (recursively referring to step D). + * + * F) When comparing "between" two fragments, first a comparison is made between + * each field in the first referenced set of fields and each field in the the + * second referenced set of fields. + * + * G) Also, any fragments referenced by the first must be compared to the + * second, and any fragments referenced by the second must be compared to the + * first (recursively referring to step F). + * + * H) When comparing two fields, if both have selection sets, then a comparison + * is made "between" both selection sets, first comparing the set of fields in + * the first selection set with the set of fields in the second. + * + * I) Also, if any fragment is referenced in either selection set, then a + * comparison is made "between" the other set of fields and the + * referenced fragment. + * + * J) Also, if two fragments are referenced in both selection sets, then a + * comparison is made "between" the two fragments. + * + */ + +// Find all conflicts found "within" a selection set, including those found +// via spreading in fragments. Called when visiting each SelectionSet in the +// GraphQL Document. +function findConflictsWithinSelectionSet( + context: ValidationContext, + cachedFieldsAndFragmentNames: Map, + comparedFragmentPairs: PairSet, + parentType: Maybe, + selectionSet: SelectionSetNode, +): Array { + const conflicts: Array = []; + + const [fieldMap, fragmentNames] = getFieldsAndFragmentNames( + context, + cachedFieldsAndFragmentNames, + parentType, + selectionSet, + ); + + // (A) Find find all conflicts "within" the fields of this selection set. + // Note: this is the *only place* `collectConflictsWithin` is called. + collectConflictsWithin( + context, + conflicts, + cachedFieldsAndFragmentNames, + comparedFragmentPairs, + fieldMap, + ); + + if (fragmentNames.length !== 0) { + // (B) Then collect conflicts between these fields and those represented by + // each spread fragment name found. + for (let i = 0; i < fragmentNames.length; i++) { + collectConflictsBetweenFieldsAndFragment( + context, + conflicts, + cachedFieldsAndFragmentNames, + comparedFragmentPairs, + false, + fieldMap, + fragmentNames[i], + ); + // (C) Then compare this fragment with all other fragments found in this + // selection set to collect conflicts between fragments spread together. + // This compares each item in the list of fragment names to every other + // item in that same list (except for itself). + for (let j = i + 1; j < fragmentNames.length; j++) { + collectConflictsBetweenFragments( + context, + conflicts, + cachedFieldsAndFragmentNames, + comparedFragmentPairs, + false, + fragmentNames[i], + fragmentNames[j], + ); + } + } + } + return conflicts; +} + +// Collect all conflicts found between a set of fields and a fragment reference +// including via spreading in any nested fragments. +function collectConflictsBetweenFieldsAndFragment( + context: ValidationContext, + conflicts: Array, + cachedFieldsAndFragmentNames: Map, + comparedFragmentPairs: PairSet, + areMutuallyExclusive: boolean, + fieldMap: NodeAndDefCollection, + fragmentName: string, +): void { + const fragment = context.getFragment(fragmentName); + if (!fragment) { + return; + } + + const [fieldMap2, referencedFragmentNames] = + getReferencedFieldsAndFragmentNames( + context, + cachedFieldsAndFragmentNames, + fragment, + ); + + // Do not compare a fragment's fieldMap to itself. + if (fieldMap === fieldMap2) { + return; + } + + // (D) First collect any conflicts between the provided collection of fields + // and the collection of fields represented by the given fragment. + collectConflictsBetween( + context, + conflicts, + cachedFieldsAndFragmentNames, + comparedFragmentPairs, + areMutuallyExclusive, + fieldMap, + fieldMap2, + ); + + // (E) Then collect any conflicts between the provided collection of fields + // and any fragment names found in the given fragment. + for (const referencedFragmentName of referencedFragmentNames) { + // Memoize so two fragments are not compared for conflicts more than once. + if ( + comparedFragmentPairs.has( + referencedFragmentName, + fragmentName, + areMutuallyExclusive, + ) + ) { + continue; + } + comparedFragmentPairs.add( + referencedFragmentName, + fragmentName, + areMutuallyExclusive, + ); + + collectConflictsBetweenFieldsAndFragment( + context, + conflicts, + cachedFieldsAndFragmentNames, + comparedFragmentPairs, + areMutuallyExclusive, + fieldMap, + referencedFragmentName, + ); + } +} + +// Collect all conflicts found between two fragments, including via spreading in +// any nested fragments. +function collectConflictsBetweenFragments( + context: ValidationContext, + conflicts: Array, + cachedFieldsAndFragmentNames: Map, + comparedFragmentPairs: PairSet, + areMutuallyExclusive: boolean, + fragmentName1: string, + fragmentName2: string, +): void { + // No need to compare a fragment to itself. + if (fragmentName1 === fragmentName2) { + return; + } + + // Memoize so two fragments are not compared for conflicts more than once. + if ( + comparedFragmentPairs.has( + fragmentName1, + fragmentName2, + areMutuallyExclusive, + ) + ) { + return; + } + comparedFragmentPairs.add(fragmentName1, fragmentName2, areMutuallyExclusive); + + const fragment1 = context.getFragment(fragmentName1); + const fragment2 = context.getFragment(fragmentName2); + if (!fragment1 || !fragment2) { + return; + } + + const [fieldMap1, referencedFragmentNames1] = + getReferencedFieldsAndFragmentNames( + context, + cachedFieldsAndFragmentNames, + fragment1, + ); + const [fieldMap2, referencedFragmentNames2] = + getReferencedFieldsAndFragmentNames( + context, + cachedFieldsAndFragmentNames, + fragment2, + ); + + // (F) First, collect all conflicts between these two collections of fields + // (not including any nested fragments). + collectConflictsBetween( + context, + conflicts, + cachedFieldsAndFragmentNames, + comparedFragmentPairs, + areMutuallyExclusive, + fieldMap1, + fieldMap2, + ); + + // (G) Then collect conflicts between the first fragment and any nested + // fragments spread in the second fragment. + for (const referencedFragmentName2 of referencedFragmentNames2) { + collectConflictsBetweenFragments( + context, + conflicts, + cachedFieldsAndFragmentNames, + comparedFragmentPairs, + areMutuallyExclusive, + fragmentName1, + referencedFragmentName2, + ); + } + + // (G) Then collect conflicts between the second fragment and any nested + // fragments spread in the first fragment. + for (const referencedFragmentName1 of referencedFragmentNames1) { + collectConflictsBetweenFragments( + context, + conflicts, + cachedFieldsAndFragmentNames, + comparedFragmentPairs, + areMutuallyExclusive, + referencedFragmentName1, + fragmentName2, + ); + } +} + +// Find all conflicts found between two selection sets, including those found +// via spreading in fragments. Called when determining if conflicts exist +// between the sub-fields of two overlapping fields. +function findConflictsBetweenSubSelectionSets( + context: ValidationContext, + cachedFieldsAndFragmentNames: Map, + comparedFragmentPairs: PairSet, + areMutuallyExclusive: boolean, + parentType1: Maybe, + selectionSet1: SelectionSetNode, + parentType2: Maybe, + selectionSet2: SelectionSetNode, +): Array { + const conflicts: Array = []; + + const [fieldMap1, fragmentNames1] = getFieldsAndFragmentNames( + context, + cachedFieldsAndFragmentNames, + parentType1, + selectionSet1, + ); + const [fieldMap2, fragmentNames2] = getFieldsAndFragmentNames( + context, + cachedFieldsAndFragmentNames, + parentType2, + selectionSet2, + ); + + // (H) First, collect all conflicts between these two collections of field. + collectConflictsBetween( + context, + conflicts, + cachedFieldsAndFragmentNames, + comparedFragmentPairs, + areMutuallyExclusive, + fieldMap1, + fieldMap2, + ); + + // (I) Then collect conflicts between the first collection of fields and + // those referenced by each fragment name associated with the second. + for (const fragmentName2 of fragmentNames2) { + collectConflictsBetweenFieldsAndFragment( + context, + conflicts, + cachedFieldsAndFragmentNames, + comparedFragmentPairs, + areMutuallyExclusive, + fieldMap1, + fragmentName2, + ); + } + + // (I) Then collect conflicts between the second collection of fields and + // those referenced by each fragment name associated with the first. + for (const fragmentName1 of fragmentNames1) { + collectConflictsBetweenFieldsAndFragment( + context, + conflicts, + cachedFieldsAndFragmentNames, + comparedFragmentPairs, + areMutuallyExclusive, + fieldMap2, + fragmentName1, + ); + } + + // (J) Also collect conflicts between any fragment names by the first and + // fragment names by the second. This compares each item in the first set of + // names to each item in the second set of names. + for (const fragmentName1 of fragmentNames1) { + for (const fragmentName2 of fragmentNames2) { + collectConflictsBetweenFragments( + context, + conflicts, + cachedFieldsAndFragmentNames, + comparedFragmentPairs, + areMutuallyExclusive, + fragmentName1, + fragmentName2, + ); + } + } + return conflicts; +} + +// Collect all Conflicts "within" one collection of fields. +function collectConflictsWithin( + context: ValidationContext, + conflicts: Array, + cachedFieldsAndFragmentNames: Map, + comparedFragmentPairs: PairSet, + fieldMap: NodeAndDefCollection, +): void { + // A field map is a keyed collection, where each key represents a response + // name and the value at that key is a list of all fields which provide that + // response name. For every response name, if there are multiple fields, they + // must be compared to find a potential conflict. + for (const [responseName, fields] of Object.entries(fieldMap)) { + // This compares every field in the list to every other field in this list + // (except to itself). If the list only has one item, nothing needs to + // be compared. + if (fields.length > 1) { + for (let i = 0; i < fields.length; i++) { + for (let j = i + 1; j < fields.length; j++) { + const conflict = findConflict( + context, + cachedFieldsAndFragmentNames, + comparedFragmentPairs, + false, // within one collection is never mutually exclusive + responseName, + fields[i], + fields[j], + ); + if (conflict) { + conflicts.push(conflict); + } + } + } + } + } +} + +// Collect all Conflicts between two collections of fields. This is similar to, +// but different from the `collectConflictsWithin` function above. This check +// assumes that `collectConflictsWithin` has already been called on each +// provided collection of fields. This is true because this validator traverses +// each individual selection set. +function collectConflictsBetween( + context: ValidationContext, + conflicts: Array, + cachedFieldsAndFragmentNames: Map, + comparedFragmentPairs: PairSet, + parentFieldsAreMutuallyExclusive: boolean, + fieldMap1: NodeAndDefCollection, + fieldMap2: NodeAndDefCollection, +): void { + // A field map is a keyed collection, where each key represents a response + // name and the value at that key is a list of all fields which provide that + // response name. For any response name which appears in both provided field + // maps, each field from the first field map must be compared to every field + // in the second field map to find potential conflicts. + for (const [responseName, fields1] of Object.entries(fieldMap1)) { + const fields2 = fieldMap2[responseName]; + if (fields2) { + for (const field1 of fields1) { + for (const field2 of fields2) { + const conflict = findConflict( + context, + cachedFieldsAndFragmentNames, + comparedFragmentPairs, + parentFieldsAreMutuallyExclusive, + responseName, + field1, + field2, + ); + if (conflict) { + conflicts.push(conflict); + } + } + } + } + } +} + +// Determines if there is a conflict between two particular fields, including +// comparing their sub-fields. +function findConflict( + context: ValidationContext, + cachedFieldsAndFragmentNames: Map, + comparedFragmentPairs: PairSet, + parentFieldsAreMutuallyExclusive: boolean, + responseName: string, + field1: NodeAndDef, + field2: NodeAndDef, +): Maybe { + const [parentType1, node1, def1] = field1; + const [parentType2, node2, def2] = field2; + + // If it is known that two fields could not possibly apply at the same + // time, due to the parent types, then it is safe to permit them to diverge + // in aliased field or arguments used as they will not present any ambiguity + // by differing. + // It is known that two parent types could never overlap if they are + // different Object types. Interface or Union types might overlap - if not + // in the current state of the schema, then perhaps in some future version, + // thus may not safely diverge. + const areMutuallyExclusive = + parentFieldsAreMutuallyExclusive || + (parentType1 !== parentType2 && + isObjectType(parentType1) && + isObjectType(parentType2)); + + if (!areMutuallyExclusive) { + // Two aliases must refer to the same field. + const name1 = node1.name.value; + const name2 = node2.name.value; + if (name1 !== name2) { + return [ + [responseName, `"${name1}" and "${name2}" are different fields`], + [node1], + [node2], + ]; + } + + // FIXME https://github.com/graphql/graphql-js/issues/2203 + const args1 = /* c8 ignore next */ node1.arguments ?? []; + const args2 = /* c8 ignore next */ node2.arguments ?? []; + + // Two field calls must have the same arguments. + if (!sameArguments(args1, args2)) { + return [ + [responseName, 'they have differing arguments'], + [node1], + [node2], + ]; + } + } + + // The return type for each field. + const type1 = def1?.type; + const type2 = def2?.type; + + if (type1 && type2 && doTypesConflict(type1, type2)) { + return [ + [ + responseName, + `they return conflicting types "${inspect(type1)}" and "${inspect( + type2, + )}"`, + ], + [node1], + [node2], + ]; + } + + // Collect and compare sub-fields. Use the same "visited fragment names" list + // for both collections so fields in a fragment reference are never + // compared to themselves. + const selectionSet1 = node1.selectionSet; + const selectionSet2 = node2.selectionSet; + if (selectionSet1 && selectionSet2) { + const conflicts = findConflictsBetweenSubSelectionSets( + context, + cachedFieldsAndFragmentNames, + comparedFragmentPairs, + areMutuallyExclusive, + getNamedType(type1), + selectionSet1, + getNamedType(type2), + selectionSet2, + ); + return subfieldConflicts(conflicts, responseName, node1, node2); + } +} + +function sameArguments( + arguments1: ReadonlyArray, + arguments2: ReadonlyArray, +): boolean { + if (arguments1.length !== arguments2.length) { + return false; + } + return arguments1.every((argument1) => { + const argument2 = arguments2.find( + (argument) => argument.name.value === argument1.name.value, + ); + if (!argument2) { + return false; + } + return sameValue(argument1.value, argument2.value); + }); +} + +function sameValue(value1: ValueNode, value2: ValueNode): boolean { + return print(value1) === print(value2); +} + +// Two types conflict if both types could not apply to a value simultaneously. +// Composite types are ignored as their individual field types will be compared +// later recursively. However List and Non-Null types must match. +function doTypesConflict( + type1: GraphQLOutputType, + type2: GraphQLOutputType, +): boolean { + if (isListType(type1)) { + return isListType(type2) + ? doTypesConflict(type1.ofType, type2.ofType) + : true; + } + if (isListType(type2)) { + return true; + } + if (isNonNullType(type1)) { + return isNonNullType(type2) + ? doTypesConflict(type1.ofType, type2.ofType) + : true; + } + if (isNonNullType(type2)) { + return true; + } + if (isLeafType(type1) || isLeafType(type2)) { + return type1 !== type2; + } + return false; +} + +// Given a selection set, return the collection of fields (a mapping of response +// name to field nodes and definitions) as well as a list of fragment names +// referenced via fragment spreads. +function getFieldsAndFragmentNames( + context: ValidationContext, + cachedFieldsAndFragmentNames: Map, + parentType: Maybe, + selectionSet: SelectionSetNode, +): FieldsAndFragmentNames { + const cached = cachedFieldsAndFragmentNames.get(selectionSet); + if (cached) { + return cached; + } + const nodeAndDefs: NodeAndDefCollection = Object.create(null); + const fragmentNames: ObjMap = Object.create(null); + _collectFieldsAndFragmentNames( + context, + parentType, + selectionSet, + nodeAndDefs, + fragmentNames, + ); + const result = [nodeAndDefs, Object.keys(fragmentNames)] as const; + cachedFieldsAndFragmentNames.set(selectionSet, result); + return result; +} + +// Given a reference to a fragment, return the represented collection of fields +// as well as a list of nested fragment names referenced via fragment spreads. +function getReferencedFieldsAndFragmentNames( + context: ValidationContext, + cachedFieldsAndFragmentNames: Map, + fragment: FragmentDefinitionNode, +) { + // Short-circuit building a type from the node if possible. + const cached = cachedFieldsAndFragmentNames.get(fragment.selectionSet); + if (cached) { + return cached; + } + + const fragmentType = typeFromAST(context.getSchema(), fragment.typeCondition); + return getFieldsAndFragmentNames( + context, + cachedFieldsAndFragmentNames, + fragmentType, + fragment.selectionSet, + ); +} + +function _collectFieldsAndFragmentNames( + context: ValidationContext, + parentType: Maybe, + selectionSet: SelectionSetNode, + nodeAndDefs: NodeAndDefCollection, + fragmentNames: ObjMap, +): void { + for (const selection of selectionSet.selections) { + switch (selection.kind) { + case Kind.FIELD: { + const fieldName = selection.name.value; + let fieldDef; + if (isObjectType(parentType) || isInterfaceType(parentType)) { + fieldDef = parentType.getFields()[fieldName]; + } + const responseName = selection.alias + ? selection.alias.value + : fieldName; + if (!nodeAndDefs[responseName]) { + nodeAndDefs[responseName] = []; + } + nodeAndDefs[responseName].push([parentType, selection, fieldDef]); + break; + } + case Kind.FRAGMENT_SPREAD: + fragmentNames[selection.name.value] = true; + break; + case Kind.INLINE_FRAGMENT: { + const typeCondition = selection.typeCondition; + const inlineFragmentType = typeCondition + ? typeFromAST(context.getSchema(), typeCondition) + : parentType; + _collectFieldsAndFragmentNames( + context, + inlineFragmentType, + selection.selectionSet, + nodeAndDefs, + fragmentNames, + ); + break; + } + } + } +} + +// Given a series of Conflicts which occurred between two sub-fields, generate +// a single Conflict. +function subfieldConflicts( + conflicts: ReadonlyArray, + responseName: string, + node1: FieldNode, + node2: FieldNode, +): Maybe { + if (conflicts.length > 0) { + return [ + [responseName, conflicts.map(([reason]) => reason)], + [node1, ...conflicts.map(([, fields1]) => fields1).flat()], + [node2, ...conflicts.map(([, , fields2]) => fields2).flat()], + ]; + } +} + +/** + * A way to keep track of pairs of things when the ordering of the pair does not matter. + */ +class PairSet { + _data: Map>; + + constructor() { + this._data = new Map(); + } + + has(a: string, b: string, areMutuallyExclusive: boolean): boolean { + const [key1, key2] = a < b ? [a, b] : [b, a]; + + const result = this._data.get(key1)?.get(key2); + if (result === undefined) { + return false; + } + + // areMutuallyExclusive being false is a superset of being true, hence if + // we want to know if this PairSet "has" these two with no exclusivity, + // we have to ensure it was added as such. + return areMutuallyExclusive ? true : areMutuallyExclusive === result; + } + + add(a: string, b: string, areMutuallyExclusive: boolean): void { + const [key1, key2] = a < b ? [a, b] : [b, a]; + + const map = this._data.get(key1); + if (map === undefined) { + this._data.set(key1, new Map([[key2, areMutuallyExclusive]])); + } else { + map.set(key2, areMutuallyExclusive); + } + } +} diff --git a/src/validation/rules/PossibleFragmentSpreadsRule.ts b/src/validation/rules/PossibleFragmentSpreadsRule.ts new file mode 100644 index 00000000..b2210e5a --- /dev/null +++ b/src/validation/rules/PossibleFragmentSpreadsRule.ts @@ -0,0 +1,78 @@ +import { inspect } from '../../jsutils/inspect'; +import type { Maybe } from '../../jsutils/Maybe'; + +import { GraphQLError } from '../../error/GraphQLError'; + +import type { ASTVisitor } from '../../language/visitor'; + +import type { GraphQLCompositeType } from '../../type/definition'; +import { isCompositeType } from '../../type/definition'; + +import { doTypesOverlap } from '../../utilities/typeComparators'; +import { typeFromAST } from '../../utilities/typeFromAST'; + +import type { ValidationContext } from '../ValidationContext'; + +/** + * Possible fragment spread + * + * A fragment spread is only valid if the type condition could ever possibly + * be true: if there is a non-empty intersection of the possible parent types, + * and possible types which pass the type condition. + */ +export function PossibleFragmentSpreadsRule( + context: ValidationContext, +): ASTVisitor { + return { + InlineFragment(node) { + const fragType = context.getType(); + const parentType = context.getParentType(); + if ( + isCompositeType(fragType) && + isCompositeType(parentType) && + !doTypesOverlap(context.getSchema(), fragType, parentType) + ) { + const parentTypeStr = inspect(parentType); + const fragTypeStr = inspect(fragType); + context.reportError( + new GraphQLError( + `Fragment cannot be spread here as objects of type "${parentTypeStr}" can never be of type "${fragTypeStr}".`, + node, + ), + ); + } + }, + FragmentSpread(node) { + const fragName = node.name.value; + const fragType = getFragmentType(context, fragName); + const parentType = context.getParentType(); + if ( + fragType && + parentType && + !doTypesOverlap(context.getSchema(), fragType, parentType) + ) { + const parentTypeStr = inspect(parentType); + const fragTypeStr = inspect(fragType); + context.reportError( + new GraphQLError( + `Fragment "${fragName}" cannot be spread here as objects of type "${parentTypeStr}" can never be of type "${fragTypeStr}".`, + node, + ), + ); + } + }, + }; +} + +function getFragmentType( + context: ValidationContext, + name: string, +): Maybe { + const frag = context.getFragment(name); + if (frag) { + const type = typeFromAST(context.getSchema(), frag.typeCondition); + if (isCompositeType(type)) { + return type; + } + } +} diff --git a/src/validation/rules/PossibleTypeExtensionsRule.ts b/src/validation/rules/PossibleTypeExtensionsRule.ts new file mode 100644 index 00000000..4abca7b7 --- /dev/null +++ b/src/validation/rules/PossibleTypeExtensionsRule.ts @@ -0,0 +1,144 @@ +import { didYouMean } from '../../jsutils/didYouMean'; +import { inspect } from '../../jsutils/inspect'; +import { invariant } from '../../jsutils/invariant'; +import type { ObjMap } from '../../jsutils/ObjMap'; +import { suggestionList } from '../../jsutils/suggestionList'; + +import { GraphQLError } from '../../error/GraphQLError'; + +import type { DefinitionNode, TypeExtensionNode } from '../../language/ast'; +import { Kind } from '../../language/kinds'; +import { isTypeDefinitionNode } from '../../language/predicates'; +import type { ASTVisitor } from '../../language/visitor'; + +import type { GraphQLNamedType } from '../../type/definition'; +import { + isEnumType, + isInputObjectType, + isInterfaceType, + isObjectType, + isScalarType, + isUnionType, +} from '../../type/definition'; + +import type { SDLValidationContext } from '../ValidationContext'; + +/** + * Possible type extension + * + * A type extension is only valid if the type is defined and has the same kind. + */ +export function PossibleTypeExtensionsRule( + context: SDLValidationContext, +): ASTVisitor { + const schema = context.getSchema(); + const definedTypes: ObjMap = Object.create(null); + + for (const def of context.getDocument().definitions) { + if (isTypeDefinitionNode(def)) { + definedTypes[def.name.value] = def; + } + } + + return { + ScalarTypeExtension: checkExtension, + ObjectTypeExtension: checkExtension, + InterfaceTypeExtension: checkExtension, + UnionTypeExtension: checkExtension, + EnumTypeExtension: checkExtension, + InputObjectTypeExtension: checkExtension, + }; + + function checkExtension(node: TypeExtensionNode): void { + const typeName = node.name.value; + const defNode = definedTypes[typeName]; + const existingType = schema?.getType(typeName); + + let expectedKind: Kind | undefined; + if (defNode) { + expectedKind = defKindToExtKind[defNode.kind]; + } else if (existingType) { + expectedKind = typeToExtKind(existingType); + } + + if (expectedKind) { + if (expectedKind !== node.kind) { + const kindStr = extensionKindToTypeName(node.kind); + context.reportError( + new GraphQLError( + `Cannot extend non-${kindStr} type "${typeName}".`, + defNode ? [defNode, node] : node, + ), + ); + } + } else { + const allTypeNames = Object.keys({ + ...definedTypes, + ...schema?.getTypeMap(), + }); + + const suggestedTypes = suggestionList(typeName, allTypeNames); + context.reportError( + new GraphQLError( + `Cannot extend type "${typeName}" because it is not defined.` + + didYouMean(suggestedTypes), + node.name, + ), + ); + } + } +} + +const defKindToExtKind: ObjMap = { + [Kind.SCALAR_TYPE_DEFINITION]: Kind.SCALAR_TYPE_EXTENSION, + [Kind.OBJECT_TYPE_DEFINITION]: Kind.OBJECT_TYPE_EXTENSION, + [Kind.INTERFACE_TYPE_DEFINITION]: Kind.INTERFACE_TYPE_EXTENSION, + [Kind.UNION_TYPE_DEFINITION]: Kind.UNION_TYPE_EXTENSION, + [Kind.ENUM_TYPE_DEFINITION]: Kind.ENUM_TYPE_EXTENSION, + [Kind.INPUT_OBJECT_TYPE_DEFINITION]: Kind.INPUT_OBJECT_TYPE_EXTENSION, +}; + +function typeToExtKind(type: GraphQLNamedType): Kind { + if (isScalarType(type)) { + return Kind.SCALAR_TYPE_EXTENSION; + } + if (isObjectType(type)) { + return Kind.OBJECT_TYPE_EXTENSION; + } + if (isInterfaceType(type)) { + return Kind.INTERFACE_TYPE_EXTENSION; + } + if (isUnionType(type)) { + return Kind.UNION_TYPE_EXTENSION; + } + if (isEnumType(type)) { + return Kind.ENUM_TYPE_EXTENSION; + } + if (isInputObjectType(type)) { + return Kind.INPUT_OBJECT_TYPE_EXTENSION; + } + /* c8 ignore next 3 */ + // Not reachable. All possible types have been considered + invariant(false, 'Unexpected type: ' + inspect(type)); +} + +function extensionKindToTypeName(kind: Kind): string { + switch (kind) { + case Kind.SCALAR_TYPE_EXTENSION: + return 'scalar'; + case Kind.OBJECT_TYPE_EXTENSION: + return 'object'; + case Kind.INTERFACE_TYPE_EXTENSION: + return 'interface'; + case Kind.UNION_TYPE_EXTENSION: + return 'union'; + case Kind.ENUM_TYPE_EXTENSION: + return 'enum'; + case Kind.INPUT_OBJECT_TYPE_EXTENSION: + return 'input object'; + // Not reachable. All possible types have been considered + /* c8 ignore next */ + default: + invariant(false, 'Unexpected kind: ' + inspect(kind)); + } +} diff --git a/src/validation/rules/ProvidedRequiredArgumentsRule.ts b/src/validation/rules/ProvidedRequiredArgumentsRule.ts new file mode 100644 index 00000000..b16079b1 --- /dev/null +++ b/src/validation/rules/ProvidedRequiredArgumentsRule.ts @@ -0,0 +1,127 @@ +import { inspect } from '../../jsutils/inspect'; +import { keyMap } from '../../jsutils/keyMap'; +import type { ObjMap } from '../../jsutils/ObjMap'; + +import { GraphQLError } from '../../error/GraphQLError'; + +import type { InputValueDefinitionNode } from '../../language/ast'; +import { Kind } from '../../language/kinds'; +import { print } from '../../language/printer'; +import type { ASTVisitor } from '../../language/visitor'; + +import type { GraphQLArgument } from '../../type/definition'; +import { isRequiredArgument, isType } from '../../type/definition'; +import { specifiedDirectives } from '../../type/directives'; + +import type { + SDLValidationContext, + ValidationContext, +} from '../ValidationContext'; + +/** + * Provided required arguments + * + * A field or directive is only valid if all required (non-null without a + * default value) field arguments have been provided. + */ +export function ProvidedRequiredArgumentsRule( + context: ValidationContext, +): ASTVisitor { + return { + // eslint-disable-next-line new-cap + ...ProvidedRequiredArgumentsOnDirectivesRule(context), + Field: { + // Validate on leave to allow for deeper errors to appear first. + leave(fieldNode) { + const fieldDef = context.getFieldDef(); + if (!fieldDef) { + return false; + } + + const providedArgs = new Set( + // FIXME: https://github.com/graphql/graphql-js/issues/2203 + /* c8 ignore next */ + fieldNode.arguments?.map((arg) => arg.name.value), + ); + for (const argDef of fieldDef.args) { + if (!providedArgs.has(argDef.name) && isRequiredArgument(argDef)) { + const argTypeStr = inspect(argDef.type); + context.reportError( + new GraphQLError( + `Field "${fieldDef.name}" argument "${argDef.name}" of type "${argTypeStr}" is required, but it was not provided.`, + fieldNode, + ), + ); + } + } + }, + }, + }; +} + +/** + * @internal + */ +export function ProvidedRequiredArgumentsOnDirectivesRule( + context: ValidationContext | SDLValidationContext, +): ASTVisitor { + const requiredArgsMap: ObjMap< + ObjMap + > = Object.create(null); + + const schema = context.getSchema(); + const definedDirectives = schema?.getDirectives() ?? specifiedDirectives; + for (const directive of definedDirectives) { + requiredArgsMap[directive.name] = keyMap( + directive.args.filter(isRequiredArgument), + (arg) => arg.name, + ); + } + + const astDefinitions = context.getDocument().definitions; + for (const def of astDefinitions) { + if (def.kind === Kind.DIRECTIVE_DEFINITION) { + // FIXME: https://github.com/graphql/graphql-js/issues/2203 + /* c8 ignore next */ + const argNodes = def.arguments ?? []; + + requiredArgsMap[def.name.value] = keyMap( + argNodes.filter(isRequiredArgumentNode), + (arg) => arg.name.value, + ); + } + } + + return { + Directive: { + // Validate on leave to allow for deeper errors to appear first. + leave(directiveNode) { + const directiveName = directiveNode.name.value; + const requiredArgs = requiredArgsMap[directiveName]; + if (requiredArgs) { + // FIXME: https://github.com/graphql/graphql-js/issues/2203 + /* c8 ignore next */ + const argNodes = directiveNode.arguments ?? []; + const argNodeMap = new Set(argNodes.map((arg) => arg.name.value)); + for (const [argName, argDef] of Object.entries(requiredArgs)) { + if (!argNodeMap.has(argName)) { + const argType = isType(argDef.type) + ? inspect(argDef.type) + : print(argDef.type); + context.reportError( + new GraphQLError( + `Directive "@${directiveName}" argument "${argName}" of type "${argType}" is required, but it was not provided.`, + directiveNode, + ), + ); + } + } + } + }, + }, + }; +} + +function isRequiredArgumentNode(arg: InputValueDefinitionNode): boolean { + return arg.type.kind === Kind.NON_NULL_TYPE && arg.defaultValue == null; +} diff --git a/src/validation/rules/ScalarLeafsRule.ts b/src/validation/rules/ScalarLeafsRule.ts new file mode 100644 index 00000000..c59667d9 --- /dev/null +++ b/src/validation/rules/ScalarLeafsRule.ts @@ -0,0 +1,48 @@ +import { inspect } from '../../jsutils/inspect'; + +import { GraphQLError } from '../../error/GraphQLError'; + +import type { FieldNode } from '../../language/ast'; +import type { ASTVisitor } from '../../language/visitor'; + +import { getNamedType, isLeafType } from '../../type/definition'; + +import type { ValidationContext } from '../ValidationContext'; + +/** + * Scalar leafs + * + * A GraphQL document is valid only if all leaf fields (fields without + * sub selections) are of scalar or enum types. + */ +export function ScalarLeafsRule(context: ValidationContext): ASTVisitor { + return { + Field(node: FieldNode) { + const type = context.getType(); + const selectionSet = node.selectionSet; + if (type) { + if (isLeafType(getNamedType(type))) { + if (selectionSet) { + const fieldName = node.name.value; + const typeStr = inspect(type); + context.reportError( + new GraphQLError( + `Field "${fieldName}" must not have a selection since type "${typeStr}" has no subfields.`, + selectionSet, + ), + ); + } + } else if (!selectionSet) { + const fieldName = node.name.value; + const typeStr = inspect(type); + context.reportError( + new GraphQLError( + `Field "${fieldName}" of type "${typeStr}" must have a selection of subfields. Did you mean "${fieldName} { ... }"?`, + node, + ), + ); + } + } + }, + }; +} diff --git a/src/validation/rules/SingleFieldSubscriptionsRule.ts b/src/validation/rules/SingleFieldSubscriptionsRule.ts new file mode 100644 index 00000000..db0e6446 --- /dev/null +++ b/src/validation/rules/SingleFieldSubscriptionsRule.ts @@ -0,0 +1,82 @@ +import type { ObjMap } from '../../jsutils/ObjMap'; + +import { GraphQLError } from '../../error/GraphQLError'; + +import type { + FragmentDefinitionNode, + OperationDefinitionNode, +} from '../../language/ast'; +import { Kind } from '../../language/kinds'; +import type { ASTVisitor } from '../../language/visitor'; + +import { collectFields } from '../../execution/collectFields'; + +import type { ValidationContext } from '../ValidationContext'; + +/** + * Subscriptions must only include a non-introspection field. + * + * A GraphQL subscription is valid only if it contains a single root field and + * that root field is not an introspection field. + * + * See https://spec.graphql.org/draft/#sec-Single-root-field + */ +export function SingleFieldSubscriptionsRule( + context: ValidationContext, +): ASTVisitor { + return { + OperationDefinition(node: OperationDefinitionNode) { + if (node.operation === 'subscription') { + const schema = context.getSchema(); + const subscriptionType = schema.getSubscriptionType(); + if (subscriptionType) { + const operationName = node.name ? node.name.value : null; + const variableValues: { + [variable: string]: any; + } = Object.create(null); + const document = context.getDocument(); + const fragments: ObjMap = Object.create(null); + for (const definition of document.definitions) { + if (definition.kind === Kind.FRAGMENT_DEFINITION) { + fragments[definition.name.value] = definition; + } + } + const fields = collectFields( + schema, + fragments, + variableValues, + subscriptionType, + node.selectionSet, + ); + if (fields.size > 1) { + const fieldSelectionLists = [...fields.values()]; + const extraFieldSelectionLists = fieldSelectionLists.slice(1); + const extraFieldSelections = extraFieldSelectionLists.flat(); + context.reportError( + new GraphQLError( + operationName != null + ? `Subscription "${operationName}" must select only one top level field.` + : 'Anonymous Subscription must select only one top level field.', + extraFieldSelections, + ), + ); + } + for (const fieldNodes of fields.values()) { + const field = fieldNodes[0]; + const fieldName = field.name.value; + if (fieldName.startsWith('__')) { + context.reportError( + new GraphQLError( + operationName != null + ? `Subscription "${operationName}" must not select an introspection top level field.` + : 'Anonymous Subscription must not select an introspection top level field.', + fieldNodes, + ), + ); + } + } + } + } + }, + }; +} diff --git a/src/validation/rules/UniqueArgumentDefinitionNamesRule.ts b/src/validation/rules/UniqueArgumentDefinitionNamesRule.ts new file mode 100644 index 00000000..3f6e79df --- /dev/null +++ b/src/validation/rules/UniqueArgumentDefinitionNamesRule.ts @@ -0,0 +1,79 @@ +import { groupBy } from '../../jsutils/groupBy'; + +import { GraphQLError } from '../../error/GraphQLError'; + +import type { + FieldDefinitionNode, + InputValueDefinitionNode, + NameNode, +} from '../../language/ast'; +import type { ASTVisitor } from '../../language/visitor'; + +import type { SDLValidationContext } from '../ValidationContext'; + +/** + * Unique argument definition names + * + * A GraphQL Object or Interface type is only valid if all its fields have uniquely named arguments. + * A GraphQL Directive is only valid if all its arguments are uniquely named. + */ +export function UniqueArgumentDefinitionNamesRule( + context: SDLValidationContext, +): ASTVisitor { + return { + DirectiveDefinition(directiveNode) { + // FIXME: https://github.com/graphql/graphql-js/issues/2203 + /* c8 ignore next */ + const argumentNodes = directiveNode.arguments ?? []; + + return checkArgUniqueness(`@${directiveNode.name.value}`, argumentNodes); + }, + InterfaceTypeDefinition: checkArgUniquenessPerField, + InterfaceTypeExtension: checkArgUniquenessPerField, + ObjectTypeDefinition: checkArgUniquenessPerField, + ObjectTypeExtension: checkArgUniquenessPerField, + }; + + function checkArgUniquenessPerField(typeNode: { + readonly name: NameNode; + readonly fields?: ReadonlyArray; + }) { + const typeName = typeNode.name.value; + + // FIXME: https://github.com/graphql/graphql-js/issues/2203 + /* c8 ignore next */ + const fieldNodes = typeNode.fields ?? []; + + for (const fieldDef of fieldNodes) { + const fieldName = fieldDef.name.value; + + // FIXME: https://github.com/graphql/graphql-js/issues/2203 + /* c8 ignore next */ + const argumentNodes = fieldDef.arguments ?? []; + + checkArgUniqueness(`${typeName}.${fieldName}`, argumentNodes); + } + + return false; + } + + function checkArgUniqueness( + parentName: string, + argumentNodes: ReadonlyArray, + ) { + const seenArgs = groupBy(argumentNodes, (arg) => arg.name.value); + + for (const [argName, argNodes] of seenArgs) { + if (argNodes.length > 1) { + context.reportError( + new GraphQLError( + `Argument "${parentName}(${argName}:)" can only be defined once.`, + argNodes.map((node) => node.name), + ), + ); + } + } + + return false; + } +} diff --git a/src/validation/rules/UniqueArgumentNamesRule.ts b/src/validation/rules/UniqueArgumentNamesRule.ts new file mode 100644 index 00000000..fad6ed0e --- /dev/null +++ b/src/validation/rules/UniqueArgumentNamesRule.ts @@ -0,0 +1,46 @@ +import { groupBy } from '../../jsutils/groupBy'; + +import { GraphQLError } from '../../error/GraphQLError'; + +import type { ArgumentNode } from '../../language/ast'; +import type { ASTVisitor } from '../../language/visitor'; + +import type { ASTValidationContext } from '../ValidationContext'; + +/** + * Unique argument names + * + * A GraphQL field or directive is only valid if all supplied arguments are + * uniquely named. + * + * See https://spec.graphql.org/draft/#sec-Argument-Names + */ +export function UniqueArgumentNamesRule( + context: ASTValidationContext, +): ASTVisitor { + return { + Field: checkArgUniqueness, + Directive: checkArgUniqueness, + }; + + function checkArgUniqueness(parentNode: { + arguments?: ReadonlyArray; + }) { + // FIXME: https://github.com/graphql/graphql-js/issues/2203 + /* c8 ignore next */ + const argumentNodes = parentNode.arguments ?? []; + + const seenArgs = groupBy(argumentNodes, (arg) => arg.name.value); + + for (const [argName, argNodes] of seenArgs) { + if (argNodes.length > 1) { + context.reportError( + new GraphQLError( + `There can be only one argument named "${argName}".`, + argNodes.map((node) => node.name), + ), + ); + } + } + } +} diff --git a/src/validation/rules/UniqueDirectiveNamesRule.ts b/src/validation/rules/UniqueDirectiveNamesRule.ts new file mode 100644 index 00000000..cbd39ce2 --- /dev/null +++ b/src/validation/rules/UniqueDirectiveNamesRule.ts @@ -0,0 +1,46 @@ +import { GraphQLError } from '../../error/GraphQLError'; + +import type { ASTVisitor } from '../../language/visitor'; + +import type { SDLValidationContext } from '../ValidationContext'; + +/** + * Unique directive names + * + * A GraphQL document is only valid if all defined directives have unique names. + */ +export function UniqueDirectiveNamesRule( + context: SDLValidationContext, +): ASTVisitor { + const knownDirectiveNames = Object.create(null); + const schema = context.getSchema(); + + return { + DirectiveDefinition(node) { + const directiveName = node.name.value; + + if (schema?.getDirective(directiveName)) { + context.reportError( + new GraphQLError( + `Directive "@${directiveName}" already exists in the schema. It cannot be redefined.`, + node.name, + ), + ); + return; + } + + if (knownDirectiveNames[directiveName]) { + context.reportError( + new GraphQLError( + `There can be only one directive named "@${directiveName}".`, + [knownDirectiveNames[directiveName], node.name], + ), + ); + } else { + knownDirectiveNames[directiveName] = node.name; + } + + return false; + }, + }; +} diff --git a/src/validation/rules/UniqueDirectivesPerLocationRule.ts b/src/validation/rules/UniqueDirectivesPerLocationRule.ts new file mode 100644 index 00000000..18b04c50 --- /dev/null +++ b/src/validation/rules/UniqueDirectivesPerLocationRule.ts @@ -0,0 +1,91 @@ +import { GraphQLError } from '../../error/GraphQLError'; + +import { Kind } from '../../language/kinds'; +import { + isTypeDefinitionNode, + isTypeExtensionNode, +} from '../../language/predicates'; +import type { ASTVisitor } from '../../language/visitor'; + +import { specifiedDirectives } from '../../type/directives'; + +import type { + SDLValidationContext, + ValidationContext, +} from '../ValidationContext'; + +/** + * Unique directive names per location + * + * A GraphQL document is only valid if all non-repeatable directives at + * a given location are uniquely named. + * + * See https://spec.graphql.org/draft/#sec-Directives-Are-Unique-Per-Location + */ +export function UniqueDirectivesPerLocationRule( + context: ValidationContext | SDLValidationContext, +): ASTVisitor { + const uniqueDirectiveMap = Object.create(null); + + const schema = context.getSchema(); + const definedDirectives = schema + ? schema.getDirectives() + : specifiedDirectives; + for (const directive of definedDirectives) { + uniqueDirectiveMap[directive.name] = !directive.isRepeatable; + } + + const astDefinitions = context.getDocument().definitions; + for (const def of astDefinitions) { + if (def.kind === Kind.DIRECTIVE_DEFINITION) { + uniqueDirectiveMap[def.name.value] = !def.repeatable; + } + } + + const schemaDirectives = Object.create(null); + const typeDirectivesMap = Object.create(null); + + return { + // Many different AST nodes may contain directives. Rather than listing + // them all, just listen for entering any node, and check to see if it + // defines any directives. + enter(node) { + if (!('directives' in node) || !node.directives) { + return; + } + + let seenDirectives; + if ( + node.kind === Kind.SCHEMA_DEFINITION || + node.kind === Kind.SCHEMA_EXTENSION + ) { + seenDirectives = schemaDirectives; + } else if (isTypeDefinitionNode(node) || isTypeExtensionNode(node)) { + const typeName = node.name.value; + seenDirectives = typeDirectivesMap[typeName]; + if (seenDirectives === undefined) { + typeDirectivesMap[typeName] = seenDirectives = Object.create(null); + } + } else { + seenDirectives = Object.create(null); + } + + for (const directive of node.directives) { + const directiveName = directive.name.value; + + if (uniqueDirectiveMap[directiveName]) { + if (seenDirectives[directiveName]) { + context.reportError( + new GraphQLError( + `The directive "@${directiveName}" can only be used once at this location.`, + [seenDirectives[directiveName], directive], + ), + ); + } else { + seenDirectives[directiveName] = directive; + } + } + } + }, + }; +} diff --git a/src/validation/rules/UniqueEnumValueNamesRule.ts b/src/validation/rules/UniqueEnumValueNamesRule.ts new file mode 100644 index 00000000..5fbe62ce --- /dev/null +++ b/src/validation/rules/UniqueEnumValueNamesRule.ts @@ -0,0 +1,69 @@ +import { GraphQLError } from '../../error/GraphQLError'; + +import type { + EnumTypeDefinitionNode, + EnumTypeExtensionNode, +} from '../../language/ast'; +import type { ASTVisitor } from '../../language/visitor'; + +import { isEnumType } from '../../type/definition'; + +import type { SDLValidationContext } from '../ValidationContext'; + +/** + * Unique enum value names + * + * A GraphQL enum type is only valid if all its values are uniquely named. + */ +export function UniqueEnumValueNamesRule( + context: SDLValidationContext, +): ASTVisitor { + const schema = context.getSchema(); + const existingTypeMap = schema ? schema.getTypeMap() : Object.create(null); + const knownValueNames = Object.create(null); + + return { + EnumTypeDefinition: checkValueUniqueness, + EnumTypeExtension: checkValueUniqueness, + }; + + function checkValueUniqueness( + node: EnumTypeDefinitionNode | EnumTypeExtensionNode, + ) { + const typeName = node.name.value; + + if (!knownValueNames[typeName]) { + knownValueNames[typeName] = Object.create(null); + } + + // FIXME: https://github.com/graphql/graphql-js/issues/2203 + /* c8 ignore next */ + const valueNodes = node.values ?? []; + const valueNames = knownValueNames[typeName]; + + for (const valueDef of valueNodes) { + const valueName = valueDef.name.value; + + const existingType = existingTypeMap[typeName]; + if (isEnumType(existingType) && existingType.getValue(valueName)) { + context.reportError( + new GraphQLError( + `Enum value "${typeName}.${valueName}" already exists in the schema. It cannot also be defined in this type extension.`, + valueDef.name, + ), + ); + } else if (valueNames[valueName]) { + context.reportError( + new GraphQLError( + `Enum value "${typeName}.${valueName}" can only be defined once.`, + [valueNames[valueName], valueDef.name], + ), + ); + } else { + valueNames[valueName] = valueDef.name; + } + } + + return false; + } +} diff --git a/src/validation/rules/UniqueFieldDefinitionNamesRule.ts b/src/validation/rules/UniqueFieldDefinitionNamesRule.ts new file mode 100644 index 00000000..f312b76d --- /dev/null +++ b/src/validation/rules/UniqueFieldDefinitionNamesRule.ts @@ -0,0 +1,88 @@ +import { GraphQLError } from '../../error/GraphQLError'; + +import type { + FieldDefinitionNode, + InputValueDefinitionNode, + NameNode, +} from '../../language/ast'; +import type { ASTVisitor } from '../../language/visitor'; + +import type { GraphQLNamedType } from '../../type/definition'; +import { + isInputObjectType, + isInterfaceType, + isObjectType, +} from '../../type/definition'; + +import type { SDLValidationContext } from '../ValidationContext'; + +/** + * Unique field definition names + * + * A GraphQL complex type is only valid if all its fields are uniquely named. + */ +export function UniqueFieldDefinitionNamesRule( + context: SDLValidationContext, +): ASTVisitor { + const schema = context.getSchema(); + const existingTypeMap = schema ? schema.getTypeMap() : Object.create(null); + const knownFieldNames = Object.create(null); + + return { + InputObjectTypeDefinition: checkFieldUniqueness, + InputObjectTypeExtension: checkFieldUniqueness, + InterfaceTypeDefinition: checkFieldUniqueness, + InterfaceTypeExtension: checkFieldUniqueness, + ObjectTypeDefinition: checkFieldUniqueness, + ObjectTypeExtension: checkFieldUniqueness, + }; + + function checkFieldUniqueness(node: { + readonly name: NameNode; + readonly fields?: ReadonlyArray< + InputValueDefinitionNode | FieldDefinitionNode + >; + }) { + const typeName = node.name.value; + + if (!knownFieldNames[typeName]) { + knownFieldNames[typeName] = Object.create(null); + } + + // FIXME: https://github.com/graphql/graphql-js/issues/2203 + /* c8 ignore next */ + const fieldNodes = node.fields ?? []; + const fieldNames = knownFieldNames[typeName]; + + for (const fieldDef of fieldNodes) { + const fieldName = fieldDef.name.value; + + if (hasField(existingTypeMap[typeName], fieldName)) { + context.reportError( + new GraphQLError( + `Field "${typeName}.${fieldName}" already exists in the schema. It cannot also be defined in this type extension.`, + fieldDef.name, + ), + ); + } else if (fieldNames[fieldName]) { + context.reportError( + new GraphQLError( + `Field "${typeName}.${fieldName}" can only be defined once.`, + [fieldNames[fieldName], fieldDef.name], + ), + ); + } else { + fieldNames[fieldName] = fieldDef.name; + } + } + + return false; + } +} + +function hasField(type: GraphQLNamedType, fieldName: string): boolean { + if (isObjectType(type) || isInterfaceType(type) || isInputObjectType(type)) { + return type.getFields()[fieldName] != null; + } + return false; +} diff --git a/src/validation/rules/UniqueFragmentNamesRule.ts b/src/validation/rules/UniqueFragmentNamesRule.ts new file mode 100644 index 00000000..47e129e1 --- /dev/null +++ b/src/validation/rules/UniqueFragmentNamesRule.ts @@ -0,0 +1,35 @@ +import { GraphQLError } from '../../error/GraphQLError'; + +import type { ASTVisitor } from '../../language/visitor'; + +import type { ASTValidationContext } from '../ValidationContext'; + +/** + * Unique fragment names + * + * A GraphQL document is only valid if all defined fragments have unique names. + * + * See https://spec.graphql.org/draft/#sec-Fragment-Name-Uniqueness + */ +export function UniqueFragmentNamesRule( + context: ASTValidationContext, +): ASTVisitor { + const knownFragmentNames = Object.create(null); + return { + OperationDefinition: () => false, + FragmentDefinition(node) { + const fragmentName = node.name.value; + if (knownFragmentNames[fragmentName]) { + context.reportError( + new GraphQLError( + `There can be only one fragment named "${fragmentName}".`, + [knownFragmentNames[fragmentName], node.name], + ), + ); + } else { + knownFragmentNames[fragmentName] = node.name; + } + return false; + }, + }; +} diff --git a/src/validation/rules/UniqueInputFieldNamesRule.ts b/src/validation/rules/UniqueInputFieldNamesRule.ts new file mode 100644 index 00000000..392df444 --- /dev/null +++ b/src/validation/rules/UniqueInputFieldNamesRule.ts @@ -0,0 +1,51 @@ +import { invariant } from '../../jsutils/invariant'; +import type { ObjMap } from '../../jsutils/ObjMap'; + +import { GraphQLError } from '../../error/GraphQLError'; + +import type { NameNode } from '../../language/ast'; +import type { ASTVisitor } from '../../language/visitor'; + +import type { ASTValidationContext } from '../ValidationContext'; + +/** + * Unique input field names + * + * A GraphQL input object value is only valid if all supplied fields are + * uniquely named. + * + * See https://spec.graphql.org/draft/#sec-Input-Object-Field-Uniqueness + */ +export function UniqueInputFieldNamesRule( + context: ASTValidationContext, +): ASTVisitor { + const knownNameStack: Array> = []; + let knownNames: ObjMap = Object.create(null); + + return { + ObjectValue: { + enter() { + knownNameStack.push(knownNames); + knownNames = Object.create(null); + }, + leave() { + const prevKnownNames = knownNameStack.pop(); + invariant(prevKnownNames); + knownNames = prevKnownNames; + }, + }, + ObjectField(node) { + const fieldName = node.name.value; + if (knownNames[fieldName]) { + context.reportError( + new GraphQLError( + `There can be only one input field named "${fieldName}".`, + [knownNames[fieldName], node.name], + ), + ); + } else { + knownNames[fieldName] = node.name; + } + }, + }; +} diff --git a/src/validation/rules/UniqueOperationNamesRule.ts b/src/validation/rules/UniqueOperationNamesRule.ts new file mode 100644 index 00000000..fb6b11cd --- /dev/null +++ b/src/validation/rules/UniqueOperationNamesRule.ts @@ -0,0 +1,37 @@ +import { GraphQLError } from '../../error/GraphQLError'; + +import type { ASTVisitor } from '../../language/visitor'; + +import type { ASTValidationContext } from '../ValidationContext'; + +/** + * Unique operation names + * + * A GraphQL document is only valid if all defined operations have unique names. + * + * See https://spec.graphql.org/draft/#sec-Operation-Name-Uniqueness + */ +export function UniqueOperationNamesRule( + context: ASTValidationContext, +): ASTVisitor { + const knownOperationNames = Object.create(null); + return { + OperationDefinition(node) { + const operationName = node.name; + if (operationName) { + if (knownOperationNames[operationName.value]) { + context.reportError( + new GraphQLError( + `There can be only one operation named "${operationName.value}".`, + [knownOperationNames[operationName.value], operationName], + ), + ); + } else { + knownOperationNames[operationName.value] = operationName; + } + } + return false; + }, + FragmentDefinition: () => false, + }; +} diff --git a/src/validation/rules/UniqueOperationTypesRule.ts b/src/validation/rules/UniqueOperationTypesRule.ts new file mode 100644 index 00000000..59aa4c95 --- /dev/null +++ b/src/validation/rules/UniqueOperationTypesRule.ts @@ -0,0 +1,66 @@ +import { GraphQLError } from '../../error/GraphQLError'; + +import type { + SchemaDefinitionNode, + SchemaExtensionNode, +} from '../../language/ast'; +import type { ASTVisitor } from '../../language/visitor'; + +import type { SDLValidationContext } from '../ValidationContext'; + +/** + * Unique operation types + * + * A GraphQL document is only valid if it has only one type per operation. + */ +export function UniqueOperationTypesRule( + context: SDLValidationContext, +): ASTVisitor { + const schema = context.getSchema(); + const definedOperationTypes = Object.create(null); + const existingOperationTypes = schema + ? { + query: schema.getQueryType(), + mutation: schema.getMutationType(), + subscription: schema.getSubscriptionType(), + } + : {}; + + return { + SchemaDefinition: checkOperationTypes, + SchemaExtension: checkOperationTypes, + }; + + function checkOperationTypes( + node: SchemaDefinitionNode | SchemaExtensionNode, + ) { + // See: https://github.com/graphql/graphql-js/issues/2203 + /* c8 ignore next */ + const operationTypesNodes = node.operationTypes ?? []; + + for (const operationType of operationTypesNodes) { + const operation = operationType.operation; + const alreadyDefinedOperationType = definedOperationTypes[operation]; + + if (existingOperationTypes[operation]) { + context.reportError( + new GraphQLError( + `Type for ${operation} already defined in the schema. It cannot be redefined.`, + operationType, + ), + ); + } else if (alreadyDefinedOperationType) { + context.reportError( + new GraphQLError( + `There can be only one ${operation} type in schema.`, + [alreadyDefinedOperationType, operationType], + ), + ); + } else { + definedOperationTypes[operation] = operationType; + } + } + + return false; + } +} diff --git a/src/validation/rules/UniqueTypeNamesRule.ts b/src/validation/rules/UniqueTypeNamesRule.ts new file mode 100644 index 00000000..7d11a320 --- /dev/null +++ b/src/validation/rules/UniqueTypeNamesRule.ts @@ -0,0 +1,52 @@ +import { GraphQLError } from '../../error/GraphQLError'; + +import type { TypeDefinitionNode } from '../../language/ast'; +import type { ASTVisitor } from '../../language/visitor'; + +import type { SDLValidationContext } from '../ValidationContext'; + +/** + * Unique type names + * + * A GraphQL document is only valid if all defined types have unique names. + */ +export function UniqueTypeNamesRule(context: SDLValidationContext): ASTVisitor { + const knownTypeNames = Object.create(null); + const schema = context.getSchema(); + + return { + ScalarTypeDefinition: checkTypeName, + ObjectTypeDefinition: checkTypeName, + InterfaceTypeDefinition: checkTypeName, + UnionTypeDefinition: checkTypeName, + EnumTypeDefinition: checkTypeName, + InputObjectTypeDefinition: checkTypeName, + }; + + function checkTypeName(node: TypeDefinitionNode) { + const typeName = node.name.value; + + if (schema?.getType(typeName)) { + context.reportError( + new GraphQLError( + `Type "${typeName}" already exists in the schema. It cannot also be defined in this type definition.`, + node.name, + ), + ); + return; + } + + if (knownTypeNames[typeName]) { + context.reportError( + new GraphQLError(`There can be only one type named "${typeName}".`, [ + knownTypeNames[typeName], + node.name, + ]), + ); + } else { + knownTypeNames[typeName] = node.name; + } + + return false; + } +} diff --git a/src/validation/rules/UniqueVariableNamesRule.ts b/src/validation/rules/UniqueVariableNamesRule.ts new file mode 100644 index 00000000..1e9a5f8d --- /dev/null +++ b/src/validation/rules/UniqueVariableNamesRule.ts @@ -0,0 +1,40 @@ +import { groupBy } from '../../jsutils/groupBy'; + +import { GraphQLError } from '../../error/GraphQLError'; + +import type { ASTVisitor } from '../../language/visitor'; + +import type { ASTValidationContext } from '../ValidationContext'; + +/** + * Unique variable names + * + * A GraphQL operation is only valid if all its variables are uniquely named. + */ +export function UniqueVariableNamesRule( + context: ASTValidationContext, +): ASTVisitor { + return { + OperationDefinition(operationNode) { + // See: https://github.com/graphql/graphql-js/issues/2203 + /* c8 ignore next */ + const variableDefinitions = operationNode.variableDefinitions ?? []; + + const seenVariableDefinitions = groupBy( + variableDefinitions, + (node) => node.variable.name.value, + ); + + for (const [variableName, variableNodes] of seenVariableDefinitions) { + if (variableNodes.length > 1) { + context.reportError( + new GraphQLError( + `There can be only one variable named "$${variableName}".`, + variableNodes.map((node) => node.variable.name), + ), + ); + } + } + }, + }; +} diff --git a/src/validation/rules/ValuesOfCorrectTypeRule.ts b/src/validation/rules/ValuesOfCorrectTypeRule.ts new file mode 100644 index 00000000..158691c5 --- /dev/null +++ b/src/validation/rules/ValuesOfCorrectTypeRule.ts @@ -0,0 +1,157 @@ +import { didYouMean } from '../../jsutils/didYouMean'; +import { inspect } from '../../jsutils/inspect'; +import { keyMap } from '../../jsutils/keyMap'; +import { suggestionList } from '../../jsutils/suggestionList'; + +import { GraphQLError } from '../../error/GraphQLError'; + +import type { ValueNode } from '../../language/ast'; +import { print } from '../../language/printer'; +import type { ASTVisitor } from '../../language/visitor'; + +import { + getNamedType, + getNullableType, + isInputObjectType, + isLeafType, + isListType, + isNonNullType, + isRequiredInputField, +} from '../../type/definition'; + +import type { ValidationContext } from '../ValidationContext'; + +/** + * Value literals of correct type + * + * A GraphQL document is only valid if all value literals are of the type + * expected at their position. + * + * See https://spec.graphql.org/draft/#sec-Values-of-Correct-Type + */ +export function ValuesOfCorrectTypeRule( + context: ValidationContext, +): ASTVisitor { + return { + ListValue(node) { + // Note: TypeInfo will traverse into a list's item type, so look to the + // parent input type to check if it is a list. + const type = getNullableType(context.getParentInputType()); + if (!isListType(type)) { + isValidValueNode(context, node); + return false; // Don't traverse further. + } + }, + ObjectValue(node) { + const type = getNamedType(context.getInputType()); + if (!isInputObjectType(type)) { + isValidValueNode(context, node); + return false; // Don't traverse further. + } + // Ensure every required field exists. + const fieldNodeMap = keyMap(node.fields, (field) => field.name.value); + for (const fieldDef of Object.values(type.getFields())) { + const fieldNode = fieldNodeMap[fieldDef.name]; + if (!fieldNode && isRequiredInputField(fieldDef)) { + const typeStr = inspect(fieldDef.type); + context.reportError( + new GraphQLError( + `Field "${type.name}.${fieldDef.name}" of required type "${typeStr}" was not provided.`, + node, + ), + ); + } + } + }, + ObjectField(node) { + const parentType = getNamedType(context.getParentInputType()); + const fieldType = context.getInputType(); + if (!fieldType && isInputObjectType(parentType)) { + const suggestions = suggestionList( + node.name.value, + Object.keys(parentType.getFields()), + ); + context.reportError( + new GraphQLError( + `Field "${node.name.value}" is not defined by type "${parentType.name}".` + + didYouMean(suggestions), + node, + ), + ); + } + }, + NullValue(node) { + const type = context.getInputType(); + if (isNonNullType(type)) { + context.reportError( + new GraphQLError( + `Expected value of type "${inspect(type)}", found ${print(node)}.`, + node, + ), + ); + } + }, + EnumValue: (node) => isValidValueNode(context, node), + IntValue: (node) => isValidValueNode(context, node), + FloatValue: (node) => isValidValueNode(context, node), + StringValue: (node) => isValidValueNode(context, node), + BooleanValue: (node) => isValidValueNode(context, node), + }; +} + +/** + * Any value literal may be a valid representation of a Scalar, depending on + * that scalar type. + */ +function isValidValueNode(context: ValidationContext, node: ValueNode): void { + // Report any error at the full type expected by the location. + const locationType = context.getInputType(); + if (!locationType) { + return; + } + + const type = getNamedType(locationType); + + if (!isLeafType(type)) { + const typeStr = inspect(locationType); + context.reportError( + new GraphQLError( + `Expected value of type "${typeStr}", found ${print(node)}.`, + node, + ), + ); + return; + } + + // Scalars and Enums determine if a literal value is valid via parseLiteral(), + // which may throw or return an invalid value to indicate failure. + try { + const parseResult = type.parseLiteral(node, undefined /* variables */); + if (parseResult === undefined) { + const typeStr = inspect(locationType); + context.reportError( + new GraphQLError( + `Expected value of type "${typeStr}", found ${print(node)}.`, + node, + ), + ); + } + } catch (error) { + const typeStr = inspect(locationType); + if (error instanceof GraphQLError) { + context.reportError(error); + } else { + context.reportError( + new GraphQLError( + `Expected value of type "${typeStr}", found ${print(node)}; ` + + error.message, + node, + undefined, + undefined, + undefined, + error, // Ensure a reference to the original error is maintained. + ), + ); + } + } +} diff --git a/src/validation/rules/VariablesAreInputTypesRule.ts b/src/validation/rules/VariablesAreInputTypesRule.ts new file mode 100644 index 00000000..bf830380 --- /dev/null +++ b/src/validation/rules/VariablesAreInputTypesRule.ts @@ -0,0 +1,41 @@ +import { GraphQLError } from '../../error/GraphQLError'; + +import type { VariableDefinitionNode } from '../../language/ast'; +import { print } from '../../language/printer'; +import type { ASTVisitor } from '../../language/visitor'; + +import { isInputType } from '../../type/definition'; + +import { typeFromAST } from '../../utilities/typeFromAST'; + +import type { ValidationContext } from '../ValidationContext'; + +/** + * Variables are input types + * + * A GraphQL operation is only valid if all the variables it defines are of + * input types (scalar, enum, or input object). + * + * See https://spec.graphql.org/draft/#sec-Variables-Are-Input-Types + */ +export function VariablesAreInputTypesRule( + context: ValidationContext, +): ASTVisitor { + return { + VariableDefinition(node: VariableDefinitionNode) { + const type = typeFromAST(context.getSchema(), node.type); + + if (type !== undefined && !isInputType(type)) { + const variableName = node.variable.name.value; + const typeName = print(node.type); + + context.reportError( + new GraphQLError( + `Variable "$${variableName}" cannot be non-input type "${typeName}".`, + node.type, + ), + ); + } + }, + }; +} diff --git a/src/validation/rules/VariablesInAllowedPositionRule.ts b/src/validation/rules/VariablesInAllowedPositionRule.ts new file mode 100644 index 00000000..d8d50025 --- /dev/null +++ b/src/validation/rules/VariablesInAllowedPositionRule.ts @@ -0,0 +1,102 @@ +import { inspect } from '../../jsutils/inspect'; +import type { Maybe } from '../../jsutils/Maybe'; + +import { GraphQLError } from '../../error/GraphQLError'; + +import type { ValueNode } from '../../language/ast'; +import { Kind } from '../../language/kinds'; +import type { ASTVisitor } from '../../language/visitor'; + +import type { GraphQLType } from '../../type/definition'; +import { isNonNullType } from '../../type/definition'; +import type { GraphQLSchema } from '../../type/schema'; + +import { isTypeSubTypeOf } from '../../utilities/typeComparators'; +import { typeFromAST } from '../../utilities/typeFromAST'; + +import type { ValidationContext } from '../ValidationContext'; + +/** + * Variables in allowed position + * + * Variable usages must be compatible with the arguments they are passed to. + * + * See https://spec.graphql.org/draft/#sec-All-Variable-Usages-are-Allowed + */ +export function VariablesInAllowedPositionRule( + context: ValidationContext, +): ASTVisitor { + let varDefMap = Object.create(null); + + return { + OperationDefinition: { + enter() { + varDefMap = Object.create(null); + }, + leave(operation) { + const usages = context.getRecursiveVariableUsages(operation); + + for (const { node, type, defaultValue } of usages) { + const varName = node.name.value; + const varDef = varDefMap[varName]; + if (varDef && type) { + // A var type is allowed if it is the same or more strict (e.g. is + // a subtype of) than the expected type. It can be more strict if + // the variable type is non-null when the expected type is nullable. + // If both are list types, the variable item type can be more strict + // than the expected item type (contravariant). + const schema = context.getSchema(); + const varType = typeFromAST(schema, varDef.type); + if ( + varType && + !allowedVariableUsage( + schema, + varType, + varDef.defaultValue, + type, + defaultValue, + ) + ) { + const varTypeStr = inspect(varType); + const typeStr = inspect(type); + context.reportError( + new GraphQLError( + `Variable "$${varName}" of type "${varTypeStr}" used in position expecting type "${typeStr}".`, + [varDef, node], + ), + ); + } + } + } + }, + }, + VariableDefinition(node) { + varDefMap[node.variable.name.value] = node; + }, + }; +} + +/** + * Returns true if the variable is allowed in the location it was found, + * which includes considering if default values exist for either the variable + * or the location at which it is located. + */ +function allowedVariableUsage( + schema: GraphQLSchema, + varType: GraphQLType, + varDefaultValue: Maybe, + locationType: GraphQLType, + locationDefaultValue: Maybe, +): boolean { + if (isNonNullType(locationType) && !isNonNullType(varType)) { + const hasNonNullVariableDefaultValue = + varDefaultValue != null && varDefaultValue.kind !== Kind.NULL; + const hasLocationDefaultValue = locationDefaultValue !== undefined; + if (!hasNonNullVariableDefaultValue && !hasLocationDefaultValue) { + return false; + } + const nullableLocationType = locationType.ofType; + return isTypeSubTypeOf(schema, varType, nullableLocationType); + } + return isTypeSubTypeOf(schema, varType, locationType); +} diff --git a/src/validation/rules/custom/NoDeprecatedCustomRule.ts b/src/validation/rules/custom/NoDeprecatedCustomRule.ts new file mode 100644 index 00000000..38b688a2 --- /dev/null +++ b/src/validation/rules/custom/NoDeprecatedCustomRule.ts @@ -0,0 +1,92 @@ +import { invariant } from '../../../jsutils/invariant'; + +import { GraphQLError } from '../../../error/GraphQLError'; + +import type { ASTVisitor } from '../../../language/visitor'; + +import { getNamedType, isInputObjectType } from '../../../type/definition'; + +import type { ValidationContext } from '../../ValidationContext'; + +/** + * No deprecated + * + * A GraphQL document is only valid if all selected fields and all used enum values have not been + * deprecated. + * + * Note: This rule is optional and is not part of the Validation section of the GraphQL + * Specification. The main purpose of this rule is detection of deprecated usages and not + * necessarily to forbid their use when querying a service. + */ +export function NoDeprecatedCustomRule(context: ValidationContext): ASTVisitor { + return { + Field(node) { + const fieldDef = context.getFieldDef(); + const deprecationReason = fieldDef?.deprecationReason; + if (fieldDef && deprecationReason != null) { + const parentType = context.getParentType(); + invariant(parentType != null); + context.reportError( + new GraphQLError( + `The field ${parentType.name}.${fieldDef.name} is deprecated. ${deprecationReason}`, + node, + ), + ); + } + }, + Argument(node) { + const argDef = context.getArgument(); + const deprecationReason = argDef?.deprecationReason; + if (argDef && deprecationReason != null) { + const directiveDef = context.getDirective(); + if (directiveDef != null) { + context.reportError( + new GraphQLError( + `Directive "@${directiveDef.name}" argument "${argDef.name}" is deprecated. ${deprecationReason}`, + node, + ), + ); + } else { + const parentType = context.getParentType(); + const fieldDef = context.getFieldDef(); + invariant(parentType != null && fieldDef != null); + context.reportError( + new GraphQLError( + `Field "${parentType.name}.${fieldDef.name}" argument "${argDef.name}" is deprecated. ${deprecationReason}`, + node, + ), + ); + } + } + }, + ObjectField(node) { + const inputObjectDef = getNamedType(context.getParentInputType()); + if (isInputObjectType(inputObjectDef)) { + const inputFieldDef = inputObjectDef.getFields()[node.name.value]; + const deprecationReason = inputFieldDef?.deprecationReason; + if (deprecationReason != null) { + context.reportError( + new GraphQLError( + `The input field ${inputObjectDef.name}.${inputFieldDef.name} is deprecated. ${deprecationReason}`, + node, + ), + ); + } + } + }, + EnumValue(node) { + const enumValueDef = context.getEnumValue(); + const deprecationReason = enumValueDef?.deprecationReason; + if (enumValueDef && deprecationReason != null) { + const enumTypeDef = getNamedType(context.getInputType()); + invariant(enumTypeDef != null); + context.reportError( + new GraphQLError( + `The enum value "${enumTypeDef.name}.${enumValueDef.name}" is deprecated. ${deprecationReason}`, + node, + ), + ); + } + }, + }; +} diff --git a/src/validation/rules/custom/NoSchemaIntrospectionCustomRule.ts b/src/validation/rules/custom/NoSchemaIntrospectionCustomRule.ts new file mode 100644 index 00000000..7a1c1f2a --- /dev/null +++ b/src/validation/rules/custom/NoSchemaIntrospectionCustomRule.ts @@ -0,0 +1,37 @@ +import { GraphQLError } from '../../../error/GraphQLError'; + +import type { FieldNode } from '../../../language/ast'; +import type { ASTVisitor } from '../../../language/visitor'; + +import { getNamedType } from '../../../type/definition'; +import { isIntrospectionType } from '../../../type/introspection'; + +import type { ValidationContext } from '../../ValidationContext'; + +/** + * Prohibit introspection queries + * + * A GraphQL document is only valid if all fields selected are not fields that + * return an introspection type. + * + * Note: This rule is optional and is not part of the Validation section of the + * GraphQL Specification. This rule effectively disables introspection, which + * does not reflect best practices and should only be done if absolutely necessary. + */ +export function NoSchemaIntrospectionCustomRule( + context: ValidationContext, +): ASTVisitor { + return { + Field(node: FieldNode) { + const type = getNamedType(context.getType()); + if (type && isIntrospectionType(type)) { + context.reportError( + new GraphQLError( + `GraphQL introspection has been disabled, but the requested query contained the field "${node.name.value}".`, + node, + ), + ); + } + }, + }; +} diff --git a/src/validation/specifiedRules.ts b/src/validation/specifiedRules.ts new file mode 100644 index 00000000..16e555db --- /dev/null +++ b/src/validation/specifiedRules.ts @@ -0,0 +1,125 @@ +// Spec Section: "Executable Definitions" +import { ExecutableDefinitionsRule } from './rules/ExecutableDefinitionsRule'; +// Spec Section: "Field Selections on Objects, Interfaces, and Unions Types" +import { FieldsOnCorrectTypeRule } from './rules/FieldsOnCorrectTypeRule'; +// Spec Section: "Fragments on Composite Types" +import { FragmentsOnCompositeTypesRule } from './rules/FragmentsOnCompositeTypesRule'; +// Spec Section: "Argument Names" +import { + KnownArgumentNamesOnDirectivesRule, + KnownArgumentNamesRule, +} from './rules/KnownArgumentNamesRule'; +// Spec Section: "Directives Are Defined" +import { KnownDirectivesRule } from './rules/KnownDirectivesRule'; +// Spec Section: "Fragment spread target defined" +import { KnownFragmentNamesRule } from './rules/KnownFragmentNamesRule'; +// Spec Section: "Fragment Spread Type Existence" +import { KnownTypeNamesRule } from './rules/KnownTypeNamesRule'; +// Spec Section: "Lone Anonymous Operation" +import { LoneAnonymousOperationRule } from './rules/LoneAnonymousOperationRule'; +// SDL-specific validation rules +import { LoneSchemaDefinitionRule } from './rules/LoneSchemaDefinitionRule'; +// Spec Section: "Fragments must not form cycles" +import { NoFragmentCyclesRule } from './rules/NoFragmentCyclesRule'; +// Spec Section: "All Variable Used Defined" +import { NoUndefinedVariablesRule } from './rules/NoUndefinedVariablesRule'; +// Spec Section: "Fragments must be used" +import { NoUnusedFragmentsRule } from './rules/NoUnusedFragmentsRule'; +// Spec Section: "All Variables Used" +import { NoUnusedVariablesRule } from './rules/NoUnusedVariablesRule'; +// Spec Section: "Field Selection Merging" +import { OverlappingFieldsCanBeMergedRule } from './rules/OverlappingFieldsCanBeMergedRule'; +// Spec Section: "Fragment spread is possible" +import { PossibleFragmentSpreadsRule } from './rules/PossibleFragmentSpreadsRule'; +import { PossibleTypeExtensionsRule } from './rules/PossibleTypeExtensionsRule'; +// Spec Section: "Argument Optionality" +import { + ProvidedRequiredArgumentsOnDirectivesRule, + ProvidedRequiredArgumentsRule, +} from './rules/ProvidedRequiredArgumentsRule'; +// Spec Section: "Leaf Field Selections" +import { ScalarLeafsRule } from './rules/ScalarLeafsRule'; +// Spec Section: "Subscriptions with Single Root Field" +import { SingleFieldSubscriptionsRule } from './rules/SingleFieldSubscriptionsRule'; +import { UniqueArgumentDefinitionNamesRule } from './rules/UniqueArgumentDefinitionNamesRule'; +// Spec Section: "Argument Uniqueness" +import { UniqueArgumentNamesRule } from './rules/UniqueArgumentNamesRule'; +import { UniqueDirectiveNamesRule } from './rules/UniqueDirectiveNamesRule'; +// Spec Section: "Directives Are Unique Per Location" +import { UniqueDirectivesPerLocationRule } from './rules/UniqueDirectivesPerLocationRule'; +import { UniqueEnumValueNamesRule } from './rules/UniqueEnumValueNamesRule'; +import { UniqueFieldDefinitionNamesRule } from './rules/UniqueFieldDefinitionNamesRule'; +// Spec Section: "Fragment Name Uniqueness" +import { UniqueFragmentNamesRule } from './rules/UniqueFragmentNamesRule'; +// Spec Section: "Input Object Field Uniqueness" +import { UniqueInputFieldNamesRule } from './rules/UniqueInputFieldNamesRule'; +// Spec Section: "Operation Name Uniqueness" +import { UniqueOperationNamesRule } from './rules/UniqueOperationNamesRule'; +import { UniqueOperationTypesRule } from './rules/UniqueOperationTypesRule'; +import { UniqueTypeNamesRule } from './rules/UniqueTypeNamesRule'; +// Spec Section: "Variable Uniqueness" +import { UniqueVariableNamesRule } from './rules/UniqueVariableNamesRule'; +// Spec Section: "Value Type Correctness" +import { ValuesOfCorrectTypeRule } from './rules/ValuesOfCorrectTypeRule'; +// Spec Section: "Variables are Input Types" +import { VariablesAreInputTypesRule } from './rules/VariablesAreInputTypesRule'; +// Spec Section: "All Variable Usages Are Allowed" +import { VariablesInAllowedPositionRule } from './rules/VariablesInAllowedPositionRule'; +import type { SDLValidationRule, ValidationRule } from './ValidationContext'; + +/** + * This set includes all validation rules defined by the GraphQL spec. + * + * The order of the rules in this list has been adjusted to lead to the + * most clear output when encountering multiple validation errors. + */ +export const specifiedRules: ReadonlyArray = Object.freeze([ + ExecutableDefinitionsRule, + UniqueOperationNamesRule, + LoneAnonymousOperationRule, + SingleFieldSubscriptionsRule, + KnownTypeNamesRule, + FragmentsOnCompositeTypesRule, + VariablesAreInputTypesRule, + ScalarLeafsRule, + FieldsOnCorrectTypeRule, + UniqueFragmentNamesRule, + KnownFragmentNamesRule, + NoUnusedFragmentsRule, + PossibleFragmentSpreadsRule, + NoFragmentCyclesRule, + UniqueVariableNamesRule, + NoUndefinedVariablesRule, + NoUnusedVariablesRule, + KnownDirectivesRule, + UniqueDirectivesPerLocationRule, + KnownArgumentNamesRule, + UniqueArgumentNamesRule, + ValuesOfCorrectTypeRule, + ProvidedRequiredArgumentsRule, + VariablesInAllowedPositionRule, + OverlappingFieldsCanBeMergedRule, + UniqueInputFieldNamesRule, +]); + +/** + * @internal + */ +export const specifiedSDLRules: ReadonlyArray = + Object.freeze([ + LoneSchemaDefinitionRule, + UniqueOperationTypesRule, + UniqueTypeNamesRule, + UniqueEnumValueNamesRule, + UniqueFieldDefinitionNamesRule, + UniqueArgumentDefinitionNamesRule, + UniqueDirectiveNamesRule, + KnownTypeNamesRule, + KnownDirectivesRule, + UniqueDirectivesPerLocationRule, + PossibleTypeExtensionsRule, + KnownArgumentNamesOnDirectivesRule, + UniqueArgumentNamesRule, + UniqueInputFieldNamesRule, + ProvidedRequiredArgumentsOnDirectivesRule, + ]); diff --git a/src/validation/validate.ts b/src/validation/validate.ts new file mode 100644 index 00000000..72598742 --- /dev/null +++ b/src/validation/validate.ts @@ -0,0 +1,137 @@ +import { devAssert } from '../jsutils/devAssert'; +import type { Maybe } from '../jsutils/Maybe'; + +import { GraphQLError } from '../error/GraphQLError'; + +import type { DocumentNode } from '../language/ast'; +import { visit, visitInParallel } from '../language/visitor'; + +import type { GraphQLSchema } from '../type/schema'; +import { assertValidSchema } from '../type/validate'; + +import { TypeInfo, visitWithTypeInfo } from '../utilities/TypeInfo'; + +import { specifiedRules, specifiedSDLRules } from './specifiedRules'; +import type { SDLValidationRule, ValidationRule } from './ValidationContext'; +import { SDLValidationContext, ValidationContext } from './ValidationContext'; + +/** + * Implements the "Validation" section of the spec. + * + * Validation runs synchronously, returning an array of encountered errors, or + * an empty array if no errors were encountered and the document is valid. + * + * A list of specific validation rules may be provided. If not provided, the + * default list of rules defined by the GraphQL specification will be used. + * + * Each validation rules is a function which returns a visitor + * (see the language/visitor API). Visitor methods are expected to return + * GraphQLErrors, or Arrays of GraphQLErrors when invalid. + * + * Validate will stop validation after a `maxErrors` limit has been reached. + * Attackers can send pathologically invalid queries to induce a DoS attack, + * so by default `maxErrors` set to 100 errors. + * + * Optionally a custom TypeInfo instance may be provided. If not provided, one + * will be created from the provided schema. + */ +export function validate( + schema: GraphQLSchema, + documentAST: DocumentNode, + rules: ReadonlyArray = specifiedRules, + options?: { maxErrors?: number }, + + /** @deprecated will be removed in 17.0.0 */ + typeInfo: TypeInfo = new TypeInfo(schema), +): ReadonlyArray { + const maxErrors = options?.maxErrors ?? 100; + + devAssert(documentAST, 'Must provide document.'); + // If the schema used for validation is invalid, throw an error. + assertValidSchema(schema); + + const abortObj = Object.freeze({}); + const errors: Array = []; + const context = new ValidationContext( + schema, + documentAST, + typeInfo, + (error) => { + if (errors.length >= maxErrors) { + errors.push( + new GraphQLError( + 'Too many validation errors, error limit reached. Validation aborted.', + ), + ); + // eslint-disable-next-line @typescript-eslint/no-throw-literal + throw abortObj; + } + errors.push(error); + }, + ); + + // This uses a specialized visitor which runs multiple visitors in parallel, + // while maintaining the visitor skip and break API. + const visitor = visitInParallel(rules.map((rule) => rule(context))); + + // Visit the whole document with each instance of all provided rules. + try { + visit(documentAST, visitWithTypeInfo(typeInfo, visitor)); + } catch (e) { + if (e !== abortObj) { + throw e; + } + } + return errors; +} + +/** + * @internal + */ +export function validateSDL( + documentAST: DocumentNode, + schemaToExtend?: Maybe, + rules: ReadonlyArray = specifiedSDLRules, +): ReadonlyArray { + const errors: Array = []; + const context = new SDLValidationContext( + documentAST, + schemaToExtend, + (error) => { + errors.push(error); + }, + ); + + const visitors = rules.map((rule) => rule(context)); + visit(documentAST, visitInParallel(visitors)); + return errors; +} + +/** + * Utility function which asserts a SDL document is valid by throwing an error + * if it is invalid. + * + * @internal + */ +export function assertValidSDL(documentAST: DocumentNode): void { + const errors = validateSDL(documentAST); + if (errors.length !== 0) { + throw new Error(errors.map((error) => error.message).join('\n\n')); + } +} + +/** + * Utility function which asserts a SDL document is valid by throwing an error + * if it is invalid. + * + * @internal + */ +export function assertValidSDLExtension( + documentAST: DocumentNode, + schema: GraphQLSchema, +): void { + const errors = validateSDL(documentAST, schema); + if (errors.length !== 0) { + throw new Error(errors.map((error) => error.message).join('\n\n')); + } +} diff --git a/src/version.ts b/src/version.ts new file mode 100644 index 00000000..f1f2c1b6 --- /dev/null +++ b/src/version.ts @@ -0,0 +1,17 @@ +// Note: This file is autogenerated using "resources/gen-version.js" script and +// automatically updated by "npm version" command. + +/** + * A string containing the version of the GraphQL.js library + */ +export const version = '16.2.0' as string; + +/** + * An object containing the components of the GraphQL.js version string + */ +export const versionInfo = Object.freeze({ + major: 16 as number, + minor: 2 as number, + patch: 0 as number, + preReleaseTag: null as string | null, +}); diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..8dfb0f47 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,14 @@ +{ + "include": ["src/**/*"], + "compilerOptions": { + "module": "commonjs", + "lib": ["es2019", "es2020.promise", "es2020.bigint", "es2020.string"], + "target": "es2019", + "strict": true, + "useUnknownInCatchVariables": false, + "noEmit": true, + "isolatedModules": true, + "importsNotUsedAsValues": "error", + "forceConsistentCasingInFileNames": true + } +}