Open vgough opened 6 years ago
Thanks for the suggestion/feature request.
That makes sense. encoding/json
sets a good precedent for this with its json:"-"
.
I'll think about this a bit, and most likely go with graphql:"-"
as well.
A question so I can understand this better. Can you elaborate on your use case and how you came up with this need? Given that query
usually maps to a GraphQL query pretty directly, why did you need/want to have fields there that are meant to not be a part of the GraphQL query?
I had been doing some post processing of the results before sending them to an html template renderer. I've since reorganized my code to avoid mutating the query result, or copying to another representation for the places where the query struct doesn't fit well with the renderer.
I see. If I understand correctly, you no longer have a need for this, is that right? If so, I'm happy to defer dealing with this issue until a concrete need comes up. It would give us more time to think about it, and keeps the project simpler until then.
Hey @dmitshur 👋🏼
Is this something you're still considering adding to the package?
Other golang serializers tend to use "-" as an ignore tag. Eg, json :
json:"-"
I've found an ugly workaround for githubql: