relay-compiler 20.1.1 → 21.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -9,6 +9,10 @@
9
9
  * @oncall relay
10
10
  */
11
11
 
12
+ /**
13
+ * LLM/AI Agent: Relay documentation is available in node_modules/relay-runtime/llm-docs/
14
+ */
15
+
12
16
  'use strict';
13
17
 
14
18
  const path = require('path');
package/linux-arm64/relay CHANGED
Binary file
package/linux-x64/relay CHANGED
Binary file
package/macos-arm64/relay CHANGED
Binary file
package/macos-x64/relay CHANGED
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "relay-compiler",
3
3
  "description": "A compiler tool for building GraphQL-driven applications.",
4
- "version": "20.1.1",
4
+ "version": "21.0.1",
5
5
  "keywords": [
6
6
  "graphql",
7
7
  "relay"
@@ -134,6 +134,11 @@
134
134
  "type": "boolean",
135
135
  "default": false
136
136
  },
137
+ "oneOfType": {
138
+ "description": "How to generate a type for an input object marked as @oneOf.\nDefaults to \"strict\", which is to generate a union type which\npermits only a single property being set at a time. \"ignore\"\ngenerates the type as if the @oneOf annotation does not exist.",
139
+ "$ref": "#/$defs/OneOfGeneration",
140
+ "default": "strict"
141
+ },
137
142
  "optionalInputFields": {
138
143
  "title": "For Flow type generation",
139
144
  "description": "When set, generated input types will have the listed fields optional\neven if the schema defines them as required.",
@@ -207,6 +212,12 @@
207
212
  "null"
208
213
  ]
209
214
  },
215
+ "schemaCompact": {
216
+ "type": [
217
+ "string",
218
+ "null"
219
+ ]
220
+ },
210
221
  "schemaConfig": {
211
222
  "description": "Extra configuration for the GraphQL schema itself.",
212
223
  "$ref": "#/$defs/SchemaConfig",
@@ -243,7 +254,7 @@
243
254
  ]
244
255
  },
245
256
  "schemaExtensions": {
246
- "description": "Directory containing *.graphql files with schema extensions.",
257
+ "description": "File or directory containing *.graphql files with schema extensions.",
247
258
  "type": "array",
248
259
  "default": [],
249
260
  "items": {
@@ -306,7 +317,7 @@
306
317
  ]
307
318
  },
