diff options
author | Minteck <contact@minteck.org> | 2023-02-23 19:34:56 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2023-02-23 19:34:56 +0100 |
commit | 3d1cd02f27518f1a04374c7c8320cd5d82ede6e9 (patch) | |
tree | 75be5fba4368472fb11c8015aee026b2b9a71888 /school/node_modules/graphql/validation/rules/custom | |
parent | 8cc1f13c17fa2fb5a4410542d39e650e02945634 (diff) | |
download | pluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.tar.gz pluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.tar.bz2 pluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.zip |
Updated 40 files, added 37 files, deleted 1103 files and renamed 3905 files (automated)
Diffstat (limited to 'school/node_modules/graphql/validation/rules/custom')
8 files changed, 0 insertions, 368 deletions
diff --git a/school/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.d.ts b/school/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.d.ts deleted file mode 100644 index d376cf8..0000000 --- a/school/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { ASTVisitor } from '../../../language/visitor'; -import { 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; diff --git a/school/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.js b/school/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.js deleted file mode 100644 index 63ad4dc..0000000 --- a/school/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.js +++ /dev/null @@ -1,79 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.NoDeprecatedCustomRule = NoDeprecatedCustomRule; - -var _invariant = _interopRequireDefault(require("../../../jsutils/invariant.js")); - -var _GraphQLError = require("../../../error/GraphQLError.js"); - -var _definition = require("../../../type/definition.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * 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. - */ -function NoDeprecatedCustomRule(context) { - return { - Field: function Field(node) { - var fieldDef = context.getFieldDef(); - var deprecationReason = fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.deprecationReason; - - if (fieldDef && deprecationReason != null) { - var parentType = context.getParentType(); - parentType != null || (0, _invariant.default)(0); - context.reportError(new _GraphQLError.GraphQLError("The field ".concat(parentType.name, ".").concat(fieldDef.name, " is deprecated. ").concat(deprecationReason), node)); - } - }, - Argument: function Argument(node) { - var argDef = context.getArgument(); - var deprecationReason = argDef === null || argDef === void 0 ? void 0 : argDef.deprecationReason; - - if (argDef && deprecationReason != null) { - var directiveDef = context.getDirective(); - - if (directiveDef != null) { - context.reportError(new _GraphQLError.GraphQLError("Directive \"@".concat(directiveDef.name, "\" argument \"").concat(argDef.name, "\" is deprecated. ").concat(deprecationReason), node)); - } else { - var parentType = context.getParentType(); - var fieldDef = context.getFieldDef(); - parentType != null && fieldDef != null || (0, _invariant.default)(0); - context.reportError(new _GraphQLError.GraphQLError("Field \"".concat(parentType.name, ".").concat(fieldDef.name, "\" argument \"").concat(argDef.name, "\" is deprecated. ").concat(deprecationReason), node)); - } - } - }, - ObjectField: function ObjectField(node) { - var inputObjectDef = (0, _definition.getNamedType)(context.getParentInputType()); - - if ((0, _definition.isInputObjectType)(inputObjectDef)) { - var inputFieldDef = inputObjectDef.getFields()[node.name.value]; // flowlint-next-line unnecessary-optional-chain:off - - var deprecationReason = inputFieldDef === null || inputFieldDef === void 0 ? void 0 : inputFieldDef.deprecationReason; - - if (deprecationReason != null) { - context.reportError(new _GraphQLError.GraphQLError("The input field ".concat(inputObjectDef.name, ".").concat(inputFieldDef.name, " is deprecated. ").concat(deprecationReason), node)); - } - } - }, - EnumValue: function EnumValue(node) { - var enumValueDef = context.getEnumValue(); - var deprecationReason = enumValueDef === null || enumValueDef === void 0 ? void 0 : enumValueDef.deprecationReason; - - if (enumValueDef && deprecationReason != null) { - var enumTypeDef = (0, _definition.getNamedType)(context.getInputType()); - enumTypeDef != null || (0, _invariant.default)(0); - context.reportError(new _GraphQLError.GraphQLError("The enum value \"".concat(enumTypeDef.name, ".").concat(enumValueDef.name, "\" is deprecated. ").concat(deprecationReason), node)); - } - } - }; -} diff --git a/school/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.js.flow b/school/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.js.flow deleted file mode 100644 index 6b61065..0000000 --- a/school/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.js.flow +++ /dev/null @@ -1,94 +0,0 @@ -// @flow strict -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]; - // flowlint-next-line unnecessary-optional-chain:off - 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/school/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.mjs b/school/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.mjs deleted file mode 100644 index f0e0b36..0000000 --- a/school/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.mjs +++ /dev/null @@ -1,68 +0,0 @@ -import invariant from "../../../jsutils/invariant.mjs"; -import { GraphQLError } from "../../../error/GraphQLError.mjs"; -import { getNamedType, isInputObjectType } from "../../../type/definition.mjs"; - -/** - * 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) { - return { - Field: function Field(node) { - var fieldDef = context.getFieldDef(); - var deprecationReason = fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.deprecationReason; - - if (fieldDef && deprecationReason != null) { - var parentType = context.getParentType(); - parentType != null || invariant(0); - context.reportError(new GraphQLError("The field ".concat(parentType.name, ".").concat(fieldDef.name, " is deprecated. ").concat(deprecationReason), node)); - } - }, - Argument: function Argument(node) { - var argDef = context.getArgument(); - var deprecationReason = argDef === null || argDef === void 0 ? void 0 : argDef.deprecationReason; - - if (argDef && deprecationReason != null) { - var directiveDef = context.getDirective(); - - if (directiveDef != null) { - context.reportError(new GraphQLError("Directive \"@".concat(directiveDef.name, "\" argument \"").concat(argDef.name, "\" is deprecated. ").concat(deprecationReason), node)); - } else { - var parentType = context.getParentType(); - var fieldDef = context.getFieldDef(); - parentType != null && fieldDef != null || invariant(0); - context.reportError(new GraphQLError("Field \"".concat(parentType.name, ".").concat(fieldDef.name, "\" argument \"").concat(argDef.name, "\" is deprecated. ").concat(deprecationReason), node)); - } - } - }, - ObjectField: function ObjectField(node) { - var inputObjectDef = getNamedType(context.getParentInputType()); - - if (isInputObjectType(inputObjectDef)) { - var inputFieldDef = inputObjectDef.getFields()[node.name.value]; // flowlint-next-line unnecessary-optional-chain:off - - var deprecationReason = inputFieldDef === null || inputFieldDef === void 0 ? void 0 : inputFieldDef.deprecationReason; - - if (deprecationReason != null) { - context.reportError(new GraphQLError("The input field ".concat(inputObjectDef.name, ".").concat(inputFieldDef.name, " is deprecated. ").concat(deprecationReason), node)); - } - } - }, - EnumValue: function EnumValue(node) { - var enumValueDef = context.getEnumValue(); - var deprecationReason = enumValueDef === null || enumValueDef === void 0 ? void 0 : enumValueDef.deprecationReason; - - if (enumValueDef && deprecationReason != null) { - var enumTypeDef = getNamedType(context.getInputType()); - enumTypeDef != null || invariant(0); - context.reportError(new GraphQLError("The enum value \"".concat(enumTypeDef.name, ".").concat(enumValueDef.name, "\" is deprecated. ").concat(deprecationReason), node)); - } - } - }; -} diff --git a/school/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.ts b/school/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.ts deleted file mode 100644 index 3677fa1..0000000 --- a/school/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { ASTVisitor } from '../../../language/visitor'; -import { 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; diff --git a/school/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.js b/school/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.js deleted file mode 100644 index 6861bd4..0000000 --- a/school/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.js +++ /dev/null @@ -1,34 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.NoSchemaIntrospectionCustomRule = NoSchemaIntrospectionCustomRule; - -var _GraphQLError = require("../../../error/GraphQLError.js"); - -var _definition = require("../../../type/definition.js"); - -var _introspection = require("../../../type/introspection.js"); - -/** - * 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. - */ -function NoSchemaIntrospectionCustomRule(context) { - return { - Field: function Field(node) { - var type = (0, _definition.getNamedType)(context.getType()); - - if (type && (0, _introspection.isIntrospectionType)(type)) { - context.reportError(new _GraphQLError.GraphQLError("GraphQL introspection has been disabled, but the requested query contained the field \"".concat(node.name.value, "\"."), node)); - } - } - }; -} diff --git a/school/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.js.flow b/school/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.js.flow deleted file mode 100644 index 333ba41..0000000 --- a/school/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.js.flow +++ /dev/null @@ -1,38 +0,0 @@ -// @flow strict -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/school/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs b/school/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs deleted file mode 100644 index 26f7d74..0000000 --- a/school/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs +++ /dev/null @@ -1,25 +0,0 @@ -import { GraphQLError } from "../../../error/GraphQLError.mjs"; -import { getNamedType } from "../../../type/definition.mjs"; -import { isIntrospectionType } from "../../../type/introspection.mjs"; - -/** - * 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) { - return { - Field: function Field(node) { - var type = getNamedType(context.getType()); - - if (type && isIntrospectionType(type)) { - context.reportError(new GraphQLError("GraphQL introspection has been disabled, but the requested query contained the field \"".concat(node.name.value, "\"."), node)); - } - } - }; -} |