ChilliCream / ChilliCream/graphql-platform
Error on generating code for non nullable ICollection<Guid>
@PascalSenn is already working on this.
Since Feb 8, 2022.
- Dominant language
- C#
- Stars
- 5.8k
- Forks
- 810
- Avg merge
- 15h 39m
- Merged PRs (30d)
- 98
Description
Describe the bug
If you have a DTO (maybe record) with a non nullable property ICollection<Guid> MyValues than the generated schema.graphql looks great:
input MyDtoInput {
myValues: [UUID!]!
}
But the code generator for StrawberryShake throws an error on generating process:
Non-Nullable-Feld "_value_myValues" muss beim Beenden des Konstruktors einen Wert ungleich NULL enthalten. Erwägen Sie eine Deklaration von "Feld" als Nullable.
To get the process working the only possibility is to mark ICollection<Guid>? MyValues as nullable.
Steps to reproduce
- Create DTO
public record MyDto( ICollection<Guid> MyValues); - Create DTO
public record MyInput( MyDto MyValue) - Update schema with
dotnet graphql update - Create mutation
mutation SendMyInput( $dto:MyInput!){ sendMyInput( input: $dto ) } - The code generator throws the error
Relevant log output
Non-Nullable-Feld "_value_myValues" muss beim Beenden des Konstruktors einen Wert ungleich NULL enthalten. Erwägen Sie eine Deklaration von "Feld" als Nullable.
Product
Hot Chocolate, Strawberry Shake
Version
12.6.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.