-
|
Is there some way I can strip all hash comments from a schema in the form of a |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
|
This is what I did in the end: AstTransformer astTransformer = new AstTransformer();
CommentStripper visitor = new CommentStripper();
Document documentWithoutComments = (Document) astTransformer.transform(documentWithComments, visitor);The class Ref: #1335 (comment) |
Beta Was this translation helpful? Give feedback.
-
|
We did some work a while back to separate However we never put in a parser option to say "dont collect" them. In theory you can write an AST transformer that could get rid of them but I think a parser option to never collec them in the first place is better If you are using SchemaGenerator for building your schema can set Can I ask - why is it that you dont want them? Is it schema printing? memory used? |
Beta Was this translation helpful? Give feedback.
We did some work a while back to separate
#comments from descriptions. Hence theDescriptionclass versus theCommentclassHowever we never put in a parser option to say "dont collect" them. In theory you can write an AST transformer that could get rid of them but I think a parser option to never collec them in the first place is better
#2767
If you are using SchemaGenerator for building your schema can set
graphql.schema.idl.SchemaGenerator.Options#isUseCommentsAsDescription(which defaults to true) so setting that to false would mean that comments would not come into the "element descriptions" This flag as left as true during the migration from #comments to proper descriptions.Can I …