Skip to content

semantic nullability proposal with single GraphQLSemanticNullable wrapper type #4338

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

Draft
wants to merge 36 commits into
base: 16.x.x
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
fb9bd1f
New GraphQLSemanticNonNull type
benjie Sep 14, 2024
0c64761
Handle isNonNullType
benjie Sep 14, 2024
934c634
More fixes
benjie Sep 14, 2024
48c7b53
More fixes
benjie Sep 14, 2024
b758b67
Yet more updates
benjie Sep 14, 2024
e309ed5
Recognize in introspection, enable disabling null bubbling
benjie Sep 14, 2024
f599c4e
Lint fixes
benjie Sep 14, 2024
b7e2c7f
More missing pieces
benjie Sep 14, 2024
033e917
More fixes
benjie Sep 14, 2024
2787de0
Fix schema
benjie Sep 14, 2024
e029b6d
Fix another test
benjie Sep 14, 2024
f69db21
More minor test fixes
benjie Sep 14, 2024
e73c4ba
Fix introspection test
benjie Sep 14, 2024
8cc7fab
Add support for * to lexer
benjie Sep 14, 2024
6b0611d
Allow specifying errorPropagation at top level
benjie Sep 14, 2024
dd60b9e
Factor into getIntrospectionQuery
benjie Sep 14, 2024
3e01bb2
Lint
benjie Sep 14, 2024
0df7bdc
Prettier
benjie Sep 14, 2024
36b3cf2
parser tests passing
twof Oct 30, 2024
69739eb
Add semantic optional type
twof Nov 7, 2024
4dcf01c
printer and parser tests passing
twof Nov 7, 2024
509d0c6
some new semanticNullability execution tests
twof Nov 8, 2024
71e4057
SemanticNonNull halts null propagation
twof Nov 8, 2024
5cdbf81
SemanticOptional cleared
twof Nov 8, 2024
3099d63
logging cleanup
twof Nov 8, 2024
9e4bf7d
rename to SemanticNullable
twof Nov 8, 2024
7002eb1
better SemanticNullable docs
twof Nov 8, 2024
6a63f91
move semantic nullability tests to their own file
twof Nov 8, 2024
3d7cd06
fix git status
twof Nov 8, 2024
9247ff2
run prettier
twof Nov 8, 2024
e6c2239
Add comment to parser about document directive
twof Nov 8, 2024
f45b474
use semantic nullable wrapper only
yaacovCR Nov 10, 2024
e6afbfd
use expectJSON and other usual testing shorthands
yaacovCR Nov 10, 2024
7c737fe
fix sp
yaacovCR Feb 2, 2025
4ad3587
fix types
yaacovCR Feb 2, 2025
a0ca9d9
add actually printing the semantic nullability directive
yaacovCR Feb 2, 2025
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
Prev Previous commit
Next Next commit
SemanticNonNull halts null propagation
twof authored and yaacovCR committed Feb 2, 2025
commit 71e40570bad4fc1393fc2fef6e96eeba431be9af
9 changes: 6 additions & 3 deletions src/execution/__tests__/executor-test.ts
Original file line number Diff line number Diff line change
@@ -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 {
2 changes: 1 addition & 1 deletion src/execution/execute.ts
Original file line number Diff line number Diff line change
@@ -651,7 +651,7 @@ function completeValue(
throw result;
}

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

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