diff --git a/packages/vue-apollo-composable/src/useLazyQuery.ts b/packages/vue-apollo-composable/src/useLazyQuery.ts index 5e80a310..41deacff 100644 --- a/packages/vue-apollo-composable/src/useLazyQuery.ts +++ b/packages/vue-apollo-composable/src/useLazyQuery.ts @@ -1,6 +1,11 @@ import { DocumentNode } from 'graphql' import { isRef } from 'vue-demi' -import { useQueryImpl, DocumentParameter, VariablesParameter, OptionsParameter, UseQueryOptions } from './useQuery' +import { useQueryImpl, DocumentParameter, VariablesParameter, OptionsParameter, UseQueryOptions, UseQueryReturn } from './useQuery' +import type { OperationVariables } from '@apollo/client/core' + +export interface UseLazyQueryReturn extends UseQueryReturn { + load: (document?: DocumentNode | null, variables?: TVariables | null, options?: UseQueryOptions | null) => false | Promise +} export function useLazyQuery< TResult = any, @@ -9,7 +14,7 @@ export function useLazyQuery< document: DocumentParameter, variables?: VariablesParameter, options?: OptionsParameter, -) { +): UseLazyQueryReturn { const query = useQueryImpl(document, variables, options, true) function load (