Sha256: 1709181cb58b85b72f7533413f26e9d4221ed001e1886e1f61e3b23d3d46ac72
Contents?: true
Size: 676 Bytes
Versions: 50
Compression:
Stored size: 676 Bytes
Contents
# frozen_string_literal: true module Decidim module Pages class PagesType < Decidim::Api::Types::BaseObject implements Decidim::Core::ComponentInterface graphql_name "Pages" description "A pages component of a participatory space." field :pages, Decidim::Pages::PageType.connection_type, null: true, connection: true def pages Page.where(component: object).includes(:component) end field :page, Decidim::Pages::PageType, null: true do argument :id, GraphQL::Types::ID, required: true end def page(**args) Page.where(component: object).find_by(id: args[:id]) end end end end
Version data entries
50 entries across 50 versions & 1 rubygems