shurcooL/graphql

Help: Can you dynamically construct a graphql query?

SamuelToh opened this issue · 3 comments

Based on the usage text and also the example shown here. It seems to me that the client will need to be told upfront what the graphql query would be before it can make the call.

Is there a way or example that show case dynamically construction of the query struct? In another words, can I use the client to perform any graphql call without preemptively knowing how the query would look like?

Like different fields depending on user input?

The experience of performing dynamic GraphQL queries is still a work in progress. There's an open issue about it at shurcooL/githubv4#17. A comment shurcooL/githubv4#17 (comment) in that issue describes an existing approach for doing this.

@CreatCodeBuild Correct.

Looks like @dmitshur has got it covered in his comment. I'll close this as this is a duplicate of issue #17

Thanks for looking into this guys.