Skip to content

Commit 21a5323

Browse files
committed
small fixes in Readme
1 parent 3e08540 commit 21a5323

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Source code: https://github.com/nodkz/graphql-compose-mongoose-example
1010

1111
```js
1212
import mongoose from 'mongoose';
13-
import mongooseToTypeComposer from 'graphql-compose-mongoose';
13+
import composeWithMongoose from 'graphql-compose-mongoose';
1414
import { GraphQLSchema, GraphQLObjectType } from 'graphql';
1515

1616
// STEP 1: DEFINE MONGOOSE SCHEMA AND MODEL
@@ -47,7 +47,7 @@ const UserModel = mongoose.model('UserModel', UserSchema);
4747

4848
// STEP 2: CONVERT MONGOOSE MODEL TO GraphQL PIECES
4949
const customizationOptions = {}; // left it empty for simplicity
50-
const typeComposer = mongooseToTypeComposer(UserModel, customizationOptions);
50+
const typeComposer = composeWithMongoose(UserModel, customizationOptions);
5151
// get list of 12 Resolvers (findById, updateMany and others)
5252
const resolvers = typeComposer.getResolvers();
5353

@@ -67,6 +67,7 @@ const graphqlSchema = new GraphQLSchema({
6767
userOne: resolvers.get('findOne').getFieldConfig(),
6868
userMany: resolvers.get('findMany').getFieldConfig(),
6969
userTotal: resolvers.get('count').getFieldConfig(),
70+
userConnection: resolvers.get('connection').getFieldConfig(),
7071
},
7172
}),
7273
mutation: new GraphQLObjectType({

0 commit comments

Comments
 (0)