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:

  • token (String)

    GitHub API token for authentication

  • host (String)

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



260
261
262
263
# File 'lib/fbe/github_graph.rb', line 260

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:

  • _context (Object)

    The GraphQL request context (unused)

Returns:

  • (Hash)

    Headers for the request



269
270
271
# File 'lib/fbe/github_graph.rb', line 269

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