Conversation
… invalidation Agent-Logs-Url: https://github.com/effect-app/libs/sessions/d526ea86-93cd-459c-86f1-ae6de2b44a4c Co-authored-by: patroza <42661+patroza@users.noreply.github.com>
Agent-Logs-Url: https://github.com/effect-app/libs/sessions/d526ea86-93cd-459c-86f1-ae6de2b44a4c Co-authored-by: patroza <42661+patroza@users.noreply.github.com>
…ompletes Agent-Logs-Url: https://github.com/effect-app/libs/sessions/807d1e72-6c05-40ee-8897-99dabe25ee49 Co-authored-by: patroza <42661+patroza@users.noreply.github.com>
|
@copilot check, lint and fix if needed |
|
@copilot integrate latest main changes |
Ran |
…ayed-cache-invalidation # Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit. Co-authored-by: patroza <42661+patroza@users.noreply.github.com>
|
@copilot when there is a select provided, the final result the caller receives should be the select output, not the original |
Agent-Logs-Url: https://github.com/effect-app/libs/sessions/9c355684-faf6-4316-92b3-de1f25f8371e Co-authored-by: patroza <42661+patroza@users.noreply.github.com>
|
@copilot how is that supposed to work type wise? You would need to conditionally return the select effect A type only when specified, otherwise the mutation A type |
|
@copilot check, lint and fix if needed |
…eneric Agent-Logs-Url: https://github.com/effect-app/libs/sessions/b5a981c4-f211-49d4-a7be-b967b82075b9 Co-authored-by: patroza <42661+patroza@users.noreply.github.com>
Added a second type param |
|
|
@copilot on similarly for that means we need to update all the |
Done in 874170b. <B = A, E2 = never, R2 = never>(i: I, options?: MutationOptionsBase<A, B, E2, R2>): Effect.Effect<B, E | E2, R | R2>When no The implementation in |
select option to MutationOptionsBase for post-mutation pollingselect option to MutationOptionsBase and per-call options to MutationExtWithInput
874170b to
d279faa
Compare
Cache invalidation fired only once — immediately when the mutation RPC returned — even for long-running operations where meaningful state change happens later (e.g. after a background job finishes).
Changes
MutationOptionsBase<A = unknown, B = A>— made generic over both the mutation result (A) and the select output (B); adds optionalselect: (result: A) => Effect<B, unknown, never>fieldselectis provided:selectcompletes — allowing a polling/awaiting effect to run before the second refreshselectis provided, the caller receives theselectoutput (B) as the final result instead of the original mutation result (A); whenselectis omitted,Bdefaults toAso the return type is unchangedinvalidateQueriesnow accepts the fullMutationOptionsBaseinstead of justqueryInvalidationmakeMutation,useMakeMutation,useMutation,useMutationIntupdated toMutationOptionsBase<A, B>, returningEffect<B, E, R>MutationExtWithInputcall signature updated to accept optional per-callMutationOptionsBaseas a second argument:<B = A, E2 = never, R2 = never>(i: I, options?: MutationOptionsBase<A, B, E2, R2>): Effect.Effect<B, E | E2, R | R2>— per-callselect/queryInvalidationoverride construction-time options at invocation timeUsage