We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First, thanks for all your work on this. It's a very helpful package.
For some context, I originally wanted to do this:
schema.graphql
schema { query: Query mutation: Mutation } type Query {} type Mutation { addBookmark(b: Bookmarkable!): Boolean! } type Item {} union Bookmarkable = Item
But it doesn't compile:
$ gqlgen $ go build ./generated.go:117:16: (&arg0).UnmarshalGQL undefined (type *Bookmarkable is pointer to interface, not interface)
models_gen.go
// This file was generated by github.com/vektah/gqlgen, DO NOT EDIT package tmp type Bookmarkable interface{} type Item struct { }
generated.go
// ... func (ec *executionContext) _Mutation_addBookmark(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { args := map[string]interface{}{} var arg0 Bookmarkable if tmp, ok := field.Args["b"]; ok { var err error err = (&arg0).UnmarshalGQL(tmp) // <-- the problem if err != nil { ec.Error(err) return graphql.Null } } // ...
There are lengthy discussions about this at graphql/graphql-js#207 and graphql/graphql-spec#395. It sounds like there's no official solution yet. So I tried this:
schema { query: Query mutation: Mutation } type Query {} type Mutation { addBookmark(b: BookmarkableInput!): Boolean! } type Item {} input BookmarkableInput { item: Item }
$ gqlgen unable to gofmt: generated.go:821:9: expected selector or type assertion, found '='
It creates a malformed generated.go
//... func UnmarshalBookmarkableInput(v interface{}) (BookmarkableInput, error) { var it BookmarkableInput for k, v := range v.(map[string]interface{}) { switch k { case "item": var err error var ptr1 Item if v != nil { err = (&ptr1).UnmarshalGQL(v) it. = &ptr1} // <-- the problem if err != nil { return it, err } } } return it, nil } // ...
The text was updated successfully, but these errors were encountered:
Interesting, It wouldn't be too hard to add once that RFC lands.
As for the second issue, you cant reference types from input types.
I will tighten up the error handling for both.
Sorry, something went wrong.
resolves 99designs#92: fix processing of negative scalars during pars…
d30eb00
…e literals
No branches or pull requests
First, thanks for all your work on this. It's a very helpful package.
For some context, I originally wanted to do this:
schema.graphql
But it doesn't compile:
models_gen.go
generated.go
There are lengthy discussions about this at graphql/graphql-js#207 and graphql/graphql-spec#395. It sounds like there's no official solution yet. So I tried this:
It creates a malformed
generated.go
The text was updated successfully, but these errors were encountered: