Closed hipitihop closed 2 years ago
Hello,
Yep, should be a relatively simple fix, to do nothing if the first word is a GraphQL keyword.
By the way the workaround is to declare the query first and the fragment second (I am pretty sure it is valid to do that)
By the way the workaround is to declare the query first and the fragment second (I am pretty sure it is valid to do that)
I'll give it a go and let you know
@oliyh Looks like that's not supported. It causes error: reference to undefined fragment "brief_fields"
Sad times, ok will work on a fix
In the graphql spec the example given shows the query defined before the fragment: https://spec.graphql.org/June2018/#sec-Language.Fragments
So I think your server implementation should support it, that said it's still a relatively simple fix so I can still support it in re-graph.
@oliyh Many thanks for the fix. I have raised an issue with Hasura pointing this out.
The fix is in the latest snapshot on clojars
The following query is valid in the Hasura console, however when executed by re-graph, it naively prepends
query
to the start, making it invalid.see: https://github.com/oliyh/re-graph/blob/4553d11f67033383c092a967854efde8bb48f04a/src/re_graph/core.cljc#L66
Using 0.2.0