diff options
Diffstat (limited to 'source/http.ts')
| -rwxr-xr-x | source/http.ts | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/http.ts b/source/http.ts index 7c747e1..c4a70c8 100755 --- a/source/http.ts +++ b/source/http.ts @@ -54,6 +54,9 @@ export function GraphQLHTTP< ...options }: GQLOptions<Ctx, Req>): GraphQLHandler<Req> { return async (request: Req) => { + if (options.subscriptions && request.headers.get("upgrade")?.toLowerCase() === "websocket") + return options.subscriptions(request as unknown as Request); + const accept = request.headers.get("Accept") || ""; const typeList = ["application/json", "text/html", "text/plain", "*/*"] |