relay-compiler 20.1.1 → 21.0.0

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.0",
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,11 @@
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
+ },
664
709
  "legacy_include_path_in_required_reader_nodes": {
665
710
  "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
711
  "$ref": "#/$defs/FeatureFlag",
@@ -872,7 +917,7 @@
872
917
  "description": "Enable and disable experimental or legacy behaviors.\nWARNING! These are not stable and may change at any time.",
873
918
  "$ref": "#/$defs/FeatureFlags",
874
919
  "default": {
875
- "actor_change_support": {
920
+ "allow_legacy_relay_resolver_tag": {
876
921
  "kind": "disabled"
877
922
  },
878
923
  "allow_output_type_resolvers": {
@@ -899,17 +944,30 @@
899
944
  "disable_full_argument_type_validation": {
900
945
  "kind": "disabled"
901
946
  },
947
+ "disable_more_precise_abstract_selection_raw_response_type": {
948
+ "kind": "disabled"
949
+ },
902
950
  "disable_resolver_reader_ast": false,
903
951
  "disable_schema_validation": false,
952
+ "disallow_required_action_throw_on_semantically_nullable_fields": {
953
+ "kind": "disabled"
954
+ },
955
+ "emit_nogrep_annotation": {
956
+ "kind": "disabled"
957
+ },
904
958
  "enable_3d_branch_arg_generation": false,
905
959
  "enable_exec_time_resolvers_directive": false,
906
960
  "enable_fragment_argument_transform": false,
907
961
  "enable_relay_resolver_mutations": false,
908
962
  "enable_resolver_normalization_ast": false,
963
+ "enable_shadow_resolvers": {
964
+ "kind": "disabled"
965
+ },
909
966
  "enable_strict_custom_scalars": false,
910
967
  "enforce_fragment_alias_where_ambiguous": {
911
- "kind": "disabled"
968
+ "kind": "enabled"
912
969
  },
970
+ "enforce_module_name_prefix_for_non_haste": false,
913
971
  "legacy_include_path_in_required_reader_nodes": {
914
972
  "kind": "disabled"
915
973
  },
@@ -1026,6 +1084,20 @@
1026
1084
  },
1027
1085
  "additionalProperties": false
1028
1086
  },
1087
+ "OneOfGeneration": {
1088
+ "oneOf": [
1089
+ {
1090
+ "description": "Will generate a union type, which can have only a single property set",
1091
+ "type": "string",
1092
+ "const": "strict"
1093
+ },
1094
+ {
1095
+ "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",
1096
+ "type": "string",
1097
+ "const": "ignore"
1098
+ }
1099
+ ]
1100
+ },
1029
1101
  "PersistConfig": {
1030
1102
  "description": "Configuration for how the Relay Compiler should persist GraphQL queries.",
1031
1103
  "anyOf": [
@@ -1161,7 +1233,7 @@
1161
1233
  ]
1162
1234
  },
1163
1235
  "ResolversSchemaModuleConfig": {
1164
- "description": "Configuration for resolvers_schema_module generation",
1236
+ "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
1237
  "type": "object",
1166
1238
  "properties": {
1167
1239
  "applyToNormalizationAst": {
@@ -1169,8 +1241,11 @@
1169
1241
  "default": false
1170
1242
  },
1171
1243
  "path": {
1172
- "type": "string",
1173
- "default": ""
1244
+ "type": [
1245
+ "string",
1246
+ "null"
1247
+ ],
1248
+ "default": null
1174
1249
  }
1175
1250
  },
1176
1251
  "additionalProperties": false
@@ -1230,6 +1305,7 @@
1230
1305
  "type": "object",
1231
1306
  "properties": {
1232
1307
  "connectionInterface": {
1308
+ "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
1309
  "$ref": "#/$defs/ConnectionInterface",
1234
1310
  "default": {
1235
1311
  "cursor": "cursor",
@@ -1440,6 +1516,11 @@
1440
1516
  ],
1441
1517
  "default": null
1442
1518
  },
1519
+ "oneOfType": {
1520
+ "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.",
1521
+ "$ref": "#/$defs/OneOfGeneration",
1522
+ "default": "strict"
1523
+ },
1443
1524
  "optionalInputFields": {
1444
1525
  "title": "For Flow type generation",
1445
1526
  "description": "When set, generated input types will have the listed fields optional\neven if the schema defines them as required.",
@@ -1529,7 +1610,7 @@
1529
1610
  }
1530
1611
  },
1531
1612
  "schemaExtensions": {
1532
- "description": "List of directories with schema extensions.",
1613
+ "description": "List of files or directories with schema extensions.",
1533
1614
  "type": "array",
1534
1615
  "default": [],
1535
1616
  "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