Module async_graphql::dynamic
source · Available on crate feature
dynamic-schema
only.Expand description
Suppport for dynamic schema
Create a simple GraphQL schema
use async_graphql::{dynamic::*, value, Value};
let query = Object::new("Query").field(Field::new("value", TypeRef::named_nn(TypeRef::INT), |ctx| {
FieldFuture::new(async move { Ok(Some(Value::from(100))) })
}));
let schema = Schema::build(query.type_name(), None, None)
.register(query)
.finish()?;
assert_eq!(
schema
.execute("{ value }")
.await
.into_result()
.unwrap()
.data,
value!({ "value": 100 })
);
Structs
A GraphQL enum type
A GraphQL enum item
A GraphQL field
A future that returned from field resolver
A value returned from the resolver function
A GraphQL input object type
A GraphQL input value type
A GraphQL interface type
A GraphQL interface field type
A list accessor
A GraphQL object type
A object accessor
A context for resolver function
A GraphQL scalar type
Dyanmic GraphQL schema.
Dynamic schema builder
An error can occur when building dynamic schema
A GraphQL subscription type
A GraphQL subscription field
A future that returned from field resolver
A type reference
A GraphQL union type
A value accessor
Enums
A GraphQL type