Class: Decidim::BulletinBoard::Graphql::Factory

Inherits:
Object
  • Object
show all
Defined in:
lib/decidim/bulletin_board/graphql/factory.rb

Class Method Summary collapse

Class Method Details

.client_for(settings) ⇒ Object

The Bulletin Board GraphQL client factory



10
11
12
13
14
15
16
# File 'lib/decidim/bulletin_board/graphql/factory.rb', line 10

def self.client_for(settings)
  Graphlient::Client.new(settings.bulletin_board_server,
                         schema_path: File.join(__dir__, "bb_schema.json"),
                         headers: {
                           "Authorization" => settings.authority_api_key
                         })
end

.client_for_file(settings, file_path) ⇒ Object



18
19
20
21
22
23
24
25
# File 'lib/decidim/bulletin_board/graphql/factory.rb', line 18

def self.client_for_file(settings, file_path)
  Graphlient::Client.new(file_path,
                         schema_path: File.join(__dir__, "bb_schema.json"),
                         http: FileAdapter,
                         headers: {
                           "Authorization" => settings.authority_api_key
                         })
end