For legacy compatibility we have some fields on some types defined with different spelling, i.e. the first name field can be referenced as firstName but also as first_name.
In code this looks like:
field :first_name, String
field :first_name, String, camelize: false
rubocop-graphql currently detects this as duplicate field definition which is not really correct since it actually results in two different fields.
I guess the issue is similar to #83 and a solution would be to consider the camelize option when checking for duplication.
I did throw together a quick fix for this but I have no previous experience with rubocop and/or rubocop-ast so the code is ugly and needs some love before it could be merged.
I'll happily open a PR and invest some time in polishing if you think that this is an issue worth fixing.
For legacy compatibility we have some fields on some types defined with different spelling, i.e. the first name field can be referenced as
firstName
but also asfirst_name
.In code this looks like:
rubocop-graphql currently detects this as duplicate field definition which is not really correct since it actually results in two different fields.
I guess the issue is similar to #83 and a solution would be to consider the
camelize
option when checking for duplication.I did throw together a quick fix for this but I have no previous experience with rubocop and/or rubocop-ast so the code is ugly and needs some love before it could be merged.
I'll happily open a PR and invest some time in polishing if you think that this is an issue worth fixing.