module Ecoportal module API class GraphQL module Query class LocationStructures < Ecoportal::API::GraphQL::Logic::QueryArray accepted_params :includeArchived, :includeUnpublished field_name :structures class_resolver :item_class, Ecoportal::API::GraphQL::Model::LocationStructure private def basic_block(&block) final_block = block || default_query_block Proc.new { query(includeArchived: :boolean, includeUnpublished: :boolean) { currentOrganization { locations { structures( includeArchived: :includeArchived, includeUnpublished: :includeUnpublished, &final_block ) } } } } end def default_query_block Proc.new { id name archived weight visitorManagementEnabled nodes(includeArchived: true) { ___Ecoportal__API__GraphQL__Fragment__LocationNode } } end end end end end end