apidash icon indicating copy to clipboard operation
apidash copied to clipboard

GraphQL Variables

Open Clasherzz opened this issue 10 months ago • 4 comments

Tell us about the task you want to perform and are unable to do so because the feature is not available

Finding it hard to use the graphql feauture since the query needs to be edited again and again for minor changes in values.

Describe the solution/feature you'd like us to add

Introduce a section for graphql variables .

Any other feedback you would like to provide regarding the site

Clasherzz avatar Feb 17 '25 14:02 Clasherzz

@ashitaprasad We can send it through the body of graphql

Clasherzz avatar Feb 17 '25 14:02 Clasherzz

Thanks for raising the issue @Clasherzz This feature will definitely be very useful

ashitaprasad avatar Feb 18 '25 17:02 ashitaprasad

In GraphQL, the standard practice is to provide variables in the form of JSON. So, a simple JSON text editor (like that for JSON content-type request body) should be preferred.

Instead of parsing form inputs, handling type conversions and rebuilding the json, this will be more efficient.

And, it will also pave way for other graphQL features like filters & mutation.

Ref:

  • https://www.contentful.com/blog/how-to-use-graphql-variables/
  • https://dgraph.io/docs/query-language/graphql-variables/
  • https://hygraph.com/docs/api-reference/content-api/variables

ashitaprasad avatar Feb 22 '25 05:02 ashitaprasad

@ashitaprasad I see i didn't knew that . Would come back after learning more about this

Clasherzz avatar Feb 22 '25 05:02 Clasherzz