B2B Integration 10.4 | Administering and Monitoring B2B Transactions | 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
}
}
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.

Copyright © 2016- 2019 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
Innovation Release