Skip to content
New issue

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

Input Resolver Code Gen issue with type alias #1868

Closed
mohammadcazi opened this issue Jan 28, 2022 · 4 comments
Closed

Input Resolver Code Gen issue with type alias #1868

mohammadcazi opened this issue Jan 28, 2022 · 4 comments
Labels

Comments

@mohammadcazi
Copy link

mohammadcazi commented Jan 28, 2022

Looks like this pr caused an issue in code gen: #1404

The generated code expects a resolver for inputs now but it fails to implement the resolver. Also, the model that was already matching using @GoModel directive is no longer matching:

type Bar struct {
   a, b string
}

type FooType []Bar
type Baz struct {
    Foo FooType
}


input SomeInput @goModel(model: "Baz") {
   foo: [Bar!]! # this used to get mapped to the go struct, but now it doesn't. 
}

input Bar @goModel(model: "Bar") {
   a: String!
   b: String!
}
@frederikhors
Copy link
Collaborator

Please create a Github repository to reproduce the issue.

@mojtabacazi
Copy link

@frederikhors here is a sample repository for the issue.

https://github.com/mojtabacazi/gql-issue-type-alias

Generated code with 0.14 works fine but not 0.15 nor 0.16. Here is the error from the project:

./main.go:13:23: cannot use &rsv (type *resolvers.Resolver) as type generated.ResolverRoot in field value:
        *resolvers.Resolver does not implement generated.ResolverRoot (missing SampleInput method)

@mojtabacazi
Copy link

@frederikhors Any updates?

@StevenACoffman
Copy link
Collaborator

I believe this is resolved with #1950

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants