INNER CODE UNIT · TypeScript
client
Diizzayy/nuxt-graphql-client · src/runtime/composables/index.ts:232
const client = Object.keys(GqClientOps).find(k => GqClientOps[k as keyof typeof GqClientOps].includes(operation)) ?? 'default'
const clientState = state?.value?.[client]
if (!clientState || !clientState.instance) {
throw new Error('Invalid GraphQL Operation')
}
const { instance } = clientState
return GqlSdks[client as keyof typeof GqlSdks]!(instance, async (action, operationName, operationType): Promise<any> => {
try {
return await action()
}
catch (err: any) {
errState.value = {
client,
operationType,
operationName,