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

exposing multiple fields with differing case / underscores causes invalid code generation #376

Closed
vektah opened this issue Oct 11, 2018 · 1 comment
Labels
bug Something isn't working v0.8 For release in v0.8

Comments

@vektah
Copy link
Collaborator

vektah commented Oct 11, 2018

Given the schema:

type Foo {
   sizeMapping: [Sizemapping!]!
   size_mapping: [Sizemapping!]! @deprecated
}

The generated complexity struct ends up duplicating a method, which is a compile error:

struct {
        SizeMapping func(childComplexity int) int
        SizeMapping func(childComplexity int) int
}

Worth checking the other field binding logic isn't doing anything too crazy here.

@vektah vektah added the bug Something isn't working label Oct 11, 2018
@mathewbyrne
Copy link
Contributor

@vektah this occurs for resolvers (if both fields get a resolver generated) and model gen as well (although I would expect people experiencing this to be with their own models more often). What's the solution here with clashes? I guess some sort of prefix, but it's a little ugly. Perhaps a numeric prefix and an option to specify?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v0.8 For release in v0.8
Projects
None yet
Development

No branches or pull requests

2 participants