Skip to content

How to remove type directives from schema? #3090

Answered by yaacovCR
0Dmitry asked this question in Q&A
Discussion options

You must be logged in to vote

You don’t want to wrap the schema, as this creates an unnecessary layer of delegation. You want to modify all ast nodes to no longer have the directives. You could do this with mapSchema and write your own mapping functions with MapperKind.XXX mapping functions to modify the node.astNode and node.extensionASTNode. Another, perhaps simpler option is to take advantage of the fact that graphql-js printSchema function does not emit directives... so you can just print the schema and recreate it sans directives.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@0Dmitry
Comment options

Answer selected by ardatan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants