How to pass additional variables with Apollo Client 3?

258 Views Asked by At

I'm trying to pass additional variables in my client (apollo 3) like this:

MY_QUERY = gql`
  mutation MyMutation {
    my_mutation {
      id
      name
    }
  }
`
client.query({
  query: MY_QUERY,
  variables: {
   extra_variable: 1,
   extra_variable: 2
  }
})

This doesn't work on apollo 3. But on Apollo 2 it works. Am I forgetting any settings? Or is it no longer possible?

Context: graphql generator for react.

0

There are 0 best solutions below