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

feat: generate resolvers for inputs if fields are missing #1404

Merged

Conversation

danielvladco
Copy link
Contributor

Describe your PR and link to any relevant issues.

Generate resolvers for input type fields in case the user defined type is missing those fields.

fixes #1403

I have:

  • [ ] Added tests covering the bug / feature (see testing)
  • [ ] Updated any relevant documentation (see docs)

@coveralls
Copy link

coveralls commented Nov 30, 2020

Coverage Status

Coverage decreased (-0.009%) to 54.004% when pulling 06d3cb0 on danielvladco:generate-resolvers-for-inputs into 7db941a on 99designs:master.

@StevenACoffman
Copy link
Collaborator

Hi! This looks like it could use a bit of freshening up, and I think we were hoping for a test for this.

@danielvladco
Copy link
Contributor Author

Lol, I forgot about this PR long ago 😆 , looks like the maintainers don't really care about this feature. So I'm not sure if it's worth wasting time to refresh it.

@StevenACoffman
Copy link
Collaborator

Hi! I'm a maintainer now, and I care! There was a period of inactivity, but we're catching up now, and this is the kind of contribution we want to prioritize.

@danielvladco
Copy link
Contributor Author

Cool! that's good news, in this case I will revisit it again sometime this week

@StevenACoffman StevenACoffman merged commit 3bbc2a3 into 99designs:master Oct 24, 2021
@StevenACoffman
Copy link
Collaborator

Thanks!

@mojtabacazi
Copy link

mojtabacazi commented Jan 21, 2022

@StevenACoffman @danielvladco Looks like this is broken, 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!
}


@yoosful
Copy link

yoosful commented Feb 5, 2022

@StevenACoffman @danielvladco Looks like this is broken, 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!
}

I'm facing the same issue. Did you come across any workaround?

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

Successfully merging this pull request may close these issues.

Invalid generated code for inputs when go model field type does not match the graphql field type
5 participants