Skip to content

Commit 05d85ea

Browse files
Add name to configuration query response
Expose the name of a configuration (which typically matches the name of the beamline) in the GraphQL API. Now that we have a query that returns a list of configurations it is useful to have a field that can differentiate between them.
1 parent 492cd35 commit 05d85ea

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/graphql.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,13 @@ impl ScanPaths {
207207

208208
#[Object]
209209
impl BeamlineConfiguration {
210+
// We need to override name because otherwise it conflicts with the existing
211+
// BeamlineConfiguration::name
212+
#[graphql(name = "name")]
213+
pub async fn configuration_name(&self) -> async_graphql::Result<String> {
214+
Ok(self.name().to_owned())
215+
}
216+
210217
pub async fn visit_template(&self) -> async_graphql::Result<String> {
211218
Ok(self.visit()?.to_string())
212219
}

0 commit comments

Comments
 (0)