Sha256: 31dae111b5f60ab5e37653aa502d781981e08da25d7d97d4f70071832888a329

Contents?: true

Size: 803 Bytes

Versions: 35

Compression:

Stored size: 803 Bytes

Contents

# frozen_string_literal: true

require "decidim/api/engine"

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

35 entries across 35 versions & 1 rubygems

Version Path
decidim-api-0.23.6 lib/decidim/api.rb
decidim-api-0.23.5 lib/decidim/api.rb
decidim-api-0.23.4 lib/decidim/api.rb
decidim-api-0.23.3 lib/decidim/api.rb
decidim-api-0.23.2 lib/decidim/api.rb
decidim-api-0.23.1 lib/decidim/api.rb
decidim-api-0.23.1.rc1 lib/decidim/api.rb
decidim-api-0.23.0 lib/decidim/api.rb
decidim-api-0.22.0 lib/decidim/api.rb
decidim-api-0.21.0 lib/decidim/api.rb
decidim-api-0.20.1 lib/decidim/api.rb
decidim-api-0.20.0 lib/decidim/api.rb
decidim-api-0.19.1 lib/decidim/api.rb
decidim-api-0.18.1 lib/decidim/api.rb
decidim-api-0.19.0 lib/decidim/api.rb
decidim-api-0.17.2 lib/decidim/api.rb
decidim-api-0.18.0 lib/decidim/api.rb
decidim-api-0.17.1 lib/decidim/api.rb
decidim-api-0.16.1 lib/decidim/api.rb
decidim-api-0.17.0 lib/decidim/api.rb