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

workaround for v16 #3481

Closed
wants to merge 1 commit into from
Closed
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
16 changes: 16 additions & 0 deletions packages/delegate/src/prepareGatewayDocument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,22 @@ function wrapConcreteTypes(
}
},
[Kind.FIELD]: (node: FieldNode) => {
// workaround for v16 lack of visitorKeys
//
// in v15, we never enter subfields because we don't visit any keys for nodes of kind `Kind.FIELD`
// which automatically means we only visit 'root fields', no matter how nested they are in fragment
// nodes.
//
// In v16, visitorKeys is gone, and we have to enter child fields and explicitly exit by returning
// 'false'.
const parentType = typeInfo.getParentType();
if (parentType == null) {
return false;
}
if (!rootTypeNames.has(parentType.name)) {
return false;
}
// end-workaround
const type = typeInfo.getType();
if (type != null && isAbstractType(getNamedType(type))) {
return {
Expand Down