Class: Fbe::Graph::HTTP

Inherits:
GraphQL::Client::HTTP
  • Object
show all
Defined in:
lib/fbe/github_graph.rb

Overview

HTTP transport class for GraphQL client to communicate with GitHub API

This class extends GraphQL::Client::HTTP to handle GitHub-specific authentication and endpoints.

Instance Method Summary collapse

Constructor Details

#initialize(token, host) ⇒ HTTP

Initializes a new HTTP transport with GitHub authentication.

Parameters:

  • GitHub API token for authentication

  • GitHub API host (default: ‘api.github.com’)



179
180
181
182
# File 'lib/fbe/github_graph.rb', line 179

def initialize(token, host)
  @token = token
  super("https://#{host}/graphql")
end

Instance Method Details

#headers(_context) ⇒ Hash

Provides headers for GraphQL requests including authentication.

Parameters:

  • The GraphQL request context (unused)

Returns:

  • Headers for the request



188
189
190
# File 'lib/fbe/github_graph.rb', line 188

def headers(_context)
  { Authorization: "Bearer #{@token}" }
end