Commit graph

395 commits

Author SHA1 Message Date
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
Martijn Walraven
04cf5795d5 Standardize on "types" and move it after "main" in package.json 2018-08-01 10:13:16 +02:00
Martijn Walraven
9d053d6c93 Remove deprecated "typescript"/"definition" from package.json
This was only used by https://github.com/DefinitelyTyped/tsd, and hasn't been required since TypeScript 1.6.
2018-08-01 10:09:36 +02: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
Evans Hauser
04e0d5bce0
Publish
- apollo-cache-control@0.2.0
 - apollo-datasource-rest@0.1.0
 - apollo-datasource@0.1.0
 - apollo-engine-reporting@0.0.0
 - apollo-server-cache-memcached@0.1.0
 - apollo-server-cache-redis@0.1.0
 - apollo-server-caching@0.1.0
 - apollo-server-cloudflare@2.0.0-rc.12
 - apollo-server-core@2.0.0
 - apollo-server-env@2.0.0
 - apollo-server-errors@2.0.0
 - apollo-server-express@2.0.0
 - apollo-server-hapi@2.0.0
 - apollo-server-integration-testsuite@2.0.0
 - apollo-server-koa@2.0.0
 - apollo-server-lambda@2.0.0
 - apollo-server-micro@2.0.0
 - apollo-server@2.0.0
 - apollo-tracing@0.2.0
 - graphql-extensions@0.1.0
2018-07-19 12:49:55 -07:00
Martijn Walraven
c4d3a93e7b Make initialize method in data sources optional 2018-07-18 16:46:46 -07:00
Martijn Walraven
eeeea09ce5 Publish
- apollo-cache-control@0.2.0-rc.4
 - apollo-datasource-rest@0.1.0-rc.11
 - apollo-datasource@0.1.0-rc.11
 - apollo-engine-reporting@0.0.0-rc.5
 - apollo-server-caching@0.1.0-rc.11
 - apollo-server-cloudflare@2.0.0-rc.11
 - apollo-server-core@2.0.0-rc.11
 - apollo-server-env@2.0.0-rc.11
 - apollo-server-errors@2.0.0-rc.11
 - apollo-server-express@2.0.0-rc.11
 - apollo-server-hapi@2.0.0-rc.11
 - apollo-server-integration-testsuite@2.0.0-rc.11
 - apollo-server-koa@2.0.0-rc.11
 - apollo-server-lambda@2.0.0-xrc.11
 - apollo-server-memcached@0.1.0-rc.11
 - apollo-server-micro@2.0.0-rc.11
 - apollo-server-redis@0.1.0-rc.11
 - apollo-server@2.0.0-rc.11
 - apollo-tracing@0.2.0-rc.4
 - graphql-extensions@0.1.0-rc.5
2018-07-17 16:11:33 -07:00
Evans Hauser
9518c0ff1a
Publish
- apollo-cache-control@0.2.0-rc.3
 - apollo-datasource-rest@0.1.0-rc.10
 - apollo-datasource@0.1.0-rc.10
 - apollo-engine-reporting@0.0.0-rc.4
 - apollo-server-caching@0.1.0-rc.10
 - apollo-server-cloudflare@2.0.0-rc.10
 - apollo-server-core@2.0.0-rc.10
 - apollo-server-env@2.0.0-rc.10
 - apollo-server-errors@2.0.0-rc.10
 - apollo-server-express@2.0.0-rc.10
 - apollo-server-hapi@2.0.0-rc.10
 - apollo-server-integration-testsuite@2.0.0-rc.10
 - apollo-server-koa@2.0.0-rc.10
 - apollo-server-lambda@2.0.0-xrc.10
 - apollo-server-memcached@0.1.0-rc.10
 - apollo-server-micro@2.0.0-rc.10
 - apollo-server-redis@0.1.0-rc.10
 - apollo-server@2.0.0-rc.10
 - apollo-tracing@0.2.0-rc.3
 - graphql-extensions@0.1.0-rc.4
