Sending data as JSON
Here is how to send your data to us as JSON instead of embedding it into the GraphQL queries.
Most of the documentation examples shows you how to send data by embedding values into the GraphQL queries.
We understand that such long query strings would be difficult to construct with code. Here is how to send query and data separately.
You need to send us the JSON object with two properties - "query"
and "variables"
.
Declare the
$input
variable in the QraphQL"query"
string. The technology also requires you to declare the type of your input(s). See theQueryInput
in the example below.Provide the
"variables"
object with the"input"
property. The value of it must be a JSON object structured exactly as theQueryInput
type.
Do NOT provide any other GraphQL types except the highest level input argument. Otherwise, you risk to experience production issues when we deploy schema changes.
If you construct the GraphQL query using a third party library/software then you risk to violate the above requrement. We recommend to not use any GraphQL libraries.
Here is a screenshot of how a typical mutation looks in the GraphQL Playground:
Same request as cURL:
Last updated
Was this helpful?