addToContext should only see request headers #509
Labels
note/breaking-change
This issue existed already
scope/schema-context
scope/server
Related to the server component
type/improve
Something existing is made better, does not affect the interface (example: better error message)
Perceived Problem
The API is bloated, currently exposing HTTP.IncomingMessage, so an event emitter, so on:
It is not appropriate. It is not how we would design it from scratch. It is inherited without having been really reflected upon.
Aside from burdening the autocomplete DX for users, it permits nonsense:
Ideas / Proposed Solution(s)
schema.addToContext(({ headers }) => )
schema.addToContext((headers) => )
RequestData
orNexusRequestData
schema.addToContext
to where you need it...Related
response
to the context on custom Express server #506The text was updated successfully, but these errors were encountered: