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

Duplicate namespace for Queries and Mutations is unusable - Append Query/Mutation to schema names #73

Open
dash-tobin opened this issue Jun 14, 2023 · 0 comments

Comments

@dash-tobin
Copy link

dash-tobin commented Jun 14, 2023

In graphql you are able to create a query and a mutation with the same namespace. When gqlg code is run, these two will names will clash upon export.

Would it be possible to append the query & file names with Query, and the mutation & file names with Mutation

type Query {
  thingById(id: ID!): Thing!
}
type Mutation {
 thingById(input: Thing!): Thing!
}

Current Result:

// in queries/thingById.gql
query thingById($id: ID!){
    thingById(id: $id){
      ....
    }
}
// in mutations/thingById.gql
mutation thingById($input: Thing!){
    thingById(input: $input){
      ....
    }
}

Expected Result:

// in queries/thingByIdQuery.gql
query thingByIdQuery($id: ID!){
    thingById(id: $id){
      ....
    }
}
// in mutations/thingByIdMutation.gql
mutation thingByIdMutation($input: Thing!){
    thingById(input: $input){
      ....
    }
}
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

No branches or pull requests

1 participant