Commit 8fbc0b9
Deprecate returning non-model weak types from resolvers (#5004)
Summary:
We implemented this behavior has a shortcut before we had model resolvers. While it may still prove useful in the future, currently it operates as a footgun. It currently works by expecting a fully deeply populated network shaped response for the object and _all_ of its possible children (deeply nested) and then normalizes and publishes that data into the store at read time. This creates a complex write-during-read cycle which is difficult to reason about and has confusing perf characteristics.
Pull Request resolved: #5004
Test Plan: Runs on both www and xplat without triggering any errors
Reviewed By: tyao1
Differential Revision: D75182848
Pulled By: captbaritone
fbshipit-source-id: 8bbb21586f31b02bf663d74ad019d5b4e07b53c21 parent f3d0bed commit 8fbc0b9Copy full SHA for 8fbc0b9
17 files changed
+200-21Lines changed: 200 additions & 21 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- compiler/crates
- common/src
- relay-compiler
- tests
- relay_compiler_integration/fixtures
- relay-docblock
- src
- tests
- to_schema/fixtures
- scripts
Expand file treeCollapse file tree
Open diff view settings
Collapse file
compiler/crates/common/src/feature_flags.rs
Copy file name to clipboardExpand all lines: compiler/crates/common/src/feature_flags.rs+14-2Lines changed: 14 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
23 | 23 | |
24 | 24 | |
25 | 25 | |
26 | | - |
| 26 | + |
27 | 27 | |
28 | 28 | |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
29 | 41 | |
30 | 42 | |
31 | 43 | |
| ||
169 | 181 | |
170 | 182 | |
171 | 183 | |
172 | | - |
| 184 | + |
173 | 185 | |
174 | 186 | |
175 | 187 | |
|
Collapse file
compiler/crates/relay-compiler/relay-compiler-config-schema.json
Copy file name to clipboardExpand all lines: compiler/crates/relay-compiler/relay-compiler-config-schema.json+15Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
633 | 633 | |
634 | 634 | |
635 | 635 | |
| 636 | + |
| 637 | + |
| 638 | + |
| 639 | + |
| 640 | + |
| 641 | + |
| 642 | + |
| 643 | + |
| 644 | + |
| 645 | + |
| 646 | + |
636 | 647 | |
637 | 648 | |
638 | 649 | |
| ||
799 | 810 | |
800 | 811 | |
801 | 812 | |
| 813 | + |
802 | 814 | |
803 | 815 | |
804 | 816 | |
| ||
1016 | 1028 | |
1017 | 1029 | |
1018 | 1030 | |
| 1031 | + |
| 1032 | + |
| 1033 | + |
1019 | 1034 | |
1020 | 1035 | |
1021 | 1036 | |
|
Collapse file
compiler/crates/relay-compiler/tests/relay_compiler_integration/fixtures/client_mutation_resolver_different_mutation_ok.expected
Copy file name to clipboardExpand all lines: compiler/crates/relay-compiler/tests/relay_compiler_integration/fixtures/client_mutation_resolver_different_mutation_ok.expected+4-1Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
18 | 18 | |
19 | 19 | |
20 | 20 | |
21 | | - |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
22 | 25 | |
23 | 26 | |
24 | 27 | |
|
Collapse file
compiler/crates/relay-compiler/tests/relay_compiler_integration/fixtures/client_mutation_resolver_different_mutation_ok.input
Copy file name to clipboardExpand all lines: compiler/crates/relay-compiler/tests/relay_compiler_integration/fixtures/client_mutation_resolver_different_mutation_ok.input+4-1Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
17 | 17 | |
18 | 18 | |
19 | 19 | |
20 | | - |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
21 | 24 | |
22 | 25 | |
23 | 26 | |
|
Collapse file
compiler/crates/relay-compiler/tests/relay_compiler_integration/fixtures/client_mutation_resolver_invalid_disabled.expected
Copy file name to clipboardExpand all lines: compiler/crates/relay-compiler/tests/relay_compiler_integration/fixtures/client_mutation_resolver_invalid_disabled.expected+6-1Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
12 | 12 | |
13 | 13 | |
14 | 14 | |
15 | | - |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
16 | 21 | |
17 | 22 | |
18 | 23 | |
|
Collapse file
compiler/crates/relay-compiler/tests/relay_compiler_integration/fixtures/client_mutation_resolver_invalid_disabled.input
Copy file name to clipboardExpand all lines: compiler/crates/relay-compiler/tests/relay_compiler_integration/fixtures/client_mutation_resolver_invalid_disabled.input+6-1Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
11 | 11 | |
12 | 12 | |
13 | 13 | |
14 | | - |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
15 | 20 | |
16 | 21 | |
17 | 22 | |
|
Collapse file
compiler/crates/relay-compiler/tests/relay_compiler_integration/fixtures/client_mutation_resolver_invalid_nonscalar.expected
Copy file name to clipboardExpand all lines: compiler/crates/relay-compiler/tests/relay_compiler_integration/fixtures/client_mutation_resolver_invalid_nonscalar.expected+4-1Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
30 | 30 | |
31 | 31 | |
32 | 32 | |
33 | | - |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
34 | 37 | |
35 | 38 | |
36 | 39 | |
|
Collapse file
compiler/crates/relay-compiler/tests/relay_compiler_integration/fixtures/client_mutation_resolver_invalid_nonscalar.input
Copy file name to clipboardExpand all lines: compiler/crates/relay-compiler/tests/relay_compiler_integration/fixtures/client_mutation_resolver_invalid_nonscalar.input+4-1Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
29 | 29 | |
30 | 30 | |
31 | 31 | |
32 | | - |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
33 | 36 | |
34 | 37 | |
35 | 38 | |
|
Collapse file
compiler/crates/relay-compiler/tests/relay_compiler_integration/fixtures/resolver_returns_weak_client_schema_type.expected
Copy file name to clipboard+39Lines changed: 39 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
Collapse file
compiler/crates/relay-compiler/tests/relay_compiler_integration/fixtures/resolver_returns_weak_client_schema_type.input
Copy file name to clipboard+30Lines changed: 30 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
0 commit comments