DataPower API Gateway

Request mechanisms supported by GraphQL endpoints

API Connect supports various mechanisms for sending requests to GraphQL proxy API endpoints.

You can use any of the following mechanisms for sending requests to the /graphql and /graphql/cost endpoints on a GraphQL proxy API:

  • GET: the GraphQL query must be specified in a URL query parameter called query.
    For example:
    The following example includes the variables and operationName properties, with URL encoding:
  • POST with a JSON-encoded body: the Content-Type header must be set to application/json, and the GraphQL query must be sent in the query key of the JSON object.
    For example:
      "query": "query fetchAccounts ($limit: Int) {accounts(limit: $limit) {name{first,last}}}",
      "variables": {"limit": 100},
      "operationName": "fetchAccounts"

    The variables and operationName are optional. For more information, see POST request in the GraphQL documentation at

  • POST with graphql content: the Content-Type header must be set to application/graphql; the entire body of the POST is treated as the GraphQL query
Note: For a request sent to the /graphql endpoint, the GraphQL proxy API always sends the request to the backend GraphQL server as a POST with a JSON-encoded body, so the backend GraphQL server must support this mechanism otherwise the call fails.