Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SDLSchema.get_unions() #4036

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions compiler/crates/schema/src/in_memory/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,10 @@ impl InMemorySchema {
self.objects.iter()
}

pub fn get_unions(&self) -> impl Iterator<Item = &Union> {
self.unions.iter()
}

pub fn has_directive(&self, directive_name: StringKey) -> bool {
self.directives.contains_key(&directive_name)
}
Expand Down
7 changes: 7 additions & 0 deletions compiler/crates/schema/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,13 @@ impl SDLSchema {
}
}

pub fn get_unions(&self) -> impl Iterator<Item = &Union> {
match self {
SDLSchema::FlatBuffer(_schema) => todo!(),
SDLSchema::InMemory(schema) => schema.get_unions(),
}
}

pub fn has_directive(&self, directive_name: StringKey) -> bool {
match self {
SDLSchema::FlatBuffer(_schema) => todo!(),
Expand Down