-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Suggestion: Generate resolver for fields missing from go model #63
Comments
This should still work the way you describe. Model generation only happens if you don't add the model to types.json. eg, the starwars example is still using it for the friends connection Whats probably happening is |
@vektah No it is searching fine, we now receive an error:
If you add a Generating with the following:
It works for custom type connections (hence the star wars example still working), but not scalar values, e.g |
that was just a warning, but I've removed it to avoid future confusion. Scalars has an example: |
😶 |
When we first started using gqlgen, if your go model did not have a field publicly accessible that was specified on your schema, the generator would generate a resolver for you to manually handle it.
Unfortunately, this functionality disappeared when you introduced the model generator.
This was really nice feature if you have any fields on your graphql model that are generated by business logic. For the example above, something like:
I can understand the answer is probably to separate db go models from graphql go models, but for an example like this where most of the fields are duplicated, I don't see it worth it for the added overhead and complexity.
The text was updated successfully, but these errors were encountered: