UNPKG

@neo4j/graphql

Version:

A GraphQL to Cypher query execution layer for Neo4j and JavaScript GraphQL implementations

21 lines 1.06 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.parseKeyAnnotation = parseKeyAnnotation; const classes_1 = require("../../../classes"); const KeyAnnotation_1 = require("../../annotation/KeyAnnotation"); const parse_arguments_1 = require("../parse-arguments"); function parseKeyAnnotation(_, directives) { let isResolvable = false; directives.forEach((directive) => { // fields is a recognized argument but we don't use it, hence we ignore the non-usage of the variable. const { fields, resolvable, ...unrecognizedArguments } = (0, parse_arguments_1.parseArgumentsFromUnknownDirective)(directive); if (Object.keys(unrecognizedArguments).length) { throw new classes_1.Neo4jGraphQLSchemaValidationError(`@key unrecognized arguments: ${Object.keys(unrecognizedArguments).join(", ")}`); } isResolvable = isResolvable || resolvable; }); return new KeyAnnotation_1.KeyAnnotation({ resolvable: isResolvable, }); } //# sourceMappingURL=key-annotation.js.map