2018-07-17 10:55:45 -07:00
Evans Hauser
0144d4b2db
Publish
- apollo-cache-control@0.2.0-rc.2
 - apollo-datasource-rest@0.1.0-rc.9
 - apollo-datasource@0.1.0-rc.9
 - apollo-engine-reporting@0.0.0-rc.3
 - apollo-server-caching@0.1.0-rc.9
 - apollo-server-cloudflare@2.0.0-rc.9
 - apollo-server-core@2.0.0-rc.9
 - apollo-server-env@2.0.0-rc.9
 - apollo-server-errors@2.0.0-rc.9
 - apollo-server-express@2.0.0-rc.9
 - apollo-server-hapi@2.0.0-rc.9
 - apollo-server-integration-testsuite@2.0.0-rc.9
 - apollo-server-koa@2.0.0-rc.9
 - apollo-server-lambda@2.0.0-xrc.9
 - apollo-server-memcached@0.1.0-rc.9
 - apollo-server-micro@2.0.0-rc.9
 - apollo-server-redis@0.1.0-rc.9
 - apollo-server@2.0.0-rc.9
 - apollo-tracing@0.2.0-rc.2
 - graphql-extensions@0.1.0-rc.3
2018-07-17 10:44:15 -07:00
Martijn Walraven
15705b9919 Pass in DataSourceConfig object instead of positional args 2018-07-16 18:43:54 -07:00
Evans Hauser
e04a570f7e
pin internal dependencies (#1361) 2018-07-16 16:15:10 -07:00
Evans Hauser
fa6c973f36
Fix and Export Extension and Playground Types (#1360)
* export playground types

* make playground configuration recursively partial
2018-07-16 15:49:20 -07:00
renovate[bot]
3b3c50a1ab chore(deps): pin dependencies (#1346) 2018-07-16 09:56:51 -07:00
Evans Hauser
db6fdd32f1
Publish
- apollo-cache-control@0.2.0-rc.1
 - apollo-datasource-rest@2.0.0-rc.8
 - apollo-datasource@2.0.0-rc.8
 - apollo-engine-reporting@0.0.0-rc.2
 - apollo-server-caching@2.0.0-rc.8
 - apollo-server-cloudflare@2.0.0-rc.8
 - apollo-server-core@2.0.0-rc.8
 - apollo-server-env@2.0.0-rc.8
 - apollo-server-errors@2.0.0-rc.8
 - apollo-server-express@2.0.0-rc.8
 - apollo-server-hapi@2.0.0-rc.8
 - apollo-server-integration-testsuite@2.0.0-rc.8
 - apollo-server-koa@2.0.0-rc.8
 - apollo-server-lambda@2.0.0-xrc.8
 - apollo-server-memcached@2.0.0-rc.8
 - apollo-server-micro@2.0.0-rc.8
 - apollo-server-redis@2.0.0-rc.8
 - apollo-server@2.0.0-rc.8
 - apollo-tracing@0.2.0-rc.1
 - graphql-extensions@0.1.0-rc.2
2018-07-13 17:49:39 -07:00
Evans Hauser
990d915aec
Apollo Server 2: Remove formatParams (#1331)
* remove formatParams

* remove formatParams from documentation

* check for valid query string after persisted query mapping

* fix sentence about different logging and label extensions as experimental

* mark graphql-extensions as more experimental
2018-07-13 09:44:13 -07:00
Evans Hauser
78dcf4fccf
remove calculate headers as a function (#1337) 2018-07-13 09:43:28 -07:00
Adam Zionts
11b867114e Move gui option into constructor and use playground (#1297)
* Add a wider diversity of `gui` options

Although I know we want to remain less tied to the GraphQL Playground
GUI options, we definitely want to support a wider variety of options to
be passed in. This adds support for specifying partial options either
statically or dynamically for the gui, which can be extended to allow
for a wider array of guis than only GraphQL playground.

* Add boolean option and configuration for tabs

* move gui setting into ApolloServer Constructor

* document playground configuration in the constructor

* update playground types and fixed micro + koa integrations

* change gui to playground

* docs: change gui to playground

* fix logic for playground creation
2018-07-11 15:42:00 -07:00
Martijn Walraven
f055d282e0 Extract abstract DataSource superclass into apollo-datasource package 2018-07-11 15:29:46 -07:00
Prosper Otemuyiwa
61b4939327
Enable GraphQLUpload for Apollo Server 2.0 (#1322)
* export GraphQLUpload

* fix GraphQLScalar typing
2018-07-10 05:36:34 +01:00
Evans Hauser
13b796fe34
Publish
- apollo-cache-control@0.2.0-rc.0
 - apollo-datasource-rest@2.0.0-rc.7
 - apollo-engine-reporting@0.0.0-rc.1
 - apollo-server-caching@2.0.0-rc.7
 - apollo-server-cloudflare@2.0.0-rc.7
 - apollo-server-core@2.0.0-rc.7
 - apollo-server-env@2.0.0-rc.7
 - apollo-server-errors@2.0.0-rc.7
 - apollo-server-express@2.0.0-rc.7
 - apollo-server-hapi@2.0.0-rc.7
 - apollo-server-integration-testsuite@2.0.0-rc.7
 - apollo-server-koa@2.0.0-rc.7
 - apollo-server-lambda@2.0.0-rc.7
 - apollo-server-memcached@2.0.0-rc.7
 - apollo-server-micro@2.0.0-rc.7
 - apollo-server-redis@2.0.0-rc.7
 - apollo-server@2.0.0-rc.7
 - apollo-tracing@0.2.0-rc.0
 - graphql-extensions@0.1.0-rc.1
2018-07-09 19:32:59 -07:00
Martijn Walraven
f551e2bb44 Use apq prefix for persisted query caching 2018-07-09 19:28:21 -07:00
Martijn Walraven
9e60f42845 Use main cache for persisted queries by default 2018-07-09 19:25:09 -07:00
Martijn Walraven
d01b18a704 Update GraphQL Playground version 2018-07-09 16:35:30 -07:00
Martijn Walraven
94d4d4968c Use for-of loops instead of standard for loops 2018-07-04 22:31:55 +02:00
Martijn Walraven
4114bc5a0b Enable strict typing for apollo-server-core and fix issues 2018-07-04 21:31:55 +02:00
Danilo Bürger
73a5da149a Replaced RESTDataSource with generic DataSource typing (#1293) 2018-07-04 09:26:39 +02:00
C. T. Lin
8c8729f066 fix README badge links and test imports (#1281) 2018-07-03 10:32:02 -07:00
Evans Hauser
63f6b4790b
Publish
- apollo-datasource-rest@2.0.0-rc.6
 - apollo-engine-reporting@0.0.0-rc.0
 - apollo-server-caching@2.0.0-rc.6
 - apollo-server-cloudflare@2.0.0-rc.6
 - apollo-server-core@2.0.0-rc.6
 - apollo-server-env@2.0.0-rc.6
 - apollo-server-errors@2.0.0-rc.6
 - apollo-server-express@2.0.0-rc.6
 - apollo-server-hapi@2.0.0-rc.6
 - apollo-server-integration-testsuite@2.0.0-rc.6
 - apollo-server-lambda@2.0.0-rc.6
 - apollo-server-memcached@2.0.0-rc.6
 - apollo-server-redis@2.0.0-rc.6
 - apollo-server@2.0.0-rc.6
 - graphql-extensions@0.1.0-rc.0
2018-06-29 11:27:36 -07:00
Evans Hauser
e0f7052fb1
Errors Lifecycle: user extensions > engine reporting > formatError (#1272)
* enable willSendResponse to return a modified response

* add formatError as an extension that wraps engine reporting

* ensure that formatError once on every error path

* move old formatError express tests into integration suite

* add error lifecycle with minimal engine reporting check

* increase granularity of formatError test

* return 400 error for GraphQL error created by context

* add check for internal server error for errors thrown in context

* comment about context error status code
2018-06-29 10:36:52 -07:00
Martijn Walraven
84233d2010 Centralize playgroundVersion in ApolloServerBase and remove pass-through of gui options 2018-06-29 13:57:03 +02:00
Martijn Walraven
c2e4dfb265 Import graphql-extensions+apollo-engine-reporting/no global apollo-server-env (#1259)
* Export polyfills and types separately

* More imports from apollo-server-env

* Initial commit

* Add .npmignore to avoid ignoring lib when publishing

* 0.0.2

* Reorganize code and clean up GraphQLExtension interface

* 0.0.3

* Add support for timing callbacks and add GraphQLExtensionStack

* 0.0.4

* Downgrade target in tsconfig.json from es2015 to es5

* 0.0.5

* Bump `graphql` peerDependency. (#3)

* 0.0.6

* Update dependencies

* 0.0.7

* whenResultIsFinished fix for array results (#4)

* 0.0.8

* [apollo-bot] Update the Issue/PR Templates with auto label (#6)

* Bump `graphql` peerDependency. (#7)

* Update `graphql` peer dependency range to allow 0.13.x. (#8)

* Update `devDependencies` to latest versions. (#9)

* dev: Update TypeScript to latest version, v2.7.2.

* dev: Update `graphql` to latest version, v0.13.2.

* dev: Update jest & dependencies to latest versions.

* dev: Update type definitions for `graphql`, `node` and `jest`.

* Allow `undefined` return values to `GraphQLExtension`'s `format()`. (#10)

In some cases, it's conceivable that the `format()` method may need to abort
its decision to provide extension information at runtime, in the event that
it doesn't have the proper information to return a full-result.

The `format` method already removed false-y results, so this simply changes
the types to allow the same.

* 0.0.9

* Fix lifecycle method invocations on extensions

* 0.0.10

* Add changelog

* Upgrade to TypeScript 2.8

Makes my editor integration happier (a bugfix in tsserver I think)

* Add tslint and prettier

Same configuration as apollo-engine-js

* Remove magic from GraphQLExtensionStack constructor

It's not hard to consistently pass in an actual extension object to this
low-level API.

* New extension API: didStart handlers return didEnd handlers

This is a backwards-incompatible change: GraphQLExtension implementations and
users of GraphQLExtensionStack (ie apollo-server-core) must change their
implementations, if they implement any of the xDidStart/xDidEnd APIs.

This allows "didEnd" handlers to refer to closure variables from the "didStart"
handler rather than needing to store state on the extension.

The new "didEnd" handlers run in the opposite order of the "didStart" handlers,
so that they properly nest.

* 0.1.0-beta.0

* Changelog

* Add magic back into GraphQLExtensionStack constructor

But now it actually gets more context (the execution arguments) and doesn't have
to be a constructor.

* 0.1.0-beta.1

* Export more types

* 0.1.0-beta.2

* Fix lifecycle handlers to pass proper "this"

* 0.1.0-beta.3

* Pass options directly to start handlers; eliminate factory again

* 0.1.0-beta.4

* error handling in didEnd

* 0.1.0-beta.5

* pass multiple errors to EndHandler

* 0.1.0-beta.6

* add willSendResponse

* 0.1.0-beta.7

* prettier

* setFieldResolver for custom fieldResolver

* reverse

* get more initial options into requestDidStart

* 0.1.0-beta.8

* 0.1.0-beta.9

* Actually, we already get the fieldResolver!

* 0.1.0-beta.10

* work without extensionStack

* 0.1.0-beta.11

* 0.1.0-beta.12

* Send errors to willResolveField callback

* 0.1.0-beta.13

* willSendResponse can return a result

* 0.1.0-beta.14

* Revert 1063be8..56912fc

This reverts commit 1063be8..56912fc.

* add PQ options to requestDidStart

* 0.1.0-beta.14

* 0.1.0-beta.15

* Initialize an empty TypeScript/Jest package

Template based on apollo-engine-js

* Basic trace node structure building

* basic timing

* Checkpoint towards signature implementation

The new signature implementation does not try to compress whitespace.

* Basic signature implementation

* progress towards actual reporting

* basic checkpoint for reporting

* 0.0.0-beta.1

* pull in @types/long, since it is in the external api

* 0.0.0-beta.2

* get rid of Long

* 0.0.0-beta.3

* debug log request what happened

* 0.0.0-beta.4

* 0.0.0-beta.5

* correct url

* 0.0.0-beta.6

* request headers

* 0.0.0-beta.7

* leave out a few headers

* 0.0.0-beta.8

* prettier

* move stuff into multiple files, and stop exporting the extension

* lots of doc comments

* address agent.ts XXX comments

* implement privateVariables

simplify API by removing flush() and allowing flush-ers to just call sendReport
directly

* privateHeaders and error tracking

* gzip, signals

* fix test

* 0.0.0-beta.9

* Error handling for reports

* 0.0.0-beta.10

* no need to include boring stacktrace

* 0.0.0-beta.11

* tweak error reporting

* 0.0.0-beta.12

* package-lock update (npm@6?)

* Reduce target report size to 512KB from 4MB.

Load testing revealed that protobuf encoding for large FullTraceReports could
tie up CPU and reduce p99 request latency (eg, to 200ms from 10ms). Reducing the
default target report size spreads out the encoding time and mitigates the
impact on latency.  If this is not acceptable for all users, we may have to
investigate reintroducing agent-side stats aggregation to keep report sizes
small.

* 0.0.0-beta.13

* Encode Traces as they come in

This improves p99 times with little effect on p50 times. It also lets us get rid
of the heuristic average trace size estimation.

* 0.0.0-beta.14

* support PQ fields

* npm audit fix

* 0.0.0-beta.15

* ignore coverage

* Make the default signature more aggressive

We'd rather tell people confused by literal removal to tweak the signature than
tell people causing outages to do so.

* 0.0.0-beta.16

* Remove obsolete files from graphql-extensions and apollo-engine-reporting

* Fix dependencies and configs

* Fix apollo-server-cloudflare to import from apollo-server-env

* Fix compilation and test configs

* Get all tests passing again

* Switch to Lerna independent versioning

* Polyfill promisify for Node < 8 and load polyfills in tests

* ES2016 exponentiation operator is only supported in Node > 6

* add dependency cache for circle

* add missing env dependencies in REST datasource
2018-06-27 16:29:00 -07:00
Matías Olivera
8ef18187ae Fix graphql-tools/subscriptions dependencies and exports (#1257)
* Reorder dependencies

* Fix dependencies and exports

* Remove unused exports
2018-06-27 12:09:38 -07:00
Martijn Walraven
7e35305353 Always clone the context if it's not a function
Fixes #1247.
2018-06-26 10:40:41 +02:00
Evans Hauser
3ad05191bd
v2.0.0-rc.5 2018-06-25 16:51:07 -07:00
David Glasser
2ca26ab29b v2.0.0-rc.4 2018-06-25 13:58:12 -07:00
David Glasser
325f11408e apollo-engine-reporting: more aggressive signataure 2018-06-25 13:58:03 -07:00
Martijn Walraven
acedc2690b v2.0.0-rc.3 2018-06-24 12:30:42 +02:00
Evans Hauser
846579db33
update README's and remove docs for registerServer (fixes #1216) 2018-06-22 17:51:56 -07:00
David Glasser
049a61a368 Send APQ info to traces 2018-06-22 17:25:41 -07:00
Evans Hauser
e62dc4e97d
AS2: Support APQ for Batches (#1234)
* add handling of persisted queries for batched requests

* Update runHttpQuery.ts

* fix prettier
2018-06-22 16:10:01 -07:00
Evans Hauser
98fd7ae1fd
test cache-control set to false after bug from #1217 2018-06-22 12:16:04 -07:00
Evans Hauser
4770f381d3
v2.0.0-rc.2 2018-06-21 19:53:33 -07:00
Matías Olivera
944a641770 Add missing apollo-upload-server dependency (#1221)
* Add missing apollo-upload-server dependency

* Reorder dependencies (drive-by)
2018-06-21 19:36:18 -07:00
David Glasser
742fb41bc3 Amortize encoding over each trace 2018-06-21 16:06:36 -07:00
Evans Hauser
3bc09decb4
v2.0.0-rc.1 2018-06-21 15:33:07 -07:00