Skip to content

Code generation incorrect for field 'self' #193

@lilyball

Description

@lilyball

If I have a field named self in a GraphQL query, the code generator produces code that references Self.selections, which is invalid as Self is a keyword and so the code fails to compile. The current workaround is to alias the field to a different name, though unfortunately the name self_ doesn't work as Apollo still produces the type name Self.

The code generator should recognize keywords and work around them somehow, either by judicious insertion of backticks in the generated code, or by renaming the type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    codegenIssues related to or arising from code generation

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions