provideQueryClientOptions changes behaviour of queries even when not changing any default properties #109
Replies: 2 comments 2 replies
-
Taken from the actual file (packages/ng-query/src/lib/providers.ts): export const QUERY_CLIENT_OPTIONS = new InjectionToken<QueryClientConfig>(
'QUERY_CLIENT_OPTIONS',
{
providedIn: 'root',
factory() {
return {}; // <--
},
}
); as you can see it only provides an empty object, that later gets passed to the QueryCore instance (packages/ng-query/src/lib/query-client.ts): const QueryClient = new InjectionToken<QueryCore>('QueryClient', {
providedIn: 'root',
factory() {
return new QueryCore(inject(QUERY_CLIENT_OPTIONS));
},
}); these are the only references and it doesnt get transformed midway. @NetanelBasal i think you'd agree if i say that this issue can be closed and continued in the discussions section |
Beta Was this translation helpful? Give feedback.
-
Yes I don't mind if you move to the discussions page. I understand that this is an adapter but was wondering if the behaviour is still introduced on this side. I also use tanstack query in react projects and don't get the same problem unfortunately |
Beta Was this translation helpful? Give feedback.
-
Which @ngneat/query-* package(s) are the source of the bug?
query
Is this a regression?
Yes
Description
If I use
provideQueryClientOptions
, and pass in an empty object, it changes the behaviour of the queries when it shouldn't.Specifically, one of my queries is stuck in the "fetching" state
// app.module.ts
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
Please provide the environment you discovered this bug in
No response
Anything else?
No response
Do you want to create a pull request?
No
Beta Was this translation helpful? Give feedback.
All reactions