Shift duplicate index name validation to schema definition time - #1148
Merged
myronmarston merged 2 commits intoApr 24, 2026
Conversation
With index inheritance on the horizon, the existing query-time check in `Schema#indexed_document_types_by_index_definition_name` would need to grow more complex to distinguish legitimate shared indexes (via inheritance) from accidental duplicates. Moving the check earlier — to `HasIndices#index` via `State#register_index` — keeps that complexity out of the graphql gem entirely and gives authors an immediate, clear error at schema definition time. Generated with Claude Code
marcdaniels-toast
requested review from
BrianSigafoos-SQ,
ayousufi,
bsorbo,
jwils,
jwondrusch and
myronmarston
as code owners
April 24, 2026 00:45
myronmarston
left a comment
Collaborator
There was a problem hiding this comment.
LGTM apart from some missing type signatures. Thanks for catching this!
Generated with Claude Code
myronmarston
approved these changes
Apr 24, 2026
myronmarston
enabled auto-merge (squash)
April 24, 2026 14:02
myronmarston
disabled auto-merge
April 24, 2026 14:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With index inheritance on the horizon, the existing query-time check in
GraphQL::Schema#indexed_document_types_by_index_definition_namewould need to grow more complex to distinguish legitimate shared indexes (via inheritance) from accidental duplicates. Moving the check earlier — toHasIndices#indexviaState#register_index— keeps that complexity out of the graphql gem entirely and gives schema authors an immediate, clear error at schema definition time.I pulled this change out from what I thought was going to be the last PR for Issue #1029 because I wanted to make this change first in a clear, dedicated PR. Did I miss something about why this duplicate index validation wasn't already in the schema_definition gem?