Class: ShopifyGraphql::CreateBulkMutation

Inherits:
Object
  • Object
show all
Includes:
Mutation
Defined in:
app/graphql/shopify_graphql/create_bulk_mutation.rb

Constant Summary collapse

MUTATION =
"mutation($mutation: String!, $stagedUploadPath: String!) {\n  bulkOperationRunMutation(mutation: $mutation, stagedUploadPath: $stagedUploadPath) {\n    bulkOperation {\n      id\n      status\n    }\n    userErrors {\n      code\n      field\n      message\n    }\n  }\n}\n"

Instance Method Summary collapse

Methods included from Mutation

#client

Instance Method Details

#call(mutation:, staged_upload_path:) ⇒ Object



21
22
23
24
25
26
# File 'app/graphql/shopify_graphql/create_bulk_mutation.rb', line 21

def call(mutation:, staged_upload_path:)
  response = execute(MUTATION, mutation: mutation, stagedUploadPath: staged_upload_path)
  response.data = response.data.bulkOperationRunMutation
  handle_user_errors(response.data)
  response
end