Class: GraphQL::GraphQLSchema

Inherits:
Configuration::Configurable show all
Defined in:
lib/graphql/type/schema.rb

Instance Method Summary collapse

Methods inherited from Configuration::Configurable

configuration, configure_with, #initialize, #method_missing, new

Constructor Details

This class inherits a constructor from GraphQL::Configuration::Configurable

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class GraphQL::Configuration::Configurable

Instance Method Details

#directivesObject



39
40
41
# File 'lib/graphql/type/schema.rb', line 39

def directives
  @directives ||= [GraphQLSkipDirective, GraphQLIncludeDirective]
end

#mutation_typeObject



19
20
21
# File 'lib/graphql/type/schema.rb', line 19

def mutation_type
  @configuration.mutation
end

#query_typeObject



15
16
17
# File 'lib/graphql/type/schema.rb', line 15

def query_type
  @configuration.query
end

#to_sObject



43
44
45
# File 'lib/graphql/type/schema.rb', line 43

def to_s
  name
end

#type(name) ⇒ Object



35
36
37
# File 'lib/graphql/type/schema.rb', line 35

def type(name)
  type_map[name]
end

#type_mapObject



23
24
25
# File 'lib/graphql/type/schema.rb', line 23

def type_map
  @type_map ||= [query_type, mutation_type, Introspection::Schema__].reduce({}, &TypeMapReducer)
end

#type_namesObject



27
28
29
# File 'lib/graphql/type/schema.rb', line 27

def type_names
  @type_names ||= type_map.keys
end

#typesObject



31
32
33
# File 'lib/graphql/type/schema.rb', line 31

def types
  @types ||= type_map.values
end