Current
We can only setup one request handler in a JS worker file. This proposal intends to break that restriction
Proposal
type schema @upstream(onRequest: "onRequest") {
# ...
}
type Query {
foo: Foo @http(path: "/foo", onRequest: "onRequestFoo")
bar: Bar @http(path: "/bar", onRequest: "onRequestBar")
baz: Bar @http(path: "/baz")
}
function onRequest (request) {
//
}
function onRequestFoo (request) {
//
}
function onRequestBar (request) {
//
}
In the above implementation when:
- We query
foo, onRequestFoo is called with the request params.
- We query
bar, onRequestBar is called with the request params.
- We query
baz, onRequest (default handler) is called with the request params.
Current
We can only setup one request handler in a JS worker file. This proposal intends to break that restriction
Proposal
In the above implementation when:
foo,onRequestFoois called with the request params.bar,onRequestBaris called with the request params.baz,onRequest(default handler) is called with the request params.