Struct juniper::Registry [−][src]
pub struct Registry<'r> {
pub types: FnvHashMap<Name, MetaType<'r>>,
}A type registry used to build schemas
The registry gathers metadata for all types in a schema. It provides
convenience methods to convert types implementing the GraphQLType trait
into Type instances and automatically registers them.
Fields
types: FnvHashMap<Name, MetaType<'r>>
Currently registered types
Methods
impl<'r> Registry<'r>[src]
impl<'r> Registry<'r>pub fn new(types: FnvHashMap<Name, MetaType<'r>>) -> Registry<'r>[src]
pub fn new(types: FnvHashMap<Name, MetaType<'r>>) -> Registry<'r>Construct a new registry
pub fn get_type<T>(&mut self, info: &T::TypeInfo) -> Type<'r> where
T: GraphQLType, [src]
pub fn get_type<T>(&mut self, info: &T::TypeInfo) -> Type<'r> where
T: GraphQLType, Get the Type instance for a given GraphQL type
If the registry hasn't seen a type with this name before, it will construct its metadata and store it.
pub fn field<T>(&mut self, name: &str, info: &T::TypeInfo) -> Field<'r> where
T: GraphQLType, [src]
pub fn field<T>(&mut self, name: &str, info: &T::TypeInfo) -> Field<'r> where
T: GraphQLType, Create a field with the provided name
pub fn arg<T>(&mut self, name: &str, info: &T::TypeInfo) -> Argument<'r> where
T: GraphQLType + FromInputValue, [src]
pub fn arg<T>(&mut self, name: &str, info: &T::TypeInfo) -> Argument<'r> where
T: GraphQLType + FromInputValue, Create an argument with the provided name
pub fn arg_with_default<T>(
&mut self,
name: &str,
value: &T,
info: &T::TypeInfo
) -> Argument<'r> where
T: GraphQLType + ToInputValue + FromInputValue, [src]
pub fn arg_with_default<T>(
&mut self,
name: &str,
value: &T,
info: &T::TypeInfo
) -> Argument<'r> where
T: GraphQLType + ToInputValue + FromInputValue, Create an argument with a default value
When called with type T, the actual argument will be given the type
Option<T>.
pub fn build_scalar_type<T>(&mut self, info: &T::TypeInfo) -> ScalarMeta<'r> where
T: FromInputValue + GraphQLType, [src]
pub fn build_scalar_type<T>(&mut self, info: &T::TypeInfo) -> ScalarMeta<'r> where
T: FromInputValue + GraphQLType, Create a scalar meta type
This expects the type to implement FromInputValue.
pub fn build_list_type<T: GraphQLType>(
&mut self,
info: &T::TypeInfo
) -> ListMeta<'r>[src]
pub fn build_list_type<T: GraphQLType>(
&mut self,
info: &T::TypeInfo
) -> ListMeta<'r>Create a list meta type
pub fn build_nullable_type<T: GraphQLType>(
&mut self,
info: &T::TypeInfo
) -> NullableMeta<'r>[src]
pub fn build_nullable_type<T: GraphQLType>(
&mut self,
info: &T::TypeInfo
) -> NullableMeta<'r>Create a nullable meta type
pub fn build_object_type<T>(
&mut self,
info: &T::TypeInfo,
fields: &[Field<'r>]
) -> ObjectMeta<'r> where
T: GraphQLType, [src]
pub fn build_object_type<T>(
&mut self,
info: &T::TypeInfo,
fields: &[Field<'r>]
) -> ObjectMeta<'r> where
T: GraphQLType, Create an object meta type builder
To prevent infinite recursion by enforcing ordering, this returns a function that needs to be called with the list of fields on the object.
pub fn build_enum_type<T>(
&mut self,
info: &T::TypeInfo,
values: &[EnumValue]
) -> EnumMeta<'r> where
T: FromInputValue + GraphQLType, [src]
pub fn build_enum_type<T>(
&mut self,
info: &T::TypeInfo,
values: &[EnumValue]
) -> EnumMeta<'r> where
T: FromInputValue + GraphQLType, Create an enum meta type
pub fn build_interface_type<T>(
&mut self,
info: &T::TypeInfo,
fields: &[Field<'r>]
) -> InterfaceMeta<'r> where
T: GraphQLType, [src]
pub fn build_interface_type<T>(
&mut self,
info: &T::TypeInfo,
fields: &[Field<'r>]
) -> InterfaceMeta<'r> where
T: GraphQLType, Create an interface meta type builder, by providing a type info object.
pub fn build_union_type<T>(
&mut self,
info: &T::TypeInfo,
types: &[Type<'r>]
) -> UnionMeta<'r> where
T: GraphQLType, [src]
pub fn build_union_type<T>(
&mut self,
info: &T::TypeInfo,
types: &[Type<'r>]
) -> UnionMeta<'r> where
T: GraphQLType, Create a union meta type builder
pub fn build_input_object_type<T>(
&mut self,
info: &T::TypeInfo,
args: &[Argument<'r>]
) -> InputObjectMeta<'r> where
T: FromInputValue + GraphQLType, [src]
pub fn build_input_object_type<T>(
&mut self,
info: &T::TypeInfo,
args: &[Argument<'r>]
) -> InputObjectMeta<'r> where
T: FromInputValue + GraphQLType, Create an input object meta type builder