mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
feat: Do not log IntrospectionQuery from Query Browser
This commit is contained in:
parent
8b4f0499c8
commit
175bc514be
@ -31,11 +31,14 @@ const filterVariables = (variables: any) => {
|
|||||||
const logPlugin = {
|
const logPlugin = {
|
||||||
requestDidStart(requestContext: any) {
|
requestDidStart(requestContext: any) {
|
||||||
const { logger } = requestContext
|
const { logger } = requestContext
|
||||||
const { query, mutation, variables } = requestContext.request
|
const { query, mutation, variables, operationName } = requestContext.request
|
||||||
|
if (operationName !== 'IntrospectionQuery') {
|
||||||
logger.info(`Request:
|
logger.info(`Request:
|
||||||
${mutation || query}variables: ${JSON.stringify(filterVariables(variables), null, 2)}`)
|
${mutation || query}variables: ${JSON.stringify(filterVariables(variables), null, 2)}`)
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
willSendResponse(requestContext: any) {
|
willSendResponse(requestContext: any) {
|
||||||
|
if (operationName !== 'IntrospectionQuery') {
|
||||||
if (requestContext.context.user) logger.info(`User ID: ${requestContext.context.user.id}`)
|
if (requestContext.context.user) logger.info(`User ID: ${requestContext.context.user.id}`)
|
||||||
if (requestContext.response.data) {
|
if (requestContext.response.data) {
|
||||||
logger.info('Response Success!')
|
logger.info('Response Success!')
|
||||||
@ -45,6 +48,7 @@ ${JSON.stringify(requestContext.response.data, null, 2)}`)
|
|||||||
if (requestContext.response.errors)
|
if (requestContext.response.errors)
|
||||||
logger.error(`Response-Errors:
|
logger.error(`Response-Errors:
|
||||||
${JSON.stringify(requestContext.response.errors, null, 2)}`)
|
${JSON.stringify(requestContext.response.errors, null, 2)}`)
|
||||||
|
}
|
||||||
return requestContext
|
return requestContext
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user