Class: Fbe::Graph::HTTP
- Inherits:
-
GraphQL::Client::HTTP
- Object
- GraphQL::Client::HTTP
- Fbe::Graph::HTTP
- 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
-
#headers(_context) ⇒ Hash
Provides headers for GraphQL requests including authentication.
-
#initialize(token, host) ⇒ HTTP
constructor
Initializes a new HTTP transport with GitHub authentication.
Constructor Details
#initialize(token, host) ⇒ HTTP
Initializes a new HTTP transport with GitHub authentication.
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.
269 270 271 |
# File 'lib/fbe/github_graph.rb', line 269 def headers(_context) { Authorization: "Bearer #{@token}" } end |