Skip to content
This repository has been archived by the owner on Jul 10, 2019. It is now read-only.

Fix: when alias returns a falsy value, it may return undefined #303

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/apollo-link-state/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,10 @@ export const withClientState = (
const aliasNeeded = resultKey !== fieldName;

// If aliasedValue is defined, some other link or server already returned a value
if (aliasedNode !== undefined || preAliasingNode !== undefined) {
return aliasedNode || preAliasingNode;
if (aliasedNode !== undefined) {
return aliasedNode;
} else if (preAliasingNode !== undefined) {
return preAliasingNode;
}

// Look for the field in the custom resolver map
Expand Down