GraphQLs

Graphql

Execute a GraphQL query

post
/v1/graphql

Authorization

ChatBotKit API Secret * Required

HTTP Authorization Scheme: bearer

Request Body * Required

Request Body Schema: application/json

querystring

The GraphQL query or mutation string

variablesobject

The variables for the GraphQL operation

operationNamestring

The name of the operation to execute

import { ChatBotKit } from '@chatbotkit/sdk'

const cbk = new ChatBotKit({

secret: process.env.CHATBOTKIT_API_KEY!

})

const response = await cbk.graphql(

{
"query":"string",
"variables":"object",
"operationName":"string"
}
)
{
"data":"object",
"errors":[
{
"message":"string"
}
]
}
The result of the GraphQL operation