Some fix with Apollo

This commit is contained in:
Riccardo
2021-01-03 11:10:52 +01:00
parent b5129342e3
commit 9641e4f7e3
3 changed files with 42 additions and 127 deletions

View File

@@ -1,12 +1,11 @@
import mongoose from 'mongoose';
const { Schema } = mongoose;
import timestamps from 'mongoose-timestamp';
import { composeWithMongoose } from 'graphql-compose-mongoose';
export const TaskSchema = new Schema(
export const TaskSchema = new mongoose.Schema(
{
user: {
type: Schema.Types.ObjectId,
type: mongoose.Schema.Types.ObjectId,
ref: 'User',
required: true,
},

View File

@@ -1,9 +1,8 @@
import mongoose from 'mongoose';
const { Schema } = mongoose
import timestamps from 'mongoose-timestamp';
import { composeWithMongoose } from 'graphql-compose-mongoose';
export const UserSchema = new Schema(
export const UserSchema = new mongoose.Schema(
{
name: {
type: String,