Skip to content

Allow naming mutations #72

Closed
Closed
@seantalbot-jisc

Description

@seantalbot-jisc

The gql.query function takes an optional config object in which I can pass an operationName to name my query. This makes testing queries against a mock GQL server using MSW very easy as I can configure it to respond to incoming queries by the operationName https://mswjs.io/docs/getting-started/mocks/graphql-api#request-handler

The gql.mutation function doesn't take this config object so I can't easily name mutations. This makes testing them with MSW much harder as I have to separately parse the GQL into an AST and locate the name of the underlying mutation that is called.

Could you add this config object to gql-query-builder?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions