INNER CODE UNIT · TypeScript

useGqlCors

Diizzayy/nuxt-graphql-client · src/runtime/composables/index.ts:189

export const useGqlCors = (opts: GqlCors) => {
  const { mode, credentials, client } = opts || {}

  setGqlState({ client, patch: { mode, credentials } })
}

/**
 * `useGqlHost` allows you to change a client's host at runtime.
 *
 * @param {string} host The host to be used for subsequent requests
 * @param {string} client The name of your GraphQL client. Defaults to either the client named `default` or the first configured client.
 */
export const useGqlHost = (host: string, client?: GqlClients) => {
  const state = useGqlState()

  client = getGqlClient(client, state)

  if (!host.match(/^https?:\/\//)) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…