Module: Decidim::Api

Defined in:
decidim-api/lib/decidim/api.rb,
decidim-api/app/helpers/decidim/api/application_helper.rb,
decidim-api/app/controllers/decidim/api/queries_controller.rb,
decidim-api/app/controllers/decidim/api/graphiql_controller.rb,
decidim-api/app/controllers/decidim/api/application_controller.rb,
decidim-api/app/controllers/decidim/api/documentation_controller.rb,
decidim-api/lib/decidim/api/types.rb,
decidim-api/lib/decidim/api/engine.rb,
decidim-api/lib/decidim/api/schema.rb,
decidim-api/lib/decidim/api/version.rb,
decidim-api/lib/decidim/api/query_type.rb,
decidim-api/lib/decidim/api/mutation_type.rb,
decidim-api/lib/decidim/api/types/base_enum.rb,
decidim-api/lib/decidim/api/types/base_field.rb,
decidim-api/lib/decidim/api/types/base_union.rb,
decidim-api/lib/decidim/api/types/base_object.rb,
decidim-api/lib/decidim/api/types/base_scalar.rb,
decidim-api/lib/decidim/api/types/base_argument.rb,
decidim-api/lib/decidim/api/types/base_mutation.rb,
decidim-api/lib/decidim/api/types/base_interface.rb,
decidim-api/lib/decidim/api/types/base_input_object.rb

Overview

This holds the decidim-api version.

Defined Under Namespace

Modules: ApplicationHelper, Types Classes: ApplicationController, DocumentationController, Engine, GraphiQLController, MutationType, QueriesController, QueryType, Schema

Class Method Summary collapse

Class Method Details

.add_orphan_type(type) ⇒ Object


20
21
22
23
# File 'decidim-api/lib/decidim/api.rb', line 20

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

.orphan_typesObject

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.


14
15
16
17
18
# File 'decidim-api/lib/decidim/api.rb', line 14

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

.versionObject


6
7
8
# File 'decidim-api/lib/decidim/api/version.rb', line 6

def self.version
  "0.25.0.dev"
end