Commit graph

1129 commits

Author SHA1 Message Date
Jesse Rosenberger
8f383b3286
README: Update anchor links for installations to be lower-cased.
This will fix npm next time we publish.
2019-02-26 16:30:41 +02:00
Jesse Rosenberger
046327068b
Publish
- apollo-engine-reporting@1.0.7
 - apollo-server-azure-functions@2.4.8
 - apollo-server-cloud-functions@2.4.8
 - apollo-server-cloudflare@2.4.8
 - apollo-server-core@2.4.8
 - apollo-server-express@2.4.8
 - apollo-server-fastify@2.4.8
 - apollo-server-hapi@2.4.8
 - apollo-server-integration-testsuite@2.4.8
 - apollo-server-koa@2.4.8
 - apollo-server-lambda@2.4.8
 - apollo-server-micro@2.4.8
 - apollo-server-plugin-base@0.3.7
 - apollo-server-testing@2.4.8
 - apollo-server@2.4.8
 - graphql-extensions@0.5.7
2019-02-26 16:21:42 +02:00
Jesse Rosenberger
628a5c88fa
Use the README.md from packages/apollo-server as the monorepo root README.md. 2019-02-26 16:17:29 +02:00
Jesse Rosenberger
a9e5776b5c
Remove inaccurate coverage badge, same spirit as 721c4c9b26. 2019-02-26 13:32:45 +02:00
Jesse Rosenberger
11e4f340cf
Revert "Use the root README.md for the apollo-server package."
This reverts commit 25782382b8.

Unfortunately, `npm publish` isn't okay with using a `README.md` from
outside the package's root, even if the README at the root of the repository
is far more reasonable to use for the `apollo-server` package itself.
2019-02-26 13:30:54 +02:00
Jesse Rosenberger
a95421f19b
Publish
- apollo-engine-reporting@1.0.6
 - apollo-server-azure-functions@2.4.7
 - apollo-server-cloud-functions@2.4.7
 - apollo-server-cloudflare@2.4.7
 - apollo-server-core@2.4.7
 - apollo-server-express@2.4.7
 - apollo-server-fastify@2.4.7
 - apollo-server-hapi@2.4.7
 - apollo-server-integration-testsuite@2.4.7
 - apollo-server-koa@2.4.7
 - apollo-server-lambda@2.4.7
 - apollo-server-micro@2.4.7
 - apollo-server-plugin-base@0.3.6
 - apollo-server-testing@2.4.7
 - apollo-server@2.4.7
 - graphql-extensions@0.5.6
