GraphQL API

The GraphQL package exposes staff data, staff groups, assigned customers and staff authentication to headless storefronts and integrations.

composer require mageb2b/staff-graph-ql:*
php bin/magento setup:upgrade
php bin/magento cache:flush

The package requires the Staff base extension (mageb2b/staff). This is a technical integration interface; plan it with the developer or agency that maintains the storefront.

Queries

Query Returns
staff A filtered list of staff records
staffById(id: Int!) One staff record
staffGroups A filtered list of staff groups
staffGroupById(id: Int!) One staff group
staffMyCustomers The customers assigned to the authenticated staff account
staffCustomersByStaffId The customers assigned to a given staff record

Mutations

Mutation Purpose
generateStaffToken(email, password) Sign a staff account in and receive a bearer token
revokeStaffToken Invalidate the current staff token
requestStaffPasswordReset(email) Send the staff password-reset email
resetStaffPassword(token, new_password, confirm_password) Set a new password with the emailed token
createStaffCustomerToken(customer_id) Create a customer token for impersonating an assigned customer

Staff identity data includes name, email, phone, status, website, customer access and creation/edit permissions. Customer impersonation through createStaffCustomerToken follows the same assignment rules as the storefront My Customers area — it does not bypass customer assignment.

Test sign-in, token expiry and customer authorization in staging before exposing the schema to a production storefront. Inspect the installed schema with an introspection query if your version differs.