Sha256: 8f4668d2f8eefcb175bc6d8986f693c493009aff8771cbd05e624690d8d5ab27

Contents?: true

Size: 834 Bytes

Versions: 28

Compression:

Stored size: 834 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Meetings
    MeetingsType = GraphQL::ObjectType.define do
      interfaces [-> { Decidim::Core::ComponentInterface }]

      name "Meetings"
      description "A meetings component of a participatory space."

      connection :meetings, MeetingType.connection_type do
        resolve ->(component, _args, _ctx) {
                  MeetingsTypeHelper.base_scope(component).includes(:component)
                }
      end

      field(:meeting, MeetingType) do
        argument :id, !types.ID

        resolve ->(component, args, _ctx) {
          MeetingsTypeHelper.base_scope(component).find_by(id: args[:id])
        }
      end
    end

    module MeetingsTypeHelper
      def self.base_scope(component)
        Meeting.where(component: component)
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
decidim-meetings-0.20.1 app/types/decidim/meetings/meetings_type.rb
decidim-meetings-0.20.0 app/types/decidim/meetings/meetings_type.rb
decidim-meetings-0.19.1 app/types/decidim/meetings/meetings_type.rb
decidim-meetings-0.18.1 app/types/decidim/meetings/meetings_type.rb
decidim-meetings-0.19.0 app/types/decidim/meetings/meetings_type.rb
decidim-meetings-0.17.2 app/types/decidim/meetings/meetings_type.rb
decidim-meetings-0.18.0 app/types/decidim/meetings/meetings_type.rb
decidim-meetings-0.17.1 app/types/decidim/meetings/meetings_type.rb
decidim-meetings-0.16.1 app/types/decidim/meetings/meetings_type.rb
decidim-meetings-0.17.0 app/types/decidim/meetings/meetings_type.rb
decidim-meetings-0.16.0 app/types/decidim/meetings/meetings_type.rb
decidim-meetings-0.15.2 app/types/decidim/meetings/meetings_type.rb
decidim-meetings-0.15.1 app/types/decidim/meetings/meetings_type.rb
decidim-meetings-0.15.0 app/types/decidim/meetings/meetings_type.rb
decidim-meetings-0.14.4 app/types/decidim/meetings/meetings_type.rb
decidim-meetings-0.14.3 app/types/decidim/meetings/meetings_type.rb
decidim-meetings-0.14.2 app/types/decidim/meetings/meetings_type.rb
decidim-meetings-0.14.1 app/types/decidim/meetings/meetings_type.rb
decidim-meetings-0.13.1 app/types/decidim/meetings/meetings_type.rb
decidim-meetings-0.12.2 app/types/decidim/meetings/meetings_type.rb