Class: ShopifyGraphql::CreateStagedUploads

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

Constant Summary collapse

MUTATION =
<<~GRAPHQL
  mutation stagedUploadsCreate($input: [StagedUploadInput!]!) {
    stagedUploadsCreate(input: $input) {
      stagedTargets {
        url
        resourceUrl
        parameters {
          name
          value
        }
      }
      userErrors{
        field,
        message
      }
    }
  }
GRAPHQL

Instance Method Summary collapse

Methods included from Mutation

#client

Instance Method Details

#call(input:) ⇒ Object



24
25
26
27
28
29
# File 'app/graphql/shopify_graphql/create_staged_uploads.rb', line 24

def call(input:)
  response = execute(MUTATION, input: input)
  response.data = response.data.stagedUploadsCreate
  handle_user_errors(response.data)
  response
end