Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tatejones opened this issue Apr 30, 2021 · 0 comments

Comments

@tatejones
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant