-
-
Notifications
You must be signed in to change notification settings - Fork 519
Labels
enhancementNew feature or requestNew feature or request
Description
I am thinking of ways of maybe do some kinds of optimist update, maybe per config?
Something like this
export default defineConfig({
petstore: {
output: {
client: 'angular-query',
override: {
query: {
// Define optimistic update relationships
optimisticUpdates: {
createPets: {
invalidates: ['listPets'], // Which queries to invalidate
strategy: 'append', // 'append' | 'prepend' | 'upsert' | 'custom'
},
updatePetById: {
invalidates: ['listPets', 'showPetById'],
strategy: 'upsert',
matchBy: 'petId', // Field to match for upsert
},
deletePet: {
invalidates: ['listPets'],
strategy: 'remove',
matchBy: 'petId',
},
},
},
},
},
},
});Or maybe something more automatic if we go with something like this
optimisticUpdates: {
enabled: true, // Turn on auto-inference
infer: 'route-based', // or 'tag-based'
overrides: { // Manual fixes for edge cases
createPets: {
invalidates: ['listPets', 'getPetStats'], // Add non-obvious relationship
},
importBulkData: false, // Disable for this operation
},
}The full automatic one should be pretty accurate for "basic" Crud Api´s but i guess for side-effects it wouldn't really work. Without manual Configuration.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request