module GraphQL::Schema::Member::RelayShortcuts
Public Instance Methods
Source
# File lib/graphql/schema/member/relay_shortcuts.rb, line 60 def connection_type initialize_relay_metadata @connection_type ||= begin conn_name = self.graphql_name + "Connection" edge_type_class = self.edge_type Class.new(connection_type_class) do #: self as untyped graphql_name(conn_name) edge_type(edge_type_class) end end end
# File lib/graphql/schema/member/relay_shortcuts.rb, line 29 def connection_type_class(new_connection_type_class = nil) if new_connection_type_class initialize_relay_metadata @connection_type_class = new_connection_type_class else # Don't call `ancestor.connection_type_class` # because we don't want a fallback from any ancestors -- # only apply the fallback if _no_ ancestor has a configured value! all_ancestors = self.ancestors #: Array[untyped] for ancestor in all_ancestors if ancestor.respond_to?(:configured_connection_type_class, true) && (ctc = ancestor.configured_connection_type_class) return ctc end end Types::Relay::BaseConnection end end
Source
# File lib/graphql/schema/member/relay_shortcuts.rb, line 47 def edge_type initialize_relay_metadata @edge_type ||= begin edge_name = self.graphql_name + "Edge" node_type_class = self Class.new(edge_type_class) do #: self as untyped graphql_name(edge_name) node_type(node_type_class) end end end
# File lib/graphql/schema/member/relay_shortcuts.rb, line 11 def edge_type_class(new_edge_type_class = nil) if new_edge_type_class initialize_relay_metadata @edge_type_class = new_edge_type_class else # Don't call `ancestor.edge_type_class` # because we don't want a fallback from any ancestors -- # only apply the fallback if _no_ ancestor has a configured value! all_ancestors = self.ancestors #: Array[untyped] for ancestor in all_ancestors if ancestor.respond_to?(:configured_edge_type_class, true) && (etc = ancestor.configured_edge_type_class) return etc end end Types::Relay::BaseEdge end end