easygraphql-tester icon indicating copy to clipboard operation
easygraphql-tester copied to clipboard

Support for GraphQL Unions - TypeError: Cannot read property 'type' of undefined

Open tatejones opened this issue 4 years ago • 0 comments
trafficstars

From the code it looks like it expects all types to have fields. The GraphQLUnionType does not support fields, but the getTypes() on this type would expose each type with these fields.

In the validate fixture I could flatten the types in fields to expand the fields available for validating.

..line 89

  • const fields = selectedType.fields
  • const fields = selectedType.fields.concat([].concat.apply([], selectedType.types.map(selectedType => schema[selectedType].fields)));

If I get time next week I will create a unit test for this.

tatejones avatar Apr 30 '21 05:04 tatejones