Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pass variables in mutation graphQL Playground?

I am using apollo express server 2.0. And I am trying to execute mutation in the graphql playground. Here is the mutation I have attached a screenshot with another screenshot of a variable.

Mutation Command to create new user Mutation variables

I am getting the following error when I am trying to execute mutation command in the graphql playground.

enter image description here

Please guide me where I am incorrect.

like image 441
Piyush Bansal Avatar asked Jul 10 '19 07:07

Piyush Bansal


People also ask

How do you add variables in GraphiQL?

The GraphiQL client allows you to create variables for use in your queries. To add a query variable, click the Query Variables pane and enter a JSON object that defines your variable. To use a variable in your query, prepend the $ character to your variable name and use it to replace the desired value.


1 Answers

There are two tabs QUERY VARIABLES and HTTP HEADERS in the input field at the bottom right of graphQL Playground. Please check the tab QUERY VARIABLES is selected.

like image 195
cuspymd Avatar answered Oct 06 '22 01:10

cuspymd