nuxt-graphql-client
nuxt-graphql-client copied to clipboard
Send query params along with the host defined in runtimeConfig?
I'm working on a headless Craft CMS site and need to send api requests with a dynamically generated query parameter to get live previews of content. Is it possible to send query parameters along with the GraphQL request?
@ariviom
query Sites ($name:String!) { sites ( where: { name: { equals: $name } } ) { name isActive pages { name } } }
@Diizzayy any Idea here. It's a thing whats related to CraftCMS and Livepreviews. When Live Previews are used we need to add a token to the API URL like this:
const api = preview && token ? `${apiUrl}?token=${token}` : apiUrl
And the token is dynamically created.
Hope there is solution for this.
@davidhellmann @ariviom Thank you for raising this point, and it's importance.
I'm going to familiarize myself with the requisites for CraftCMS's live preview and determine the best way to provide a proper solution here. I'll keep you updated accordingly.
I want to use this package, but what's stopping me is that I still haven't found a solution to change the URL or part of it at runtime.
My problem is a little different from this one. I need to change the organization:
/v1/ORGANIZATION_1/graphql /v1/ORGANIZATION_2/graphql
In my case the organization is based on the URL.