From ff4d6cc3785aa390c26093e6ca9773f6353e7015 Mon Sep 17 00:00:00 2001 From: Jesse Rosenberger Date: Tue, 26 Feb 2019 09:48:36 +0200 Subject: [PATCH] Pluck the "Context" section from the middle of the "Integrations". This looks like it's been buried in the README.md after several rounds of adding new integrations. This moves it back out on its own. --- README.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 78b6563a..6cf60529 100644 --- a/README.md +++ b/README.md @@ -223,20 +223,6 @@ async function StartServer() { StartServer().catch(error => console.log(error)); ``` -### Context - -The context is created for each request. The following code snippet shows the creation of a context. The arguments are the `request`, the request, and `h`, the response toolkit. - -```js -new ApolloServer({ - typeDefs, - resolvers, - context: async ({ request, h }) => { - return { ... }; - }, -}) -``` - ## Fastify ```js @@ -282,6 +268,20 @@ const server = new ApolloServer({ typeDefs, resolvers }); exports.graphqlHandler = server.createHandler(); ``` +### Context + +The context is created for each request. The following code snippet shows the creation of a context. The arguments are the `request`, the request, and `h`, the response toolkit. + +```js +new ApolloServer({ + typeDefs, + resolvers, + context: async ({ request, h }) => { + return { ... }; + }, +}) +``` + ## Apollo Server Development If you want to develop Apollo Server locally you must follow the following instructions: