MCPcopy Create free account
hub / github.com/SeaQL/sea-orm / schema

Function schema

examples/seaography_example/graphql/src/query_root.rs:8–21  ·  view source on GitHub ↗
(
    database: DatabaseConnection,
    depth: Option<usize>,
    complexity: Option<usize>,
)

Source from the content-addressed store, hash-verified

6lazy_static::lazy_static! { static ref CONTEXT : BuilderContext = BuilderContext :: default () ; }
7
8pub fn schema(
9 database: DatabaseConnection,
10 depth: Option<usize>,
11 complexity: Option<usize>,
12) -> Result<Schema, SchemaError> {
13 let mut builder = Builder::new(&CONTEXT, database.clone());
14 seaography::register_entities!(builder, [baker, bakery, cake, cake_baker,]);
15 builder
16 .set_depth_limit(depth)
17 .set_complexity_limit(complexity)
18 .schema_builder()
19 .data(database)
20 .finish()
21}

Callers 1

mainFunction · 0.70

Calls 1

newFunction · 0.50

Tested by

no test coverage detected