Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
},
};
return {
typePaths: ['./**/*.graphql'],
directiveResolvers,
context: ({ req, connection }) =>
connection ? { req: connection.context } : { req },
debug: false,
subscriptions: {
onConnect: (connectionParams, webSocket, context) => {
console.log('🔗 Connected to websocket');
},
},
persistedQueries: {
cache: new MemcachedCache(
['memcached-server-1', 'memcached-server-2', 'memcached-server-3'],
{ retries: 10, retry: 10000 }, // Options
),
},
installSubscriptionHandlers: true,
introspection: true,
playground: {
settings: {
'editor.cursorShape': 'line', // possible values: 'line', 'block', 'underline'
'editor.fontFamily': `'Source Code Pro', 'Consolas', 'Inconsolata', 'Droid Sans Mono', 'Monaco', monospace`,
'editor.fontSize': 14,
'editor.reuseHeaders': true, // new tab reuses headers from last tab
'editor.theme': 'dark', // possible values: 'dark', 'light'
'general.betaUpdates': false,
'queryPlan.hideQueryPlanResponse': false,
'request.credentials': 'include', // possible values: 'omit', 'include', 'same-origin'
const { initPromise } = context
const { currentUser } = await initPromise
await getMongoRepository(User).updateOne(
{ _id: currentUser._id },
{
$set: { isOnline: false },
},
{
upsert: true,
}
)
},
},
persistedQueries: {
cache: new MemcachedCache(
['memcached-server-1', 'memcached-server-2', 'memcached-server-3'],
{ retries: 10, retry: 10000 } // Options
),
},
installSubscriptionHandlers: true,
// uploads: false
}
}
}
const { initPromise } = context
const { currentUser } = await initPromise
await getMongoRepository(User).updateOne(
{ _id: currentUser._id },
{
$set: { isOnline: false }
},
{
upsert: true
}
)
}
},
persistedQueries: {
cache: new MemcachedCache(
['memcached-server-1', 'memcached-server-2', 'memcached-server-3'],
{ retries: 10, retry: 10000 } // Options
)
},
installSubscriptionHandlers: true,
uploads: {
maxFieldSize: 2, // 1mb
maxFileSize: 20, // 20mb
maxFiles: 5
}
}
}
}