Class: ShopifyAPI::GraphQL::Bulk::Cancel

Inherits:
Request
  • Object
show all
Defined in:
lib/shopify_api/graphql/bulk/cancel.rb

Overview

:nodoc:

Constant Summary collapse

BULK_OPERATION_CANCEL =
"\#{BULK_OPERATION_FIELDS}\nmutation bulkOperationCancel($id: ID!) {\n  bulkOperationCancel(id: $id) {\n    bulkOperation {\n      ...BulkOperationFields\n    }\n    userErrors {\n      field\n      message\n    }\n  }\n}\n"

Instance Method Summary collapse

Instance Method Details

#execute(id, options = nil) ⇒ Object



22
23
24
25
26
27
28
29
30
# File 'lib/shopify_api/graphql/bulk/cancel.rb', line 22

def execute(id, options = nil)
  begin
    data = super(BULK_OPERATION_CANCEL, :id => id).dig(:data, :bulk_operation_cancel, :bulk_operation)
  rescue => e
    raise Error, "cancel request failed: #{e}"
  end

  Operation.new(data, options)
end