gql-generator icon indicating copy to clipboard operation
gql-generator copied to clipboard

Add option to avoid cycles

Open mariusaarsnes opened this issue 4 years ago • 1 comments

This PR adds functionality to avoid cycles in the queries being generated in case there are cycles in the GraphQL schema definitions.

Add an optional parameter avoidCycles which when set will make generateQuery stop the recursion when encountering a child with the same name as a predecessor.

Pass along a set of Parents for each field. In the case that the name of the current field exists in the parent set, the method returns to avoid cycles

mariusaarsnes avatar Nov 17 '21 15:11 mariusaarsnes

@timqian What are your thoughts on a flag like this? Would be awesome to add something like this IMO

dr3 avatar Nov 08 '22 23:11 dr3