![]() - apollo-cache-control@0.5.2 - apollo-datasource-rest@0.3.2 - apollo-engine-reporting@1.0.4 - apollo-server-azure-functions@2.4.4 - apollo-server-cloud-functions@2.4.4 - apollo-server-cloudflare@2.4.4 - apollo-server-core@2.4.4 - apollo-server-errors@2.2.1 - apollo-server-express@2.4.4 - apollo-server-fastify@2.4.4 - apollo-server-hapi@2.4.4 - apollo-server-integration-testsuite@2.4.4 - apollo-server-koa@2.4.4 - apollo-server-lambda@2.4.4 - apollo-server-micro@2.4.4 - apollo-server-plugin-base@0.3.4 - apollo-server-testing@2.4.4 - apollo-server@2.4.4 - apollo-tracing@0.5.2 - graphql-extensions@0.5.4 |
||
---|---|---|
.. | ||
src | ||
.npmignore | ||
package.json | ||
README.md | ||
tsconfig.json |
Apollo Tracing (for Node.js)
This package is used to collect and expose trace data in the Apollo Tracing format.
It relies on instrumenting a GraphQL schema to collect resolver timings, and exposes trace data for an individual request under extensions
as part of the GraphQL response.
This data can be consumed by Apollo Engine or any other tool to provide visualization and history of field-by-field execution performance.
Usage
Apollo Server
Apollo Server includes built-in support for tracing from version 1.1.0 onwards.
The only code change required is to add tracing: true
to the options passed to the Apollo Server middleware function for your framework of choice. For example, for Express:
app.use('/graphql', bodyParser.json(), graphqlExpress({
schema,
context: {},
tracing: true,
}));
If you are using
express-graphql
, we recommend you switch to Apollo Server. Bothexpress-graphql
and Apollo Server are based on thegraphql-js
reference implementation, and switching should only require changing a few lines of code.