INNER CODE UNIT · TypeScript

useGqlErrorState

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

const useGqlErrorState = () => useState<GqlError | null>('_gqlErrors', () => null)

type PickFrom<T, K extends Array<string>> = T extends Array<any> ? T : T extends Record<string, any> ? keyof T extends K[number] ? T : K[number] extends never ? T : Pick<T, K[number]> : T
type KeysOf<T> = Array<T extends T ? keyof T extends string ? keyof T : never : never>

/**
 * Asynchronously query data that is required to load a page or component.
 *
 * @param {object} options
 * @param {string} options.operation Name of the query to be executed.
 * @param {string} options.variables Variables to be passed to the query.
 * @param {object} options.options AsyncData options.
 */
export function useAsyncGql<
  T extends GqlOps,
  p extends Parameters<GqlSdkFuncs[T]>['0'],
  P extends { [K in keyof p]: Ref<p[K]> | p[K] } | Omit<Ref<p>, 'value'>,
  d extends Awaited<ReturnType<GqlSdkFuncs[T]>>,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…