Skip to content

Commit d15c7d7

Browse files
Picowchewmeta-codesync[bot]
authored andcommitted
Skip required-argument validation for fragment variable definitions annotated with @hoist_to_operation
Summary: TSIA Reviewed By: janettec Differential Revision: D129139865 fbshipit-source-id: 8969661f76c0faf8a534981cc4ee2ec35f7c18d0
1 parent f3e38d4 commit d15c7d7

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎compiler/crates/graphql-ir/src/build.rs‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ pub static FIXME_FAT_INTERFACE: LazyLock<DirectiveName> =
7373
static DIRECTIVE_UNCHECKED_ARGUMENTS: LazyLock<StringKey> =
7474
LazyLock::new(|| "uncheckedArguments_DEPRECATED".intern());
7575
pub static DIRECTIVE_ARGUMENTS: LazyLock<StringKey> = LazyLock::new(|| "arguments".intern());
76+
static HOIST_TO_OPERATION: LazyLock<DirectiveName> =
77+
LazyLock::new(|| DirectiveName("hoist_to_operation".intern()));
7678

7779
/// The semantic of defining variables on a fragment definition.
7880
#[derive(Copy, Clone, PartialEq)]
@@ -2221,4 +2223,8 @@ fn variable_definition_requires_argument(variable_definition: &VariableDefinitio
22212223
.directives
22222224
.named(ProvidedVariableMetadata::directive_name())
22232225
.is_none()
2226+
&& variable_definition
2227+
.directives
2228+
.named(*HOIST_TO_OPERATION)
2229+
.is_none()
22242230
}

0 commit comments

Comments
 (0)