Module: ActiveProject::Adapters::GithubProject::Connection

Includes:
Connections::GraphQl
Included in:
ActiveProject::Adapters::GithubProjectAdapter
Defined in:
lib/active_project/adapters/github_project/connection.rb

Defined Under Namespace

Modules: InstanceGraphqlPatcher

Constant Summary collapse

ENDPOINT =
"https://api.github.com/graphql"

Constants included from Connections::HttpClient

Connections::HttpClient::DEFAULT_HEADERS, Connections::HttpClient::DEFAULT_RETRY_OPTS

Instance Attribute Summary

Attributes included from Connections::HttpClient

#connection, #last_response

Instance Method Summary collapse

Methods included from Connections::GraphQl

#init_graphql, #request_gql

Methods included from Connections::Pagination

#each_edge, #each_page

Methods included from Connections::HttpClient

#build_connection, #request

Methods included from Connections::Base

#parse_link_header

Instance Method Details

#initialize(config:) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/active_project/adapters/github_project/connection.rb', line 11

def initialize(config:)
  super(config: config)
  token = @config.options.fetch(:access_token)

  init_graphql(
    endpoint: ENDPOINT,
    token: token,
    extra_headers: {
      "X-Github-Next-Global-ID" => "1"
    }
  )

  # monkey-patch method for this instance only
  class << self
    prepend InstanceGraphqlPatcher
  end
end