Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
app.get(graphiqlPath, (req, res) => {
const tab = { endpoint };
if (req.query && req.query.query) {
tab.query = req.query.query;
tab.variables = req.query.variables;
}
res.setHeader('Content-Type', 'text/html');
res.write(
renderPlaygroundPage({
endpoint,
version: playgroundPkg.version,
tabs: [tab],
settings: { 'request.credentials': 'same-origin' },
})
);
res.end();
});