summaryrefslogtreecommitdiff
path: root/includes/external/school/node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs
diff options
context:
space:
mode:
authorRaindropsSys <contact@minteck.org>2023-06-22 23:06:12 +0200
committerRaindropsSys <contact@minteck.org>2023-06-22 23:06:12 +0200
commit23563c7188e089929b60f9e10721c6fc43a220ff (patch)
treeedfe2b009c82900d4ac27db02222d2f68dcad846 /includes/external/school/node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs
parent7a7a49332df7c852abbaa33c7e8e87f93d064d61 (diff)
downloadpluralconnect-23563c7188e089929b60f9e10721c6fc43a220ff.tar.gz
pluralconnect-23563c7188e089929b60f9e10721c6fc43a220ff.tar.bz2
pluralconnect-23563c7188e089929b60f9e10721c6fc43a220ff.zip
Updated 15 files, added includes/maintenance/deleteUnusedAssets.php and deleted 4944 files (automated)
Diffstat (limited to 'includes/external/school/node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs')
-rw-r--r--includes/external/school/node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs89
1 files changed, 0 insertions, 89 deletions
diff --git a/includes/external/school/node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs b/includes/external/school/node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs
deleted file mode 100644
index d21057e..0000000
--- a/includes/external/school/node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs
+++ /dev/null
@@ -1,89 +0,0 @@
-function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
-
-function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
-
-function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-
-import didYouMean from "../../jsutils/didYouMean.mjs";
-import suggestionList from "../../jsutils/suggestionList.mjs";
-import { GraphQLError } from "../../error/GraphQLError.mjs";
-import { Kind } from "../../language/kinds.mjs";
-import { specifiedDirectives } from "../../type/directives.mjs";
-
-/**
- * Known argument names
- *
- * A GraphQL field is only valid if all supplied arguments are defined by
- * that field.
- */
-export function KnownArgumentNamesRule(context) {
- return _objectSpread(_objectSpread({}, KnownArgumentNamesOnDirectivesRule(context)), {}, {
- Argument: function Argument(argNode) {
- var argDef = context.getArgument();
- var fieldDef = context.getFieldDef();
- var parentType = context.getParentType();
-
- if (!argDef && fieldDef && parentType) {
- var argName = argNode.name.value;
- var knownArgsNames = fieldDef.args.map(function (arg) {
- return arg.name;
- });
- var suggestions = suggestionList(argName, knownArgsNames);
- context.reportError(new GraphQLError("Unknown argument \"".concat(argName, "\" on field \"").concat(parentType.name, ".").concat(fieldDef.name, "\".") + didYouMean(suggestions), argNode));
- }
- }
- });
-}
-/**
- * @internal
- */
-
-export function KnownArgumentNamesOnDirectivesRule(context) {
- var directiveArgs = Object.create(null);
- var schema = context.getSchema();
- var definedDirectives = schema ? schema.getDirectives() : specifiedDirectives;
-
- for (var _i2 = 0; _i2 < definedDirectives.length; _i2++) {
- var directive = definedDirectives[_i2];
- directiveArgs[directive.name] = directive.args.map(function (arg) {
- return arg.name;
- });
- }
-
- var astDefinitions = context.getDocument().definitions;
-
- for (var _i4 = 0; _i4 < astDefinitions.length; _i4++) {
- var def = astDefinitions[_i4];
-
- if (def.kind === Kind.DIRECTIVE_DEFINITION) {
- var _def$arguments;
-
- // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')
- var argsNodes = (_def$arguments = def.arguments) !== null && _def$arguments !== void 0 ? _def$arguments : [];
- directiveArgs[def.name.value] = argsNodes.map(function (arg) {
- return arg.name.value;
- });
- }
- }
-
- return {
- Directive: function Directive(directiveNode) {
- var directiveName = directiveNode.name.value;
- var knownArgs = directiveArgs[directiveName];
-
- if (directiveNode.arguments && knownArgs) {
- for (var _i6 = 0, _directiveNode$argume2 = directiveNode.arguments; _i6 < _directiveNode$argume2.length; _i6++) {
- var argNode = _directiveNode$argume2[_i6];
- var argName = argNode.name.value;
-
- if (knownArgs.indexOf(argName) === -1) {
- var suggestions = suggestionList(argName, knownArgs);
- context.reportError(new GraphQLError("Unknown argument \"".concat(argName, "\" on directive \"@").concat(directiveName, "\".") + didYouMean(suggestions), argNode));
- }
- }
- }
-
- return false;
- }
- };
-}