Version: 2024-01
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query StaffMember($id: ID!) { staffMember(id: $id) { active avatar { url } email exists firstName id initials isShopOwner lastName locale name phone } }\",\n \"variables\": {\n \"id\": \"gid://shopify/StaffMember/902541635\"\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `query StaffMember($id: ID!) {\n staffMember(id: $id) {\n active\n avatar {\n url\n }\n email\n exists\n firstName\n id\n initials\n isShopOwner\n lastName\n locale\n name\n phone\n }\n }`,\n \"variables\": {\n \"id\": \"gid://shopify/StaffMember/902541635\"\n },\n },\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query StaffMember($id: ID!) {\n staffMember(id: $id) {\n active\n avatar {\n url\n }\n email\n exists\n firstName\n id\n initials\n isShopOwner\n lastName\n locale\n name\n phone\n }\n }\nQUERY\n\nvariables = {\n \"id\": \"gid://shopify/StaffMember/902541635\"\n}\n\nresponse = client.query(query: query, variables: variables)\n" PHP example: "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n query StaffMember($id: ID!) {\n staffMember(id: $id) {\n active\n avatar {\n url\n }\n email\n exists\n firstName\n id\n initials\n isShopOwner\n lastName\n locale\n name\n phone\n }\n }\nQUERY;\n\n$variables = [\n \"id\" => \"gid://shopify/StaffMember/902541635\",\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query StaffMember($id: ID!) {\n staffMember(id: $id) {\n active\n avatar {\n url\n }\n email\n exists\n firstName\n id\n initials\n isShopOwner\n lastName\n locale\n name\n phone\n }\n }`,\n {\n variables: {\n \"id\": \"gid://shopify/StaffMember/902541635\"\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "query StaffMember($id: ID!) {\n staffMember(id: $id) {\n active\n avatar {\n url\n }\n email\n exists\n firstName\n id\n initials\n isShopOwner\n lastName\n locale\n name\n phone\n }\n}"
input: { "id": "gid://shopify/StaffMember/902541635" }
response: { "data": { "staffMember": { "active": true, "avatar": { "url": "https://cdn.shopify.com/s/files/1/2637/1970/users/foo.jpg?v=1731443626" }, "email": "bob@example.com", "exists": true, "firstName": "bob", "id": "gid://shopify/StaffMember/902541635", "initials": [ "b", "b" ], "isShopOwner": true, "lastName": "bobsen", "locale": "en", "name": "bob bobsen", "phone": null } } }
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query { staffMember { active avatar { url } email exists firstName id initials isShopOwner lastName locale name phone privateData { accountSettingsUrl createdAt } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n staffMember {\n active\n avatar {\n url\n }\n email\n exists\n firstName\n id\n initials\n isShopOwner\n lastName\n locale\n name\n phone\n privateData {\n accountSettingsUrl\n createdAt\n }\n }\n }`,\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query {\n staffMember {\n active\n avatar {\n url\n }\n email\n exists\n firstName\n id\n initials\n isShopOwner\n lastName\n locale\n name\n phone\n privateData {\n accountSettingsUrl\n createdAt\n }\n }\n }\nQUERY\n\nresponse = client.query(query: query)\n" PHP example: "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n query {\n staffMember {\n active\n avatar {\n url\n }\n email\n exists\n firstName\n id\n initials\n isShopOwner\n lastName\n locale\n name\n phone\n privateData {\n accountSettingsUrl\n createdAt\n }\n }\n }\nQUERY;\n\n$response = $client->query([\"query\" => $query]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query {\n staffMember {\n active\n avatar {\n url\n }\n email\n exists\n firstName\n id\n initials\n isShopOwner\n lastName\n locale\n name\n phone\n privateData {\n accountSettingsUrl\n createdAt\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n staffMember {\n active\n avatar {\n url\n }\n email\n exists\n firstName\n id\n initials\n isShopOwner\n lastName\n locale\n name\n phone\n privateData {\n accountSettingsUrl\n createdAt\n }\n }\n}"
input: null
response: { "data": { "staffMember": { "active": true, "avatar": { "url": "https://cdn.shopify.com/s/files/1/2637/1970/users/foo.jpg?v=1731443626" }, "email": "bob@example.com", "exists": true, "firstName": "bob", "id": "gid://shopify/StaffMember/902541635", "initials": [ "b", "b" ], "isShopOwner": true, "lastName": "bobsen", "locale": "en", "name": "bob bobsen", "phone": null, "privateData": { "accountSettingsUrl": "https://www.snowdevil.ca/admin/settings/account/902541635", "createdAt": "2005-01-01T00:00:00Z" } } } }