GraphQLError =
object
An error from a GraphQL query.
extensions:
Record<string,any>
locations:
GraphQLLocation[]
message:
string
path:
GraphQLPathSegment[]
GraphQLLocation =
object
A location in a GraphQL query.
column:
number
line:
number
GraphQLPathSegment =
string|number
A segment of a path in a GraphQL query.
GraphQLResponse<
T> =object
The response from a GraphQL query.
| Type Parameter |
|---|
T |
optionaldata:T
optionalerrors:GraphQLError[]
GraphQLSDK =
object
The SDK for the GraphQL service.
execute<
T>(query:string,variables?:Record<string,any>):Promise<GraphQLResponse<T>>
Executes a GraphQL query.
| Type Parameter |
|---|
T |
| Parameter | Type |
|---|---|
query |
string |
variables? |
Record<string, any> |
Promise<GraphQLResponse<T>>
await sdk.graphql.execute(`
query {
viewer
}
`);