aboutsummaryrefslogtreecommitdiff
path: root/source/utility
diff options
context:
space:
mode:
authornetop://ウィビ <paul@webb.page>2026-05-03 12:40:04 -0700
committernetop://ウィビ <paul@webb.page>2026-05-03 12:40:04 -0700
commit52ee736bd2ac407952863c8e8397770bf1495a45 (patch)
treef982218600682f7714a5a5157e940acc0e0e8a13 /source/utility
parent83f2352fef7dc93396e3cf8f224acba271f1ef9d (diff)
downloadgq-52ee736bd2ac407952863c8e8397770bf1495a45.tar.gz
gq-52ee736bd2ac407952863c8e8397770bf1495a45.zip
adds support for subscriptions
Diffstat (limited to 'source/utility')
-rwxr-xr-xsource/utility/types.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/utility/types.ts b/source/utility/types.ts
index 0d8b443..2311c25 100755
--- a/source/utility/types.ts
+++ b/source/utility/types.ts
@@ -41,6 +41,12 @@ export interface GQLOptions<Context, Req extends GQLRequest = GQLRequest> extend
playgroundOptions?: Omit<RenderPageOptions, "endpoint">;
/** The executable schema to query against. */
schema: GraphQLSchema;
+ /**
+ * WebSocket subscription handler returned by `GraphQLWS()`. When set, any
+ * incoming request with `Upgrade: websocket` is delegated to it before HTTP
+ * content negotiation runs.
+ */
+ subscriptions?: (request: Request) => Response;
}
/** A single GraphQL operation — either a `query` or a `mutation`, never both. */