chore: update deps and fix tests

This commit is contained in:
Guillaume Chau
2023-02-21 14:27:09 +01:00
parent 18fe206761
commit c454937b8a
7 changed files with 2453 additions and 2237 deletions
@@ -10,6 +10,7 @@ export function useLazyQuery<
variables?: VariablesParameter<TVariables>,
options?: OptionsParameter<TResult, TVariables>,
) {
// @ts-expect-error apollo-client types issue with TVariables
const query = useQueryImpl<TResult, TVariables>(document, variables, options, true)
function load (
@@ -10,7 +10,7 @@ import {
nextTick,
} from 'vue-demi'
import { DocumentNode } from 'graphql'
import {
import type {
OperationVariables,
WatchQueryOptions,
ObservableQuery,
@@ -38,6 +38,7 @@ export interface UseQueryOptions<
// eslint-disable-next-line @typescript-eslint/no-unused-vars
TResult = any,
TVariables = OperationVariables
// @ts-expect-error apollo-client types issue with TVariables
> extends Omit<WatchQueryOptions<TVariables>, 'query' | 'variables'> {
clientId?: string
enabled?: boolean
@@ -69,6 +70,7 @@ export interface UseQueryReturn<TResult, TVariables> {
document: Ref<DocumentNode>
variables: Ref<TVariables | undefined>
options: UseQueryOptions<TResult, TVariables> | Ref<UseQueryOptions<TResult, TVariables>>
// @ts-expect-error apollo-client types issue with TVariables
query: Ref<ObservableQuery<TResult, TVariables> | null | undefined>
refetch: (variables?: TVariables) => Promise<ApolloQueryResult<TResult>> | undefined
fetchMore: (options: FetchMoreQueryOptions<TVariables, TResult> & FetchMoreOptions<TResult, TVariables>) => Promise<ApolloQueryResult<TResult>> | undefined
@@ -9,7 +9,7 @@ import {
onBeforeUnmount,
nextTick,
} from 'vue-demi'
import {
import type {
OperationVariables,
SubscriptionOptions,
FetchResult,
@@ -140,6 +140,7 @@ export function useSubscription <
const client = resolveClient(currentOptions.value?.clientId)
// @ts-expect-error apollo-client types issue with TVariables
subscription.value = client.subscribe<TResult, TVariables>({
query: currentDocument,
variables: currentVariables,
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "ES2015",
"target": "ESNext",
"module": "commonjs",
"noEmit": true,
"esModuleInterop": true,
@@ -148,7 +148,7 @@ import { assertExactType } from './assertions'
{ id: '4E79Lq' },
{
clientId: 'any',
context: 'any',
context: { foo: 'any' },
debounce: 500,
enabled: true,
errorPolicy: 'all',
+2 -3
View File
@@ -1,7 +1,6 @@
{
"compilerOptions": {
"target": "ES2015",
"module": "CommonJS",
"target": "ESNext",
"sourceMap": true,
"skipLibCheck": true,
"allowSyntheticDefaultImports": true,
@@ -9,7 +8,7 @@
"moduleResolution": "node",
"lib": [
"DOM",
"ES2015",
"ES2020",
"ES2020.Symbol.WellKnown"
],
"declaration": true,
+2443 -2230
View File
File diff suppressed because it is too large Load Diff