staffMember
The StaffMember resource, by ID.
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.
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.
- active•Boolean!non-null
Whether the staff member is active.
- avatar•Image!non-null
The image used as the staff member's avatar in the Shopify admin.
- email•String!non-null
The staff member's email address.
- exists•Boolean!non-null
Whether the staff member's account exists.
- first
Name •String The staff member's first name.
- id•ID!non-null
A globally-unique ID.
- initials•[String!]
The staff member's initials, if available.
- is
Shop •Owner Boolean!non-null Whether the staff member is the shop owner.
- last
Name •String The staff member's last name.
- locale•String!non-null
The staff member's preferred locale. Locale values use the format
language
or, where
language
is a two-letter language code, andis a two-letter country code. For example:
en
or- name•String!non-null
The staff member's full name.
- phone•String
The staff member's phone number.
- private
Data •Staffnon-nullMember Private Data! The data used to customize the Shopify admin experience for the staff member.
- active•
- Retrieves a single user
- Retrieves the currently logged-in user
Examples
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/2024-07/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)