Created
February 1, 2021 15:09
-
-
Save daniel-sim/4a68412d36932de46ada5c5ac05b37da to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ShopifyPartnerAPI | |
class HTTPClient < GraphQL::Client::HTTP | |
def initialize | |
super("https://partners.shopify.com/") | |
end | |
def headers(context) | |
{ | |
"X-Shopify-Access-Token": context.fetch(:access_token) | |
} | |
end | |
def execute(document:, operation_name: nil, variables: {}, context: {}) | |
@uri = URI.parse("https://partners.shopify.com/#{context.fetch(:organization_id)}/api/unstable/graphql.json") | |
super(document: document, operation_name: operation_name, variables: variables, context: context) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment