Log in
Factory

ContextFactory

Magento\GraphQl\Model\Query\ContextFactory

What it does

This factory class creates and manages the GraphQL query context object, which holds user authentication information and extension attributes needed during GraphQL request processing.

Developers use this to access user context data (user ID, user type) and custom extension attributes throughout GraphQL query execution.

It implements a singleton pattern through the get() method to ensure the same context is reused within a request.

Public Methods

  • create()
  • get()
  • _resetState()