Anchor to staffMemberstaff
staffMember
query
The StaffMember resource, by ID.
Anchor to Arguments
Arguments
- •
The ID of the staff member to return. If no ID is provided, then the staff member making the query (if any) is returned.
Was this section helpful?
Anchor to Possible returnsPossible returns
- Anchor to StaffMemberStaff•
Member Represents the data about a staff member's Shopify account. Merchants can use staff member data to get more information about the staff members in their store.
Was this section helpful?
- Retrieves a single user
- Retrieves the currently logged-in user
Examples
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
query StaffMember($id: ID!) {
staffMember(id: $id) {
active
avatar {
url
}
email
exists
firstName
id
initials
isShopOwner
lastName
locale
name
phone
}
}`,
{
variables: {
"id": "gid://shopify/StaffMember/902541635"
},
},
);
const data = await response.json();
query StaffMember($id: ID!) {
staffMember(id: $id) {
active
avatar {
url
}
email
exists
firstName
id
initials
isShopOwner
lastName
locale
name
phone
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "query StaffMember($id: ID!) { staffMember(id: $id) { active avatar { url } email exists firstName id initials isShopOwner lastName locale name phone } }",
"variables": {
"id": "gid://shopify/StaffMember/902541635"
}
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
query StaffMember($id: ID!) {
staffMember(id: $id) {
active
avatar {
url
}
email
exists
firstName
id
initials
isShopOwner
lastName
locale
name
phone
}
}`,
{
variables: {
"id": "gid://shopify/StaffMember/902541635"
},
},
);
const data = await response.json();
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: {
"query": `query StaffMember($id: ID!) {
staffMember(id: $id) {
active
avatar {
url
}
email
exists
firstName
id
initials
isShopOwner
lastName
locale
name
phone
}
}`,
"variables": {
"id": "gid://shopify/StaffMember/902541635"
},
},
});
session = ShopifyAPI::Auth::Session.new(
shop: "your-development-store.myshopify.com",
access_token: access_token
)
client = ShopifyAPI::Clients::Graphql::Admin.new(
session: session
)
query = <<~QUERY
query StaffMember($id: ID!) {
staffMember(id: $id) {
active
avatar {
url
}
email
exists
firstName
id
initials
isShopOwner
lastName
locale
name
phone
}
}
QUERY
variables = {
"id": "gid://shopify/StaffMember/902541635"
}
response = client.query(query: query, variables: variables)
Input variables
JSON{
"id": "gid://shopify/StaffMember/902541635"
}
Response
JSON{
"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
}
}