Reputation: 1110
I would like to build a script that generates an example query with all fields from a GraphQL endpoint.
I found some mechanisms to get the schema as a JSON structure and to adapt the schema files to a query. but nothing takes an endpoint and provides a suitable query for that endpoint.
Does someone have any experience in that?
Upvotes: 15
Views: 10785
Reputation: 307
I just stumbled upon a chrome extension, Graphql Query Generator, look it up on chrome web store.
Its generates sample queries with dummy data direclty from schema files, helped me as I'm still getting hang of the GraphQL query syntax.
It seems to use some public domain code internally, but no credits whatsoever, not good :)
Upvotes: 3
Reputation: 222
Have same problems. The best approach that I know for now is to:
There was a tool that claimed to "generate queries from endpoint", but I wasn't able to make it working in my case, and now I can't even find it, but it was called "gql-test" and I still have it installed in npm.
Upvotes: 17