I was testing the new Store credit primitive and API developer preview released recently and available here , for that I have Created a store to test and build from partner dashboard and create custom app in shopify admin to get the access token, with that token I have send the below GraphQL mutation to create Store credit primitive:
{"variables": {"creditInput": {"creditAmount": {"amount": "49.99", "currencyCode": "USD"}}, "id": "gid://shopify/Customer/7246127562990"}, "query": "mutation storeCreditAccountCredit($id: ID!, $creditInput: StoreCreditAccountCreditInput!) {\r\n storeCreditAccountCredit(id: $id, creditInput: $creditInput) {\r\n storeCreditAccountTransaction {\r\n amount {\r\n amount\r\n currencyCode\r\n }\r\n account {\r\n id\r\n balance {\r\n amount\r\n currencyCode\r\n }\r\n }\r\n }\r\n userErrors {\r\n message\r\n field\r\n }\r\n }\r\n}\r\n"}
But I am getting an error
{
"errors": [
{
"message": "StoreCreditAccountCreditInput isn't a defined input type (on $creditInput)",
"locations": [
{
"line": 1,
"column": 45
}
],
"path": [
"mutation storeCreditAccountCredit"
],
"extensions": {
"code": "variableRequiresValidType",
"typeName": "StoreCreditAccountCreditInput",
"variableName": "creditInput"
}
},
{
"message": "Field 'storeCreditAccountCredit' doesn't exist on type 'Mutation'",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"mutation storeCreditAccountCredit",
"storeCreditAccountCredit"
],
"extensions": {
"code": "undefinedField",
"typeName": "Mutation",
"fieldName": "storeCreditAccountCredit"
}
},
{
"message": "Variable $id is declared by storeCreditAccountCredit but not used",
"locations": [
{
"line": 1,
"column": 1
}
],
"path": [
"mutation storeCreditAccountCredit"
],
"extensions": {
"code": "variableNotUsed",
"variableName": "id"
}
},
{
"message": "Variable $creditInput is declared by storeCreditAccountCredit but not used",
"locations": [
{
"line": 1,
"column": 1
}
],
"path": [
"mutation storeCreditAccountCredit"
],
"extensions": {
"code": "variableNotUsed",
"variableName": "creditInput"
}
}
]
}
So I would like to know what’s going on?
