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
func (o *SomeObject) UnmarshalGQL(inst interface{}) error { ... }
func (o SomeObject) MashalQL(q io.Writer) { ... }
gqlgen generate then outputs this:
validation failed: packages.Load: /home/jwatte/go/src/gqlbug/graph/generated/generated.go:2309:17: ec.unmarshalInputSomeObject undefined (type *executionContext has no field or method unmarshalInputSomeObject)
/home/jwatte/go/src/gqlbug/graph/generated/generated.go:2320:12: ec._SomeObject undefined (type *executionContext has no field or method _SomeObject)
This discussion was converted from issue #1414 on January 19, 2022 14:29.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
What happened?
I added a scalar that is typedefed to a map[string]interface{}
I got undefined symbol errors when trying to compile the generated code.
What did you expect?
I expected this to work
Minimal graphql.schema and models to reproduce
Trying to reproduce #1391 on v0.13.0, I ran into another problem.
I start with the "gqlgen init" sample todo framework, and make a few edits:
In schema.graphql:
scalar SomeObject
mutation {
doThing(input:SomeObject!):String!
}
in gqlgen.yml:
models:
SomeObject:
model: github.com/jwatte/gqlbug/foo.SomeObject
in foo/object.go:
type SomeObject map[string]interface{}
func (o *SomeObject) UnmarshalGQL(inst interface{}) error { ... }
func (o SomeObject) MashalQL(q io.Writer) { ... }
gqlgen generate
then outputs this:validation failed: packages.Load: /home/jwatte/go/src/gqlbug/graph/generated/generated.go:2309:17: ec.unmarshalInputSomeObject undefined (type *executionContext has no field or method unmarshalInputSomeObject)
/home/jwatte/go/src/gqlbug/graph/generated/generated.go:2320:12: ec._SomeObject undefined (type *executionContext has no field or method _SomeObject)
versions
gqlgen version
?v0.13.0
go version
?v1.14.2
dep or go modules?
go modules
Beta Was this translation helpful? Give feedback.
All reactions