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

Refactor processSelectionSet field flattening to allow @client and @defer directives on fragment spreads #8951

Merged
merged 15 commits into from
Oct 22, 2021
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
{
"name": "apollo-client",
"path": "./dist/apollo-client.min.cjs",
"maxSize": "28.0 kB"
"maxSize": "28.25 kB"
}
],
"engines": {
Expand Down
46 changes: 25 additions & 21 deletions src/cache/inmemory/__tests__/__snapshots__/writeToStore.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ Object {
}
`;

exports[`writing to the store "Cache data maybe lost..." warnings should not warn when scalar fields are updated 3`] = `[MockFunction]`;

exports[`writing to the store correctly merges fragment fields along multiple paths 1`] = `
Object {
"Item:0f47f85d-8081-466e-9121-c94069a77c3e": Object {
Expand Down Expand Up @@ -72,19 +74,6 @@ Object {
exports[`writing to the store should not keep reference when type of mixed inlined field changes to non-inlined field 1`] = `
[MockFunction] {
"calls": Array [
Array [
"Missing field 'price' while writing result {
\\"id\\": \\"1\\",
\\"name\\": \\"Todo 1\\",
\\"description\\": \\"Description 1\\",
\\"__typename\\": \\"ShoppingCartItem\\"
}",
],
Array [
"Missing field 'expensive' while writing result {
\\"id\\": 1
}",
],
Array [
"Missing field 'id' while writing result {
\\"__typename\\": \\"Cat\\",
Expand All @@ -97,14 +86,6 @@ exports[`writing to the store should not keep reference when type of mixed inlin
"type": "return",
"value": undefined,
},
Object {
"type": "return",
"value": undefined,
},
Object {
"type": "return",
"value": undefined,
},
],
}
`;
Expand Down Expand Up @@ -218,6 +199,29 @@ Object {
}
`;

exports[`writing to the store writeResultToStore shape checking should not warn if a field is defered 1`] = `[MockFunction]`;

exports[`writing to the store writeResultToStore shape checking should warn when it receives the wrong data inside a fragment 1`] = `
[MockFunction] {
"calls": Array [
Array [
"Missing field 'price' while writing result {
\\"id\\": \\"1\\",
\\"name\\": \\"Todo 1\\",
\\"description\\": \\"Description 1\\",
\\"__typename\\": \\"ShoppingCartItem\\"
}",
],
],
"results": Array [
Object {
"type": "return",
"value": undefined,
},
],
}
`;

exports[`writing to the store writeResultToStore shape checking should warn when it receives the wrong data with non-union fragments 1`] = `
[MockFunction] {
"calls": Array [
Expand Down
Loading