-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(schema): add read support types for objects within a list
For example take this schema: ```javascript const PostSchema = new mongoose.Schema({ title: String, authors: [{ username: String, email: String }] }) ``` Before this commit `authors` would be mapped to `GraphQLGeneric`. This commit generates the appropriate nested types. Incidentally, this commit also fixes resolving refs within nested objects and lists. For instance: ```javascript const UserSchema = new mongoose.Schema({ name: { type: String }, sub: { subsub: { sister: { type: mongoose.Schema.Types.ObjectId, ref: 'User' } } } }); ``` Previously `user.sub.subsub.sister` would have resolved only to an `ID`. This commit causes this case to resolve properly to a `User`. This change only applies to queries. Mutations of objects nested in a list are a TODO.
- Loading branch information
Showing
5 changed files
with
122 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters