{"action":"closed","issue":{"url":"https://api.github.com/repos/nodkz/graphql-compose/issues/2","repository_url":"https://api.github.com/repos/nodkz/graphql-compose","labels_url":"https://api.github.com/repos/nodkz/graphql-compose/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/nodkz/graphql-compose/issues/2/comments","events_url":"https://api.github.com/repos/nodkz/graphql-compose/issues/2/events","html_url":"https://github.com/nodkz/graphql-compose/issues/2","id":173032239,"number":2,"title":"Generate types with subdocuments","user":{"login":"richyeiv","id":1832011,"avatar_url":"https://avatars.githubusercontent.com/u/1832011?v=3","gravatar_id":"","url":"https://api.github.com/users/richyeiv","html_url":"https://github.com/richyeiv","followers_url":"https://api.github.com/users/richyeiv/followers","following_url":"https://api.github.com/users/richyeiv/following{/other_user}","gists_url":"https://api.github.com/users/richyeiv/gists{/gist_id}","starred_url":"https://api.github.com/users/richyeiv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richyeiv/subscriptions","organizations_url":"https://api.github.com/users/richyeiv/orgs","repos_url":"https://api.github.com/users/richyeiv/repos","events_url":"https://api.github.com/users/richyeiv/events{/privacy}","received_events_url":"https://api.github.com/users/richyeiv/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-08-24T19:03:01Z","updated_at":"2016-08-25T05:30:25Z","closed_at":"2016-08-25T05:30:25Z","body":"I Have the following mongoose models:\r\n\r\n```javascript\r\n// Country \r\nconst CountrySchema = new mongoose.Schema({\r\ncode:           String,\r\nname:           String,\r\ndictionary:     [ { _id: false, value: String } ],\r\nlanguage:       [ { _id: false, code: String, name: String } ],\r\nloc:            { type: { type: String }, geometries: [ GeometrySchema ] },\r\ncreationDate:   Date,\r\nmodifiedDate:   Date\r\n});\r\nconst Country = mongoose.model('Country', CountrySchema);\r\n\r\nconst AddressSchema = new mongoose.Schema({\r\n    _id:        false, \r\n    timezone:   String, \r\n    postalCode: String, \r\n    road:       String, \r\n    district:   String, \r\n    town:       String, \r\n    state:      String, \r\n    country_id: { type: Schema.Types.ObjectId, ref: 'Country' } \r\n});\r\n\r\n// dmc\r\nconst DmcSchema = new mongoose.Schema({\r\n    meID:        String,\r\n    name:           String,\r\n    address:        AddressSchema,\r\n    country_ids:    [ { _id: false, type: Schema.Types.ObjectId, ref: 'Country' } ],\r\n    language:       [ { _id: false, code: String, name: String, description: String } ],\r\n    creationDate:   Date,\r\n    modifiedDate:   Date\r\n});\r\nconst Dmc = mongoose.model('Dmc', DmcSchema);\r\n```\r\n\r\nWhat I need is to create the relation between Dmc.address.country_id and Country, and the relation between Dmc.country_ids and Country.\r\n\r\nI am stuck with addRelation, any help will be apreciate.\r\n"}}
{"actor":{"display_login":"richyeiv"}}