timqian / gql-generator

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

Fix broken codegen with fields with same type #13

Open gaberudy opened 5 years ago

gaberudy commented 5 years ago

Pop the crossReferenceKeyList after recursing down so that codegen succeeds when two siblings have the same complex type.

timqian commented 5 years ago

This change makes the code only check one level of parent-child relation, and will pop every crossReferenceKey (parent-child relation) away, I think it will result in bug for recursive schema. And besides, manipulating pointer parameter in recursive function make the code hard to reason about