apollo-server/packages
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
..
apollo-cache-control Publish 2019-02-14 15:25:38 +02:00
apollo-datasource Publish 2019-02-14 15:25:38 +02:00
apollo-datasource-rest Publish 2019-02-14 15:25:38 +02:00
apollo-engine-reporting Publish 2019-02-20 19:00:08 +02:00
apollo-engine-reporting-protobuf Publish 2019-02-14 15:25:38 +02:00
apollo-server Type parameters for context function separately from the context it produces (#2350) 2019-02-21 12:49:04 -05:00
apollo-server-azure-functions Publish 2019-02-20 19:00:08 +02:00
apollo-server-cache-memcached Publish 2019-02-14 15:25:38 +02:00
apollo-server-cache-redis Publish 2019-02-14 15:25:38 +02:00
apollo-server-caching Publish 2019-02-14 15:25:38 +02:00
apollo-server-cloud-functions Publish 2019-02-20 19:00:08 +02:00
apollo-server-cloudflare Publish 2019-02-20 19:00:08 +02:00
apollo-server-core Type parameters for context function separately from the context it produces (#2350) 2019-02-21 12:49:04 -05:00
apollo-server-env Publish 2018-11-07 08:17:21 -08:00
apollo-server-errors Add more accurate typings to formatError (#2343) 2019-02-21 09:10:13 -05:00
apollo-server-express Type parameters for context function separately from the context it produces (#2350) 2019-02-21 12:49:04 -05:00
apollo-server-fastify Publish 2019-02-20 19:00:08 +02:00
apollo-server-hapi Publish 2019-02-20 19:00:08 +02:00
apollo-server-integration-testsuite Publish 2019-02-20 19:00:08 +02:00
apollo-server-koa Publish 2019-02-20 19:00:08 +02:00
apollo-server-lambda Publish 2019-02-20 19:00:08 +02:00
apollo-server-micro Publish 2019-02-20 19:00:08 +02:00
apollo-server-plugin-base Publish 2019-02-20 19:00:08 +02:00
apollo-server-testing Publish 2019-02-20 19:00:08 +02:00
apollo-tracing Publish 2019-02-14 15:25:38 +02:00
graphql-extensions Publish 2019-02-20 19:00:08 +02:00