pub struct Registry<'r, S = DefaultScalarValue> {
    pub types: FnvHashMap<Name, MetaType<'r, S>>,
}
Expand description

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, S>>

Currently registered types

Implementations

Construct a new registry

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.

Create a field with the provided name

Create an argument with the provided name

Create an argument with a default value

When called with type T, the actual argument will be given the type Option<T>.

Create a scalar meta type

This expects the type to implement FromInputValue.

Create a list meta type

Create a nullable meta type

Create an object meta type

To prevent infinite recursion by enforcing ordering, this returns a function that needs to be called with the list of fields on the object.

Create an enum meta type

Create an interface meta type, by providing a type info object.

Create a union meta type

Create an input object meta type

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.