Skip to content

Commit

Permalink
Merge branch 'main' into fix/codegenErrorDev
Browse files Browse the repository at this point in the history
  • Loading branch information
cpreston321 committed Jan 5, 2023
2 parents 51759ac + cc0ea98 commit a4a9bb7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nuxt-graphql-client",
"version": "0.2.23",
"version": "0.2.24",
"keywords": [
"vue",
"nuxt",
Expand Down
19 changes: 8 additions & 11 deletions src/runtime/composables/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<GqlSdkFuncs[T]>,
P extends Parameters<GqlSdkFuncs[T]>['0'],
> (args: { operation: T, variables?: P }) => R) &
(<
T extends GqlOps,
R extends ReturnType<GqlSdkFuncs[T]>,
P extends Parameters<GqlSdkFuncs[T]>['0'],
> (operation: T, variables?: P) => R) => {
export function useGql (): <
T extends GqlOps,
R extends ReturnType<GqlSdkFuncs[T]>,
P extends Parameters<GqlSdkFuncs[T]>['0'],
> (...args: [T, P] | [{ operation: T, variables?: P }]) => R

export function useGql () {
const state = useGqlState()
const errState = useGqlErrorState()

Expand Down

0 comments on commit a4a9bb7

Please sign in to comment.