Nullable reference types not detected in mutation parameters
See original GitHub issueIf a mutation uses separate parameters (vs. a parameters object), any of the parameters that are of a reference type and are marked as nullable still show up as non-nullable in the GraphQL.
For example, in a mutation:
void Update(InputType a, InputType? b) { ... }
Should output the GraphQL:
update(a: InputType!, b: InputType)
Currently, it outputs:
update(a: InputType!, b: InputType!)
EntityGraphQL should inspect the nullability:
var nullabilityContext = new NullabilityInfoContext();
var nullabilityInfo = nullabilityContext.Create(parameterInfo);
bool isNullable = nullabilityInfo.WriteState is NullabilityState.Nullable;
Issue Analytics
- State:
- Created a year ago
- Comments:11 (1 by maintainers)
Top Results From Across the Web
Nullable reference types
Nullable reference types refers to a group of features enabled in a nullable aware context that minimize the likelihood that your code causes ......
Read more >c# - When to null-check arguments with nullable reference ...
Given a function in a program using C# 8.0's nullable reference types feature, should I still be performing null checks on the arguments?...
Read more >Expose top-level nullability information from reflection
+1 on having the new API recognize nullable value types. It's true the nullable reference and value types are completely different things under ......
Read more >How to Stop NullReferenceExceptions in .NET
This article gives you a toolset for stopping NullReferenceExceptions in .NET code. The article centers around Nullable Reference Types ...
Read more >Nullable Reference Types in C# 8 • Jon Skeet • GOTO 2019
This presentation was recorded at GOTO Copenhagen 2019. #GOTOcon #GOTOcph http://gotocph.com Jon Skeet - +34000 answers on Stack Overflow ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Whoops I did miss that. Thanks
@lukemurray It looks like this bug probably isn’t related to this issue, so I’ve split it off into a separate bug report: https://github.com/EntityGraphQL/EntityGraphQL/issues/221
@breyed Sorry for the noise! 🙂