Skip to content
Discussion options

You must be logged in to vote

Hi @gino,

The client-preset removes the need to provide the Generic type arguments to GraphQL client's useQuery()/useMutation() functions.
You can directly use it as showcased below and still get full type safety:

import { graphql } from "~/__generated__";

const CreateInvitationMutation = graphql(`
  mutation CreateInvitation($input: CreateInvitationInput!) {
    createInvitation(input: $input)
  }
`);

function Component() {
    const { mutate, data } = useMutation(CreateInvitationMutation)
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by charlypoly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants