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.

Nullable reference types not detected in mutation parameters

See original GitHub issue

If 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:closed
  • Created a year ago
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
lukemurraycommented, Aug 23, 2022

Whoops I did miss that. Thanks

0reactions
Eli-Black-Workcommented, Aug 25, 2022

@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! 🙂

Read more comments on GitHub >

github_iconTop 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 >

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