Skip to content

Auto-generate query names for anonymous GraphQL queries #225

@freb97

Description

@freb97

For the type generation to work, GraphQL queries have to have a unique name.

works:

query GetCustomer {
  customer {
    firstName
    lastName
  }
}

doesn't work:

query {
  customer {
    firstName
    lastName
  }
}

Since we control the type generation and have access to the originating file name, contents, etc. it would be possible to auto-generate missing query names. This should be behind a configuration flag, but if it turns out to be viable and stable it should be enabled by default with a possibility to opt-out.

Name generation has to be unique enough that multiple queries can be created in the same file without a name and still get the correct types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestnice-to-haveNot the highest priority right now, but a useful feature / fix

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions