Commit be8f5f7
Enhance
Summary:
**Summary**
This update enhances the behavior of the `"schemaExtensions"` configuration key, allowing it to specify either:
- A folder containing GraphQL schema extension files (as originally documented).
- A specific .graphql schema extension file (new functionality).
This change unifies behavior between the Watchman query and the walkdir implementation, ensuring consistent handling of schema extensions regardless of configuration.
**Details**
Previously, the Relay documentation instructed users to configure "schemaExtensions" with a folder path containing the GraphQL schema extensions. However:
• Relay did not enforce that the target was a folder.
• Users could already specify a single .graphql schema extension file directly and it would work when not using Watchman.
This update ensures both approaches work seamlessly with Watchman and enhancing flexibility. The documentation has also been updated to reflect this new functionality.
**Why This Change?**
This improvement resolves an inconsistency between Watchman and non-Watchman setups, offering better support for varying project configurations without breaking existing workflows.
Pull Request resolved: #4859
Reviewed By: evanyeung
Differential Revision: D68106213
Pulled By: captbaritone
fbshipit-source-id: ca2f2f401429face4b60c88b033099450e6a3e05schemaExtensions to Support Both Files and Directories (#4859)1 parent 99cbea8 commit be8f5f7Copy full SHA for be8f5f7
5 files changed
+28-13Lines changed: 28 additions & 13 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- compiler/crates/relay-compiler/src
- file_source
- packages/relay-compiler
- website/docs/guides
Expand file treeCollapse file tree
Open diff view settings
Collapse file
compiler/crates/relay-compiler/src/config.rs
Copy file name to clipboardExpand all lines: compiler/crates/relay-compiler/src/config.rs+4-4Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
994 | 994 | |
995 | 995 | |
996 | 996 | |
997 | | - |
| 997 | + |
998 | 998 | |
999 | | - |
1000 | | - |
| 999 | + |
| 1000 | + |
1001 | 1001 | |
1002 | | - |
| 1002 | + |
1003 | 1003 | |
1004 | 1004 | |
1005 | 1005 | |
|
Collapse file
compiler/crates/relay-compiler/src/errors.rs
Copy file name to clipboardExpand all lines: compiler/crates/relay-compiler/src/errors.rs+3-3Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
218 | 218 | |
219 | 219 | |
220 | 220 | |
221 | | - |
| 221 | + |
222 | 222 | |
223 | | - |
| 223 | + |
224 | 224 | |
225 | | - |
| 225 | + |
226 | 226 | |
227 | 227 | |
228 | 228 | |
|
Collapse file
compiler/crates/relay-compiler/src/file_source/watchman_query_builder.rs
Copy file name to clipboardExpand all lines: compiler/crates/relay-compiler/src/file_source/watchman_query_builder.rs+16-2Lines changed: 16 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
67 | 67 | |
68 | 68 | |
69 | 69 | |
70 | | - |
| 70 | + |
71 | 71 | |
72 | 72 | |
73 | 73 | |
| ||
132 | 132 | |
133 | 133 | |
134 | 134 | |
135 | | - |
| 135 | + |
136 | 136 | |
137 | 137 | |
138 | 138 | |
139 | 139 | |
140 | 140 | |
141 | 141 | |
| 142 | + |
| 143 | + |
| 144 | + |
| 145 | + |
| 146 | + |
| 147 | + |
| 148 | + |
| 149 | + |
| 150 | + |
| 151 | + |
| 152 | + |
| 153 | + |
| 154 | + |
| 155 | + |
142 | 156 | |
143 | 157 | |
144 | 158 | |
|
Collapse file
packages/relay-compiler/README.md
Copy file name to clipboardExpand all lines: packages/relay-compiler/README.md+1-1Lines changed: 1 addition & 1 deletion
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
69 | 69 | |
70 | 70 | |
71 | 71 | |
72 | | - |
| 72 | + |
73 | 73 | |
74 | 74 | |
75 | 75 | |
|
Collapse file
website/docs/guides/client-schema-extensions.md
Copy file name to clipboardExpand all lines: website/docs/guides/client-schema-extensions.md+4-3Lines changed: 4 additions & 3 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
29 | 29 | |
30 | 30 | |
31 | 31 | |
32 | | - |
33 | | - |
34 | | - |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
35 | 36 | |
36 | 37 | |
37 | 38 | |
|
0 commit comments