diff options
| author | netop://ウィビ <paul@webb.page> | 2026-05-03 12:40:04 -0700 |
|---|---|---|
| committer | netop://ウィビ <paul@webb.page> | 2026-05-03 12:40:04 -0700 |
| commit | 52ee736bd2ac407952863c8e8397770bf1495a45 (patch) | |
| tree | f982218600682f7714a5a5157e940acc0e0e8a13 /source/http.ts | |
| parent | 83f2352fef7dc93396e3cf8f224acba271f1ef9d (diff) | |
| download | gq-52ee736bd2ac407952863c8e8397770bf1495a45.tar.gz gq-52ee736bd2ac407952863c8e8397770bf1495a45.zip | |
adds support for subscriptions
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", "*/*"] |