Skip to content
This repository has been archived by the owner on Apr 15, 2020. It is now read-only.

Commit

Permalink
fix(WrapType): fix root type edge case
Browse files Browse the repository at this point in the history
Allow wrapping root types even when a root type value is not defined for the query.
  • Loading branch information
yaacovCR committed Dec 9, 2019
1 parent 27696aa commit c851df0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/test/testAlternateMergeSchemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -700,8 +700,8 @@ type UnionImpl {
}
}
`,
{},
{},
undefined,
undefined,
{
pid: 'p1',
},
Expand Down
2 changes: 1 addition & 1 deletion src/transforms/WrapType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default class WrapType implements Transform {
this.transformer = new ExtendSchema({
resolvers: {
[outerTypeName]: {
[fieldName]: parent => parent,
[fieldName]: parent => parent ? parent : {},
},
},
fieldNodeTransformerMap: {
Expand Down

0 comments on commit c851df0

Please sign in to comment.