Commit graph

72 commits

Author SHA1 Message Date
Martijn Walraven
20eb2e9e03 Publish
- apollo-cache-control@0.3.1
 - apollo-engine-reporting@0.1.1
 - apollo-server-azure-functions@2.2.1
 - apollo-server-cloud-functions@2.2.1
 - apollo-server-cloudflare@2.2.1
 - apollo-server-core@2.2.1
 - apollo-server-express@2.2.1
 - apollo-server-hapi@2.2.1
 - apollo-server-integration-testsuite@2.2.1
 - apollo-server-koa@2.2.1
 - apollo-server-lambda@2.2.1
 - apollo-server-micro@2.2.1
 - apollo-server-plugin-base@0.1.1
 - apollo-server-testing@2.2.1
 - apollo-server@2.2.1
 - apollo-tracing@0.3.1
 - graphql-extensions@0.3.1
2018-11-12 14:26:26 +01:00
Martijn Walraven
6bd73b175f Publish
- apollo-cache-control@0.3.0
 - apollo-datasource-rest@0.2.0
 - apollo-datasource@0.2.0
 - apollo-engine-reporting-protobuf@0.1.0
 - apollo-engine-reporting@0.1.0
 - apollo-server-azure-functions@2.2.0
 - apollo-server-cache-memcached@0.2.0
 - apollo-server-cache-redis@0.2.0
 - apollo-server-caching@0.2.0
 - apollo-server-cloud-functions@2.2.0
 - apollo-server-cloudflare@2.2.0
 - apollo-server-core@2.2.0
 - apollo-server-env@2.2.0
 - apollo-server-errors@2.2.0
 - apollo-server-express@2.2.0
 - apollo-server-hapi@2.2.0
 - apollo-server-integration-testsuite@2.2.0
 - apollo-server-koa@2.2.0
 - apollo-server-lambda@2.2.0
 - apollo-server-micro@2.2.0
 - apollo-server-plugin-base@0.1.0
 - apollo-server-testing@2.2.0
 - apollo-server@2.2.0
 - apollo-tracing@0.3.0
 - graphql-extensions@0.3.0
2018-11-07 08:17:21 -08:00
Jesse Rosenberger
5ca4c07bd5
Publish
- apollo-cache-control@0.3.0-alpha.3
 - apollo-engine-reporting-protobuf@0.1.0-alpha.3
 - apollo-engine-reporting@0.1.0-alpha.3
 - apollo-server-cloud-functions@2.2.0-alpha.3
 - apollo-server-cloudflare@2.2.0-alpha.3
 - apollo-server-core@2.2.0-alpha.3
 - apollo-server-express@2.2.0-alpha.3
 - apollo-server-hapi@2.2.0-alpha.3
 - apollo-server-integration-testsuite@2.2.0-alpha.3
 - apollo-server-koa@2.2.0-alpha.3
 - apollo-server-lambda@2.2.0-alpha.3
 - apollo-server-micro@2.2.0-alpha.3
 - apollo-server-plugin-base@0.1.0-alpha.3
 - apollo-server-testing@2.2.0-alpha.3
 - apollo-server@2.2.0-alpha.3
 - apollo-tracing@0.3.0-alpha.3
 - graphql-extensions@0.3.0-alpha.3
