class GraphQL::Schema

Defined in:

graphql/schema.cr

Constant Summary

EMPTY_VARIABLES = {} of String => Language::FValue

For operations that declare no variables; never mutated.

Constructors

Instance Method Summary

Constructor Detail

def self.new(query : QueryType, mutation : MutationType | Nil = nil, subscription : SubscriptionType | Nil = nil) #

Instance Method Detail

def document : Language::Document #

def execute(query : String, variables : Hash(String, JSON::Any) | Nil = nil, operation_name : String | Nil = nil, context = Context.new) : String #

def execute(io : IO, query : String, variables : Hash(String, JSON::Any) | Nil = nil, operation_name : String | Nil = nil, context = Context.new) : Nil #

def subscribe(query : String, variables : Hash(String, JSON::Any) | Nil = nil, operation_name : String | Nil = nil, context = Context.new) : Subscription #

Starts a subscription. Each value the resolver's channel produces is delivered as one response document. A request that cannot be started yields a subscription that delivers a single error response and is already closed.