Skip to content

Commit 546a2b6

Browse files
yoadsnnodkz
authored andcommitted
docs: Improve clarity of docs about embedded type names
Small fix to the doc clarity
1 parent d0fde84 commit 546a2b6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ const Article = Schema({
183183
heroImage: ImageDataStructure
184184
});
185185
```
186-
If you want the `ImageDataStructure` to use the same GraphQL type in both `Article` and `UserProfile` you will need to explicitly tell `graphql-compose-mongoose` that.
186+
If you want the `ImageDataStructure` to use the same GraphQL type in both `Article` and `UserProfile` you will need create it as a mongoose schema (not a standard javascript object) and to explicitly tell `graphql-compose-mongoose` the name you want it to have. Otherwise, without the name, it would generate the name according to the first parent this type was embedded in.
187+
187188
Do the following:
188189
```js
189190
import { convertSchemaToGraphQL } from 'graphql-compose-mongoose';

0 commit comments

Comments
 (0)