Skip to main content

vantage_api_client/graphql/
vista.rs

1//! Vista bridge for the GraphQL backend.
2//!
3//! Construct a `Vista` from a typed `Table<GraphqlApi, E>` via
4//! `GraphqlApi::vista_factory().from_table(...)`. Metadata (columns, id
5//! field, title fields, references) is harvested up front; the typed
6//! table is then re-wrapped as `Table<GraphqlApi, EmptyEntity>` so the
7//! universal Vista surface sees the same level of detail as the REST
8//! bridge.
9//!
10//! A YAML spec builds the same way through `build_from_spec`, and its
11//! `references:` traverse to other specs on the same endpoint.
12//!
13//! The shell only reads: it counts, lists and fetches by id, and
14//! advertises ordering, search and paging where the root field takes them.
15//! Writes are not supported, because mutation names and argument shapes
16//! differ from one schema to the next.
17
18pub mod factory;
19mod lowering;
20mod narrow;
21mod paging;
22mod source;
23pub mod spec;
24mod traversal;
25
26pub use factory::GraphqlApiVistaFactory;
27pub use source::GraphqlApiTableShell;
28pub use spec::{
29    GraphqlApiVistaSpec, GraphqlBlock, GraphqlColumnBlock, GraphqlColumnExtras, GraphqlTableExtras,
30};
31
32use crate::graphql::api::GraphqlApi;
33
34impl GraphqlApi {
35    /// Return a Vista factory bound to this GraphQL data source.
36    pub fn vista_factory(&self) -> GraphqlApiVistaFactory {
37        GraphqlApiVistaFactory::new(self.clone())
38    }
39}