https://launchpad.graphql.com/9qvqz3v5r
Here is my graphQL example
If i passed userId:2 as static
{
user(userId:2){
firstName
lastName
}
}
I will get output as below
{
"data": {
"user": {
"firstName": "Joe",
"lastName": "spin"
}
}
}
I need same output using dynamic query variable
query getUserNameData($userId: User){
user(userId:$userId){
firstName
lastName
}
}
query variables
{
"userId" : 2
}
But i am getter error as : Variable \"$userId\" cannot be non-input type \"User http://prntscr.com/h2ojor
Can anyone help me?