timqian/gql-generator

Support extend type

guzmo opened this issue · 4 comments

guzmo commented

Hi,

We have modularized our graphql in to separate files so we extend the queries and mutations, eg.

extend type Query {
  someQuery: Boolean
}

Would it be possible to support this?

I have not tried the extend feature yet. But this tool use graphql-js to parse schema file, as long as graphql-js support it, gql-generator should support it too. But you might need to concat your schemas to one file as gql-generator does not support multiple schema files now

guzmo commented

Currently im pushing all to one file and then I run your tool on that file. But the only queries/mutations I get are the ones in the regular Query and Mutation type, not from the extended ones.

We use buildSchema method of graphql-js and seems graphql-js is still implementing it

graphql/graphql-js#922 (comment)

it ignores extend for now, and seems it will support it soon.

We can add extend support as long as graphql-js support it. PR is welcomed if I forget do it on time