@as-integrations/koa
Advanced tools
Changelog
1.1.0
#130 c504479
Thanks @ryota-ka! - Parameterize the returned Middleware type so that this library can be used along with a context-parameterized Koa app.
In order to utilize this feature, provide your Koa app's State
and Context
types as type arguments to the koaMiddleware
function.
If you use a context
function (for Apollo Server), the State
and Context
types are positions 1 and 2 like so:
type KoaState = { state: object };
type KoaContext = { context: object };
koaMiddleware<GraphQLContext, KoaState, KoaContext>(
new ApolloServer<GraphQLContext>(),
//...
{
context: async ({ ctx }) => ({ graphqlContext: {} }),
},
);
If you don't use a context
function, the State
and Context
types are positions 0 and 1 like so:
type KoaState = { state: object };
type KoaContext = { context: object };
koaMiddleware<KoaState, KoaContext>(
new ApolloServer<GraphQLContext>(),
//...
);
Changelog
1.0.0
#117 4567c98
Thanks @trevor-scheer! - Drop support for Node.js 14, require v16+
The only change required for users to take this update is to upgrade their Node.js version to v16+. No other breaking changes.
Changelog
0.3.0
bb28b66
Thanks @laverdet! - Implement support for the @defer directive. In order to use this feature, you must be using an appropriate version of graphql
. At the time of writing this, @defer is only available in v17 alpha versions of the graphql
package, which is currently not officially supported. Due to peer dependencies, you must install graphql like so in order to force v17:
npm i graphql@alpha --legacy-peer-deps
Changelog
0.1.0
61106d1
Thanks @matthew-gordon! - Update Apollo Server dependencies, add explicit non-support for incremental delivery for now"