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

fix by getting underlying type prior to delegation #1639

Merged
merged 1 commit into from Jun 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/stitch/src/stitchingInfo.ts
Expand Up @@ -6,6 +6,8 @@ import {
SelectionSetNode,
isObjectType,
isScalarType,
getNamedType,
GraphQLOutputType,
} from 'graphql';

import {
Expand Down Expand Up @@ -106,6 +108,7 @@ function createMergedTypes(
schema: subschema,
operation: 'query',
fieldName: mergedTypeConfig.fieldName,
returnType: getNamedType(info.returnType) as GraphQLOutputType,
args: mergedTypeConfig.args(originalResult),
selectionSet,
context,
Expand Down
4 changes: 4 additions & 0 deletions packages/stitch/tests/typeMerging.test.ts
Expand Up @@ -16,6 +16,7 @@ let chirpSchema = makeExecutableSchema({
text: String
author: User
coAuthors: [User]
authorGroups: [[User]]
}

type User {
Expand Down Expand Up @@ -85,6 +86,9 @@ describe('merging using type merging', () => {
coAuthors {
email
}
authorGroups {
email
}
}
}
}
Expand Down