module GraphitiGql class Schema class Query def initialize(resources, existing_query: nil) @resources = resources @query_class = Class.new(existing_query || Schema.base_object) @query_class.graphql_name "Query" end def build define_entrypoints @query_class end private def registry Registry.instance end def define_entrypoints registry.resource_types.each do |registered| if registered[:resource].graphql_entrypoint Fields::Index.new(registered).apply(@query_class) Fields::Show.new(registered).apply(@query_class) end end end end end end