Required input struct generated as pointer #2156
Unanswered
Junaid-Ahm
asked this question in
Q&A
Replies: 1 comment 3 replies
-
Already discussed hundreds of times. Search through issues and discussions. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What happened?
For a required object field in another schema object (happens with both
type
orinput
), it declares the required object field as pointer to the struct - see fieldDetails
declared as*UserDetailsInput
in declaration ofUpdateUserInput
. It should have been declared asUserDetailsInput
instead.The
models_gen.go
containsWhat did you expect?
If the object field is required, it should be declared without pointer. In other words, it should only be declared as pointer if the object field is optional.
The
models_gen.go
should containMinimal graphql.schema and models to reproduce
versions
go run github.com/99designs/gqlgen version
: v0.17.4go version
: 1.18Beta Was this translation helpful? Give feedback.
All reactions