![]() * import jest * remove mocha, chai, sinon * fix JSON parsing for package.json * replace import mocha, chai, sinon with jest * add jest as test npm script * remove dependency on mocha types * errors: remove unused jest tests * move tests to __tests__ folders * add jest types to root tsconfig * fix tsconfig include excludes * .to.equal -> toEqual * .true -> .toBe(true) * .to.deep.equal -> .toEqual * .to.exist -> .toBeDefined() * .to.contain -> .toMatch * .to.match -> .toMatch * to.be.undefined -> .toBeUndefined() * not.toBeDefined -> .toBeUndefined * bring integration test up to date with past changes * remove message from expect * .null -> .toBe(null) * expect.fail -> done.fail * callsFake -> jest.fn * mocha mock calls -> jest * .not.to.exist -> .toBeUndefined() * callCount -> mocks.calls.length * returns -> jest.fn() * .equals -> .toEqual * fix relative imports * remove string in expects and place as comment * remove Fibers from runQuery * restore -> mockRestore * before -> beforeAll * after -> afterAll * fix async_hooks test and Promise await * remove jest from testsuite package json * remove unnecessary apollo-server-env setup * add start of cloudflare tests * this.timeout -> timeout argument * express: fix relative require * import gql tag properly * .to.throw -> .toThrow * .to.be.instanceof -> .toBeInstanceOf * remove console log check test * done(Error) -> done.fail(Error) * done -> done.fail * change port numbers, since jest runs in parallel * fix toBeUndefined for null checks * make engine port unique in testsuite * make data source rest endpoint port unique * add coverage scripts * travis npm script -> cricle script * make engine port random * change ports to not conflict across integrations * increase node version for apollo-server-hapi * add node versioning to prevent hapi tests from running * move jest dependencies to the root package.json * make hapi port unique * fix port reference in hapi tests |
||
---|---|---|
.. | ||
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.