Class: GraphqlUtil::Http

Inherits:
GraphQL::Client::HTTP
  • Object
show all
Defined in:
lib/graphql_util/http.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(endpoint:, headers: {}) ⇒ Http

Returns the GraphQL::Client::HTTP instance injecting the PulsarAuthUtil authentication Token

Parameters:

  • endpoint (String)

    GraphQL API Endpoint

  • headers (Hash) (defaults to: {})

    HTTP Request headers



13
14
15
16
17
18
19
20
# File 'lib/graphql_util/http.rb', line 13

def initialize(endpoint:, headers: {})
  @headers = headers
  super(endpoint) do
    def headers(context)
      @headers
    end
  end
end

Instance Attribute Details

#tokenObject

Returns the value of attribute token.



6
7
8
# File 'lib/graphql_util/http.rb', line 6

def token
  @token
end