Добавлены плагины для Apollo Server, обеспечивающие логирование операций GraphQL и обработку ошибок. Улучшено логирование в резолверах, добавлены проверки параметров с детальной информацией. Обновлены типы GraphQL для поддержки новых полей в деталях группы быстрого поиска.
This commit is contained in:
@ -86,6 +86,24 @@ const server = new ApolloServer({
|
||||
typeDefs,
|
||||
resolvers,
|
||||
introspection: true,
|
||||
plugins: [
|
||||
{
|
||||
async requestDidStart() {
|
||||
return {
|
||||
async didResolveOperation(requestContext: any) {
|
||||
console.log('🔍 GraphQL Operation:', {
|
||||
operationName: requestContext.request.operationName,
|
||||
query: requestContext.request.query?.replace(/\s+/g, ' ').substring(0, 200) + '...',
|
||||
variables: requestContext.request.variables
|
||||
});
|
||||
},
|
||||
async didEncounterErrors(requestContext: any) {
|
||||
console.error('❌ GraphQL Errors:', requestContext.errors);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
const handler = startServerAndCreateNextHandler(server, {
|
||||
|
Reference in New Issue
Block a user