timqian / gql-generator

Generate queries from graphql schema, used for writing api test.
MIT License
375 stars 93 forks source link

Detect query/mutation/subscription roots from schema #62

Open dush opened 2 years ago

dush commented 2 years ago

I have schema that defines query,mutation and subscription root type names in schema file and does not use default names

schema {
  query: query_root
  mutation: mutation_root
  subscription: subscription_root
}
type mutation_root {...}

type query_root {...}

type subscription_root {...}

But they are not recognized by gql-generator, because it's regexes does not match those names.

Example from GraphQL spec https://spec.graphql.org/October2021/#example-e2969