'GraphQL: Variable 'input' has coerced Null value for NonNull type 'CustomerSearchInput!'
I'm trying to make an API call to search for a Braintree customer (by the customer's ID).
https://graphql.braintreepayments.com/guides/making_api_calls/
I've set up the API call with a graphql query that looks like this.
{
"query": "query Search($input: CustomerSearchInput!) {
search {
customers(input: $input) {
pageInfo {
hasNextPage
startCursor
endCursor
},
edges {
node {
id
}
}
}
}
}",
"variables": {
"input": {
"id": {
"is": "7492836219"
}
}
}
}
The query part of this always works but for some reason, it doesn't seem to detect any variables. I keep getting an error that says the following.
{"errors":[{"message":"Variable 'input' has coerced Null value for NonNull type 'CustomerSearchInput!'","locations":[{"line":1,"column":14}]}],"extensions":{"requestId":"ab399854-21ba-47a3-bf70-e41c3097dd21"}}
It seems like it's not recognizing the "variables" section of this object but I have no idea why not. Does anyone know why I keep getting this error?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|