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

Underscore on field name finder #370

Merged
merged 1 commit into from
Oct 11, 2018

Conversation

rodrigo-brito
Copy link
Contributor

@rodrigo-brito rodrigo-brito commented Oct 5, 2018

Schema fields with underscore are not considered on finder field. The strings.EqualFold don't consider the underscore on compare operation.

Closes #357

I have:

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

Copy link
Collaborator

@vektah vektah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, only a small nitpick.

codegen/util.go Outdated
@@ -105,6 +105,12 @@ func findMethod(typ *types.Named, name string) *types.Func {
return nil
}

func equalFold(source, target string) bool {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't equal fold any more, the name isn't great.

If its only called from findField, maybe equalFieldName?

@rodrigo-brito
Copy link
Contributor Author

Fixed!

@vektah vektah merged commit 3eab22a into 99designs:master Oct 11, 2018
cgxxv pushed a commit to cgxxv/gqlgen that referenced this pull request Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants