From 9a68feda5947ba828adf4b96f33cd285af48df9b Mon Sep 17 00:00:00 2001 From: Marcelo Alves Date: Thu, 2 Jul 2020 16:38:20 -0700 Subject: [PATCH] fix(types): add clear to QueryResultBase (#696) --- types/index.d.ts | 1 + types/test.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/types/index.d.ts b/types/index.d.ts index c7129c8044..42651d83c4 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -286,6 +286,7 @@ export interface QueryResultBase { query: object updatedAt: number refetch: ({ throwOnError }?: { throwOnError?: boolean }) => Promise + clear: () => void } export interface QueryIdleResult diff --git a/types/test.ts b/types/test.ts index 78573076a9..630911b08b 100644 --- a/types/test.ts +++ b/types/test.ts @@ -74,6 +74,8 @@ function simpleQuery() { querySimple.fetchMore // $ExpectError querySimple.canFetchMore // $ExpectType boolean | undefined + querySimple.clear // $ExpectType () => void + querySimple.clear() // $ExpectType void querySimple.data // $ExpectType string | undefined querySimple.error // $ExpectType Error | null querySimple.failureCount // $ExpectType number