request()
Use nhost.graphql.request
to send a GraphQL request. For more serious GraphQL usage we recommend using a GraphQL client such as Apollo Client (https://www.apollographql.com/docs/react).
const CUSTOMERS = gql`
query {
customers {
id
name
}
}
`
const { data, error } = await nhost.graphql.request(CUSTOMERS)
Parameters
document required string
| DocumentNode
variables optional V
config optional AxiosRequestConfig<any>