Last active
February 23, 2016 09:54
-
-
Save estreeper/b91ca200da5e4ef15cba to your computer and use it in GitHub Desktop.
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
var studentType = new graphql.GraphQLObjectType({ | |
name: 'Student', | |
fields: { | |
// student fields here | |
}, | |
}); | |
var schoolType = new graphql.GraphQLObjectType({ | |
name: 'School', | |
fields: { | |
schoolId: { type: graphql.GraphQLString }, | |
name: { type: graphql.GraphQLString }, | |
students: { | |
type: new GraphQLList(studentType), | |
resolve: function (school) { return someMethodToGetListofStudentsFromDatabase(school.schoolId); }, | |
}, | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment