module Ecoportal module API class GraphQL module Base class LocationStructure < Ecoportal::API::GraphQL::Base::Model read_only! extend Ecoportal::API::GraphQL::Helpers::LocationsTree passkey :id passthrough :name, :weight passboolean :archived, :published, :visitorManagementEnabled embeds_one :updatedAt, klass: Base::DateTime embeds_many :nodes, klass: Base::LocationNode, order_key: :weight def treeify self.class.treeify(nodes) end end end end end end