graphql-yoga
Version:
<div align="center"><img src="./website/public/cover.png" width="720" /></div>
15 lines (14 loc) • 437 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.useRequestParser = useRequestParser;
const DEFAULT_MATCHER = () => true;
function useRequestParser(options) {
const matchFn = options.match || DEFAULT_MATCHER;
return {
onRequestParse({ request, setRequestParser }) {
if (matchFn(request)) {
setRequestParser(options.parse);
}
},
};
}
;