graphql-compose-mongoose
Version:
Plugin for `graphql-compose` which derive a graphql types from a mongoose model.
17 lines • 460 B
JavaScript
import { mongoose, Schema } from '../../__mocks__/mongooseCommon';
const MovieSchema = new Schema({
_id: String,
characters: {
type: [String],
// redundant but i need it.
description: 'A character in the Movie, Person or Droid.'
},
director: {
type: String,
// id of director
description: 'Directed the movie.'
},
imdbRatings: String,
releaseDate: String
});
export const MovieModel = mongoose.model('Movie', MovieSchema);