Skip to content
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

Add getSourceOrThrow helper method to DgsDataFetchingEnvironment #1947

Merged
merged 1 commit into from
Jun 26, 2024

Conversation

kilink
Copy link
Member

@kilink kilink commented Jun 26, 2024

graphql-java 22.1 added nullability annotations to DataFetchingEnvironment methods such as getSource, which can make make the call-site overly verbose from Kotlin since the caller must handle the possibility of null. In this particular case, the method always returns a non-null value unless being called from the context of the root query, so having a helper that returns a non-null value is more ergonomic.

graphql-java 22.1 added nullability annotations to DataFetchingEnvironment methods such as getSource, which can
make make the call-site overly verbose from Kotlin since the caller must handle the possibility of null. In this
particular case, the method always returns a non-null value unless being called from the context of the root query,
so having a helper that returns a non-null value is more ergonomic.
@kilink kilink merged commit d5eb2d4 into master Jun 26, 2024
3 checks passed
@kilink kilink deleted the get-source-or-throw branch June 26, 2024 18:47
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.

3 participants