Sha256: dfea054b9888ab15e102a7aa43b8865859d7113e5d8a9aee349c46a91aed2b28

Contents?: true

Size: 831 Bytes

Versions: 25

Compression:

Stored size: 831 Bytes

Contents

# frozen_string_literal: true

require "decidim/api/engine"
require "decidim/api/types"

module Decidim
  # This module holds all business logic related to exposing a Public API for
  # decidim.
  module Api
    # This declares all the types an interface or union can resolve to. This needs
    # to be done in order to be able to have them found. This is a shortcoming of
    # graphql-ruby and the way it deals with loading types, in combination with
    # rail's infamous autoloading.
    def self.orphan_types
      Decidim.component_manifests.map(&:query_type).map(&:constantize).uniq +
        Decidim.participatory_space_manifests.map(&:query_type).map(&:constantize).uniq +
        (@orphan_types || [])
    end

    def self.add_orphan_type(type)
      @orphan_types ||= []
      @orphan_types += [type]
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
decidim-api-0.26.10 lib/decidim/api.rb
decidim-api-0.26.9 lib/decidim/api.rb
decidim-api-0.26.8 lib/decidim/api.rb
decidim-api-0.26.7 lib/decidim/api.rb
decidim-api-0.26.5 lib/decidim/api.rb
decidim-api-0.26.4 lib/decidim/api.rb
decidim-api-0.26.3 lib/decidim/api.rb
decidim-api-0.26.2 lib/decidim/api.rb
decidim-api-0.26.1 lib/decidim/api.rb
decidim-api-0.26.0 lib/decidim/api.rb
decidim-api-0.26.0.rc2 lib/decidim/api.rb
decidim-api-0.26.0.rc1 lib/decidim/api.rb
decidim-api-0.25.2 lib/decidim/api.rb
decidim-api-0.25.1 lib/decidim/api.rb
decidim-api-0.25.0 lib/decidim/api.rb
decidim-api-0.25.0.rc4 lib/decidim/api.rb
decidim-api-0.25.0.rc3 lib/decidim/api.rb
decidim-api-0.25.0.rc2 lib/decidim/api.rb
decidim-api-0.25.0.rc1 lib/decidim/api.rb
decidim-api-0.24.3 lib/decidim/api.rb