diff --git a/src/runtime/composables/index.ts b/src/runtime/composables/index.ts index 525b11b..2660ccb 100644 --- a/src/runtime/composables/index.ts +++ b/src/runtime/composables/index.ts @@ -195,19 +195,16 @@ export const useGqlHost = (host: string, client?: GqlClients) => { host = `${initialHost}${host}` } - return state.value?.[client].instance!.setEndpoint(host) + state.value?.[client].instance!.setEndpoint(host) } -export const useGql = (): (< - T extends GqlOps, - R extends ReturnType, - P extends Parameters['0'], - > (args: { operation: T, variables?: P }) => R) & - (< - T extends GqlOps, - R extends ReturnType, - P extends Parameters['0'], - > (operation: T, variables?: P) => R) => { +export function useGql (): < +T extends GqlOps, +R extends ReturnType, +P extends Parameters['0'], +> (...args: [T, P] | [{ operation: T, variables?: P }]) => R + +export function useGql () { const state = useGqlState() const errState = useGqlErrorState()