Creates new RequestContext instances.
(config: { req?: Request; apiType: ApiType; channelOrToken?: Channel | string; languageCode?: LanguageCode; currencyCode?: CurrencyCode; user?: User; activeOrderId?: ID; }) => Promise<RequestContext>v1.5.0Creates a RequestContext based on the config provided. This can be useful when interacting with services outside the request-response cycle, for example in stand-alone scripts or in worker jobs.
Without a user, the resulting context is anonymous and carries no permissions, which
services that perform permission checks will reject. Pass the User the context should act
as — commonly the superadmin for administrative scripts:
(req: Request, info?: GraphQLResolveInfo, requiredPermissions?: Permission[], session?: CachedSession) => Promise<RequestContext>Creates a new RequestContext based on an Express request object. This is used internally in the API layer by the AuthGuard, and creates the RequestContext which is then passed to all resolvers & controllers.