Module: ElasticGraph::Apollo::SchemaDefinition::FactoryExtension

Defined in:
lib/elastic_graph/apollo/schema_definition/factory_extension.rb

Overview

Extension module applied to ‘ElasticGraph::SchemaDefinition::Factory` to add Apollo tagging support.

Instance Method Summary collapse

Instance Method Details

#new_argument(field, name, value_type) ⇒ Object



34
35
36
37
38
39
# File 'lib/elastic_graph/apollo/schema_definition/factory_extension.rb', line 34

def new_argument(field, name, value_type)
  super(field, name, value_type) do |type|
    type.extend ArgumentExtension
    yield type if block_given?
  end
end

#new_enum_type(name) ⇒ Object



41
42
43
44
45
46
# File 'lib/elastic_graph/apollo/schema_definition/factory_extension.rb', line 41

def new_enum_type(name)
  super(name) do |type|
    type.extend EnumTypeExtension
    yield type
  end
end

#new_enum_value(name, original_name) ⇒ Object



48
49
50
51
52
53
# File 'lib/elastic_graph/apollo/schema_definition/factory_extension.rb', line 48

def new_enum_value(name, original_name)
  super(name, original_name) do |type|
    type.extend EnumValueExtension
    yield type if block_given?
  end
end

#new_input_type(name) ⇒ Object



55
56
57
58
59
60
# File 'lib/elastic_graph/apollo/schema_definition/factory_extension.rb', line 55

def new_input_type(name)
  super(name) do |type|
    type.extend InputTypeExtension
    yield type
  end
end

#new_interface_type(name) ⇒ Object



62
63
64
65
66
67
# File 'lib/elastic_graph/apollo/schema_definition/factory_extension.rb', line 62

def new_interface_type(name)
  super(name) do |type|
    type.extend InterfaceTypeExtension
    yield type
  end
end

#new_object_type(name) ⇒ Object



69
70
71
72
73
74
75
76
# File 'lib/elastic_graph/apollo/schema_definition/factory_extension.rb', line 69

def new_object_type(name)
  super(name) do |raw_type|
    raw_type.extend ObjectTypeExtension
    type = raw_type # : ElasticGraph::SchemaDefinition::SchemaElements::ObjectType & ObjectTypeExtension

    yield type if block_given?
  end
end

#new_scalar_type(name) ⇒ Object



78
79
80
81
82
83
# File 'lib/elastic_graph/apollo/schema_definition/factory_extension.rb', line 78

def new_scalar_type(name)
  super(name) do |type|
    type.extend ScalarTypeExtension
    yield type
  end
end

#new_union_type(name) ⇒ Object



85
86
87
88
89
90
# File 'lib/elastic_graph/apollo/schema_definition/factory_extension.rb', line 85

def new_union_type(name)
  super(name) do |type|
    type.extend UnionTypeExtension
    yield type
  end
end