-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
useAsyncQuery clientId parameter doesn't work #455
Labels
Comments
|
I can confirm this, as I'm getting the same behaviour ! |
Was also experiencing this, looking at the typings shows the different ways to pass parameters to type TQuery<T> = QueryOptions<OperationVariables, T>['query'];
type TVariables<T> = QueryOptions<OperationVariables, T>['variables'];
type TAsyncQuery<T> = {
query: TQuery<T>;
variables?: TVariables<T>;
key?: string;
cache?: boolean;
clientId?: string;
};
export declare function useAsyncQuery<T>(opts: TAsyncQuery<T>): AsyncData<T, Error>;
export declare function useAsyncQuery<T>(query: TQuery<T>, clientId?: string): AsyncData<T, Error>;
export declare function useAsyncQuery<T>(query: TQuery<T>, variables?: TVariables<T>, clientId?: string): AsyncData<T, Error>; So for the following const { data } = useAsyncQuery<MyQueryType>(
MyQueryDocument,
{
someVariable: 'abc',
},
'myApolloClient'
) you can rewrite it as const { data } = useAsyncQuery<MyQueryType>({
query: MyQueryDocument,
variables: {
someVariable: 'abc',
},
clientId: 'myApolloClient'
}) and it will work correctly. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment
Windows_NT
v16.18.1
3.0.0
1.0.0
[email protected]
vite
plugins
,modules
,apollo
@nuxtjs/[email protected]
,@nuxtjs/[email protected]
-
Describe the bug
useAsyncQuery(GetComentsForHome, 'reviews')
uses the 'default ' client even though I specified a different client.useQuery(GetComentsForHome, { clientId: 'reviews' })
works fine.Expected behaviour
I expect module to use specified client instead of default
Reproduction
No response
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: