Spikard.GraphQLRouteConfig (spikard v0.15.6-rc.4)

Copy Markdown

Configuration for GraphQL routes

Provides a builder pattern for configuring GraphQL route parameters for the Spikard HTTP server's routing system.

Example

use spikard_graphql::routes::GraphQLRouteConfig;

let config = GraphQLRouteConfig::new()
    .path("/graphql")
    .method("POST")
    .enable_playground(true);

assert_eq!(config.get_path(), "/graphql");
assert_eq!(config.get_method(), "POST");

Summary

Types

t()

Configuration for GraphQL routes

Functions

Set a custom description for documentation

Enable or disable the GraphQL Playground UI

Get the description if set

Get the configured method

Get the configured path

Check if playground is enabled

Set the HTTP method for the GraphQL endpoint

Build a default instance.

Set the HTTP path for the GraphQL endpoint

Types

t()

@type t() :: %Spikard.GraphQLRouteConfig{ref: reference()}

Configuration for GraphQL routes

Functions

default()

description(obj, description)

Set a custom description for documentation

enable_playground(obj, enable)

Enable or disable the GraphQL Playground UI

get_description(obj)

Get the description if set

get_method(obj)

Get the configured method

get_path(obj)

Get the configured path

is_playground_enabled(obj)

Check if playground is enabled

method(obj, method)

Set the HTTP method for the GraphQL endpoint

new()

@spec new() :: t()

Build a default instance.

path(obj, path)

Set the HTTP path for the GraphQL endpoint