The expected return type of the GraphQL query.
The type of the variables used in the GraphQL query.
The access token for authentication.
The endpoint URL for the GraphQL server.
The GraphQL query to execute.
Optional variables to be used in the GraphQL query.
Will throw an error if the GraphQL query fails.
const query: CreateUserQuery = `mutation Mutation(
$uid: String
$username: String
$email: String
$iconUrl: String
) {
createUser(uid: $uid, username: $username, email: $email, iconUrl: $iconUrl) {
id
rawId
uid
username
email
iconUrl
role
iv
createdAt
updatedAt
}
}`
const accessToken = 'your_access_token'
const variables: CreateUserParams = {
uid: 'your_uid',
username: 'your_username',
email: 'your_email',
iconUrl: 'your_icon_url',
}
const endpoint = 'https://your-production-endpoint.com/graphql'
const user = await skeetGraphql<UserType, CreateUserParams>(accessToken, endpoint, query, variables)
console.log(user)
Generated using TypeDoc
Executes a GraphQL query against a given endpoint.