apollo-connector-mongodb icon indicating copy to clipboard operation
apollo-connector-mongodb copied to clipboard

Mongoose schema.

Open smooJitter opened this issue 7 years ago • 1 comments

How does this play with mongoose.

For example, consider we have a schema like this

const UserSchema = new mongoose.Schema({ username: { type: String, required: true }, mobileNumber: { type: String }, createdAt: { type: Date, default: Date.now } });

Where the mongodb collection is tied to the mongoose model like usually

User = mongoose.model('User', UserSchema);

I gather the graphQL schema is sufficient? And thus any input and default behaviors should be handled via the Entity definition?

smooJitter avatar Jan 09 '17 07:01 smooJitter

@smooJitter unfortunately this is made to work with native mongo driver. The whole apckage is optimised to run with it. I use Typescript and GraphQL (Apollo) so I have no need for mongoose ;(

tomitrescak avatar Jan 10 '17 01:01 tomitrescak