Class: ShopifyGraphql::CreateBulkMutation

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

Constant Summary collapse

MUTATION =
<<~GRAPHQL
  mutation($mutation: String!, $stagedUploadPath: String!) {
    bulkOperationRunMutation(mutation: $mutation, stagedUploadPath: $stagedUploadPath) {
      bulkOperation {
        id
        status
      }
      userErrors {
        field
        message
      }
    }
  }
GRAPHQL

Instance Method Summary collapse

Methods included from Mutation

#client

Instance Method Details

#call(mutation:, staged_upload_path:) ⇒ Object



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

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