shurcooL / graphql

Package graphql provides a GraphQL client implementation.
MIT License
709 stars 282 forks source link

Expose constructQuery to public function #34

Open remones opened 6 years ago

remones commented 6 years ago

In my case, the server that I depend on should be mocked, and I need to verify the request in the HTTP handler, so I think it's better to expose some tool functions which can help us to encode/decode.

adamgoose commented 5 years ago

I could benefit from this as well. See https://github.com/shurcooL/graphql/issues/27#issuecomment-450298922

dmitshur commented 5 years ago

I'm warming up to this idea, but in a slightly different form.

I think it might be a good idea to expose some of the graphql internals (in this project), but in another location. The idea would be to make it possible to assemble a relatively high level GraphQL client (preferably tailored for a specific GraphQL server) library from the low-level building blocks.

I need to think it through some more and see what would be a good location for it. It's important to keep the boundary between the internals and the high level-client clear. I'll post updates here when I make more progress.

remones commented 5 years ago

Thanks for your reply. Looking forward to it.

kfilipovski commented 5 years ago

+1 It would be great to separate the graphql query constructions/parsing as a public package either in this repo or separate repo. Same 2 use-cases for me - writing a query to test a gqlgen server + constructing queries for subscriptions over websocket. Thanks.