|
1 | 1 | graphql-compose-mongoose |
2 | 2 | ====================== |
3 | | -This is a plugin for [graphql-compose](https://github.com/nodkz/graphql-compose), which derives GraphQLType from your [mongoose model](https://github.com/Automattic/mongoose). Also derives bunch of internal GraphQL Types. Provide all CRUD resolvers, including `graphql connection`. |
| 3 | +This is a plugin for [graphql-compose](https://github.com/nodkz/graphql-compose), which derives GraphQLType from your [mongoose model](https://github.com/Automattic/mongoose). Also derives bunch of internal GraphQL Types. Provide all CRUD resolvers, including `graphql connection`, also provided basic search via operators ($lt, $gt and so on). |
4 | 4 |
|
5 | 5 | Installation |
6 | 6 | ============ |
@@ -53,7 +53,7 @@ const UserModel = mongoose.model('UserModel', UserSchema); |
53 | 53 |
|
54 | 54 |
|
55 | 55 | // STEP 2: CONVERT MONGOOSE MODEL TO GraphQL PIECES |
56 | | -const customizationOptions = {}; // left it empty for simplicity |
| 56 | +const customizationOptions = {}; // left it empty for simplicity, described below |
57 | 57 | const typeComposer = composeWithMongoose(UserModel, customizationOptions); |
58 | 58 | // get list of 12 Resolvers (findById, updateMany and others) |
59 | 59 | const resolvers = typeComposer.getResolvers(); |
@@ -95,12 +95,12 @@ export default graphqlSchema; |
95 | 95 | ``` |
96 | 96 | That's all! |
97 | 97 | You think that is to much code? |
98 | | -I don't think so, because by default internally was created about 30 graphql types (for input, sorting, filtering). So you will need much much more lines of code to implement all these CRUD operations by hands. |
| 98 | +I don't think so, because by default internally was created about 55 graphql types (for input, sorting, filtering). So you will need much much more lines of code to implement all these CRUD operations by hands. |
99 | 99 |
|
100 | 100 |
|
101 | 101 | Customization options |
102 | 102 | ===================== |
103 | | -When we convert model `const typeComposer = mongooseToTypeComposer(UserModel, customizationOptions);` you may tune every piece of future derived types and resolvers. |
| 103 | +When we convert model `const typeComposer = composeWithMongoose(UserModel, customizationOptions);` you may tune every piece of future derived types and resolvers. |
104 | 104 |
|
105 | 105 | ### Here is flow typed definition of this options: |
106 | 106 |
|
|
0 commit comments