You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I expect valid go code to be generated. The actual generated code is not building for the following reason: gql/exec.go:2298:17: cannot assign []*proj.MapEntry to it.Map (type map[string]string) in multiple assignment
This is the generated go code part that is failing:
I tried the same usecase with graphql type and an additional resolver was added that has as parameter Bar and returns MapEntry.
I am aware of the fact that graphql types and inputs are totally different concepts and why the generated code was broken but I think it would be very handy to have some kind of generated resolvers similar to the ones for the type or some workaround for similar usecases.
Maybe show an error at generation time?
versions
gqlgen version v0.8.2
go version 1.11
go modules
The text was updated successfully, but these errors were encountered:
Yeah interesting, I've marked this as both a bug and a feature. We should strive for better error messages first to make sure its obvious how this is currently invalid.
And we should consider how to handle users supplying input transforms instead of erroring, as a feature with less urgency.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
What happened?
Invalid go code was generated.
What did you expect?
I expect valid go code to be generated. The actual generated code is not building for the following reason:
gql/exec.go:2298:17: cannot assign []*proj.MapEntry to it.Map (type map[string]string) in multiple assignment
This is the generated go code part that is failing:
Minimal graphql.schema and models to reproduce
--- schema.graphqls
--- gqlgen.yaml
--- models.go
I tried the same usecase with graphql
type
and an additional resolver was added that has as parameterBar
and returnsMapEntry
.I am aware of the fact that graphql types and inputs are totally different concepts and why the generated code was broken but I think it would be very handy to have some kind of generated resolvers similar to the ones for the type or some workaround for similar usecases.
Maybe show an error at generation time?
versions
gqlgen version v0.8.2
go version 1.11
go modules
The text was updated successfully, but these errors were encountered: