From 20338801db085ce4cb21a7e9bf29374eef0338ac Mon Sep 17 00:00:00 2001 From: Dale Alexander Webb Date: Sat, 1 Oct 2022 08:39:46 +0100 Subject: [PATCH 1/2] refactor(query-core): change QueryMeta and MutationMeta to an interface --- packages/query-core/src/types.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/query-core/src/types.ts b/packages/query-core/src/types.ts index d77f210b9da..3d54bd429be 100644 --- a/packages/query-core/src/types.ts +++ b/packages/query-core/src/types.ts @@ -46,7 +46,9 @@ export interface InfiniteData { pageParams: unknown[] } -export type QueryMeta = Record +export interface QueryMeta { + [x: string]: unknown +} export type NetworkMode = 'online' | 'always' | 'offlineFirst' @@ -532,7 +534,9 @@ export type MutationKey = readonly unknown[] export type MutationStatus = 'idle' | 'loading' | 'success' | 'error' -export type MutationMeta = Record +export interface MutationMeta { + [x: string]: unknown +} export type MutationFunction = ( variables: TVariables, From 1385c0fa49ceb6b6ef30307b9dbbcb1ba31a7588 Mon Sep 17 00:00:00 2001 From: Dominik Dorfmeister Date: Fri, 7 Oct 2022 21:01:16 +0200 Subject: [PATCH 2/2] Apply suggestions from code review --- packages/query-core/src/types.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/query-core/src/types.ts b/packages/query-core/src/types.ts index 3d54bd429be..738b158b422 100644 --- a/packages/query-core/src/types.ts +++ b/packages/query-core/src/types.ts @@ -47,7 +47,7 @@ export interface InfiniteData { } export interface QueryMeta { - [x: string]: unknown + [index: string]: unknown } export type NetworkMode = 'online' | 'always' | 'offlineFirst' @@ -535,7 +535,7 @@ export type MutationKey = readonly unknown[] export type MutationStatus = 'idle' | 'loading' | 'success' | 'error' export interface MutationMeta { - [x: string]: unknown + [index: string]: unknown } export type MutationFunction = (