2019-02-26 13:21:32 +02:00
Jesse Rosenberger
2807691cdd
Change the restPort within express's datasource.test.ts to another value.
I suspect the fact that this overlaps with the port used in fastify, that it
could be causing some problems when tests are run quickly enough.
2019-02-26 13:17:21 +02:00
Jesse Rosenberger
721c4c9b26
Remove dysfunctional coverall badges.
The coverage of various packages is now reported through codecov.io and can
be seen here: https://codecov.io/gh/apollographql/apollo-server/tree/master/packages
2019-02-26 12:12:25 +02:00
Jesse Rosenberger
25782382b8
Use the root README.md for the apollo-server package. 2019-02-26 12:10:33 +02:00
Jesse Rosenberger
e43b14a9cd
Remove @alpha dist-tag designator from Azure Functions README.md.
It's no longer necessary to install `apollo-server-azure-functions` from the
`alpha` tag!
2019-02-26 11:21:06 +02:00
Jesse Rosenberger
f0a48a5814
Update apollo-server badges. 2019-02-26 11:18:54 +02:00
Jesse Rosenberger
a7597913d2
Remove unnecessary --save flags from npm install commands.
While it used to be required to pass the `--save` flag in order to actually
write the dependency to the project's `package.json` file, this is no longer
the case in recent versions of npm.
2019-02-26 11:18:52 +02:00
Jesse Rosenberger
6d62d2428d
Remove @rc dist-tag suggestions from several package's READMEs. 2019-02-26 11:18:51 +02:00
hrg921
d12f28089d docs: update apollo-server-lambda/README (#2364)
I think 'this' is better than 'the'
2019-02-25 17:33:05 +02:00
Chang Wang
1ef592adeb Fix: Remove incorrect cors option type from apollo-server-express's constructor (#2373)
* Fix: Remove incorrect cors option type from apollo-server-express's constructor

https://github.com/apollographql/apollo-server/pull/2330#discussion_r259773834

* update changelog

* Update CHANGELOG.md
2019-02-25 17:32:18 +02:00
Jesse Rosenberger
62587e037b Publish
- apollo-engine-reporting@1.0.5
 - apollo-server-azure-functions@2.4.6
 - apollo-server-cloud-functions@2.4.6
 - apollo-server-cloudflare@2.4.6
 - apollo-server-core@2.4.6
 - apollo-server-express@2.4.6
 - apollo-server-fastify@2.4.6
 - apollo-server-hapi@2.4.6
 - apollo-server-integration-testsuite@2.4.6
 - apollo-server-koa@2.4.6
 - apollo-server-lambda@2.4.6
 - apollo-server-micro@2.4.6
 - apollo-server-plugin-base@0.3.5
 - apollo-server-testing@2.4.6
 - apollo-server@2.4.6
 - graphql-extensions@0.5.5
2019-02-22 07:21:47 +00:00
Jesse Rosenberger
8b02c0c440
Allow Node.js-like runtimes to identify as Node.js as well. (#2357)
Previously, in order to only load dependencies which only work on Node.js
and fail in non-Node.js environments, we introduced a check which did a
string-comparison of `process.release.name` to see if it is was `node`.

This was first introduced in 9c563fae50 as
part of #2054, but has gone on to be useful for other purposes as well.

Some Node.js forks such as NodeSource's N|Solid, which is a fork of Node.js
which follows-up each Node.js release with a custom build that includes
additional native addons but is otherwise the same, override this value with
their own name.  This means that N|Source returns `nsolid`, despite the fact
that it is almost entirely the same as Node.js.

Luckily, N|Solid leaves the base version of its Node.js in
`process.versions.node` (and additionally adds its own
`process.versions.nsolid`).  By relaxing the string comparison on
`process.release.name`, we should still be able to accurately detect the
environment we want - which is "Close enough to Node.js!".

Fixes https://github.com/apollographql/apollo-server/issues/2356
2019-02-22 09:04:16 +02:00
Jesse Rosenberger
750f0010ca Re-align version numbers after 587c660d.
cc @cheapsteak
2019-02-22 06:37:16 +00:00
Chang Wang
587c660dc1 Publish
- apollo-server-express@2.4.5
 - apollo-server@2.4.5
2019-02-21 14:35:58 -05:00
KATT
7cb33769cb Tests using ApolloServerExpressConfig 2019-02-21 15:46:10 -03:00
KATT
f0a3c69635 export interface ExpressContext 2019-02-21 15:46:07 -03:00
Chang Wang
879ed19034 Publish
- apollo-cache-control@0.5.2
 - apollo-datasource-rest@0.3.2
 - apollo-engine-reporting@1.0.4
 - apollo-server-azure-functions@2.4.4
 - apollo-server-cloud-functions@2.4.4
 - apollo-server-cloudflare@2.4.4
 - apollo-server-core@2.4.4
 - apollo-server-errors@2.2.1
 - apollo-server-express@2.4.4
 - apollo-server-fastify@2.4.4
 - apollo-server-hapi@2.4.4
 - apollo-server-integration-testsuite@2.4.4
 - apollo-server-koa@2.4.4
 - apollo-server-lambda@2.4.4
 - apollo-server-micro@2.4.4
 - apollo-server-plugin-base@0.3.4
 - apollo-server-testing@2.4.4
 - apollo-server@2.4.4
 - apollo-tracing@0.5.2
 - graphql-extensions@0.5.4
2019-02-21 13:05:33 -05:00
Chang Wang
a4ebadc876
Type parameters for context function separately from the context it produces (#2350)
* Add AS constructor with context usage to tests

* fix(typing): Context template type should be 'object' and not 'any'

```context?: ContextFunction<ExpressContext, any> | Context<any>;```
is
```context?: ContextFunction<ExpressContext, any> | any;```
which is
```context?: any;```

https://github.com/Microsoft/TypeScript/issues/18568

Since the ContextFunction<...> part is ignored, no type hinting will be provided when a function is passed to `context`. We don't really mean `any`, we mean an object with any shape, so we should use `object` instead

* fix(typing): type ContextFunction params separately from resulting context object

* Update changelog

* rename: ContextContent -> ProducedContext
2019-02-21 12:49:04 -05:00
Chang Wang
8850e0f7ed
Add more accurate typings to formatError (#2343)
* Type formatErrors function to specify that it accepts and returns ApolloError

* Update changelog

* type(formatErrors): accept GraphQLError, return GraphQLFormattedError

* update changelog
2019-02-21 09:10:13 -05:00
Jesse Rosenberger
e1d7078817
Publish
- apollo-engine-reporting@1.0.3
 - apollo-server-azure-functions@2.4.3
 - apollo-server-cloud-functions@2.4.3
 - apollo-server-cloudflare@2.4.3
 - apollo-server-core@2.4.3
 - apollo-server-express@2.4.3
 - apollo-server-fastify@2.4.3
 - apollo-server-hapi@2.4.3
 - apollo-server-integration-testsuite@2.4.3
 - apollo-server-koa@2.4.3
 - apollo-server-lambda@2.4.3
 - apollo-server-micro@2.4.3
 - apollo-server-plugin-base@0.3.3
 - apollo-server-testing@2.4.3
 - apollo-server@2.4.3
 - graphql-extensions@0.5.3
2019-02-20 19:00:08 +02:00
Jesse Rosenberger
e727a252fe
Replace Slack shields in project README.mds with Spectrum shields. (#2345)
As we're moving the community from Slack to Spectrum, its time to update
these shields from our project README files (which show on npm and in
GitHub) to reflect the new home for conversation.

If you haven't already joined the new Apollo community on Spectrum.chat,
visit https://spectrum.chat/apollo/ to join the discussion!

For more details on the move, checkout the Apollo blog post by @hwillson:

https://blog.apollographql.com/goodbye-slack-hello-spectrum-8fa6b979645b
2019-02-20 17:55:16 +02:00
Jesse Rosenberger
72f410da46
Stop casting to net.AddressInfo type as that should already be inferred.
This is necessary after the changes in 0f75909e35
and https://github.com/apollographql/apollo-server/pull/2344, as the
`AddressInfo` type didn't become available until a future version of
`@types/node`.

Regardless, it seems to me that this should be inferred without any problem
and we don't actually rely on the `AddressInfo` type, and instead are only
looking for an interface which has `port`, `address` and `family`, as the
inferred return value from `http.Server.prototype.address()` does.
2019-02-20 17:11:09 +02:00
Jesse Rosenberger
0d4fb48d9a
Merge branch 'master' into patch-1 2019-02-20 13:09:50 +02:00
Jesse Rosenberger
c1607cb919
Switch to import = for ws types, since @types/ws uses export =.
While it would be perfectly fine to use `import *` in this particular case,
we've moved away from the star-import pattern in this repository, instead
preferring the `esModuleInterop` compiler option which seems to be the
direction that TypeScript is moving as it's now the default with `tsc --init`.

TypeScript clearly lost its battle with `import *` which many consider to
have been an incorrect direction in the first place.  Some build tools won't
work with star imports, and using them can make some optimizations more
difficult.  By avoiding this pattern here, hopefully we'll avoid moving back
in that direction inadvertently.

Here's a read I found at one point which roughly explains:

https://itnext.io/great-import-schism-typescript-confusion-around-imports-explained-d512fc6769c2
2019-02-20 12:45:42 +02:00
Jesse Rosenberger
6905e6dfdd
Use specific types from aws-lambda, rather than star-imports.
We've generally moved away from the star-import pattern which TypeScript
also no longer generates with its default `tsc --init` configuration, so it
seems to make sense to keep picking exactly what we want since this pattern
is no longer forced upon us by TypeScript.
2019-02-20 12:45:32 +02:00
Chang Wang
63089961f5 Provide more accurate types for apollo-server-express's ContextFunction (#2330)
* typing: context function could return value synchronously

* Create ApolloServerExpressConfig type that has req and res in context

* Have apollo-server-express's constructor also use the express-specific config

* Update changelog
2019-02-19 20:00:12 +02:00
Ralph
2f773625c0 apollo-server-koa: Respond to OPTIONS (#2288)
Closes #2253
2019-02-19 18:01:17 +02:00
Arthur Petrie
212eb94430
Merge branch 'master' into patch-1 2019-02-19 15:55:37 +01:00
Arthur Petrie
5efa6a5175
Update ApolloServer.ts
Fix lambda types import: aws-lambda types has no default export
2019-02-19 15:54:11 +01:00
Jesse Rosenberger
c1669c3d74
Publish
- apollo-cache-control@0.5.1
 - apollo-datasource-rest@0.3.1
 - apollo-datasource@0.3.1
 - apollo-engine-reporting-protobuf@0.2.1
 - apollo-engine-reporting@1.0.2
 - apollo-server-azure-functions@2.4.2
 - apollo-server-cache-memcached@0.3.1
 - apollo-server-cache-redis@0.3.1
 - apollo-server-caching@0.3.1
 - apollo-server-cloud-functions@2.4.2
 - apollo-server-cloudflare@2.4.2
 - apollo-server-core@2.4.2
 - apollo-server-express@2.4.2
 - apollo-server-fastify@2.4.2
 - apollo-server-hapi@2.4.2
 - apollo-server-integration-testsuite@2.4.2
 - apollo-server-koa@2.4.2
 - apollo-server-lambda@2.4.2
 - apollo-server-micro@2.4.2
 - apollo-server-plugin-base@0.3.2
 - apollo-server-testing@2.4.2
 - apollo-server@2.4.2
 - apollo-tracing@0.5.1
 - graphql-extensions@0.5.2
2019-02-14 15:25:38 +02:00
Jesse Rosenberger
f988a30e8c
Publish
- apollo-cache-control@0.5.1-rc.0
 - apollo-datasource-rest@0.3.1-rc.0
 - apollo-datasource@0.3.1-rc.0
 - apollo-engine-reporting-protobuf@0.2.1-rc.0
 - apollo-engine-reporting@1.0.2-rc.0
 - apollo-server-azure-functions@2.4.2-rc.0
 - apollo-server-cache-memcached@0.3.1-rc.0
 - apollo-server-cache-redis@0.3.1-rc.0
 - apollo-server-caching@0.3.1-rc.0
 - apollo-server-cloud-functions@2.4.2-rc.0
 - apollo-server-cloudflare@2.4.2-rc.0
 - apollo-server-core@2.4.2-rc.0
 - apollo-server-express@2.4.2-rc.0
 - apollo-server-fastify@2.4.2-rc.0
 - apollo-server-hapi@2.4.2-rc.0
 - apollo-server-integration-testsuite@2.4.2-rc.0
 - apollo-server-koa@2.4.2-rc.0
 - apollo-server-lambda@2.4.2-rc.0
 - apollo-server-micro@2.4.2-rc.0
 - apollo-server-plugin-base@0.3.2-rc.0
 - apollo-server-testing@2.4.2-rc.0
 - apollo-server@2.4.2-rc.0
 - apollo-tracing@0.5.1-rc.0
 - graphql-extensions@0.5.2-rc.0
2019-02-14 15:16:36 +02:00
Jesse Rosenberger
8f204f4906
Align apollo-server-fastify's version in preparation for publishing.
This will allow Lerna to release the first version as
`apollo-server-fastify@2.4.2`.
2019-02-14 15:02:38 +02:00
Jesse Rosenberger
8ac2884cfa
Merge branch 'master' into re-stage-pr-1971 2019-02-14 15:01:00 +02:00
Trevor Scheer
4f24edc1f6 Migrate apollo-graphql package to apollo-tooling repo (#2316)
The purpose of this PR is to remove the `apollo-graphql` package from this repository, to be added to `apollo-tooling` instead.

https://github.com/apollographql/apollo-tooling

Ref: https://github.com/apollographql/apollo-tooling/pull/1018
2019-02-14 12:41:58 +02:00
Jesse Rosenberger
8c71adf2aa
azure-functions: Add missing test configuration files. (#2312)
These missing configurations, which weren't identified in the original
implementation of `apollo-server-azure-functions` in #1926, are responsible
for the failures which have surfaced in the #2228, which updates Jest to v24.x.
2019-02-13 20:24:32 +02:00
Jesse Rosenberger
e7709588fb
Update to apollo-tools@0.3.3, even for nested dependencies.
There was a breaking change to `core-js` in `3.0.0-beta.12` which seems to
warrant this extra protection.
2019-02-13 16:16:45 +02:00
Chang Wang
5918e188d9 Follow-up #2298 with regression test (#2308)
* test: ensure "total duration" > "duration of resolvers"

Add test for https://github.com/apollographql/apollo-server/pull/2298

* Update tracing duration test to be more comprehensive

Previously we were only guaranteeing that individual resolvers didn't have a duration longer than the total duration. The updated test guarantees that the duration (from when the first resolver started to when the last resolver ended) should be less than total duration

* Add another resolver to tracing test

* Prefer `const` over `let` for variables which aren't mutated.
2019-02-13 15:09:38 +02:00
Ben Newman
4116b2ff4a
Publish
- apollo-engine-reporting@1.0.1
 - apollo-server-azure-functions@2.4.1
 - apollo-server-cloud-functions@2.4.1
 - apollo-server-cloudflare@2.4.1
 - apollo-server-core@2.4.1
 - apollo-server-express@2.4.1
 - apollo-server-hapi@2.4.1
 - apollo-server-integration-testsuite@2.4.1
 - apollo-server-koa@2.4.1
 - apollo-server-lambda@2.4.1
 - apollo-server-micro@2.4.1
 - apollo-server-plugin-base@0.3.1
 - apollo-server-testing@2.4.1
 - apollo-server@2.4.1
 - graphql-extensions@0.5.1
2019-02-12 16:34:47 -05:00
Ben Newman
b89de2675b
Allow passing parseOptions to ApolloServerBase constructor. (#2289) 2019-02-12 14:09:12 -05:00
Ben Newman
3f7a7f3d67
Avoid importing entire crypto dependency tree if not in Node.js. (#2304)
The apollo-server-core package uses Node's built-in crypto module only to
create SHA-256 and -512 hashes.

When we're actually running in Node, the native crypto library is clearly
the best way to create these hashes, not least because we can assume it
will be available without having to bundle it first.

Outside of Node (such as in React Native apps), bundlers tend to fall back
on the crypto-browserify polyfill, which comprises more than a hundred
separate modules. Importing this polyfill at runtime (likely during
application startup) takes precious time and memory, even though almost
all of it is unused.

Since we only need to create SHA hashes, we can import the much smaller
sha.js library in non-Node environments, which happens to be what
crypto-browserify uses for SHA hashing, and is a widely used npm package
in its own right: https://www.npmjs.com/package/sha.js.
2019-02-12 14:07:42 -05:00
Chang Wang
bf120018bf Await on graphql.execute() before calling executionDidEnd handler (AS-59) (#2298)
* Wait on graphql.execute() before calling end handler

* Update changelog
2019-02-12 20:34:56 +02:00
Jacob Marshall
e3070a51d6 Correct Azure Functions type definitions (#2287)
* Rename azureFunctions.d.ts to azureFunctions.ts

See https://github.com/apollographql/apollo-server/issues/2085#issuecomment-449686772

* Update CHANGELOG.md
2019-02-12 18:28:12 +02:00
Ben Newman
543b9c8432
Require apollo-engine-reporting only if EngineReportingAgent used. (#2305)
When getEngineServiceId does not return a truthy value, we can save memory
and startup time by avoiding importing apollo-engine-reporting, which
(among its other dependencies) imports the protobuf.js implementation.
2019-02-12 11:21:07 -05:00
Ben Newman
96351a4db6 Remove unused lodash dependency. (#2303)
The only usage of lodash was removed by @martijnwalraven in commit
a09d514e59.
2019-02-12 17:44:22 +02:00
Jesse Rosenberger
b4df18b31a
Merge branch 'master' into re-stage-pr-1971 2019-02-08 12:48:41 +02:00