aerogear / create-graphql

Command-line utility to build production-ready servers with GraphQL.
MIT License
440 stars 38 forks source link

Support mongoose array fields #94

Closed JCMais closed 7 years ago

JCMais commented 7 years ago

Fixes https://github.com/lucasbento/create-graphql/issues/81

codecov[bot] commented 7 years ago

Codecov Report

Merging #94 into master will increase coverage by 4.24%. The diff coverage is 95.74%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #94      +/-   ##
==========================================
+ Coverage   59.01%   63.26%   +4.24%     
==========================================
  Files          13       13              
  Lines         305      343      +38     
==========================================
+ Hits          180      217      +37     
- Misses        125      126       +1
Impacted Files Coverage Δ
packages/generator/src/utils.js 95.65% <95.74%> (+0.65%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 81e0ded...a093882. Read the comment docs.

JCMais commented 7 years ago

@lucasbento the following is now supported:

{
  array1: [String],
  array2: {
    type: [String],
    description: 'Some description'
  },
  array3: [
    {
      type: ObjectId,
      ref: 'AnotherModel',
    },
  ],
  array4: {
    type: [ObjectId],
    ref: 'AnotherModel',
    description: 'Some description'
  }
}

I'm mutating the AST though, so I don't know if you have any problem with that.