Version: 2024-07
Curl example: "curl -X POST \\\nhttps://shopify.com/<shop-id>/account/customer/api/2024-07/graphql/api/2024-07/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'Authorization: {access_token}' \\\n-d '{\n\"query\": \"mutation customerUpdate($input: CustomerUpdateInput!) { customerUpdate(input: $input) { userErrors { field message } customer { firstName lastName } } }\",\n \"variables\": {\n \"input\": {\n \"firstName\": \"Quinn\",\n \"lastName\": \"Ishida\"\n }\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation customerUpdate($input: CustomerUpdateInput!) {\n customerUpdate(input: $input) {\n userErrors {\n field\n message\n }\n customer {\n firstName\n lastName\n }\n }\n }`,\n \"variables\": {\n \"input\": {\n \"firstName\": \"Quinn\",\n \"lastName\": \"Ishida\"\n }\n },\n },\n});\n" Ruby example: null PHP example: null Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await customer.graphql(\n `#graphql\n mutation customerUpdate($input: CustomerUpdateInput!) {\n customerUpdate(input: $input) {\n userErrors {\n field\n message\n }\n customer {\n firstName\n lastName\n }\n }\n }`,\n {\n variables: {\n \"input\": {\n \"firstName\": \"Quinn\",\n \"lastName\": \"Ishida\"\n }\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation customerUpdate($input: CustomerUpdateInput!) {\n customerUpdate(input: $input) {\n userErrors {\n field\n message\n }\n customer {\n firstName\n lastName\n }\n }\n}"
input: { "input": { "firstName": "Quinn", "lastName": "Ishida" } }
response: { "data": { "customerUpdate": { "userErrors": [], "customer": { "firstName": "Quinn", "lastName": "Ishida" } } } }