add middleware example

This commit is contained in:
unicodeveloper 2018-06-01 22:16:28 +01:00
parent 31609b6853
commit c26affb990

View file

@ -152,7 +152,9 @@ const server = new ApolloServer({
resolvers,
});
registerServer({ server, app }); // app is from an existing express app. Mount middleware here.
app.use(jwtCheck, requireAuth, checkScope); // you can mount several middleware at this point to run before Apollo.
registerServer({ server, app, '/specialUrl' }); // app is from an existing express app. Mount Apollo middleware here. If no path is specified, it defaults to `/graphql`.
```
## `gql`