@quantiya/codevibe-claude-plugin 1.0.37 → 1.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/bin/codevibe-claude +17 -3
- package/dist/server.js +8 -7
- package/hooks/stop.sh +30 -10
- package/node_modules/@quantiya/codevibe-core/dist/appsync/appsync-client.d.ts +1 -139
- package/node_modules/@quantiya/codevibe-core/dist/appsync/queries.d.ts +0 -5
- package/node_modules/@quantiya/codevibe-core/dist/auth/auth-telemetry.d.ts +64 -29
- package/node_modules/@quantiya/codevibe-core/dist/index.d.ts +0 -4
- package/node_modules/@quantiya/codevibe-core/dist/index.js +33 -194
- package/node_modules/@quantiya/codevibe-core/dist/keychain/keychain-manager.d.ts +16 -2
- package/node_modules/@quantiya/codevibe-core/dist/session/session-rekey.d.ts +40 -0
- package/node_modules/@quantiya/codevibe-core/dist/session/session-resume.d.ts +1 -0
- package/node_modules/@quantiya/codevibe-core/dist/types/index.d.ts +0 -2
- package/node_modules/@quantiya/codevibe-core/dist/types/session.d.ts +0 -16
- package/node_modules/@quantiya/codevibe-core/package.json +1 -1
- package/node_modules/body-parser/README.md +18 -18
- package/node_modules/body-parser/index.js +6 -15
- package/node_modules/body-parser/lib/read.js +17 -20
- package/node_modules/body-parser/lib/types/json.js +8 -16
- package/node_modules/body-parser/lib/types/raw.js +3 -4
- package/node_modules/body-parser/lib/types/text.js +3 -4
- package/node_modules/body-parser/lib/types/urlencoded.js +8 -8
- package/node_modules/body-parser/lib/utils.js +11 -9
- package/node_modules/body-parser/package.json +2 -2
- package/node_modules/content-disposition/README.md +7 -8
- package/node_modules/content-disposition/index.js +118 -40
- package/node_modules/content-disposition/package.json +8 -11
- package/node_modules/express/Readme.md +39 -29
- package/node_modules/express/lib/application.js +1 -1
- package/node_modules/express/lib/request.js +5 -6
- package/node_modules/express/lib/response.js +14 -0
- package/node_modules/express/lib/utils.js +3 -1
- package/node_modules/express/package.json +6 -5
- package/node_modules/finalhandler/HISTORY.md +6 -0
- package/node_modules/finalhandler/README.md +26 -23
- package/node_modules/finalhandler/package.json +13 -9
- package/node_modules/graphql/execution/execute.d.ts +14 -1
- package/node_modules/graphql/execution/execute.js +63 -13
- package/node_modules/graphql/execution/execute.mjs +63 -13
- package/node_modules/graphql/execution/subscribe.js +1 -0
- package/node_modules/graphql/execution/subscribe.mjs +2 -0
- package/node_modules/graphql/execution/values.js +4 -4
- package/node_modules/graphql/execution/values.mjs +4 -4
- package/node_modules/graphql/index.d.ts +1 -0
- package/node_modules/graphql/language/ast.d.ts +10 -1
- package/node_modules/graphql/language/ast.js +8 -1
- package/node_modules/graphql/language/ast.mjs +8 -1
- package/node_modules/graphql/language/directiveLocation.d.ts +1 -0
- package/node_modules/graphql/language/directiveLocation.js +1 -0
- package/node_modules/graphql/language/directiveLocation.mjs +1 -0
- package/node_modules/graphql/language/index.d.ts +1 -0
- package/node_modules/graphql/language/kinds.d.ts +1 -0
- package/node_modules/graphql/language/kinds.js +1 -0
- package/node_modules/graphql/language/kinds.mjs +1 -0
- package/node_modules/graphql/language/parser.d.ts +14 -0
- package/node_modules/graphql/language/parser.js +33 -0
- package/node_modules/graphql/language/parser.mjs +33 -0
- package/node_modules/graphql/language/predicates.js +3 -1
- package/node_modules/graphql/language/predicates.mjs +5 -1
- package/node_modules/graphql/language/printer.js +13 -1
- package/node_modules/graphql/language/printer.mjs +13 -1
- package/node_modules/graphql/package.json +1 -1
- package/node_modules/graphql/type/directives.d.ts +9 -1
- package/node_modules/graphql/type/directives.js +10 -1
- package/node_modules/graphql/type/directives.mjs +10 -1
- package/node_modules/graphql/type/introspection.js +24 -1
- package/node_modules/graphql/type/introspection.mjs +24 -1
- package/node_modules/graphql/utilities/buildASTSchema.js +4 -0
- package/node_modules/graphql/utilities/buildASTSchema.mjs +4 -0
- package/node_modules/graphql/utilities/buildClientSchema.js +1 -0
- package/node_modules/graphql/utilities/buildClientSchema.mjs +1 -0
- package/node_modules/graphql/utilities/coerceInputValue.js +2 -2
- package/node_modules/graphql/utilities/coerceInputValue.mjs +2 -2
- package/node_modules/graphql/utilities/extendSchema.js +58 -3
- package/node_modules/graphql/utilities/extendSchema.mjs +58 -3
- package/node_modules/graphql/utilities/getIntrospectionQuery.d.ts +16 -0
- package/node_modules/graphql/utilities/getIntrospectionQuery.js +31 -38
- package/node_modules/graphql/utilities/getIntrospectionQuery.mjs +31 -38
- package/node_modules/graphql/utilities/introspectionFromSchema.js +1 -0
- package/node_modules/graphql/utilities/introspectionFromSchema.mjs +1 -0
- package/node_modules/graphql/utilities/printSchema.js +1 -0
- package/node_modules/graphql/utilities/printSchema.mjs +1 -0
- package/node_modules/graphql/utilities/valueFromAST.js +12 -2
- package/node_modules/graphql/utilities/valueFromAST.mjs +12 -2
- package/node_modules/graphql/validation/rules/KnownDirectivesRule.js +4 -0
- package/node_modules/graphql/validation/rules/KnownDirectivesRule.mjs +4 -0
- package/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.js +12 -0
- package/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.mjs +12 -0
- package/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.js +5 -11
- package/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.mjs +5 -11
- package/node_modules/graphql/validation/validate.js +12 -0
- package/node_modules/graphql/validation/validate.mjs +13 -2
- package/node_modules/graphql/version.js +2 -2
- package/node_modules/graphql/version.mjs +2 -2
- package/node_modules/hasown/CHANGELOG.md +11 -0
- package/node_modules/hasown/eslint.config.mjs +6 -0
- package/node_modules/hasown/index.d.ts +1 -0
- package/node_modules/hasown/package.json +14 -14
- package/node_modules/iconv-lite/lib/index.d.ts +114 -26
- package/node_modules/iconv-lite/lib/index.js +39 -40
- package/node_modules/iconv-lite/package.json +13 -2
- package/node_modules/iconv-lite/types/encodings.d.ts +423 -0
- package/node_modules/node-abi/abi_registry.json +10 -3
- package/node_modules/{semver → node-abi/node_modules/semver}/README.md +19 -4
- package/node_modules/{semver → node-abi/node_modules/semver}/bin/semver.js +14 -10
- package/node_modules/node-abi/node_modules/semver/functions/truncate.js +48 -0
- package/node_modules/{semver → node-abi/node_modules/semver}/index.js +2 -0
- package/node_modules/{semver → node-abi/node_modules/semver}/internal/re.js +1 -1
- package/node_modules/{semver → node-abi/node_modules/semver}/package.json +3 -3
- package/node_modules/{semver → node-abi/node_modules/semver}/range.bnf +5 -4
- package/node_modules/node-abi/package.json +1 -1
- package/node_modules/path-to-regexp/Readme.md +3 -3
- package/node_modules/path-to-regexp/dist/index.d.ts +3 -0
- package/node_modules/path-to-regexp/dist/index.js +215 -193
- package/node_modules/path-to-regexp/dist/index.js.map +1 -1
- package/node_modules/path-to-regexp/package.json +2 -2
- package/node_modules/qs/.editorconfig +1 -1
- package/node_modules/qs/.github/SECURITY.md +11 -0
- package/node_modules/qs/.github/THREAT_MODEL.md +78 -0
- package/node_modules/qs/CHANGELOG.md +190 -0
- package/node_modules/qs/README.md +29 -4
- package/node_modules/qs/dist/qs.js +21 -21
- package/node_modules/qs/eslint.config.mjs +56 -0
- package/node_modules/qs/lib/parse.js +94 -49
- package/node_modules/qs/lib/utils.js +85 -11
- package/node_modules/qs/package.json +10 -9
- package/node_modules/qs/test/parse.js +391 -13
- package/node_modules/qs/test/stringify.js +16 -3
- package/node_modules/qs/test/utils.js +173 -3
- package/node_modules/send/package.json +11 -8
- package/node_modules/serve-static/README.md +23 -23
- package/node_modules/serve-static/package.json +6 -3
- package/node_modules/side-channel-list/CHANGELOG.md +25 -4
- package/node_modules/side-channel-list/index.js +1 -3
- package/node_modules/side-channel-list/package.json +8 -8
- package/node_modules/side-channel-list/test/index.js +50 -0
- package/node_modules/uuid/dist/v35.js +3 -0
- package/node_modules/uuid/dist/v6.js +3 -0
- package/node_modules/uuid/dist-node/v35.js +3 -0
- package/node_modules/uuid/dist-node/v6.js +3 -0
- package/node_modules/uuid/package.json +1 -1
- package/node_modules/ws/index.js +15 -6
- package/node_modules/ws/lib/constants.js +1 -0
- package/node_modules/ws/lib/permessage-deflate.js +6 -6
- package/node_modules/ws/lib/websocket-server.js +10 -6
- package/node_modules/ws/lib/websocket.js +19 -14
- package/node_modules/ws/package.json +4 -3
- package/node_modules/ws/wrapper.mjs +14 -1
- package/package.json +2 -2
- package/node_modules/@quantiya/codevibe-core/dist/appsync/__tests__/appsync-client.test.d.ts +0 -1
- package/node_modules/@quantiya/codevibe-core/dist/audit-keys/__tests__/audit-keys-parity.test.d.ts +0 -1
- package/node_modules/@quantiya/codevibe-core/dist/audit-keys/index.d.ts +0 -41
- package/node_modules/@quantiya/codevibe-core/dist/auth/__tests__/auth-telemetry.test.d.ts +0 -1
- package/node_modules/@quantiya/codevibe-core/dist/orchestration/__tests__/setup-bootstrap.test.d.ts +0 -1
- package/node_modules/@quantiya/codevibe-core/dist/orchestration/__tests__/setup-failure-recourse.test.d.ts +0 -1
- package/node_modules/@quantiya/codevibe-core/dist/orchestration/__tests__/setup-save.test.d.ts +0 -1
- package/node_modules/@quantiya/codevibe-core/dist/orchestration/__tests__/setup-seat-picker.test.d.ts +0 -1
- package/node_modules/@quantiya/codevibe-core/dist/orchestration/__tests__/setup-telemetry.test.d.ts +0 -1
- package/node_modules/@quantiya/codevibe-core/dist/orchestration/__tests__/setup-test-agents.test.d.ts +0 -1
- package/node_modules/@quantiya/codevibe-core/dist/orchestration/__tests__/setup-types.test.d.ts +0 -1
- package/node_modules/@quantiya/codevibe-core/dist/orchestration/__tests__/setup-wizard.test.d.ts +0 -1
- package/node_modules/@quantiya/codevibe-core/dist/orchestration/__tests__/v1-options.test.d.ts +0 -1
- package/node_modules/@quantiya/codevibe-core/dist/orchestration/detect-agents.d.ts +0 -56
- package/node_modules/@quantiya/codevibe-core/dist/orchestration/index.d.ts +0 -3
- package/node_modules/@quantiya/codevibe-core/dist/orchestration/orchestration-cli.d.ts +0 -12
- package/node_modules/@quantiya/codevibe-core/dist/orchestration/setup-bootstrap.d.ts +0 -146
- package/node_modules/@quantiya/codevibe-core/dist/orchestration/setup-failure-recourse.d.ts +0 -23
- package/node_modules/@quantiya/codevibe-core/dist/orchestration/setup-save.d.ts +0 -47
- package/node_modules/@quantiya/codevibe-core/dist/orchestration/setup-seat-picker.d.ts +0 -72
- package/node_modules/@quantiya/codevibe-core/dist/orchestration/setup-telemetry.d.ts +0 -54
- package/node_modules/@quantiya/codevibe-core/dist/orchestration/setup-test-agents.d.ts +0 -108
- package/node_modules/@quantiya/codevibe-core/dist/orchestration/setup-types.d.ts +0 -140
- package/node_modules/@quantiya/codevibe-core/dist/orchestration/setup-wizard.d.ts +0 -57
- package/node_modules/@quantiya/codevibe-core/dist/orchestration/v1-options.d.ts +0 -108
- package/node_modules/@quantiya/codevibe-core/dist/reviewer/__tests__/integration.test.d.ts +0 -1
- package/node_modules/@quantiya/codevibe-core/dist/reviewer/__tests__/mocks.test.d.ts +0 -1
- package/node_modules/@quantiya/codevibe-core/dist/reviewer/__tests__/output-parser.test.d.ts +0 -1
- package/node_modules/@quantiya/codevibe-core/dist/reviewer/__tests__/registry.test.d.ts +0 -1
- package/node_modules/@quantiya/codevibe-core/dist/reviewer/__tests__/subprocess.test.d.ts +0 -1
- package/node_modules/@quantiya/codevibe-core/dist/reviewer/index.d.ts +0 -15
- package/node_modules/@quantiya/codevibe-core/dist/reviewer/mocks.d.ts +0 -80
- package/node_modules/@quantiya/codevibe-core/dist/reviewer/output-parser.d.ts +0 -95
- package/node_modules/@quantiya/codevibe-core/dist/reviewer/provider.d.ts +0 -153
- package/node_modules/@quantiya/codevibe-core/dist/reviewer/providers/__tests__/claude-live-smoke.test.d.ts +0 -1
- package/node_modules/@quantiya/codevibe-core/dist/reviewer/providers/__tests__/claude.test.d.ts +0 -1
- package/node_modules/@quantiya/codevibe-core/dist/reviewer/providers/__tests__/codex-live-smoke.test.d.ts +0 -1
- package/node_modules/@quantiya/codevibe-core/dist/reviewer/providers/__tests__/codex.test.d.ts +0 -1
- package/node_modules/@quantiya/codevibe-core/dist/reviewer/providers/__tests__/gemini-live-smoke.test.d.ts +0 -1
- package/node_modules/@quantiya/codevibe-core/dist/reviewer/providers/__tests__/gemini.test.d.ts +0 -1
- package/node_modules/@quantiya/codevibe-core/dist/reviewer/providers/claude.d.ts +0 -59
- package/node_modules/@quantiya/codevibe-core/dist/reviewer/providers/codex.d.ts +0 -67
- package/node_modules/@quantiya/codevibe-core/dist/reviewer/providers/common.d.ts +0 -25
- package/node_modules/@quantiya/codevibe-core/dist/reviewer/providers/gemini.d.ts +0 -108
- package/node_modules/@quantiya/codevibe-core/dist/reviewer/registry.d.ts +0 -87
- package/node_modules/@quantiya/codevibe-core/dist/reviewer/subprocess.d.ts +0 -117
- package/node_modules/@quantiya/codevibe-core/dist/reviewer/types.d.ts +0 -101
- package/node_modules/@quantiya/codevibe-core/dist/types/orchestration.d.ts +0 -57
- package/node_modules/@quantiya/codevibe-core/dist/types/reviewer.d.ts +0 -67
- package/node_modules/content-disposition/HISTORY.md +0 -72
- package/node_modules/express/History.md +0 -3858
- package/node_modules/hasown/.eslintrc +0 -5
- package/node_modules/iconv-lite/Changelog.md +0 -236
- package/node_modules/qs/.eslintrc +0 -39
- package/node_modules/send/HISTORY.md +0 -580
- package/node_modules/serve-static/HISTORY.md +0 -516
- /package/node_modules/{semver → node-abi/node_modules/semver}/LICENSE +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/classes/comparator.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/classes/index.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/classes/range.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/classes/semver.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/functions/clean.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/functions/cmp.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/functions/coerce.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/functions/compare-build.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/functions/compare-loose.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/functions/compare.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/functions/diff.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/functions/eq.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/functions/gt.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/functions/gte.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/functions/inc.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/functions/lt.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/functions/lte.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/functions/major.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/functions/minor.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/functions/neq.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/functions/parse.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/functions/patch.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/functions/prerelease.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/functions/rcompare.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/functions/rsort.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/functions/satisfies.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/functions/sort.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/functions/valid.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/internal/constants.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/internal/debug.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/internal/identifiers.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/internal/lrucache.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/internal/parse-options.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/preload.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/ranges/gtr.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/ranges/intersects.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/ranges/ltr.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/ranges/max-satisfying.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/ranges/min-satisfying.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/ranges/min-version.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/ranges/outside.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/ranges/simplify.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/ranges/subset.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/ranges/to-comparators.js +0 -0
- /package/node_modules/{semver → node-abi/node_modules/semver}/ranges/valid.js +0 -0
- /package/node_modules/{strip-json-comments → rc/node_modules/strip-json-comments}/index.js +0 -0
- /package/node_modules/{strip-json-comments → rc/node_modules/strip-json-comments}/license +0 -0
- /package/node_modules/{strip-json-comments → rc/node_modules/strip-json-comments}/package.json +0 -0
- /package/node_modules/{strip-json-comments → rc/node_modules/strip-json-comments}/readme.md +0 -0
|
@@ -1112,6 +1112,7 @@ class Parser {
|
|
|
1112
1112
|
* - UnionTypeExtension
|
|
1113
1113
|
* - EnumTypeExtension
|
|
1114
1114
|
* - InputObjectTypeDefinition
|
|
1115
|
+
* - DirectiveDefinitionExtension
|
|
1115
1116
|
*/
|
|
1116
1117
|
|
|
1117
1118
|
parseTypeSystemExtension() {
|
|
@@ -1139,6 +1140,13 @@ class Parser {
|
|
|
1139
1140
|
|
|
1140
1141
|
case 'input':
|
|
1141
1142
|
return this.parseInputObjectTypeExtension();
|
|
1143
|
+
|
|
1144
|
+
case 'directive':
|
|
1145
|
+
if (this._options.experimentalDirectivesOnDirectiveDefinitions) {
|
|
1146
|
+
return this.parseDirectiveDefinitionExtension();
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
break;
|
|
1142
1150
|
}
|
|
1143
1151
|
}
|
|
1144
1152
|
|
|
@@ -1334,6 +1342,25 @@ class Parser {
|
|
|
1334
1342
|
fields,
|
|
1335
1343
|
});
|
|
1336
1344
|
}
|
|
1345
|
+
|
|
1346
|
+
parseDirectiveDefinitionExtension() {
|
|
1347
|
+
const start = this._lexer.token;
|
|
1348
|
+
this.expectKeyword('extend');
|
|
1349
|
+
this.expectKeyword('directive');
|
|
1350
|
+
this.expectToken(_tokenKind.TokenKind.AT);
|
|
1351
|
+
const name = this.parseName();
|
|
1352
|
+
const directives = this.parseConstDirectives();
|
|
1353
|
+
|
|
1354
|
+
if (directives.length === 0) {
|
|
1355
|
+
throw this.unexpected();
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
return this.node(start, {
|
|
1359
|
+
kind: _kinds.Kind.DIRECTIVE_EXTENSION,
|
|
1360
|
+
name,
|
|
1361
|
+
directives,
|
|
1362
|
+
});
|
|
1363
|
+
}
|
|
1337
1364
|
/**
|
|
1338
1365
|
* ```
|
|
1339
1366
|
* DirectiveDefinition :
|
|
@@ -1348,6 +1375,10 @@ class Parser {
|
|
|
1348
1375
|
this.expectToken(_tokenKind.TokenKind.AT);
|
|
1349
1376
|
const name = this.parseName();
|
|
1350
1377
|
const args = this.parseArgumentDefs();
|
|
1378
|
+
const directives = this._options
|
|
1379
|
+
.experimentalDirectivesOnDirectiveDefinitions
|
|
1380
|
+
? this.parseConstDirectives()
|
|
1381
|
+
: [];
|
|
1351
1382
|
const repeatable = this.expectOptionalKeyword('repeatable');
|
|
1352
1383
|
this.expectKeyword('on');
|
|
1353
1384
|
const locations = this.parseDirectiveLocations();
|
|
@@ -1356,6 +1387,7 @@ class Parser {
|
|
|
1356
1387
|
description,
|
|
1357
1388
|
name,
|
|
1358
1389
|
arguments: args,
|
|
1390
|
+
directives,
|
|
1359
1391
|
repeatable,
|
|
1360
1392
|
locations,
|
|
1361
1393
|
});
|
|
@@ -1398,6 +1430,7 @@ class Parser {
|
|
|
1398
1430
|
* `ENUM_VALUE`
|
|
1399
1431
|
* `INPUT_OBJECT`
|
|
1400
1432
|
* `INPUT_FIELD_DEFINITION`
|
|
1433
|
+
* `DIRECTIVE_DEFINITION`
|
|
1401
1434
|
*/
|
|
1402
1435
|
|
|
1403
1436
|
parseDirectiveLocation() {
|
|
@@ -1075,6 +1075,7 @@ export class Parser {
|
|
|
1075
1075
|
* - UnionTypeExtension
|
|
1076
1076
|
* - EnumTypeExtension
|
|
1077
1077
|
* - InputObjectTypeDefinition
|
|
1078
|
+
* - DirectiveDefinitionExtension
|
|
1078
1079
|
*/
|
|
1079
1080
|
|
|
1080
1081
|
parseTypeSystemExtension() {
|
|
@@ -1102,6 +1103,13 @@ export class Parser {
|
|
|
1102
1103
|
|
|
1103
1104
|
case 'input':
|
|
1104
1105
|
return this.parseInputObjectTypeExtension();
|
|
1106
|
+
|
|
1107
|
+
case 'directive':
|
|
1108
|
+
if (this._options.experimentalDirectivesOnDirectiveDefinitions) {
|
|
1109
|
+
return this.parseDirectiveDefinitionExtension();
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
break;
|
|
1105
1113
|
}
|
|
1106
1114
|
}
|
|
1107
1115
|
|
|
@@ -1297,6 +1305,25 @@ export class Parser {
|
|
|
1297
1305
|
fields,
|
|
1298
1306
|
});
|
|
1299
1307
|
}
|
|
1308
|
+
|
|
1309
|
+
parseDirectiveDefinitionExtension() {
|
|
1310
|
+
const start = this._lexer.token;
|
|
1311
|
+
this.expectKeyword('extend');
|
|
1312
|
+
this.expectKeyword('directive');
|
|
1313
|
+
this.expectToken(TokenKind.AT);
|
|
1314
|
+
const name = this.parseName();
|
|
1315
|
+
const directives = this.parseConstDirectives();
|
|
1316
|
+
|
|
1317
|
+
if (directives.length === 0) {
|
|
1318
|
+
throw this.unexpected();
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
return this.node(start, {
|
|
1322
|
+
kind: Kind.DIRECTIVE_EXTENSION,
|
|
1323
|
+
name,
|
|
1324
|
+
directives,
|
|
1325
|
+
});
|
|
1326
|
+
}
|
|
1300
1327
|
/**
|
|
1301
1328
|
* ```
|
|
1302
1329
|
* DirectiveDefinition :
|
|
@@ -1311,6 +1338,10 @@ export class Parser {
|
|
|
1311
1338
|
this.expectToken(TokenKind.AT);
|
|
1312
1339
|
const name = this.parseName();
|
|
1313
1340
|
const args = this.parseArgumentDefs();
|
|
1341
|
+
const directives = this._options
|
|
1342
|
+
.experimentalDirectivesOnDirectiveDefinitions
|
|
1343
|
+
? this.parseConstDirectives()
|
|
1344
|
+
: [];
|
|
1314
1345
|
const repeatable = this.expectOptionalKeyword('repeatable');
|
|
1315
1346
|
this.expectKeyword('on');
|
|
1316
1347
|
const locations = this.parseDirectiveLocations();
|
|
@@ -1319,6 +1350,7 @@ export class Parser {
|
|
|
1319
1350
|
description,
|
|
1320
1351
|
name,
|
|
1321
1352
|
arguments: args,
|
|
1353
|
+
directives,
|
|
1322
1354
|
repeatable,
|
|
1323
1355
|
locations,
|
|
1324
1356
|
});
|
|
@@ -1358,6 +1390,7 @@ export class Parser {
|
|
|
1358
1390
|
* `ENUM_VALUE`
|
|
1359
1391
|
* `INPUT_OBJECT`
|
|
1360
1392
|
* `INPUT_FIELD_DEFINITION`
|
|
1393
|
+
* `DIRECTIVE_DEFINITION`
|
|
1361
1394
|
*/
|
|
1362
1395
|
|
|
1363
1396
|
parseDirectiveLocation() {
|
|
@@ -94,7 +94,9 @@ function isTypeDefinitionNode(node) {
|
|
|
94
94
|
|
|
95
95
|
function isTypeSystemExtensionNode(node) {
|
|
96
96
|
return (
|
|
97
|
-
node.kind === _kinds.Kind.SCHEMA_EXTENSION ||
|
|
97
|
+
node.kind === _kinds.Kind.SCHEMA_EXTENSION ||
|
|
98
|
+
node.kind === _kinds.Kind.DIRECTIVE_EXTENSION ||
|
|
99
|
+
isTypeExtensionNode(node)
|
|
98
100
|
);
|
|
99
101
|
}
|
|
100
102
|
|
|
@@ -67,7 +67,11 @@ export function isTypeDefinitionNode(node) {
|
|
|
67
67
|
);
|
|
68
68
|
}
|
|
69
69
|
export function isTypeSystemExtensionNode(node) {
|
|
70
|
-
return
|
|
70
|
+
return (
|
|
71
|
+
node.kind === Kind.SCHEMA_EXTENSION ||
|
|
72
|
+
node.kind === Kind.DIRECTIVE_EXTENSION ||
|
|
73
|
+
isTypeExtensionNode(node)
|
|
74
|
+
);
|
|
71
75
|
}
|
|
72
76
|
export function isTypeExtensionNode(node) {
|
|
73
77
|
return (
|
|
@@ -240,13 +240,21 @@ const printDocASTReducer = {
|
|
|
240
240
|
join(['input', name, join(directives, ' '), block(fields)], ' '),
|
|
241
241
|
},
|
|
242
242
|
DirectiveDefinition: {
|
|
243
|
-
leave: ({
|
|
243
|
+
leave: ({
|
|
244
|
+
description,
|
|
245
|
+
name,
|
|
246
|
+
arguments: args,
|
|
247
|
+
directives,
|
|
248
|
+
repeatable,
|
|
249
|
+
locations,
|
|
250
|
+
}) =>
|
|
244
251
|
wrap('', description, '\n') +
|
|
245
252
|
'directive @' +
|
|
246
253
|
name +
|
|
247
254
|
(hasMultilineItems(args)
|
|
248
255
|
? wrap('(\n', indent(join(args, '\n')), '\n)')
|
|
249
256
|
: wrap('(', join(args, ', '), ')')) +
|
|
257
|
+
wrap(' ', join(directives, ' ')) +
|
|
250
258
|
(repeatable ? ' repeatable' : '') +
|
|
251
259
|
' on ' +
|
|
252
260
|
join(locations, ' | '),
|
|
@@ -308,6 +316,10 @@ const printDocASTReducer = {
|
|
|
308
316
|
leave: ({ name, directives, fields }) =>
|
|
309
317
|
join(['extend input', name, join(directives, ' '), block(fields)], ' '),
|
|
310
318
|
},
|
|
319
|
+
DirectiveExtension: {
|
|
320
|
+
leave: ({ name, directives }) =>
|
|
321
|
+
join(['extend directive @' + name, join(directives, ' ')], ' '),
|
|
322
|
+
},
|
|
311
323
|
// Schema Coordinates
|
|
312
324
|
TypeCoordinate: {
|
|
313
325
|
leave: ({ name }) => name,
|
|
@@ -228,13 +228,21 @@ const printDocASTReducer = {
|
|
|
228
228
|
join(['input', name, join(directives, ' '), block(fields)], ' '),
|
|
229
229
|
},
|
|
230
230
|
DirectiveDefinition: {
|
|
231
|
-
leave: ({
|
|
231
|
+
leave: ({
|
|
232
|
+
description,
|
|
233
|
+
name,
|
|
234
|
+
arguments: args,
|
|
235
|
+
directives,
|
|
236
|
+
repeatable,
|
|
237
|
+
locations,
|
|
238
|
+
}) =>
|
|
232
239
|
wrap('', description, '\n') +
|
|
233
240
|
'directive @' +
|
|
234
241
|
name +
|
|
235
242
|
(hasMultilineItems(args)
|
|
236
243
|
? wrap('(\n', indent(join(args, '\n')), '\n)')
|
|
237
244
|
: wrap('(', join(args, ', '), ')')) +
|
|
245
|
+
wrap(' ', join(directives, ' ')) +
|
|
238
246
|
(repeatable ? ' repeatable' : '') +
|
|
239
247
|
' on ' +
|
|
240
248
|
join(locations, ' | '),
|
|
@@ -296,6 +304,10 @@ const printDocASTReducer = {
|
|
|
296
304
|
leave: ({ name, directives, fields }) =>
|
|
297
305
|
join(['extend input', name, join(directives, ' '), block(fields)], ' '),
|
|
298
306
|
},
|
|
307
|
+
DirectiveExtension: {
|
|
308
|
+
leave: ({ name, directives }) =>
|
|
309
|
+
join(['extend directive @' + name, join(directives, ' ')], ' '),
|
|
310
|
+
},
|
|
299
311
|
// Schema Coordinates
|
|
300
312
|
TypeCoordinate: {
|
|
301
313
|
leave: ({ name }) => name,
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { Maybe } from '../jsutils/Maybe';
|
|
2
|
-
import type {
|
|
2
|
+
import type {
|
|
3
|
+
DirectiveDefinitionNode,
|
|
4
|
+
DirectiveExtensionNode,
|
|
5
|
+
} from '../language/ast';
|
|
3
6
|
import { DirectiveLocation } from '../language/directiveLocation';
|
|
4
7
|
import type {
|
|
5
8
|
GraphQLArgument,
|
|
@@ -34,8 +37,10 @@ export declare class GraphQLDirective {
|
|
|
34
37
|
locations: ReadonlyArray<DirectiveLocation>;
|
|
35
38
|
args: ReadonlyArray<GraphQLArgument>;
|
|
36
39
|
isRepeatable: boolean;
|
|
40
|
+
deprecationReason: Maybe<string>;
|
|
37
41
|
extensions: Readonly<GraphQLDirectiveExtensions>;
|
|
38
42
|
astNode: Maybe<DirectiveDefinitionNode>;
|
|
43
|
+
extensionASTNodes: ReadonlyArray<DirectiveExtensionNode>;
|
|
39
44
|
constructor(config: Readonly<GraphQLDirectiveConfig>);
|
|
40
45
|
get [Symbol.toStringTag](): string;
|
|
41
46
|
toConfig(): GraphQLDirectiveNormalizedConfig;
|
|
@@ -48,13 +53,16 @@ export interface GraphQLDirectiveConfig {
|
|
|
48
53
|
locations: ReadonlyArray<DirectiveLocation>;
|
|
49
54
|
args?: Maybe<GraphQLFieldConfigArgumentMap>;
|
|
50
55
|
isRepeatable?: Maybe<boolean>;
|
|
56
|
+
deprecationReason?: Maybe<string>;
|
|
51
57
|
extensions?: Maybe<Readonly<GraphQLDirectiveExtensions>>;
|
|
52
58
|
astNode?: Maybe<DirectiveDefinitionNode>;
|
|
59
|
+
extensionASTNodes?: Maybe<ReadonlyArray<DirectiveExtensionNode>>;
|
|
53
60
|
}
|
|
54
61
|
interface GraphQLDirectiveNormalizedConfig extends GraphQLDirectiveConfig {
|
|
55
62
|
args: GraphQLFieldConfigArgumentMap;
|
|
56
63
|
isRepeatable: boolean;
|
|
57
64
|
extensions: Readonly<GraphQLDirectiveExtensions>;
|
|
65
|
+
extensionASTNodes: ReadonlyArray<DirectiveExtensionNode>;
|
|
58
66
|
}
|
|
59
67
|
/**
|
|
60
68
|
* Used to conditionally include fields or fragments.
|
|
@@ -66,7 +66,7 @@ function assertDirective(directive) {
|
|
|
66
66
|
*/
|
|
67
67
|
class GraphQLDirective {
|
|
68
68
|
constructor(config) {
|
|
69
|
-
var _config$isRepeatable, _config$args;
|
|
69
|
+
var _config$isRepeatable, _config$extensionASTN, _config$args;
|
|
70
70
|
|
|
71
71
|
this.name = (0, _assertName.assertName)(config.name);
|
|
72
72
|
this.description = config.description;
|
|
@@ -76,8 +76,14 @@ class GraphQLDirective {
|
|
|
76
76
|
_config$isRepeatable !== void 0
|
|
77
77
|
? _config$isRepeatable
|
|
78
78
|
: false;
|
|
79
|
+
this.deprecationReason = config.deprecationReason;
|
|
79
80
|
this.extensions = (0, _toObjMap.toObjMap)(config.extensions);
|
|
80
81
|
this.astNode = config.astNode;
|
|
82
|
+
this.extensionASTNodes =
|
|
83
|
+
(_config$extensionASTN = config.extensionASTNodes) !== null &&
|
|
84
|
+
_config$extensionASTN !== void 0
|
|
85
|
+
? _config$extensionASTN
|
|
86
|
+
: [];
|
|
81
87
|
Array.isArray(config.locations) ||
|
|
82
88
|
(0, _devAssert.devAssert)(
|
|
83
89
|
false,
|
|
@@ -106,8 +112,10 @@ class GraphQLDirective {
|
|
|
106
112
|
locations: this.locations,
|
|
107
113
|
args: (0, _definition.argsToArgsConfig)(this.args),
|
|
108
114
|
isRepeatable: this.isRepeatable,
|
|
115
|
+
deprecationReason: this.deprecationReason,
|
|
109
116
|
extensions: this.extensions,
|
|
110
117
|
astNode: this.astNode,
|
|
118
|
+
extensionASTNodes: this.extensionASTNodes,
|
|
111
119
|
};
|
|
112
120
|
}
|
|
113
121
|
|
|
@@ -181,6 +189,7 @@ const GraphQLDeprecatedDirective = new GraphQLDirective({
|
|
|
181
189
|
_directiveLocation.DirectiveLocation.ARGUMENT_DEFINITION,
|
|
182
190
|
_directiveLocation.DirectiveLocation.INPUT_FIELD_DEFINITION,
|
|
183
191
|
_directiveLocation.DirectiveLocation.ENUM_VALUE,
|
|
192
|
+
_directiveLocation.DirectiveLocation.DIRECTIVE_DEFINITION,
|
|
184
193
|
],
|
|
185
194
|
args: {
|
|
186
195
|
reason: {
|
|
@@ -43,7 +43,7 @@ export function assertDirective(directive) {
|
|
|
43
43
|
*/
|
|
44
44
|
export class GraphQLDirective {
|
|
45
45
|
constructor(config) {
|
|
46
|
-
var _config$isRepeatable, _config$args;
|
|
46
|
+
var _config$isRepeatable, _config$extensionASTN, _config$args;
|
|
47
47
|
|
|
48
48
|
this.name = assertName(config.name);
|
|
49
49
|
this.description = config.description;
|
|
@@ -53,8 +53,14 @@ export class GraphQLDirective {
|
|
|
53
53
|
_config$isRepeatable !== void 0
|
|
54
54
|
? _config$isRepeatable
|
|
55
55
|
: false;
|
|
56
|
+
this.deprecationReason = config.deprecationReason;
|
|
56
57
|
this.extensions = toObjMap(config.extensions);
|
|
57
58
|
this.astNode = config.astNode;
|
|
59
|
+
this.extensionASTNodes =
|
|
60
|
+
(_config$extensionASTN = config.extensionASTNodes) !== null &&
|
|
61
|
+
_config$extensionASTN !== void 0
|
|
62
|
+
? _config$extensionASTN
|
|
63
|
+
: [];
|
|
58
64
|
Array.isArray(config.locations) ||
|
|
59
65
|
devAssert(false, `@${config.name} locations must be an Array.`);
|
|
60
66
|
const args =
|
|
@@ -80,8 +86,10 @@ export class GraphQLDirective {
|
|
|
80
86
|
locations: this.locations,
|
|
81
87
|
args: argsToArgsConfig(this.args),
|
|
82
88
|
isRepeatable: this.isRepeatable,
|
|
89
|
+
deprecationReason: this.deprecationReason,
|
|
83
90
|
extensions: this.extensions,
|
|
84
91
|
astNode: this.astNode,
|
|
92
|
+
extensionASTNodes: this.extensionASTNodes,
|
|
85
93
|
};
|
|
86
94
|
}
|
|
87
95
|
|
|
@@ -150,6 +158,7 @@ export const GraphQLDeprecatedDirective = new GraphQLDirective({
|
|
|
150
158
|
DirectiveLocation.ARGUMENT_DEFINITION,
|
|
151
159
|
DirectiveLocation.INPUT_FIELD_DEFINITION,
|
|
152
160
|
DirectiveLocation.ENUM_VALUE,
|
|
161
|
+
DirectiveLocation.DIRECTIVE_DEFINITION,
|
|
153
162
|
],
|
|
154
163
|
args: {
|
|
155
164
|
reason: {
|
|
@@ -76,7 +76,18 @@ const __Schema = new _definition.GraphQLObjectType({
|
|
|
76
76
|
new _definition.GraphQLNonNull(__Directive),
|
|
77
77
|
),
|
|
78
78
|
),
|
|
79
|
-
|
|
79
|
+
args: {
|
|
80
|
+
includeDeprecated: {
|
|
81
|
+
type: new _definition.GraphQLNonNull(_scalars.GraphQLBoolean),
|
|
82
|
+
defaultValue: false,
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
resolve: (schema, { includeDeprecated }) =>
|
|
86
|
+
includeDeprecated
|
|
87
|
+
? schema.getDirectives()
|
|
88
|
+
: schema
|
|
89
|
+
.getDirectives()
|
|
90
|
+
.filter((directive) => directive.deprecationReason == null),
|
|
80
91
|
},
|
|
81
92
|
}),
|
|
82
93
|
});
|
|
@@ -127,6 +138,14 @@ const __Directive = new _definition.GraphQLObjectType({
|
|
|
127
138
|
: field.args.filter((arg) => arg.deprecationReason == null);
|
|
128
139
|
},
|
|
129
140
|
},
|
|
141
|
+
isDeprecated: {
|
|
142
|
+
type: new _definition.GraphQLNonNull(_scalars.GraphQLBoolean),
|
|
143
|
+
resolve: (directive) => directive.deprecationReason != null,
|
|
144
|
+
},
|
|
145
|
+
deprecationReason: {
|
|
146
|
+
type: _scalars.GraphQLString,
|
|
147
|
+
resolve: (directive) => directive.deprecationReason,
|
|
148
|
+
},
|
|
130
149
|
}),
|
|
131
150
|
});
|
|
132
151
|
|
|
@@ -213,6 +232,10 @@ const __DirectiveLocation = new _definition.GraphQLEnumType({
|
|
|
213
232
|
value: _directiveLocation.DirectiveLocation.INPUT_FIELD_DEFINITION,
|
|
214
233
|
description: 'Location adjacent to an input object field definition.',
|
|
215
234
|
},
|
|
235
|
+
DIRECTIVE_DEFINITION: {
|
|
236
|
+
value: _directiveLocation.DirectiveLocation.DIRECTIVE_DEFINITION,
|
|
237
|
+
description: 'Location adjacent to a directive definition.',
|
|
238
|
+
},
|
|
216
239
|
},
|
|
217
240
|
});
|
|
218
241
|
|
|
@@ -58,7 +58,18 @@ export const __Schema = new GraphQLObjectType({
|
|
|
58
58
|
type: new GraphQLNonNull(
|
|
59
59
|
new GraphQLList(new GraphQLNonNull(__Directive)),
|
|
60
60
|
),
|
|
61
|
-
|
|
61
|
+
args: {
|
|
62
|
+
includeDeprecated: {
|
|
63
|
+
type: new GraphQLNonNull(GraphQLBoolean),
|
|
64
|
+
defaultValue: false,
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
resolve: (schema, { includeDeprecated }) =>
|
|
68
|
+
includeDeprecated
|
|
69
|
+
? schema.getDirectives()
|
|
70
|
+
: schema
|
|
71
|
+
.getDirectives()
|
|
72
|
+
.filter((directive) => directive.deprecationReason == null),
|
|
62
73
|
},
|
|
63
74
|
}),
|
|
64
75
|
});
|
|
@@ -102,6 +113,14 @@ export const __Directive = new GraphQLObjectType({
|
|
|
102
113
|
: field.args.filter((arg) => arg.deprecationReason == null);
|
|
103
114
|
},
|
|
104
115
|
},
|
|
116
|
+
isDeprecated: {
|
|
117
|
+
type: new GraphQLNonNull(GraphQLBoolean),
|
|
118
|
+
resolve: (directive) => directive.deprecationReason != null,
|
|
119
|
+
},
|
|
120
|
+
deprecationReason: {
|
|
121
|
+
type: GraphQLString,
|
|
122
|
+
resolve: (directive) => directive.deprecationReason,
|
|
123
|
+
},
|
|
105
124
|
}),
|
|
106
125
|
});
|
|
107
126
|
export const __DirectiveLocation = new GraphQLEnumType({
|
|
@@ -185,6 +204,10 @@ export const __DirectiveLocation = new GraphQLEnumType({
|
|
|
185
204
|
value: DirectiveLocation.INPUT_FIELD_DEFINITION,
|
|
186
205
|
description: 'Location adjacent to an input object field definition.',
|
|
187
206
|
},
|
|
207
|
+
DIRECTIVE_DEFINITION: {
|
|
208
|
+
value: DirectiveLocation.DIRECTIVE_DEFINITION,
|
|
209
|
+
description: 'Location adjacent to a directive definition.',
|
|
210
|
+
},
|
|
188
211
|
},
|
|
189
212
|
});
|
|
190
213
|
export const __Type = new GraphQLObjectType({
|
|
@@ -105,6 +105,10 @@ function buildSchema(source, options) {
|
|
|
105
105
|
options === null || options === void 0
|
|
106
106
|
? void 0
|
|
107
107
|
: options.allowLegacyFragmentVariables,
|
|
108
|
+
experimentalDirectivesOnDirectiveDefinitions:
|
|
109
|
+
options === null || options === void 0
|
|
110
|
+
? void 0
|
|
111
|
+
: options.experimentalDirectivesOnDirectiveDefinitions,
|
|
108
112
|
});
|
|
109
113
|
return buildASTSchema(document, {
|
|
110
114
|
assumeValidSDL:
|
|
@@ -87,6 +87,10 @@ export function buildSchema(source, options) {
|
|
|
87
87
|
options === null || options === void 0
|
|
88
88
|
? void 0
|
|
89
89
|
: options.allowLegacyFragmentVariables,
|
|
90
|
+
experimentalDirectivesOnDirectiveDefinitions:
|
|
91
|
+
options === null || options === void 0
|
|
92
|
+
? void 0
|
|
93
|
+
: options.experimentalDirectivesOnDirectiveDefinitions,
|
|
90
94
|
});
|
|
91
95
|
return buildASTSchema(document, {
|
|
92
96
|
assumeValidSDL:
|
|
@@ -380,6 +380,7 @@ function buildClientSchema(introspection, options) {
|
|
|
380
380
|
name: directiveIntrospection.name,
|
|
381
381
|
description: directiveIntrospection.description,
|
|
382
382
|
isRepeatable: directiveIntrospection.isRepeatable,
|
|
383
|
+
deprecationReason: directiveIntrospection.deprecationReason,
|
|
383
384
|
locations: directiveIntrospection.locations.slice(),
|
|
384
385
|
args: buildInputValueDefMap(directiveIntrospection.args),
|
|
385
386
|
});
|
|
@@ -357,6 +357,7 @@ export function buildClientSchema(introspection, options) {
|
|
|
357
357
|
name: directiveIntrospection.name,
|
|
358
358
|
description: directiveIntrospection.description,
|
|
359
359
|
isRepeatable: directiveIntrospection.isRepeatable,
|
|
360
|
+
deprecationReason: directiveIntrospection.deprecationReason,
|
|
360
361
|
locations: directiveIntrospection.locations.slice(),
|
|
361
362
|
args: buildInputValueDefMap(directiveIntrospection.args),
|
|
362
363
|
});
|
|
@@ -94,7 +94,7 @@ function coerceInputValueImpl(inputValue, type, onError, path) {
|
|
|
94
94
|
return;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
const coercedValue =
|
|
97
|
+
const coercedValue = Object.create(null);
|
|
98
98
|
const fieldDefs = type.getFields();
|
|
99
99
|
|
|
100
100
|
for (const field of Object.values(fieldDefs)) {
|
|
@@ -167,7 +167,7 @@ function coerceInputValueImpl(inputValue, type, onError, path) {
|
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
-
return coercedValue;
|
|
170
|
+
return { ...coercedValue };
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
if ((0, _definition.isLeafType)(type)) {
|
|
@@ -76,7 +76,7 @@ function coerceInputValueImpl(inputValue, type, onError, path) {
|
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
const coercedValue =
|
|
79
|
+
const coercedValue = Object.create(null);
|
|
80
80
|
const fieldDefs = type.getFields();
|
|
81
81
|
|
|
82
82
|
for (const field of Object.values(fieldDefs)) {
|
|
@@ -149,7 +149,7 @@ function coerceInputValueImpl(inputValue, type, onError, path) {
|
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
return coercedValue;
|
|
152
|
+
return { ...coercedValue };
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
if (isLeafType(type)) {
|
|
@@ -78,7 +78,8 @@ function extendSchemaImpl(schemaConfig, documentAST, options) {
|
|
|
78
78
|
|
|
79
79
|
// Collect the type definitions and extensions found in the document.
|
|
80
80
|
const typeDefs = [];
|
|
81
|
-
const typeExtensionsMap = Object.create(null);
|
|
81
|
+
const typeExtensionsMap = Object.create(null);
|
|
82
|
+
const directiveExtensionsMap = Object.create(null); // New directives and types are separate because a directives and types can
|
|
82
83
|
// have the same name. For example, a type named "skip".
|
|
83
84
|
|
|
84
85
|
const directiveDefs = [];
|
|
@@ -101,6 +102,14 @@ function extendSchemaImpl(schemaConfig, documentAST, options) {
|
|
|
101
102
|
: [def];
|
|
102
103
|
} else if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) {
|
|
103
104
|
directiveDefs.push(def);
|
|
105
|
+
} else if (def.kind === _kinds.Kind.DIRECTIVE_EXTENSION) {
|
|
106
|
+
const extendedDirectiveName = def.name.value;
|
|
107
|
+
const existingDirectiveExtensions =
|
|
108
|
+
directiveExtensionsMap[extendedDirectiveName];
|
|
109
|
+
directiveExtensionsMap[extendedDirectiveName] =
|
|
110
|
+
existingDirectiveExtensions
|
|
111
|
+
? existingDirectiveExtensions.concat([def])
|
|
112
|
+
: [def];
|
|
104
113
|
}
|
|
105
114
|
} // If this document contains no new types, extensions, or directives then
|
|
106
115
|
// return the same unmodified GraphQLSchema instance.
|
|
@@ -108,6 +117,7 @@ function extendSchemaImpl(schemaConfig, documentAST, options) {
|
|
|
108
117
|
if (
|
|
109
118
|
Object.keys(typeExtensionsMap).length === 0 &&
|
|
110
119
|
typeDefs.length === 0 &&
|
|
120
|
+
Object.keys(directiveExtensionsMap).length === 0 &&
|
|
111
121
|
directiveDefs.length === 0 &&
|
|
112
122
|
schemaExtensions.length === 0 &&
|
|
113
123
|
schemaDef == null
|
|
@@ -132,6 +142,12 @@ function extendSchemaImpl(schemaConfig, documentAST, options) {
|
|
|
132
142
|
: buildType(typeNode);
|
|
133
143
|
}
|
|
134
144
|
|
|
145
|
+
const directiveMap = Object.create(null);
|
|
146
|
+
|
|
147
|
+
for (const existingDirective of schemaConfig.directives) {
|
|
148
|
+
directiveMap[existingDirective.name] = extendDirective(existingDirective);
|
|
149
|
+
}
|
|
150
|
+
|
|
135
151
|
const operationTypes = {
|
|
136
152
|
// Get the extended root operation types.
|
|
137
153
|
query: schemaConfig.query && replaceNamedType(schemaConfig.query),
|
|
@@ -143,6 +159,8 @@ function extendSchemaImpl(schemaConfig, documentAST, options) {
|
|
|
143
159
|
...getOperationTypes(schemaExtensions),
|
|
144
160
|
}; // Then produce and return a Schema config with these types.
|
|
145
161
|
|
|
162
|
+
const directives = Object.values(directiveMap); // will be `Array<GraphQLDirective>`
|
|
163
|
+
|
|
146
164
|
return {
|
|
147
165
|
description:
|
|
148
166
|
(_schemaDef = schemaDef) === null || _schemaDef === void 0
|
|
@@ -154,7 +172,7 @@ function extendSchemaImpl(schemaConfig, documentAST, options) {
|
|
|
154
172
|
...operationTypes,
|
|
155
173
|
types: Object.values(typeMap),
|
|
156
174
|
directives: [
|
|
157
|
-
...
|
|
175
|
+
...directives.map(replaceDirective),
|
|
158
176
|
...directiveDefs.map(buildDirective),
|
|
159
177
|
],
|
|
160
178
|
extensions: Object.create(null),
|
|
@@ -413,6 +431,29 @@ function extendSchemaImpl(schemaConfig, documentAST, options) {
|
|
|
413
431
|
return opTypes;
|
|
414
432
|
}
|
|
415
433
|
|
|
434
|
+
function extendDirective(directive) {
|
|
435
|
+
var _directiveExtensionsM, _config$deprecationRe;
|
|
436
|
+
|
|
437
|
+
const config = directive.toConfig();
|
|
438
|
+
const extensions =
|
|
439
|
+
(_directiveExtensionsM = directiveExtensionsMap[config.name]) !== null &&
|
|
440
|
+
_directiveExtensionsM !== void 0
|
|
441
|
+
? _directiveExtensionsM
|
|
442
|
+
: [];
|
|
443
|
+
const deprecationReason =
|
|
444
|
+
(_config$deprecationRe = config.deprecationReason) !== null &&
|
|
445
|
+
_config$deprecationRe !== void 0
|
|
446
|
+
? _config$deprecationRe
|
|
447
|
+
: extensions
|
|
448
|
+
.map((ext) => getDeprecationReason(ext))
|
|
449
|
+
.find((reason) => reason != null);
|
|
450
|
+
return new _directives.GraphQLDirective({
|
|
451
|
+
...config,
|
|
452
|
+
deprecationReason,
|
|
453
|
+
extensionASTNodes: config.extensionASTNodes.concat(extensions),
|
|
454
|
+
});
|
|
455
|
+
}
|
|
456
|
+
|
|
416
457
|
function getNamedType(node) {
|
|
417
458
|
var _stdTypeMap$name2;
|
|
418
459
|
|
|
@@ -443,8 +484,20 @@ function extendSchemaImpl(schemaConfig, documentAST, options) {
|
|
|
443
484
|
}
|
|
444
485
|
|
|
445
486
|
function buildDirective(node) {
|
|
446
|
-
var _node$description;
|
|
487
|
+
var _directiveExtensionsM2, _getDeprecationReason, _node$description;
|
|
447
488
|
|
|
489
|
+
const extensions =
|
|
490
|
+
(_directiveExtensionsM2 = directiveExtensionsMap[node.name.value]) !==
|
|
491
|
+
null && _directiveExtensionsM2 !== void 0
|
|
492
|
+
? _directiveExtensionsM2
|
|
493
|
+
: [];
|
|
494
|
+
const deprecationReason =
|
|
495
|
+
(_getDeprecationReason = getDeprecationReason(node)) !== null &&
|
|
496
|
+
_getDeprecationReason !== void 0
|
|
497
|
+
? _getDeprecationReason
|
|
498
|
+
: extensions
|
|
499
|
+
.map((ext) => getDeprecationReason(ext))
|
|
500
|
+
.find((reason) => reason != null);
|
|
448
501
|
return new _directives.GraphQLDirective({
|
|
449
502
|
name: node.name.value,
|
|
450
503
|
description:
|
|
@@ -456,7 +509,9 @@ function extendSchemaImpl(schemaConfig, documentAST, options) {
|
|
|
456
509
|
locations: node.locations.map(({ value }) => value),
|
|
457
510
|
isRepeatable: node.repeatable,
|
|
458
511
|
args: buildArgumentMap(node.arguments),
|
|
512
|
+
deprecationReason,
|
|
459
513
|
astNode: node,
|
|
514
|
+
extensionASTNodes: extensions,
|
|
460
515
|
});
|
|
461
516
|
}
|
|
462
517
|
|