Input
{% for row in file %}
{{ row["Your Column Name"] | log }}
{% endof %}{% capture mutation %}
mutation customerCreate($input: CustomerInput!) {
customerCreate(input: $input) {
customer {
id
}
userErrors {
field
message
}
}
}
{% endcapture %}
{% json variables %}
{
"input": {
"email": ""
}
}
{% endjson %}
{% for row in file %}
{% assign variables.input.email = row['email'] %}
{% assign result = mutation | graphql: variables %}
{% if result.customerCreate.userErrors != empty %}
{{ result.customerCreate.userErrors[0] | log }}
{% else %}
{{ "Created new customer with id: " | append: result.customerCreate.customer.id | log }}
{% endif %}
{% endfor %}Last updated