Skip to content

near-operation-file-preset with fragment masking? #9902

Answered by osdiab
osdiab asked this question in Q&A
Discussion options

You must be logged in to vote

Happy to say that I found a way to make it work by looking through the source code and understanding it better!

  • the source code for the fragment masking plugin is not exported by graphql-codegen as a standalone plugin that's reusable, but the source code is simple enough so I just copy pasted it and made my own custom version of it.
    • that said, I realize that actually it's not even necessary for it to be a plugin - it does not rely whatsoever on your GraphQL schema nor operations so you could potentially just copy paste the generated fragment masking code into a file and not worry about graphql-codegen for generating it at all.
      • the one type it does import from your generated gql types, I…

Replies: 1 comment 1 reply

Comment options

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

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