Closed
Description
I have an error when working with union result type.
Here is working demo
Uncomment getUserWithUnion
method in resolver.ts
to reproduce the problem.
TypeError: Cannot read property 'type' of undefined
at /home/maxim/workspace/demo/node_modules/type-graphql/dist/schema/schema-generator.js:66:101
at Array.map (<anonymous>)
at types (/home/maxim/workspace/demo/node_modules/type-graphql/dist/schema/schema-generator.js:66:22)
at resolveThunk (/home/maxim/workspace/demo/node_modules/graphql/type/definition.js:438:40)
at defineTypes (/home/maxim/workspace/demo/node_modules/graphql/type/definition.js:837:15)
at GraphQLUnionType.getTypes (/home/maxim/workspace/demo/node_modules/graphql/type/definition.js:806:26)
at typeMapReducer (/home/maxim/workspace/demo/node_modules/graphql/type/schema.js:272:28)
at typeMapReducer (/home/maxim/workspace/demo/node_modules/graphql/type/schema.js:286:20)
at Array.reduce (<anonymous>)
at new GraphQLSchema (/home/maxim/workspace/demo/node_modules/graphql/type/schema.js:145:28)