Log in
Model

AddCustomerGroupToContext

Magento\CustomerGraphQl\Model\Context\AddCustomerGroupToContext

What it does

This class adds the customer's group ID to the GraphQL context during query execution.

It determines the appropriate customer group based on whether the user is a guest (assigns NOT_LOGGED_IN_ID) or a logged-in customer (resolves their actual group).

Developers use this to ensure customer group information is available throughout GraphQL request processing for pricing, catalog visibility, and permissions.

Public Methods

  • execute()