0

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.

Marlos
  • 11
  • 2
  • why it should be possible? – xadm Dec 07 '20 at 20:14
  • I have to pass the default "account_id" argument for all queries and mutations. If it is not possible in Apollo 3, I will need to change all files (too many) to insert this argument as needed. So, it is not possible in 3? – Marlos Dec 07 '20 at 20:28
  • use link to pass custom header – xadm Dec 07 '20 at 20:30
  • Yes. It is an alternative, but I was wondering if it would be possible to allow this with some configuration or flag in Apollo setup. I believe that it is not possible. Anyway thank you. – Marlos Dec 07 '20 at 20:45

0 Answers0