Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support array of objects #4

Open
choyongjoon opened this issue Feb 17, 2017 · 0 comments
Open

Support array of objects #4

choyongjoon opened this issue Feb 17, 2017 · 0 comments

Comments

@choyongjoon
Copy link

The array of objects (like books in below) cause the error TypeError: Cannot read property 'ref' of undefined

const userSchema = new Schema({
  name: {
    first: { type: String, required: 'first name required' },
    last: String
  },
  school: { type: Schema.Types.ObjectId, ref: 'School' },
  books: [{
    title: String
    subject: String
  }]
})
uncaughtException TypeError: Cannot read property 'ref' of undefined
  at inheritOpts.forEach.opt (mooseql/src/type/index.js:86:64)
  at Array.forEach (native)
  at _fields.filter.map.path (mooseql/src/type/index.js:85:19)
  at Array.map (native)
  at toType (mooseql/src/type/index.js:81:6)
  at models.filter.reduce (mooseql/src/type/index.js:31:52)
  at Array.reduce (native)
  at modelsToTypes (mooseql/src/type/index.js:30:6)
  at mooseql (mooseql/src/index.js:6:19)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant