class GQLi::Introspection

Introspection schema and validator

Constants

FullType

Type introspection fragment

InputValue

Input value introspection fragment

IntrospectionQuery

Query for fetching the complete schema

TypeRef

Specific type kind introspection fragment

Attributes

mutation_type[R]
query_type[R]
schema[R]
subscription_type[R]
types[R]

Public Class Methods

new(client) click to toggle source
# File lib/gqli/introspection.rb, line 79
def initialize(client)
  @schema = client.execute!(IntrospectionQuery).data.__schema
  @query_type = schema.queryType
  @mutation_type = schema.mutationType
  @subscription_type = schema.subscriptionType
  @types = schema.types
end

Public Instance Methods

valid?(query) click to toggle source

Returns if the query is valid

# File lib/gqli/introspection.rb, line 93
def valid?(query)
  validate(query).valid?
end
validate(query) click to toggle source

Returns the evaluated validation for a query

# File lib/gqli/introspection.rb, line 88
def validate(query)
  Validation.new(self, query)
end