Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function getServer(AppOptions = {}, dbOptions = {}) {
return new Server(
{
// Inject a fake user. In a real app you'd parse a JWT to add the user
context: (request: any) => {
const userId = JSON.stringify(request.headers).length.toString();
return {
user: {
id: `user:${userId}`
}
};
},
introspection: true,
logger: Logger,
...AppOptions
},
dbOptions