You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using NgRx SignalStore as a state management tool and right now I only use Apollo Angular as a GraphQL request tool. I disabled all the caching mechanisms.
All requests are wrapped in NgRx operators like switchMap, exhaustMap, concatMap or mergeMap. However i realized that they don't do anything to the actual requests sent. Apollo Angular seems to manage that, which I do not want.
I found an option "queryDeduplication". If that is set to false, every query is sent to the server, which is not what I want. I want control over the requests.
If I use the fetch() method on the generated services, I have zero control. If I use watch().valuechanges.pipe(take(1)), I get some control back but only for queries, not for mutations. take(1) is important, because otherwise the observable never completes. It feels wrong to use it that way.
Maybe Apollo Angular is the wrong tool for me. I know, that I could use the httpClient for this as well, but I want at least typesafe request and response types.
If anyone either knows how to configure apollo-angular in a way to not interfere with the request handling and only executes them as it is told or how to configure graphql-codegen to generate services that use the plain httpClient from Angular, please share your ideas.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi there,
I am using NgRx SignalStore as a state management tool and right now I only use Apollo Angular as a GraphQL request tool. I disabled all the caching mechanisms.
All requests are wrapped in NgRx operators like switchMap, exhaustMap, concatMap or mergeMap. However i realized that they don't do anything to the actual requests sent. Apollo Angular seems to manage that, which I do not want.
I found an option "queryDeduplication". If that is set to false, every query is sent to the server, which is not what I want. I want control over the requests.
If I use the fetch() method on the generated services, I have zero control. If I use watch().valuechanges.pipe(take(1)), I get some control back but only for queries, not for mutations. take(1) is important, because otherwise the observable never completes. It feels wrong to use it that way.
Maybe Apollo Angular is the wrong tool for me. I know, that I could use the httpClient for this as well, but I want at least typesafe request and response types.
If anyone either knows how to configure apollo-angular in a way to not interfere with the request handling and only executes them as it is told or how to configure graphql-codegen to generate services that use the plain httpClient from Angular, please share your ideas.
Thanks a lot!
Beta Was this translation helpful? Give feedback.
All reactions