Designer 10.7 | webMethods Service Development Help | Working with GraphQL Descriptors | Invoking a GraphQL Descriptor | Working with POST Request
 
Working with POST Request
A GraphQL POST request can use application/json or application/graphql content type. If no content- type is set then Integration Server does not process the request body and Integration Server returns the result of the Introspection query.
*Content-Type : application/json
When a POST request is sent with application/json content-type then the request must include a JSON-encoded body in the following form:
{
"query": "...",
"operationName": "...",
"variables": { "myVariable": "someValue", ... }
}
For example, if you want to execute the following query:
query queryShape($dim:[Dim]) {
queryShape(dim:$dim) {
x
y
}
}
With Query variables:
{
"dim": [{"x": 10, "y": 20},{"x": 30, "y": 40}]
}
And with operation name : queryForShape
The content of POST request body is:
{
"query": "query queryForShape($dim:[Dim]) {\n queryShape(dim:$dim)
{\n x\n y\n }\n}",
"variables": {
"dim": [
{
"x": 10,
"y": 20
},
{
"x": 30,
"y": 40
}
]
},
"operationName": "queryForShape"
}
*Content-Type: application/graphql
When a POST request is sent with application/graphql content-type then it should include query in the request body. In this case, the request body contains the query content as below:
{
emp {
name
}
}
Note: 
1. Regardless of Content-Type and Accept request header, the response Content-Type is application/json.
2. If the request does not contain the query Query parameter then the response will contain the result of Introspection query result.
3. If Query parameters exist then Integration Server ignores the URL.