UNPKG

723 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var values_1 = require("graphql/execution/values");
4function getDirectives(schema, node) {
5 var schemaDirectives = schema && schema.getDirectives ? schema.getDirectives() : [];
6 var astNode = node && node['astNode'];
7 var result = {};
8 if (astNode) {
9 schemaDirectives.forEach(function (directive) {
10 var directiveValue = values_1.getDirectiveValues(directive, astNode);
11 if (directiveValue !== undefined) {
12 result[directive.name] = directiveValue || {};
13 }
14 });
15 }
16 return result;
17}
18exports.getDirectives = getDirectives;
19//# sourceMappingURL=get-directives.js.map
\No newline at end of file