Sha256: 453dd18190d585131f9ace9ce07b32ab8dd4b552c4175d9a96780e3725cb97cb

Contents?: true

Size: 990 Bytes

Versions: 6

Compression:

Stored size: 990 Bytes

Contents

module Ecoportal
  module API
    class GraphQL
      module Query
        class LocationClassifications < Ecoportal::API::GraphQL::Logic::QueryArray
          accepted_params :active, default: true

          base_path 'currentOrganization.locations'
          field_name :classifications

          class_resolver :item_class, Ecoportal::API::GraphQL::Base::LocationClassificationType

          private

          def basic_block(&block)
            final_block = block || default_query_block
            proc {
              query(active: :boolean) {
                currentOrganization {
                  locations {
                    classifications(active: :active, &final_block)
                  }
                }
              }
            }
          end

          def default_query_block
            proc {
              id
              name
              active
            }
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ecoportal-api-graphql-0.4.3 lib/ecoportal/api/graphql/query/location_classifications.rb
ecoportal-api-graphql-0.4.2 lib/ecoportal/api/graphql/query/location_classifications.rb
ecoportal-api-graphql-0.4.1 lib/ecoportal/api/graphql/query/location_classifications.rb
ecoportal-api-graphql-0.4.0 lib/ecoportal/api/graphql/query/location_classifications.rb
ecoportal-api-graphql-0.3.16 lib/ecoportal/api/graphql/query/location_classifications.rb
ecoportal-api-graphql-0.3.15 lib/ecoportal/api/graphql/query/location_classifications.rb