10000 Mark fields returning Result as semanticNonNull by XiNiHa · Pull Request #1638 · async-graphql/async-graphql · GitHub
[go: up one dir, main page]

Skip to content

Mark fields returning Result as semanticNonNull #1638

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

XiNiHa
Copy link
Contributor
@XiNiHa XiNiHa commented Nov 28, 2024

Stacked on #1637
Closes #1605

This PR adds support for semantic nullability as an opt-in feature.

A field gets marked as @semanticNonNull when:

  • The nullable-result feature is enabled
  • A field or container type is marked as #[graphql(semantic_non_null)]
  • A field returns type that contains Result

By introducing the feature as an opt-in, it is now a non-breaking, purely additive change. While I'd want to propose a whole rework to the core type system around nullability, that would be a huge breaking one so I went sideways for now. When the semantic nullability proposal gets merged, it'd be better to make this change more fundamentally, instead of doing workarounds like this.

@XiNiHa XiNiHa force-pushed the feat/semantic-non-null branch 3 times, most recently from 60bff38 to 061152c Compare December 4, 2024 09:54
@XiNiHa XiNiHa force-pushed the feat/semantic-non-null branch from 061152c to d22fc7e Compare December 11, 2024 22:41
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.

Add support for semantic nullability with @semanticNonNull
1 participant
0