Skip to content

Commit

Permalink
Allow @match on client edges
Browse files Browse the repository at this point in the history
Reviewed By: lynnshaoyu

Differential Revision: D70017382

fbshipit-source-id: cac0163be54aae732b81d377a1545e34431b6485
  • Loading branch information
tyao1 authored and facebook-github-bot committed Feb 22, 2025
1 parent e29e1f9 commit ee924ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions compiler/crates/relay-transforms/src/client_edges.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ use schema::Schema;
use schema::Type;

use super::ValidationMessageWithData;
use crate::match_::MATCH_CONSTANTS;
use crate::refetchable_fragment::RefetchableFragment;
use crate::refetchable_fragment::REFETCHABLE_NAME;
use crate::relay_resolvers::get_bool_argument_is_true;
Expand Down Expand Up @@ -312,6 +313,7 @@ impl<'program, 'pc> ClientEdgesTransform<'program, 'pc> {
*REQUIRED_DIRECTIVE_NAME,
*CHILDREN_CAN_BUBBLE_METADATA_KEY,
RequiredMetadataDirective::directive_name(),
MATCH_CONSTANTS.match_directive_name,
];

let other_directives = directives
Expand Down
1 change: 1 addition & 0 deletions compiler/crates/relay-transforms/src/relay_resolvers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ impl<'program> RelayResolverFieldTransform<'program> {
&& directive.name.item != *REQUIRED_DIRECTIVE_NAME
&& directive.name.item != *CHILDREN_CAN_BUBBLE_METADATA_KEY
&& directive.name.item != *CLIENT_EDGE_WATERFALL_DIRECTIVE_NAME
&& directive.name.item != crate::match_::MATCH_CONSTANTS.match_directive_name
});
if let Some(directive) = non_required_directives.next() {
self.errors.push(Diagnostic::error(
Expand Down

0 comments on commit ee924ca

Please sign in to comment.