1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | 'use strict';
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | function filterDirectivesTransform(context) {
|
17 | return require("./GraphQLIRTransformer").transform(context, {
|
18 | Directive: visitDirective
|
19 | });
|
20 | }
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 | function visitDirective(directive) {
|
29 | if (this.getContext().serverSchema.getDirectives().some(function (schemaDirective) {
|
30 | return schemaDirective.name === directive.name;
|
31 | })) {
|
32 | return directive;
|
33 | }
|
34 |
|
35 | return null;
|
36 | }
|
37 |
|
38 | module.exports = {
|
39 | transform: filterDirectivesTransform
|
40 | }; |
\ | No newline at end of file |