Sha256: 4c91e5b53a57ac8572ad44ddd6170a0a6d9d756605ed4be45e2117f82d679d69

Contents?: true

Size: 1.29 KB

Versions: 8

Compression:

Stored size: 1.29 KB

Contents

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ecoportal-api-graphql-0.3.7 lib/ecoportal/api/graphql/query/location_structures.rb
ecoportal-api-graphql-0.3.6 lib/ecoportal/api/graphql/query/location_structures.rb
ecoportal-api-graphql-0.3.5 lib/ecoportal/api/graphql/query/location_structures.rb
ecoportal-api-graphql-0.3.3 lib/ecoportal/api/graphql/query/location_structures.rb
ecoportal-api-graphql-0.3.1 lib/ecoportal/api/graphql/query/location_structures.rb
ecoportal-api-graphql-0.2.3 lib/ecoportal/api/graphql/query/location_structures.rb
ecoportal-api-graphql-0.2.2 lib/ecoportal/api/graphql/query/location_structures.rb
ecoportal-api-graphql-0.2.1 lib/ecoportal/api/graphql/query/location_structures.rb