2018-11-05 21:36:39 -08:00
James Baxley
3d69124340 change clientId => clientReportingId and schemaBranch => schemaTag (#1921)
@abernix this should be a lot more clear 👍
2018-11-05 21:18:25 -08:00
Jesse Rosenberger
a6872c2f6c
Publish
- apollo-cache-control@0.3.0-alpha.2
 - apollo-datasource-rest@0.2.0-alpha.2
 - apollo-datasource@0.2.0-alpha.2
 - apollo-engine-reporting@0.1.0-alpha.2
 - apollo-server-cache-memcached@0.2.0-alpha.2
 - apollo-server-cache-redis@0.2.0-alpha.2
 - apollo-server-caching@0.2.0-alpha.2
 - apollo-server-cloud-functions@2.2.0-alpha.2
 - apollo-server-cloudflare@2.2.0-alpha.2
 - apollo-server-core@2.2.0-alpha.2
 - apollo-server-express@2.2.0-alpha.2
 - apollo-server-hapi@2.2.0-alpha.2
 - apollo-server-integration-testsuite@2.2.0-alpha.2
 - apollo-server-koa@2.2.0-alpha.2
 - apollo-server-lambda@2.2.0-alpha.2
 - apollo-server-micro@2.2.0-alpha.2
 - apollo-server-plugin-base@0.1.0-alpha.2
 - apollo-server-testing@2.2.0-alpha.2
 - apollo-server@2.2.0-alpha.2
 - apollo-tracing@0.3.0-alpha.2
 - graphql-extensions@0.3.0-alpha.2
2018-11-05 11:45:46 -08:00
Jesse Rosenberger
5b83883233
Publish
- apollo-cache-control@0.3.0-alpha.1
 - apollo-datasource-rest@0.2.0-alpha.1
 - apollo-datasource@0.2.0-alpha.1
 - apollo-engine-reporting-protobuf@0.1.0-alpha.1
 - apollo-engine-reporting@0.1.0-alpha.1
 - apollo-server-cache-memcached@0.2.0-alpha.1
 - apollo-server-cache-redis@0.2.0-alpha.1
 - apollo-server-caching@0.2.0-alpha.1
 - apollo-server-cloud-functions@2.2.0-alpha.1
 - apollo-server-cloudflare@2.2.0-alpha.1
 - apollo-server-core@2.2.0-alpha.1
 - apollo-server-env@2.1.0-alpha.1
 - apollo-server-express@2.2.0-alpha.1
 - apollo-server-hapi@2.2.0-alpha.1
 - apollo-server-integration-testsuite@2.2.0-alpha.1
 - apollo-server-koa@2.2.0-alpha.1
 - apollo-server-lambda@2.2.0-alpha.1
 - apollo-server-micro@2.2.0-alpha.1
 - apollo-server-plugin-base@0.1.0-alpha.1
 - apollo-server@2.2.0-alpha.1
 - apollo-tracing@0.3.0-alpha.1
 - graphql-extensions@0.3.0-alpha.1
2018-10-26 21:28:15 +03:00
James Baxley
3eb0c3e79a update protobuf and remove default branch 2018-10-26 20:19:30 +03:00
James Baxley
a729831d03 Support new protobuf fields in reporting
This commit supports two new concepts for reporting:

1. Client identity
2. Schema awareness

Client identity allows the GraphQLRequestContext to be mapped into
`clientId`, `clientName`, and `clientVersion` which can be used to
filter and view requests and metrics by client information.

Schema awareness introduces schema branches which allow arbitrary
strings to generate new "branches" (or variants) of a schema.
2018-10-26 20:19:30 +03:00
Andre Eberhardt
b640be4fe6 feature(apollo-engine-reporting): Add custom http agent support (#1879)
This PR fixes #1836.

This PR enables developers to inject the http agent to be used on the network requests to apollo engine endpoint.

<!--
  Thanks for filing a pull request on GraphQL Server!

  Please look at the following checklist to ensure that your PR
  can be accepted quickly:
-->

TODO:

* [x] Update CHANGELOG.md with your change (include reference to issue & this PR)
* [x] Make sure all of the significant new logic is covered by tests
* [x] Rebase your changes on master so that they can be merged easily
* [x] Make sure all tests and linter rules pass

<!--**Pull Request Labels**

While not necessary, you can help organize our pull requests by labeling this issue when you open it.  To add a label automatically, simply [x] mark the appropriate box below:

- [ ] feature
- [ ] blocking
- [ ] docs

To add a label not listed above, simply place `/label another-label-name` on a line by itself.
-->
2018-10-26 20:14:18 +03:00
Jesse Rosenberger
9a69ad3f3a
Merge branch 'master' into testing-improvements 2018-10-12 14:58:04 +03:00
Martijn Walraven
4fac07b8f1 Consistently leave out explicit tsconfig.json when referring to TypeScript project 2018-10-12 13:34:07 +02:00
Martijn Walraven
ad3562a335 Replace {} with Object.create(null) in jest.config.js 2018-10-12 13:00:13 +02:00
Martijn Walraven
68b2c691f8 Move test tsconfig.json files under __tests__ to support editors
The TypeScript language server looks for `tsconfig.json` and doesn't take project references into account when resolving the config for a file.

See https://github.com/Microsoft/TypeScript/issues/27372.
2018-10-11 23:10:45 +02:00
Martijn Walraven
0491af858d Avoid use of object spread in Jest config files to support Node 6 2018-10-11 23:10:09 +02:00
Martijn Walraven
f5d5981ffc Add TypeScript and Jest projects for tests in individual packages 2018-10-11 04:33:23 +02:00
Jesse Rosenberger
dec2b94a0e
Publish
- apollo-cache-control@0.3.0-alpha.0
 - apollo-datasource-rest@0.2.0-alpha.0
 - apollo-datasource@0.2.0-alpha.0
 - apollo-engine-reporting-protobuf@0.1.0-alpha.0
 - apollo-engine-reporting@0.1.0-alpha.0
 - apollo-server-cache-memcached@0.2.0-alpha.0
 - apollo-server-cache-redis@0.2.0-alpha.0
 - apollo-server-caching@0.2.0-alpha.0
 - apollo-server-cloud-functions@2.2.0-alpha.0
 - apollo-server-cloudflare@2.2.0-alpha.0
 - apollo-server-core@2.2.0-alpha.0
 - apollo-server-env@2.1.0-alpha.0
 - apollo-server-errors@2.1.0-alpha.0
 - apollo-server-express@2.2.0-alpha.0
 - apollo-server-hapi@2.2.0-alpha.0
 - apollo-server-integration-testsuite@2.2.0-alpha.0
 - apollo-server-koa@2.2.0-alpha.0
 - apollo-server-lambda@2.2.0-alpha.0
 - apollo-server-micro@2.2.0-alpha.0
 - apollo-server-plugin-base@0.1.0-alpha.0
 - apollo-server@2.2.0-alpha.0
 - apollo-tracing@0.3.0-alpha.0
 - graphql-extensions@0.3.0-alpha.0
2018-10-10 22:30:54 +03:00
Martijn Walraven
11a13cd3dd Remove apollo-server-env as a project reference
We can't use `apollo-server-env` as a project reference because that requires `composite: true`, and that implies `declaration: true`, which doesn't work for `apollo-server-env` because we need to write our own declaration files for re-exported imports.

This commit also removes `apollo-engine-reporting-protobuf` as a reference, which errored out because it doesn't actually contain any TypeScript code.
2018-10-05 23:05:49 +02:00
Martijn Walraven
8932091e67 Add root level tsconfig.json as entry point 2018-10-05 21:48:49 +02:00
Martijn Walraven
1aee215e68 Switch to tsc --build and remove run scripts from packages 2018-10-05 17:48:34 +02:00
Martijn Walraven
fcaa6ad79d Enable TypeScript project references 2018-10-05 17:47:29 +02:00
Hugh Willson
dd86fa8a29 Re-enable Typescript esModuleInterop (#1699)
`esModuleInterop` was enabled in
e4164c8892
to help with importing from packages that use default exports.
Those changes were reverted in
https://github.com/apollographql/apollo-server/pull/1210
to work around a few reported issues. Those issues are no longer
relevant, so this commit re-enables `esModuleInterop`, and
updates all default imports to use the more common (standard)
import syntax.
2018-09-21 16:43:33 +03:00
Jesse Rosenberger
6d6c9ff268
Make it more clear that generateClientInfo is an experimental API.
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
2018-09-20 12:11:56 +03:00
Evans Hauser
86dd95e223
Publish
- apollo-cache-control@0.2.5
 - apollo-engine-reporting@0.0.6
 - apollo-server-cloud-functions@2.1.0
 - apollo-server-cloudflare@2.1.0
 - apollo-server-core@2.1.0
 - apollo-server-express@2.1.0
 - apollo-server-hapi@2.1.0
 - apollo-server-integration-testsuite@2.1.0
 - apollo-server-koa@2.1.0
 - apollo-server-lambda@2.1.0
 - apollo-server-micro@2.1.0
 - apollo-server@2.1.0
 - apollo-tracing@0.2.5
 - graphql-extensions@0.2.1
2018-09-18 15:26:48 -07:00
Jake Dawkins
f3df370b0a Fix header misreporting to engine (#1689)
* fix header reporting being cut short

* added changelog entry & fix npm version
2018-09-18 13:29:54 -07:00
Evans Hauser
96af44e41a
Provide ability to specify client info in traces (#1631)
* Provide ability to specify client info in traces

Adds the createClientInfo to apollo-engine-reporting, which enables the
differentiation of clients based on the request, operation, and
variables. This could be extended to include the response. However for
the first release. It doesn't quite make sense.

* Use extensions and context in createClientInfo

* Remove support for clientAddress

The frontend will not support it in the near future

* create -> generate and make default generator

createClientInfo -> generateClientInfo

* Clarify default values
2018-09-17 22:45:34 -07:00
Evans Hauser
5adae649e3
Publish
- apollo-cache-control@0.2.4
 - apollo-engine-reporting@0.0.5
 - apollo-server-cloud-functions@2.0.4
 - apollo-server-cloudflare@2.0.5
 - apollo-server-core@2.0.7
 - apollo-server-express@2.0.7
 - apollo-server-hapi@2.0.7
 - apollo-server-integration-testsuite@2.0.7
 - apollo-server-koa@2.0.7
 - apollo-server-lambda@2.0.7
 - apollo-server-micro@2.0.7
 - apollo-server@2.0.8
 - apollo-tracing@0.2.4
 - graphql-extensions@0.2.0
2018-09-14 10:35:33 -07:00
nmchaves
e7823e8fc4 catch error if JSON.stringify fails for trace variables 2018-09-13 21:47:35 -07:00
nmchaves
7ac5a17e03 fix tslint errors (shadowed variable names) 2018-09-13 21:29:19 -07:00
C.J. Winslow
408198e5ac Pass the context request and response extension methods (#1547)
* Pass the context along to all the extension methods

Addresses #1343 

With this change you should now be able to implement an extension like so:

```javascript
class MyErrorTrackingExtension extends GraphQLExtension {
    willSendResponse(o) {
        const { context, graphqlResponse } = o

        context.trackErrors(graphqlResponse.errors)

        return o
    }
}
```

Edit by @evans :
fixes #1343
fixes #614 as the request object can be taken from context or from requestDidStart
fixes #631 ""

* Remove context from extra extension functions

The context shouldn't be necessary for format, parse, validation, and
execute. Format generally outputs the state of the extension. Parse and
validate don't depend on the context. Execution includes the context
argument as contextValue

* Move change entry under vNext
2018-09-07 18:10:30 -07:00
Martijn Walraven
996c73063a Publish
- apollo-engine-reporting@0.0.4
 - apollo-server-cloud-functions@2.0.3
 - apollo-server-cloudflare@2.0.4
 - apollo-server-core@2.0.6
 - apollo-server-express@2.0.6
 - apollo-server-hapi@2.0.6
 - apollo-server-integration-testsuite@2.0.6
 - apollo-server-koa@2.0.6
 - apollo-server-lambda@2.0.6
 - apollo-server-micro@2.0.6
 - apollo-server@2.0.7
2018-09-05 17:33:16 +02:00
Evans Hauser
4a409766a5 Add toggle for including error messages in reports (#1615)
Fixes #1613.

We always send traces that includes an error node if the trace has an
error. In the case that sending errors is disabled, we replace the
message and remove the location.

Note that the Engine proxy strips all error information from the traces
with noErrorTraces set. To get errors to show up in the ui, the proxy
sends error counts inside of the aggregated stats reports. To get
similar behavior inside of the apollo server metrics reporting, we
always send a trace and mask out the PII.
2018-09-05 16:01:14 +02:00
Martijn Walraven
b80a8f050c Publish
- apollo-cache-control@0.2.3
 - apollo-datasource-rest@0.1.5
 - apollo-datasource@0.1.3
 - apollo-engine-reporting@0.0.3
 - apollo-server-cache-memcached@0.1.3
 - apollo-server-cache-redis@0.1.3
 - apollo-server-cloud-functions@2.0.2
 - apollo-server-cloudflare@2.0.3
 - apollo-server-core@2.0.5
 - apollo-server-env@2.0.3
 - apollo-server-express@2.0.5
 - apollo-server-hapi@2.0.5
 - apollo-server-integration-testsuite@2.0.5
 - apollo-server-koa@2.0.5
 - apollo-server-lambda@2.0.5
 - apollo-server-micro@2.0.5
 - apollo-server@2.0.6
 - apollo-tracing@0.2.3
 - graphql-extensions@0.1.3
2018-09-03 15:06:00 +02:00
Evans Hauser
f7b5d63d03
Publish
- apollo-cache-control@0.2.2
 - apollo-datasource-rest@0.1.3
 - apollo-datasource@0.1.2
 - apollo-engine-reporting-protobuf@0.0.1
 - apollo-engine-reporting@0.0.2
 - apollo-server-cache-memcached@0.1.2
 - apollo-server-cache-redis@0.1.2
 - apollo-server-caching@0.1.2
 - apollo-server-cloudflare@2.0.0-rc.14
 - apollo-server-core@2.0.2
 - apollo-server-env@2.0.2
 - apollo-server-errors@2.0.2
 - apollo-server-express@2.0.2
 - apollo-server-hapi@2.0.2
 - apollo-server-integration-testsuite@2.0.2
 - apollo-server-koa@2.0.2
 - apollo-server-lambda@2.0.2
 - apollo-server-micro@2.0.2
 - apollo-server@2.0.2
 - apollo-tracing@0.2.2
 - graphql-extensions@0.1.2
2018-08-14 11:49:10 -07:00
Evans Hauser
ef82add05b
Publish
- apollo-cache-control@0.2.1
 - apollo-datasource-rest@0.1.2
 - apollo-datasource@0.1.1
 - apollo-engine-reporting-protobuf@0.0.0
 - apollo-engine-reporting@0.0.1
 - apollo-server-cache-memcached@0.1.1
 - apollo-server-cache-redis@0.1.1
 - apollo-server-caching@0.1.1
 - apollo-server-cloudflare@2.0.0-rc.13
 - apollo-server-core@2.0.1
 - apollo-server-env@2.0.1
 - apollo-server-errors@2.0.1
 - apollo-server-express@2.0.1
 - apollo-server-hapi@2.0.1
 - apollo-server-integration-testsuite@2.0.1
 - apollo-server-koa@2.0.1
 - apollo-server-lambda@2.0.1
 - apollo-server-micro@2.0.1
 - apollo-server@2.0.1
 - apollo-tracing@0.2.1
 - graphql-extensions@0.1.1
2018-08-14 11:05:31 -07:00
Martijn Walraven
2369b06be2 Use strict top-level tsconfig and fix type issues or override per-package 2018-08-11 16:45:03 +02:00
Martijn Walraven
40bc73f61f Remove per-package Jest config and replace with single top-level config 2018-08-11 16:45:03 +02:00
Martijn Walraven
0d89fa7cde Make sure package.json includes clean script 2018-08-11 16:45:03 +02:00
Martijn Walraven
c049792057 Fix setupFiles reference in Jest config 2018-08-11 16:45:03 +02:00
Martijn Walraven
ef4d5e4f95 Switch to using file specifiers and root level dev dependencies only 2018-08-11 16:45:03 +02:00
Martijn Walraven
ea6faf770a Replace prepublish scripts with prepare 2018-08-11 16:45:03 +02:00
Martijn Walraven
06e31c3249 Remove per-package test, coverage and circle scripts 2018-08-11 16:45:03 +02:00
Martijn Walraven
943b91a564 Don't ignore package-lock.json 2018-08-11 16:45:03 +02:00
Renovate Bot
dfa92be140 chore(deps): update dependency @types/graphql to v0.13.4 2018-08-10 08:05:00 +00:00
Renovate Bot
47a1db3142 chore(deps): update dependency @types/lodash to v4.14.116 2018-08-03 06:19:19 +00:00
Renovate Bot
8b4a2f0a73 chore(deps): update dependency graphql-tools to v3.1.1 2018-08-03 04:02:13 +00:00
Renovate Bot
e4108fba4f chore(deps): update dependency graphql-tools to v3.1.0 2018-08-02 05:04:40 +00:00
Evans Hauser
9dd1fec766
Mocha to Jest Test Conversion (#1453)
* 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
2018-07-31 15:40:03 -07:00
Renovate Bot
e77701c772 chore(deps): update dependency jest to v23.4.2 2018-07-31 02:18:27 +00:00
Renovate Bot
4ce11f63a0 chore(deps): update dependency @types/lodash to v4.14.115 2018-07-28 08:07:16 +00:00
Renovate Bot
3ba5440743 chore(deps): update dependency @types/lodash to v4.14.114 2018-07-27 08:01:50 +00:00