Using graphql-tag
graphql-tag
You can use tagging libraries, as we use the graphql print
method to make sure the query is transformed to a string.
const getUser = client.createRequest<Tea[]>()({
endpoint: gql`
query GetUser {
username {
username
firstName
}
}
`,
});
const { data, status, extra, success, error } = await getUser.send();