Skip to content

Commit 9d4d3cd

Browse files
updated docs to reference apollo-server and updated keywords in package
1 parent 2fe101d commit 9d4d3cd

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ const UnknownError = createError('UnknownError', {
4040
export const baseResolver = createResolver(
4141
//incoming requests will pass through this resolver like a no-op
4242
null,
43-
44-
/*
45-
Only mask outgoing errors that aren't already apollo-errors,
43+
44+
/*
45+
Only mask outgoing errors that aren't already apollo-errors,
4646
such as ORM errors etc
4747
*/
4848
(root, args, context, error) => isInstance(error) ? error : new UnknownError()
@@ -79,7 +79,7 @@ export const isAdminResolver = isAuthenticatedResolver.createResolver(
7979
the client within the `errors` array in the response.
8080
*/
8181
if (!user.isAdmin) throw new ForbiddenError();
82-
82+
8383
/*
8484
Since we aren't returning anything from the
8585
request resolver, the request will continue on
@@ -134,7 +134,7 @@ const banUser = isAdminResolver.createResolver(
134134
For admin users, let's tell the user what actually broke
135135
in the case of an unhandled exception
136136
*/
137-
137+
138138
if (!isInstance(error)) throw new ExposedError({
139139
// overload the message
140140
message: error.message
@@ -175,7 +175,7 @@ Resolvers are provided a mutable context object that is shared between all resol
175175
``` javascript
176176
import express from 'express';
177177
import bodyParser from 'body-parser';
178-
import { graphqlExpress } from 'graphql-server-express';
178+
import { graphqlExpress } from 'apollo-server-express';
179179
import { createExpressContext } from 'apollo-resolvers';
180180
import { formatError as apolloFormatError, createError } from 'apollo-errors';
181181

@@ -212,16 +212,16 @@ app.use((req, res, next) => {
212212

213213
app.post('/graphql', graphqlExpress((req, res) => {
214214
const user = req.user;
215-
215+
216216
const models = {
217217
User: new UserModel(user)
218218
};
219-
219+
220220
const context = createExpressContext({
221221
models,
222222
user
223223
}, res);
224-
224+
225225
return {
226226
schema,
227227
formatError, // error formatting via apollo-errors

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
"graphql",
1515
"resolvers",
1616
"apollo",
17+
"apollo-client",
18+
"apollo-server",
1719
"api"
1820
],
1921
"author": "Andrew E. Rhyne",

0 commit comments

Comments
 (0)