async-graphql-test 1.0.0

A test framework for Rust GraphQL servers.
Documentation
use async_graphql::SchemaBuilder;

/// Register all assertion directives in the given [`SchemaBuilder`].
///
/// The resulting [`Schema`][async_graphql::Schema] will support these directives,
/// and you'll be able to use assertions in your tests.
pub fn register_directives<Query, Mutation, Subscription>(
    schema_builder: SchemaBuilder<Query, Mutation, Subscription>,
) -> SchemaBuilder<Query, Mutation, Subscription> {
    schema_builder
        .directive(super::should_be_close_to)
        .directive(super::should_be_defined)
        .directive(super::should_be_falsy)
        .directive(super::should_be_greater_than)
        .directive(super::should_be_greater_than_or_equal)
        .directive(super::should_be_less_than)
        .directive(super::should_be_less_than_or_equal)
        .directive(super::should_be_not_null)
        .directive(super::should_be_null)
        .directive(super::should_be_one_of)
        .directive(super::should_be_truthy)
        .directive(super::should_contain)
        .directive(super::should_equal)
        .directive(super::should_have_length)
        .directive(super::should_match)
        .directive(super::should_throw)
}