Skip to content

Commit f9b9565

Browse files
yoadsnnodkz
authored andcommitted
docs: Document using schema composer on direct exports
1 parent 13f7887 commit f9b9565

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,12 @@ If you want the `ImageDataStructure` to use the same GraphQL type in both `Artic
207207

208208
Do the following:
209209
```js
210+
import { schemaComposer } from 'graphql-compose'; // get the default schemaComposer or your created schemaComposer
211+
//import { GQC } from 'graphql-compose'; // <- or use your GQC which is actually the default schemaComposer
210212
import { convertSchemaToGraphQL } from 'graphql-compose-mongoose';
211-
convertSchemaToGraphQL(ImageDataStructure, 'EmbeddedImage'); // Force this type on this mongoose schema
213+
214+
convertSchemaToGraphQL(ImageDataStructure, 'EmbeddedImage', schemaComposer); // Force this type on this mongoose schema
215+
//convertSchemaToGraphQL(ImageDataStructure, 'EmbeddedImage', GQC); // Using GQC as the schemaComposer
212216
```
213217
Before continuing to convert your models to TypeComposers:
214218
```js

0 commit comments

Comments
 (0)