Skip to content

Commit

Permalink
SemanticNonNull halts null propagation
Browse files Browse the repository at this point in the history
  • Loading branch information
twof committed Nov 8, 2024
1 parent 07e4646 commit 6fac3b5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/execution/__tests__/executor-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1425,14 +1425,17 @@ describe('Execute: Handles Semantic Nullability', () => {
});

it('SemanticNonNull halts null propagation', async () => {
const deepData = {
f: () => null
};

const data = {
a: () => 'Apple',
b: () => null,
c: () => 'Cookie',
d: () => {
f: () => null
}
d: () => deepData
};


const document = parse(`
query {
Expand Down
2 changes: 1 addition & 1 deletion src/execution/execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ function completeValue(
throw result;
}

console.log("anything", path);
console.log("anything", path, result);

Check warning on line 654 in src/execution/execute.ts

View workflow job for this annotation

GitHub Actions / ci / Lint source files

Unexpected console statement

// If field type is NonNull, complete for inner type, and throw field error
// if result is null.
Expand Down

0 comments on commit 6fac3b5

Please sign in to comment.