308
319
  "ConnectionInterface": {
309
- "description": "Configuration where Relay should expect some fields in the schema.",
320
+ "description": "Configuration where Relay should expect some fields in the schema.\n\n**Important**: When you configure this option in the compiler, you must also configure\nthe Relay runtime to match by calling `ConnectionInterface.inject()` with the same values.\nSee: <https://relay.dev/docs/api-reference/runtime-config/#connectioninterface>",
310
321
  "type": "object",
311
322
  "properties": {
312
323
  "cursor": {
@@ -553,7 +564,8 @@
553
564
  "FeatureFlags": {
554
565
  "type": "object",
555
566
  "properties": {
556
- "actor_change_support": {
567
+ "allow_legacy_relay_resolver_tag": {
568
+ "description": "When enabled for a given name, allows `@RelayResolver` as a legacy\nalias for `@relayType` / `@relayField`.",
557
569
  "$ref": "#/$defs/FeatureFlag",
558
570
  "default": {
559
571
  "kind": "disabled"
@@ -615,6 +627,13 @@
615
627
  "kind": "disabled"
616
628
  }
617
629
  },
630
+ "disable_more_precise_abstract_selection_raw_response_type": {
631
+ "description": "Disable the generation of a more precise raw response type\nfor selections on abstract types.",
632
+ "$ref": "#/$defs/FeatureFlag",
633
+ "default": {
634
+ "kind": "disabled"
635
+ }
636
+ },
618
637
  "disable_resolver_reader_ast": {
619
638
  "description": "Mirror of `enable_resolver_normalization_ast`\nexcludes resolver metadata from reader ast",
620
639
  "type": "boolean",
@@ -625,6 +644,20 @@
625
644
  "type": "boolean",
626
645
  "default": false
627
646
  },
647
+ "disallow_required_action_throw_on_semantically_nullable_fields": {
648
+ "description": "Disallow @required action THROW on semantically nullable fields.\nWhen enabled, this will prevent the use of THROW action on fields\nthat are semantically nullable (e.g., fields that can legitimately\nbe null in normal operation).",
649
+ "$ref": "#/$defs/FeatureFlag",
650
+ "default": {
651
+ "kind": "disabled"
652
+ }
653
+ },
654
+ "emit_nogrep_annotation": {
655
+ "description": "When enabled, the `@nogrep` annotation is included in the docblock\nheader of generated artifacts. This annotation was historically always\nemitted but is no longer needed. This flag allows incremental removal\nacross projects using the rollout variant keyed on the artifact name.",
656
+ "$ref": "#/$defs/FeatureFlag",
657
+ "default": {
658
+ "kind": "disabled"
659
+ }
660
+ },
628
661
  "enable_3d_branch_arg_generation": {
629
662
  "type": "boolean",
630
663
  "default": false
@@ -649,6 +682,13 @@
649
682
  "type": "boolean",
650
683
  "default": false
651
684
  },
685
+ "enable_shadow_resolvers": {
686
+ "description": "Enable experimental support for shadow resolvers. Shadow resolvers allow\ndefining a Relay Resolver that \"shadows\" an existing server field,\nproviding an alternative implementation that can be used during\nmigration or for client-side overrides.",
687
+ "$ref": "#/$defs/FeatureFlag",
688
+ "default": {
689
+ "kind": "disabled"
690
+ }
691
+ },
652
692
  "enable_strict_custom_scalars": {
653
693
  "description": "Perform strict validations when custom scalar types are used",
654
694
  "type": "boolean",
@@ -661,6 +701,18 @@
661
701
  "kind": "enabled"
662
702
  }
663
703
  },
704
+ "enforce_module_name_prefix_for_non_haste": {
705
+ "description": "Enforce that GraphQL operation and fragment names start with the file\nname. Haste projects have this enforcement automatically; this flag\nis only needed for non-Haste projects that want the same validation.",
706
+ "type": "boolean",
707
+ "default": false
708
+ },
709
+ "flow_modern_syntax": {
710
+ "description": "Use modern Flow syntax for generated object types.\nThis enables gradual rollout of exact object type syntax and readonly\nproperties across files.",
711
+ "$ref": "#/$defs/FeatureFlag",
712
+ "default": {
713
+ "kind": "disabled"
714
+ }
715
+ },
664
716
  "legacy_include_path_in_required_reader_nodes": {
665
717
  "description": "The `path` field in `@required` Reader AST nodes is no longer used. But\nremoving them in one diff is too large of a change to ship at once.\n\nThis flag will allow us to use the rollout FeatureFlag to remove them\nacross a number of diffs.",
666
718
  "$ref": "#/$defs/FeatureFlag",
@@ -694,6 +746,13 @@
694
746
  "kind": "disabled"
695
747
  }
696
748
  },
749
+ "shard_extra_artifacts": {
750
+ "description": "Shard generated extra artifacts into subdirectories under\n`extraArtifactsOutput` that mirror the source file's relative path,\nhonoring `shardOutput` / `shardStripRegex`.",
751
+ "$ref": "#/$defs/FeatureFlag",
752
+ "default": {
753
+ "kind": "disabled"
754
+ }
755
+ },
697
756
  "skip_printing_nulls": {
698
757
  "$ref": "#/$defs/FeatureFlag",
699
758
  "default": {
@@ -872,7 +931,7 @@
872
931
  "description": "Enable and disable experimental or legacy behaviors.\nWARNING! These are not stable and may change at any time.",
873
932
  "$ref": "#/$defs/FeatureFlags",
874
933
  "default": {
875
- "actor_change_support": {
934
+ "allow_legacy_relay_resolver_tag": {
876
935
  "kind": "disabled"
877
936
  },
878
937
  "allow_output_type_resolvers": {
@@ -899,15 +958,31 @@
899
958
  "disable_full_argument_type_validation": {
900
959
  "kind": "disabled"
901
960
  },
961
+ "disable_more_precise_abstract_selection_raw_response_type": {
962
+ "kind": "disabled"
963
+ },
902
964
  "disable_resolver_reader_ast": false,
903
965
  "disable_schema_validation": false,
966
+ "disallow_required_action_throw_on_semantically_nullable_fields": {
967
+ "kind": "disabled"
968
+ },
969
+ "emit_nogrep_annotation": {
970
+ "kind": "disabled"
971
+ },
904
972
  "enable_3d_branch_arg_generation": false,
905
973
  "enable_exec_time_resolvers_directive": false,
906
974
  "enable_fragment_argument_transform": false,
907
975
  "enable_relay_resolver_mutations": false,
908
976
  "enable_resolver_normalization_ast": false,
977
+ "enable_shadow_resolvers": {
978
+ "kind": "disabled"
979
+ },
909
980
  "enable_strict_custom_scalars": false,
910
981
  "enforce_fragment_alias_where_ambiguous": {
982
+ "kind": "enabled"
983
+ },
984
+ "enforce_module_name_prefix_for_non_haste": false,
985
+ "flow_modern_syntax": {
911
986
  "kind": "disabled"
912
987
  },
913
988
  "legacy_include_path_in_required_reader_nodes": {
@@ -923,6 +998,9 @@
923
998
  "relay_resolver_enable_interface_output_type": {
924
999
  "kind": "disabled"
925
1000
  },
1001
+ "shard_extra_artifacts": {
1002
+ "kind": "disabled"
1003
+ },
926
1004
  "skip_printing_nulls": {
927
1005
  "kind": "disabled"
928
1006
  },
@@ -1026,6 +1104,20 @@
1026
1104
  },
1027
1105
  "additionalProperties": false
1028
1106
  },
1107
+ "OneOfGeneration": {
1108
+ "oneOf": [
1109
+ {
1110
+ "description": "Will generate a union type, which can have only a single property set",
1111
+ "type": "string",
1112
+ "const": "strict"
1113
+ },
1114
+ {
1115
+ "description": "Will exhibit previous behaviour, where @oneOf types would generate a\npermissive object type that may include all, none, or some of the\nproperties set",
1116
+ "type": "string",
1117
+ "const": "ignore"
1118
+ }
1119
+ ]
1120
+ },
1029
1121
  "PersistConfig": {
1030
1122
  "description": "Configuration for how the Relay Compiler should persist GraphQL queries.",
1031
1123
  "anyOf": [
@@ -1161,7 +1253,7 @@
1161
1253
  ]
1162
1254
  },
1163
1255
  "ResolversSchemaModuleConfig": {
1164
- "description": "Configuration for resolvers_schema_module generation",
1256
+ "description": "Configuration for resolvers_schema_module generation.\n\nWhen `path` is provided, a monolithic resolver map file is generated at that\npath. When `path` is omitted, the map file is not generated but root\nfragment normalization split operations are still produced.",
1165
1257
  "type": "object",
1166
1258
  "properties": {
1167
1259
  "applyToNormalizationAst": {
@@ -1169,8 +1261,11 @@
1169
1261
  "default": false
1170
1262
  },
1171
1263
  "path": {
1172
- "type": "string",
1173
- "default": ""
1264
+ "type": [
1265
+ "string",
1266
+ "null"
1267
+ ],
1268
+ "default": null
1174
1269
  }
1175
1270
  },
1176
1271
  "additionalProperties": false
@@ -1230,6 +1325,7 @@
1230
1325
  "type": "object",
1231
1326
  "properties": {
1232
1327
  "connectionInterface": {
1328
+ "description": "Configuration for connection field names in the schema.\n\n**Important**: When you configure this option in the compiler, you must also configure\nthe Relay runtime to match by calling `ConnectionInterface.inject()` with the same values.\nSee: <https://relay.dev/docs/api-reference/runtime-config/#connectioninterface>",
1233
1329
  "$ref": "#/$defs/ConnectionInterface",
1234
1330
  "default": {
1235
1331
  "cursor": "cursor",
@@ -1440,6 +1536,11 @@
1440
1536
  ],
1441
1537
  "default": null
1442
1538
  },
1539
+ "oneOfType": {
1540
+ "description": "How to generate a type for an input object marked as @oneOf.\nDefaults to \"strict\", which is to generate a union type which\npermits only a single property being set at a time. \"ignore\"\ngenerates the type as if the @oneOf annotation does not exist.",
1541
+ "$ref": "#/$defs/OneOfGeneration",
1542
+ "default": "strict"
1543
+ },
1443
1544
  "optionalInputFields": {
1444
1545
  "title": "For Flow type generation",
1445
1546
  "description": "When set, generated input types will have the listed fields optional\neven if the schema defines them as required.",
@@ -1529,7 +1630,7 @@
1529
1630
  }
1530
1631
  },
1531
1632
  "schemaExtensions": {
1532
- "description": "List of directories with schema extensions.",
1633
+ "description": "List of files or directories with schema extensions.",
1533
1634
  "type": "array",
1534
1635
  "default": [],
1535
1636
  "items": {
@@ -154,10 +154,59 @@ directive @stream_connection(
154
154
  ) on FIELD
155
155
 
156
156
  # RequiredTransform
157
+ """
158
+ (Relay Only)
159
+
160
+ Actions that can be taken when a @required field is null at runtime.
161
+ These actions correspond to your expectations about the data and how
162
+ your application should handle missing values.
163
+
164
+ [Read More](https://relay.dev/docs/guides/required-directive/)
165
+ """
157
166
  enum RequiredFieldAction {
167
+ """
168
+ This data is expected to be null sometimes.
169
+
170
+ The field's nullability will "bubble up" to make the parent field null if this
171
+ field is missing, allowing the component to check the parent field instead of
172
+ this specific field.
173
+ """
158
174
  NONE
175
+
176
+ """
177
+ This data should always be present. We can recover if it is null but want to
178
+ report that something unexpected happened.
179
+
180
+ A event will be logged to the `relayFieldLogger` and the field's nullability
181
+ will "bubble up" to make the parent field null if this field is missing,
182
+ allowing the component to check the parent field instead of this specific
183
+ field.
184
+ """
159
185
  LOG
186
+
187
+ """
188
+ This data should always be present. We cannot recover if it is null.
189
+
190
+ Use THROW when the data is absolutely critical and your application cannot
191
+ function without it. This will throw an error at runtime if the field is null.
192
+
193
+ Note: If you have opted into the optional 'disallow_required_action_throw_on_semantically_nullable_fields'
194
+ feature flag, this can only be used on fields that are non-nullable or marked
195
+ with @semanticNonNull (an optional semantic nullability feature that indicates
196
+ fields should never be null in normal operation).
197
+ """
160
198
  THROW
199
+
200
+ """
201
+ This data should always be present. We cannot recover if it is null.
202
+ This action bypasses semantic nullability validation.
203
+
204
+ This action behaves identically to THROW but can be used on fields that are
205
+ nullable. This is only needed when the optional compiler feature flag
206
+ 'disallow_required_action_throw_on_semantically_nullable_fields' is enabled,
207
+ which prevents using THROW on (semantically) nullable fields.
208
+ """
209
+ DANGEROUSLY_THROW_ON_SEMANTICALLY_NULLABLE_FIELD
161
210
  }
162
211
 
163
212
  # CatchTransform
@@ -368,4 +417,7 @@ If added to a query, resolvers in that query to run at exec-time, rather than re
368
417
  This means the resolvers are run when the query data is requested rather than when the
369
418
  query is used (i.e. when the network request is made instead of at render time).
370
419
  """
371
- directive @exec_time_resolvers(enabledProvider: String) on QUERY
420
+ directive @exec_time_resolvers(
421
+ enabledProvider: String
422
+ useExperimentalProvider: String
423
+ ) on QUERY
package/win-x64/relay.exe CHANGED
Binary file