Sha256: 3bd9217ff1ad5c3fe34ed3b907aaf0972893823f9bd2af9489db748460005b80

Contents?: true

Size: 1.7 KB

Versions: 3

Compression:

Stored size: 1.7 KB

Contents

# frozen_string_literal: true

module Decidim
  module Meetings
    MeetingType = GraphQL::ObjectType.define do
      name "Meeting"
      description "A meeting"

      interfaces [
        Decidim::Comments::CommentableInterface,
        Decidim::Core::CategorizableInterface,
        Decidim::Core::ScopableInterface,
        Decidim::Core::AttachableInterface
      ]

      field :id, !types.ID
      field :reference, !types.String
      field :title, !Decidim::Core::TranslatedFieldType, "The title of this meeting."
      field :startTime, !Decidim::Core::DateTimeType, "The time this meeting starts", property: :start_time
      field :endTime, !Decidim::Core::DateTimeType, "The time this meeting ends", property: :end_time

      field :closed, !types.Boolean, "Whether this meeting is closed or not.", property: :closed?
      field :closingReport, Decidim::Core::TranslatedFieldType, "The closing report of this meeting.", property: :closing_report

      field :registrationsEnabled, !types.Boolean, "Whether the registrations are enabled or not", property: :registrations_enabled
      field :remainingSlots, types.Int, "Amount of slots available for this meeting", property: :remaining_slots
      field :attendeeCount, types.Int, "Amount of attendees to this meeting", property: :attendees_count
      field :contributionCount, types.Int, "Amount of contributions to this meeting", property: :contributions_count

      field :address, types.String, "The physical address of this meeting"
      field :coordinates, Decidim::Core::CoordinatesType, "Physical coordinates for this meeting" do
        resolve ->(meeting, _args, _ctx) {
          [meeting.latitude, meeting.longitude]
        }
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
decidim-meetings-0.11.2 app/types/decidim/meetings/meeting_type.rb
decidim-meetings-0.11.1 app/types/decidim/meetings/meeting_type.rb
decidim-meetings-0.11.0.pre1 app/types/decidim/meetings/meeting_type.rb