Class: ShopifyAPI::GraphQL
- Inherits:
-
Object
- Object
- ShopifyAPI::GraphQL
- Defined in:
- lib/shopify_api/resources/graphql.rb
Overview
GraphQL API.
Instance Method Summary collapse
-
#initialize ⇒ GraphQL
constructor
A new instance of GraphQL.
Constructor Details
#initialize ⇒ GraphQL
Returns a new instance of GraphQL.
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/shopify_api/resources/graphql.rb', line 8 def initialize uri = Base.site.dup uri.path = Base.api_version.construct_graphql_path @http = ::GraphQL::Client::HTTP.new(uri.to_s) do define_method(:headers) do |_context| Base.headers end end @schema = ::GraphQL::Client.load_schema(@http) @client = ::GraphQL::Client.new(schema: @schema, execute: @http) end |