Home > @vsf-enterprise/commercetools-api > Context

# Context interface

Contains current request and response object, integration configuration and helper methods

Signature:

export interface Context 

# Properties

Property Type Description
client ApolloClient<InMemoryCache> Apollo GraphQL client used to send requests to commercetools platform
config Config<InMemoryCache> Integration configuration
customQueries? any (Optional) Custom queries registered in middleware.config.js
extensions ApiClientExtension[] Array of registered integration extensions
req IncomingMessage & { cookies?: { [key: string]: string; }; } Request object
res ServerResponse Response object

# Methods

Method Description
extendQuery(customQuery, queries) Helper function for handling default and custom queries