Repository navigation
Add skipDuplicates parameter on @entity directive - #6458
Merged
Merged
Conversation
isum
force-pushed
the
ion/skip-duplicates
branch
from
March 26, 2026 17:31
3a426e4 to
78c451c
Compare
lutter
suggested changes
Mar 30, 2026
lutter
left a comment
Contributor
There was a problem hiding this comment.
One thing to consider here, too, is that there is really a strict hierarchy of mutability: mutable entities, immutable entities, and immutable with skipUpdates entities. That's currently expressed with 2 booleans. It might be clearer to express that with an enum
Summary
Add
skipDuplicatesparameter to the@entitydirective for immutable entities.@entity(immutable: true, skipDuplicates: true)skips duplicate inserts instead of failing indexing. This unblocks subgraph composition on Amp-powered subgraphs where SQL queries can produce the same entities across block ranges.Changes
skipDuplicatesfrom@entitydirective (requiresimmutable: true)ON CONFLICT (id) DO NOTHINGfor skip-duplicates INSERT queries, with affected-rows loggingDefault behavior (
skipDuplicates: false) is unchanged - duplicates still fail indexing.