Skip to content

Commit

Permalink
Make it more clear that generateClientInfo is an experimental API.
Browse files Browse the repository at this point in the history
The `generateClientInfo` API, used to set client identification attributes
within traces, is an experimental API and is subject to removal or change in
a future (major) Apollo Server release.

Ref: #1631
  • Loading branch information
abernix committed Sep 27, 2018
1 parent 81c4642 commit b90ccc2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

- Updated the google-cloud-functions package to handle null paths [PR #1674](https://github.com/apollographql/apollo-server/pull/1674)
- Update link inside Authentication Docs [PR #1682](https://github.com/apollographql/apollo-server/pull/1682)
- Provide ability to specify client info in traces [#1631](https://github.com/apollographql/apollo-server/pull/1631)
- Fix making sure all headers are getting reported to Engine properly when using `privateHeaders` [PR #1689](https://github.com/apollographql/apollo-server/pull/1689)
- _(experimental, subject to change/removal)_ Provide ability to specify client info in traces [#1631](https://github.com/apollographql/apollo-server/pull/1631)

### v2.0.8

Expand Down
10 changes: 0 additions & 10 deletions docs/source/api/apollo-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -365,13 +365,3 @@ addMockFunctionsToSchema({
* `maskErrorDetails`: boolean

Set to true to remove error details from the traces sent to Apollo's servers. Defaults to false.

* generateClientInfo?: (o: { context: any, extensions?: Record<string, any>}) => ClientInfo;

Creates the client information that is attached to the traces sent to the
Apollo backend. The context field is the execution context passed to the
resolvers and the extensions field corresponds to the same value in the POST
body or GET parameters. `ClientInfo` contains fields for `clientName` and
`clientVersion`, which are both optional. The default generation copies the
respective fields from `extensions.clientInfo`. If `clientName` or
`clientVersion` is not present, the values are set to the empty string.
15 changes: 9 additions & 6 deletions packages/apollo-engine-reporting/src/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,21 @@ export interface EngineReportingOptions {
sendReportsImmediately?: boolean;
// To remove the error message from traces, set this to true. Defaults to false
maskErrorDetails?: boolean;
// Creates the client information attached to the traces sent to the Apollo
// backend

/**
* (Experimental) Creates the client information for operation traces.
*
* @remarks This is experimental and subject to change or removal.
*
* @private
*
*/
generateClientInfo?: (
o: {
context: any;
extensions?: Record<string, any>;
},
) => ClientInfo;

// XXX Provide a way to set client_name, client_version, client_address,
// service, and service_version fields. They are currently not revealed in the
// Engine frontend app.
}

const REPORT_HEADER = new ReportHeader({
Expand Down

0 comments on commit b90ccc2

Please sign in to comment.