nuxt-graphql-client
nuxt-graphql-client copied to clipboard
Passing Headers in Gql Functions
Environment
- Operating System: Linux
- Node Version: v16.18.0
- Nuxt Version: 3.7.1
- CLI Version: 3.8.3
- Nitro Version: 2.6.3
- Package Manager: [email protected]
- Builder: -
- User Config: runtimeConfig, devtools, modules
- Runtime Modules: @nuxtjs/[email protected], [email protected]
- Build Modules: -
Describe the bug
There is seemingly no way to pass headers to Gql Functions: https://nuxt-graphql-client.web.app/getting-started/gql-functions
This is an issue because if I want to use a Gql Function in a server route, the Token is no longer included in the request. I would like to be able to just extract the token from the event headers and pass it manually into the function so I can use the Gql Function server side.
Expected behaviour
To be able to pass an options object or something like that where I can specify headers.
Reproduction
No response
Additional context
No response
Logs
No response
what about passing headers with this composable? https://nuxt-graphql-client.web.app/getting-started/composables#usegqlheaders
useGqlHeaders({ 'X-Custom-Header': 'value' })```
It seems like a duplicate of #328.
what about passing headers with this composable? https://nuxt-graphql-client.web.app/getting-started/composables#usegqlheaders
useGqlHeaders({ 'X-Custom-Header': 'value' })```
Sometimes I do not want to set token/header for all subsequent requests.