{"action":"created","issue":{"url":"https://api.github.com/repos/meteor/data/issues/5","labels_url":"https://api.github.com/repos/meteor/data/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/meteor/data/issues/5/comments","events_url":"https://api.github.com/repos/meteor/data/issues/5/events","html_url":"https://github.com/meteor/data/issues/5","id":129391464,"number":5,"title":"GraphQL and variable schemas","user":{"login":"hluz","id":4063415,"avatar_url":"https://avatars.githubusercontent.com/u/4063415?v=3","gravatar_id":"","url":"https://api.github.com/users/hluz","html_url":"https://github.com/hluz","followers_url":"https://api.github.com/users/hluz/followers","following_url":"https://api.github.com/users/hluz/following{/other_user}","gists_url":"https://api.github.com/users/hluz/gists{/gist_id}","starred_url":"https://api.github.com/users/hluz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hluz/subscriptions","organizations_url":"https://api.github.com/users/hluz/orgs","repos_url":"https://api.github.com/users/hluz/repos","events_url":"https://api.github.com/users/hluz/events{/privacy}","received_events_url":"https://api.github.com/users/hluz/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2016-01-28T09:14:29Z","updated_at":"2016-01-29T06:54:53Z","closed_at":"2016-01-29T05:38:34Z","body":"Maybe I'm missing the obvious, but how will we be able to retrieve / mutate data with variable schema? Consider the following scenario:\r\n\r\n- Mongo collection where each document contains a the schema definition for a sub-document. This schema is not fixed but varies from document to document. How can we retrieve such documents when we don't know in advance its schema?\r\n\r\nExample collection:\r\n```\r\n[\r\n  {\r\n    \"_id\": \"1\",\r\n    \"name\": \"A\",\r\n    \"fldDef\": [\r\n      {\r\n        \"name\": \"f1\",\r\n        \"type\": \"str\",\r\n        \"opt\": false\r\n      },\r\n      {\r\n        \"name\": \"f2\",\r\n        \"type\": \"bool\"\r\n      }\r\n    ],\r\n    \"flds\": {\r\n      \"f1\": \"value1\",\r\n      \"f2\": true\r\n    }\r\n  },\r\n  {\r\n    \"_id\": \"2\",\r\n    \"name\": \"B\",\r\n    \"fldDef\": [\r\n      {\r\n        \"name\": \"f3\",\r\n        \"type\": \"str\",\r\n        \"opt\": true\r\n      },\r\n      {\r\n        \"name\": \"f4\",\r\n        \"type\": \"str\",\r\n        \"opt\": true\r\n      },\r\n      {\r\n        \"name\": \"f5\",\r\n        \"type\": \"num\"\r\n      }\r\n    ],\r\n    \"flds\": {\r\n      \"f3\": \"value3\",\r\n      \"f5\": 25\r\n    }\r\n  }\r\n]\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/meteor/data/issues/comments/176606215","html_url":"https://github.com/meteor/data/issues/5#issuecomment-176606215","issue_url":"https://api.github.com/repos/meteor/data/issues/5","id":176606215,"user":{"login":"ianserlin","id":125881,"avatar_url":"https://avatars.githubusercontent.com/u/125881?v=3","gravatar_id":"","url":"https://api.github.com/users/ianserlin","html_url":"https://github.com/ianserlin","followers_url":"https://api.github.com/users/ianserlin/followers","following_url":"https://api.github.com/users/ianserlin/following{/other_user}","gists_url":"https://api.github.com/users/ianserlin/gists{/gist_id}","starred_url":"https://api.github.com/users/ianserlin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianserlin/subscriptions","organizations_url":"https://api.github.com/users/ianserlin/orgs","repos_url":"https://api.github.com/users/ianserlin/repos","events_url":"https://api.github.com/users/ianserlin/events{/privacy}","received_events_url":"https://api.github.com/users/ianserlin/received_events","type":"User","site_admin":false},"created_at":"2016-01-29T06:54:53Z","updated_at":"2016-01-29T06:54:53Z","body":"@justinsb Your last comment seems to be demonstrating a lack of concern and completeness for resolving legitimate questions.\r\n\r\nThe question was: Can I use GraphQL to request all child data (properties) for a parent field without specifying the name of each child property explicitly.\r\n\r\nYour first answer was: You can change how the child data is stored so that you *do* know the name of each property and can request it explicitly.\r\n\r\nThe question then became: Can I use GraphQL to request all child data (properties) for a parent field without specifying the name of each child property explicitly. (yes, the same question)\r\n\r\nYour next comment\r\n\r\n> @hluz the GraphQL structure does not need to reflect the database structure.\r\n\r\nis hard to accept, because we all know that already (that's one of the points of GraphQL), but still had this question to ask. It's still not an explicit answer, just like \"encourages the use of\" isn't either. It's a statement of what you think GraphQL is about.\r\n\r\nAn explicit answer would be: No, you cannot.\r\n\r\nThere is a whole universe of more useful answers: \r\n\r\nNo, not in the core library for this repo, and/but:\r\n\r\n* the core library will support extensions\r\n* you can use field parameters\r\n* you can write your own query resolver (to pull data)\r\n* our query standard resolver that supports mongo will be extensible\r\n* this issue belongs in the meteor forum\r\n* this issue belongs on a different repo\r\n* see this other issue in this other repo\r\n* we'll think about it and get back to you\r\n* ...\r\n\r\nMaybe none of those answers are possible, and we don't all have a lot of time to spend writing tutorials in github issue comments AND do our jobs, but...\r\n\r\nIt is your (and MDG's) job. Especially when creating a project like this.\r\n\r\nIt's not your job to implement everything people ask for of course, but remember who you are building any of this for.\r\n\r\nSimply closing this issue in this manner gives the impression that you don't care and leaves the community to go elsewhere to try and figure out on their own and guess at what you might or might not do/think/say in this regard. That's really not useful at all."}}