Package Exports
- apollo-link-trace
- apollo-link-trace/es/index.js
- apollo-link-trace/index.cjs
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (apollo-link-trace) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
apollo-link-trace
Apply Trace Context headers to your Apollo Client requests
Install
Via npm
npm install apollo-link-traceVia Yarn
yarn add apollo-link-traceHow to use
TraceContextLink accepts an options object that allows you to pass options when creating the link.
Options
tracestate - Default tracestate header to use for requests. This can be overridden via individual call contexts.
Example
import { ApolloClient, HttpLink, InMemoryCache, from } from '@apollo/client'
import { TraceContextLink } from 'apollo-link-trace'
const apolloClient = new ApolloClient({
link: from([
new TraceContextLink(),
new HttpLink({
uri: graphqlEndpoint,
})
]),
cache: new InMemoryCache(),
});