lukemorales / query-key-factory

A library for creating typesafe standardized query keys, useful for cache management in @tanstack/query
https://www.npmjs.com/package/@lukemorales/query-key-factory
MIT License
1.16k stars 32 forks source link

How to combine mutations and queries together #60

Open mohamad-qb opened 1 year ago

mohamad-qb commented 1 year ago

I have a rest api with lots of mutation and I would love to create a single store per model that combine both queries and mutations together:

image image
lukemorales commented 1 year ago

I know this would be a neat feature, but the type-system is already pretty complex as is (a result of that is that the types for createMutationKeys are broken and fixing it demands more time that I have currently available to it). We need to have createMutationKeys working first, to only then think how we could merge both functionalities

chrisisler commented 6 months ago

I enjoyed using this package on a recent small app and it would be awesome to have this feature!