Mirror: The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.

fix(vue): Fix regression causing variables to not be reactive (#3605)

Yurk Sha d07602d2 bf01d6b4

Changed files
+5 -3
packages
+1 -1
packages/vue-urql/src/useQuery.ts
···
* documentation on the `pause` option.
*/
pause?: MaybeRef<boolean>;
-
} & MaybeRefObj<GraphQLRequestParams<Data, Variables>>;
/** State of the current query, your {@link useQuery} function is executing.
*
···
* documentation on the `pause` option.
*/
pause?: MaybeRef<boolean>;
+
} & MaybeRefObj<GraphQLRequestParams<Data, MaybeRefObj<Variables>>>;
/** State of the current query, your {@link useQuery} function is executing.
*
+1 -1
packages/vue-urql/src/useSubscription.ts
···
* ```
*/
context?: MaybeRef<Partial<OperationContext>>;
-
} & MaybeRefObj<GraphQLRequestParams<Data, Variables>>;
/** Combines previous data with an incoming subscription result’s data.
*
···
* ```
*/
context?: MaybeRef<Partial<OperationContext>>;
+
} & MaybeRefObj<GraphQLRequestParams<Data, MaybeRefObj<Variables>>>;
/** Combines previous data with an incoming subscription result’s data.
*
+3 -1
packages/vue-urql/src/utils.ts
···
import { isRef } from 'vue';
export type MaybeRef<T> = T | (() => T) | Ref<T>;
-
export type MaybeRefObj<T extends {}> = { [K in keyof T]: MaybeRef<T[K]> };
export const unref = <T>(maybeRef: MaybeRef<T>): T =>
typeof maybeRef === 'function'
···
import { isRef } from 'vue';
export type MaybeRef<T> = T | (() => T) | Ref<T>;
+
export type MaybeRefObj<T> = T extends {}
+
? { [K in keyof T]: MaybeRef<T[K]> }
+
: T;
export const unref = <T>(maybeRef: MaybeRef<T>): T =>
typeof maybeRef === 'function'