Class: GraphQL::Introspection::SchemaType

Inherits:
Introspection::BaseObject
  • Object
show all
Defined in:
lib/graphql/introspection/schema_type.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.schema_description(context) ⇒ Object



20
21
22
# File 'lib/graphql/introspection/schema_type.rb', line 20

def self.schema_description(context)
  context.schema.description
end

Instance Method Details

#directives ⇒ Object



47
48
49
# File 'lib/graphql/introspection/schema_type.rb', line 47

def directives
  @context.types.directives.sort_by(&:graphql_name)
end

#mutation_type ⇒ Object



39
40
41
# File 'lib/graphql/introspection/schema_type.rb', line 39

def mutation_type
  @context.types.mutation_root
end

#query_type ⇒ Object



35
36
37
# File 'lib/graphql/introspection/schema_type.rb', line 35

def query_type
  @context.types.query_root
end

#schema_description ⇒ Object



24
25
26
# File 'lib/graphql/introspection/schema_type.rb', line 24

def schema_description
  self.class.schema_description(context)
end

#subscription_type ⇒ Object



43
44
45
# File 'lib/graphql/introspection/schema_type.rb', line 43

def subscription_type
  @context.types.subscription_root
end

#types ⇒ Object



28
29
30
31
32
33
# File 'lib/graphql/introspection/schema_type.rb', line 28

def types
  query_types = context.types.all_types
  types = query_types + context.schema.extra_types
  types.sort_by!(&:graphql_name)
  types
end