apollo-schema-extend
Version:
Extends your Apollo Server Express based graphql server with an external graphql source
16 lines (15 loc) • 853 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isFieldNode = exports.hasSelectionSet = exports.hasDirectives = exports.hasArguments = exports.isNodeKind = void 0;
const graphql_1 = require("graphql");
function isNodeKind(kind, node) {
return node ? node.kind === kind : (n) => n.kind === kind;
}
exports.isNodeKind = isNodeKind;
const hasArguments = (node) => { var _a; return !!((_a = node.arguments) === null || _a === void 0 ? void 0 : _a.length); };
exports.hasArguments = hasArguments;
const hasDirectives = (node) => { var _a; return !!((_a = node.directives) === null || _a === void 0 ? void 0 : _a.length); };
exports.hasDirectives = hasDirectives;
const hasSelectionSet = (node) => !!node.selectionSet;
exports.hasSelectionSet = hasSelectionSet;
exports.isFieldNode = isNodeKind(graphql_1.Kind.FIELD);