Sha256: 4d8111bb0f2df05c4a5990d7d165c00b741101b4679063e52147f9688f1ad9e3

Contents?: true

Size: 559 Bytes

Versions: 38

Compression:

Stored size: 559 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Core
    # This type represents a Decidim's global property.
    CoordinatesType = GraphQL::ObjectType.define do
      name "Coordinates"
      description "Physical coordinates for a location"

      field :latitude, !types.Float, "Latitude of this coordinate" do
        resolve ->(coordinates, _args, _ctx) { coordinates[0] }
      end

      field :longitude, !types.Float, "Longitude of this coordinate" do
        resolve ->(coordinates, _args, _ctx) { coordinates[1] }
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
decidim-core-0.23.6 app/types/decidim/core/coordinates_type.rb
decidim-core-0.23.5 app/types/decidim/core/coordinates_type.rb
decidim-core-0.23.4 app/types/decidim/core/coordinates_type.rb
decidim-core-0.23.3 app/types/decidim/core/coordinates_type.rb
decidim-core-0.23.2 app/types/decidim/core/coordinates_type.rb
decidim-core-0.23.1 app/types/decidim/core/coordinates_type.rb
decidim-core-0.23.1.rc1 app/types/decidim/core/coordinates_type.rb
decidim-core-0.23.0 app/types/decidim/core/coordinates_type.rb
decidim-core-0.22.0 app/types/decidim/core/coordinates_type.rb
decidim-core-0.21.0 app/types/decidim/core/coordinates_type.rb
decidim-core-0.20.1 app/types/decidim/core/coordinates_type.rb
decidim-core-0.20.0 app/types/decidim/core/coordinates_type.rb
decidim-core-0.19.1 app/types/decidim/core/coordinates_type.rb
decidim-core-0.18.1 app/types/decidim/core/coordinates_type.rb
decidim-core-0.19.0 app/types/decidim/core/coordinates_type.rb
decidim-core-0.17.2 app/types/decidim/core/coordinates_type.rb
decidim-core-0.18.0 app/types/decidim/core/coordinates_type.rb
decidim-core-0.17.1 app/types/decidim/core/coordinates_type.rb
decidim-core-0.16.1 app/types/decidim/core/coordinates_type.rb
decidim-core-0.17.0 app/types/decidim/core/coordinates_type.rb