incremental delivery without branching#3862
Conversation
✅ Deploy Preview for compassionate-pike-271cb3 ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
|
Hi @yaacovCR, I'm @github-actions bot happy to help you with this PR 👋 Supported commandsPlease post this commands in separate comments and only one per comment:
|
d8ae014 to
bcfad72
Compare
e2e397f to
51fa808
Compare
|
I have added a commit to show how deduplication can work. Error boundaries are preserved. In particular: (A) Deduplication For the following operation: query {
a {
b {
c {
d
}
... @defer {
e {
f
}
}
}
}
... @defer {
a {
b {
e {
f
}
}
}
g {
h
}
}
}...the following payloads are generated: [
{
data: {
a: {
b: {
c: {
d: 'd',
},
},
},
},
hasNext: true,
},
{
incremental: [
{
data: {
e: {
f: 'f',
},
},
path: ['a', 'b'],
},
{
data: {
g: {
h: 'h',
},
},
path: [],
},
],
hasNext: false,
},
](B) Null Bubbling is a Deduplication Exception For the following operation: query {
... @defer {
a {
someField
b {
c {
slowNonNullErrorField
}
}
}
}
a {
... @defer {
b {
c {
d
}
}
}
}
}...the following payloads are generated: [
{
data: {
a: {},
},
hasNext: true,
},
{
incremental: [
{
data: {
b: {
c: {
d: 'd',
},
},
},
path: ['a'],
},
],
hasNext: true,
},
{
incremental: [
{
data: {
a: {
b: {
c: null, // <==== note that c is sent as null even though sent already
},
someField: 'someField',
},
},
errors: [
{
message:
'Cannot return null for non-nullable field c.slowNonNullErrorField.',
locations: [{ line: 8, column: 17 }],
path: ['a', 'b', 'c', 'slowNonNullErrorField'],
},
],
path: [],
},
],
hasNext: false,
},
](C) Null Bubbling Preserving Error Boundaries For the following operation: query {
... @defer {
a {
someField
b {
c {
nonNullErrorField
}
}
}
}
a {
... @defer {
b {
c {
d
}
}
}
}
}...the following payloads are generated: [
{
data: {
a: {},
},
hasNext: true,
},
{
incremental: [
{
data: {
a: {
b: {
c: null,
},
someField: 'someField',
},
},
errors: [
{
message:
'Cannot return null for non-nullable field c.nonNullErrorField.',
locations: [{ line: 8, column: 17 }],
path: ['a', 'b', 'c', 'nonNullErrorField'],
},
],
path: [],
},
{
data: {
b: {
c: { // <==== note that c is sent with data
d: 'd', // <==== even though the other payload bubbled up
},
},
},
path: ['a'],
},
],
hasNext: false,
},
] |
da68be5 to
4b3c3f1
Compare
|
Moved deduplication out of this pr for now as per latest discussion… Extracted a few commits that start to minimize the diff…. |
562c6e9 to
d581d89
Compare
2236283 to
c383eaf
Compare
|
This PR has been updated to remove branching while retaining the original publisher. |
|
This PR has been updated to remove the stream refactoring that reduces ticks, so as to reduce the diff to facilitate review. |
|
@robrichard @IvanGoncharov @graphql/graphql-js-reviewers ready for review |
|
updated with a new test and some offline feedback from @robrichard |
the labels were only checked to be unique (and only have to be unique) in combination with the path at which they are used execute was never using the keys, just the values
|
closing in favor of #3886 |
this version of incremental delivery works without branching, solving the issue raised by @Keweiqu
see discussion here: graphql/defer-stream-wg#65
UPDATE: this is now ready for review
** huge thanks to @Urigo and @dotansimha of the guild for sponsoring my open-source work on this. **