1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | var values_1 = require("graphql/execution/values");
|
4 | function 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 | }
|
18 | exports.getDirectives = getDirectives;
|
19 |
|
\ | No newline at end of file |