src/Tracer.js
function instrumentSchemaForExpressGraphQL(schema) {
  addTracingToResolvers(schema);
  addSchemaLevelResolveFunction(schema, (root, args, ctx, info) => {
    const operation = print(info.operation);
    const fragments = Object.keys(info.fragments).map(k => print(info.fragments[k])).join('\n');

    ctx.tracer.log('request.query', `${operation}\n${fragments}`);
    ctx.tracer.log('request.variables', info.variableValues);
    ctx.tracer.log('request.operationName', info.operation.name);
    return root;
  });
}
function instrumentSchemaForExpressGraphQL(schema) {
  addTracingToResolvers(schema);
  addSchemaLevelResolveFunction(schema, (root, args, ctx, info) => {
    const operation = print(info.operation);
    const fragments = Object.keys(info.fragments).map(k => print(info.fragments[k])).join('\n');

    ctx.tracer.log('request.query', `${operation}\n${fragments}`);
    ctx.tracer.log('request.variables', info.variableValues);
    ctx.tracer.log('request.operationName', info.operation.name);
    return root;
  });
}
function instrumentSchemaForExpressGraphQL ( schema ) { addTracingToResolvers ( schema ) ; addSchemaLevelResolveFunction ( schema , ( root , args , ctx , info ) => { const operation = print ( info . operation ) ; const fragments = Object . keys ( info . fragments ) . map ( k => print ( info . fragments [ k ] ) ) . join ( '\n' ) ; ctx . tracer . log ( 'request.query' , ` ${ operation } \n ${ fragments } ` ) ; ctx . tracer . log ( 'request.variables' , info . variableValues ) ; ctx . tracer . log ( 'request.operationName' , info . operation . name ) ; return root ; } ) ; }
This instruments a GraphQL.js schema when using tracer with express-graphql
This instruments a GraphQL . js schema when using tracer with express - graphql