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