You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NB if you set `unique: true` on the array then using the `update``$push` approach will not check for duplicates, this is due to a MongoDB bug: https://jira.mongodb.org/browse/SERVER-1068. For more usage examples with `$push` and arrays see the MongoDB docs here https://docs.mongodb.com/manual/reference/operator/update/push/. Also note that `$push` will preserve order in the array (append to end of array) whereas `$addToSet` will not.
494
494
495
+
### Is it possible to use several schemas?
496
+
497
+
By default `composeWithMongoose` uses global `schemaComposer` for generated types. If you need to create different GraphQL schemas you need create own `schemaComposer`s and provide them to `customizationOptions`:
When we convert model `const UserTC = composeWithMongoose(User, customizationOptions);` you may tune every piece of future derived types and resolvers.
@@ -501,7 +515,8 @@ When we convert model `const UserTC = composeWithMongoose(User, customizationOpt
501
515
The top level of customization options. Here you setup name and description for the main type, remove fields or leave only desired fields.
502
516
503
517
```js
504
-
exporttypetypeConverterOpts= {
518
+
exporttypecustomizationOptions= {
519
+
schemaComposer?: SchemaComposer<TContext>, // will be used global schema if not provided specific instance
0 commit comments