Skip to content

Latest commit

 

History

History
74 lines (43 loc) · 1.5 KB

handler.Request.md

File metadata and controls

74 lines (43 loc) · 1.5 KB

graphql-http / handler / Request

Interface: Request<Raw, Context>

handler.Request

Server agnostic request interface containing the raw request which is server dependant.

Type parameters

Name
Raw
Context

Table of contents

Properties

Properties

body

Readonly body: null | string | Record<string, unknown> | () => null | string | Record<string, unknown> | Promise<null | string | Record<string, unknown>>

Parsed request body or a parser function.

If the provided function throws, the error message "Unparsable JSON body" will be in the erroneous response.


context

Readonly context: Context

Context value about the incoming request, you're free to pass any information here.


headers

Readonly headers: RequestHeaders


method

Readonly method: string


raw

Readonly raw: Raw

The raw request itself from the implementing server.

For example: express.Request when using Express, or maybe http.IncomingMessage when just using Node with http.createServer.


url

Readonly url: string