Careful! You are browsing documentation for an outdated version of Kong . Go here
to browse the documentation for the latest version.
Kong Studio has auto-detection for GraphQL APIs documented through OpenAPI. To enable auto-detection your GraphQL API must be documented with the following values before generating debugging requests:
- Path must be
/graphql
- Method must be
POST
- Request body must be
application/json
and must contain a propertyquery
with the typestring
- Response body must be
application/json
Below you can see an example of a described GraphQL API endpoint that will trigger auto-detection with a pre-populated request body:
paths:
/graphql:
post:
summary: 'My GraphQL API Endpoint'
description: 'My GraphQL API Endpoint'
operationId: 'graphql'
responses:
200:
description: 'Successfull Query'
content:
application/json:
schema:
type: object
requestBody:
content:
application/json:
schema:
type: object
example:
query: >
{
allFilms {
films {
title
}
}
}
properties:
query:
type: string
Learn more about debugging with GraphQL in Insomnia’s GraphQL Documentation