Skip to content

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

@tatejones

Description

@tatejones

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions