Skip to content

Commit

Permalink
Validate new arguments scenario for 1diff
Browse files Browse the repository at this point in the history
Reviewed By: chikit

Differential Revision: D56655349

fbshipit-source-id: 514ecc4737283bf4c7f35271028d78fd5b6074c4
  • Loading branch information
Deepak Singh authored and facebook-github-bot committed Apr 30, 2024
1 parent 89fe7bc commit 8932a0d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions compiler/crates/schema/src/definitions/interface.rs
Expand Up @@ -31,6 +31,13 @@ pub struct Interface {
}

impl Interface {
pub fn named_field<S: Schema>(&self, name: StringKey, schema: &S) -> Option<FieldID> {
self.fields
.iter()
.find(|field_id| schema.field(**field_id).name.item == name)
.copied()
}

/// Return all objects that implement, directly or recursively, a given interface.
/// The iteration order of the HashSet might depend on the order in which schema files
/// are processed. It should not be relied upon when generating artifacts.
Expand Down

0 comments on commit 8932a0d

Please sign in to comment.