question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@NotNull instead of @GraphQLNonNull

See original GitHub issue

Hi there!

Would be possible to allow graphql-spqr to work with @NotNull the same it works with @GraphQLNonNull? It would improve code readability, increase code compatibility with 3rd party validation tools, and would reduce code verbosity.

We have a lot of not null on our graphql/service methods, so this would help a lot.

Best regards, Rafael Pacheco.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kaqqaocommented, Apr 25, 2018

Yup, it does 😃 Both @NotNull and @NonNull work, and so do the JetBrains annotations.

0reactions
kaqqaocommented, Aug 9, 2018

Yup, I see how this can easily lead to confusion…

There are ways to still take method annotations into account, with some customization, but if upgrading javax.validation is an option, I’d still go for that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Enforcing non-nullability - Apollo GraphQL Docs
Using the @nonnull directive​​ Because GraphQL allows very granular error handling and resolvers may return errors on different fields during execution, many ...
Read more >
When To Use GraphQL Non-Null Fields | by Caleb Meredith
A GraphQL non-null field is a GraphQL field where the type is non-null. ... non-null locally instead of globally at a GraphQL schema...
Read more >
Return only non-null values from GraphQLList object
Is there a way to just return " title " or " description " only if it not null? Current result of the...
Read more >
Nulls in GraphQL: Cheatsheet - Hasura
Nullability in GraphQL is a controversial topic. Some say constant null checks are a nuisance, while others err on the side of paranoia....
Read more >
GraphQLNonNull(GraphQLBoolean) could return null #438
So it looks like that GraphQLNonNull checks that the datafetcher's returned object is not null, which it isn't.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found