nuxt-modules / apollo

Nuxt.js module to use Vue-Apollo. The Apollo integration for GraphQL.
https://apollo.nuxtjs.org
MIT License
956 stars 198 forks source link

After updating to Nuxt 3, gql is not defined #453

Closed alessioraggioli closed 1 year ago

alessioraggioli commented 2 years ago

Environment

^5.0.0-alpha.4

Describe the bug

Hi, I have updated my project to nuxt 3, these are the packages i'm using:

"@nuxtjs/apollo": "^5.0.0-alpha.4", "nuxt": "3.0.0"

after the updating i got the error: "gql is not defined", calling this function

_export function GQLsignAuth(payload) { return gql mutation { signAuth( ticketSso: "${payload.token}" product: 12 acl: [sso, provisioning] ) { ticketSso jwt profile roles } } }

Expected behaviour

gql query working

Reproduction

No response

Additional context

No response

Logs

No response

art-boer commented 1 year ago

@alessioraggioli graphql-tag is a dev dependency of this project, so you would have to install it within your own project.

joshistoast commented 1 year ago

@art-boer just installed graphql-tag via pnpm add graphql-tag but the issue persists. Are there any additional steps that need to be taken or preferred method of installation?

joshistoast commented 1 year ago

UPDATE

Moving @nuxtjs/apollo to my dev dependencies seemed to have done the trick 👍