-
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
Schema fields with underscore #357
Comments
I inspect the generator code and check some outputs. I notice that the field codegen.(*Field).ShortResolverDeclaration
|
@rodrigo-brito thanks for the report. Can I ask, did you let |
No, I used this simple example in the unit test of generator. The GQLGen example doesn't has a target model. But it happens in both of cases. |
@mathewbyrne I tried to debug it yesterday, but I don't found where it was checked. I will try to open a PR today, do you have some suspect about the issue? I notice that fields settings on gqlgen.yml solves the problem when the name was informed directly. Ex: User:
model: github.com/foo/bar/models.User
fields:
my_number:
fieldName: MyNumber |
When we generate a schema with underscore within field names, the gqlgen is including it as resolver.
Expected Behaviour
Generate a field in User model with name MyNumber and type *int`.
Actual Behavior
Minimal graphql.schema and models to reproduce
The text was updated successfully, but these errors were encountered: