Skip to content

Conversation

@isum
Copy link
Member

@isum isum commented Mar 31, 2025

This PR adds a new validation for GraphQL schemas that requires all entities to be explicitly marked as immutable or mutable. This is the first step in transitioning subgraph developers to using immutable entities by default.

As a result, the codegen command will fail if there are any entities without an immutable flag. The error message also provides a hint on what to update and how.

In addition, if GraphQL schemas do not use immutable entities (all entities are mutable), the codegen command will print a warning suggesting that immutable entities should be considered and a link to best practices.

Finally, all example subgraphs have been updated with explicit immutable flags.

Todos

@isum isum added the area/cli label Mar 31, 2025
@isum isum self-assigned this Mar 31, 2025
@changeset-bot
Copy link

changeset-bot bot commented Mar 31, 2025

🦋 Changeset detected

Latest commit: 37a8326

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@graphprotocol/graph-cli Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Mar 31, 2025

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@graphprotocol/graph-cli 0.97.0-alpha-20250331192914-bc14daac78afed59b9c25b37caa5338c950ede20 npm ↗︎ unpkg ↗︎

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 31, 2025

Deploying graph-tooling with  Cloudflare Pages  Cloudflare Pages

Latest commit: bc14daa
Status: ✅  Deploy successful!
Preview URL: https://b309369a.graph-tooling.pages.dev
Branch Preview URL: https://ion-require-immutable-flag-o.graph-tooling.pages.dev

View logs

@isum isum force-pushed the ion/require-immutable-flag-on-entities branch from 37a8326 to bc14daa Compare March 31, 2025 19:28
@isum isum marked this pull request as ready for review March 31, 2025 19:33
@matthewdarwin
Copy link
Collaborator

cosmos is no longer supported, we should consider removing those examples instead of updating them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants