Skip to content

Fix/id field non nullable json schema#1118

Merged
myronmarston merged 7 commits intoblock:mainfrom
rossroberts-toast:fix/id-field-non-nullable-json-schema
Apr 8, 2026
Merged

Fix/id field non nullable json schema#1118
myronmarston merged 7 commits intoblock:mainfrom
rossroberts-toast:fix/id-field-non-nullable-json-schema

Conversation

@rossroberts-toast
Copy link
Copy Markdown
Contributor

This PR is to ensure that the required ID field in the json schema of any top level document is non-nullable. This should resolve the bug raised here: #1117

The Goose docs moved from block.github.io/goose to goose-docs.ai,
causing a 404 in the HTML-Proofer CI check.
Copy link
Copy Markdown
Collaborator

@myronmarston myronmarston left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thanks! Two suggestions:

  • Can you rebase on latest main? That should fix the CI failure.
  • Can you also update Team.id here from ID! to ID so that it exercises this? We like using our test schema to exercise a wide variety of cases and a reason we hadn't noticed this before now is that all the indexed types in our test schema use ID! as the GraphQL type.

@rossroberts-toast
Copy link
Copy Markdown
Contributor Author

that change seemed to introduce some test failures. looking into them now.

@myronmarston myronmarston merged commit bd68e85 into block:main Apr 8, 2026
17 checks passed
myronmarston added a commit that referenced this pull request Apr 8, 2026
…pes.

After merging #1118, I realized that there's an alternate implementation
that would pass the test added in that PR but would be wrong: we could
always set the `id` field of any object type to be non-nullable. We only
want to do so on indexed types.

This adds a test confirming that `id: ID` is left as nullable in on a
non-indexed type.
myronmarston added a commit that referenced this pull request Apr 9, 2026
…pes. (#1122)

After merging #1118, I realized that there's an alternate implementation
that would pass the test added in that PR but would be wrong: we could
always set the `id` field of any object type to be non-nullable. We only
want to do so on indexed types.

This adds a test confirming that `id: ID` is left as nullable in on a
non-indexed type.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants