{"action":"opened","issue":{"url":"https://api.github.com/repos/graphcool/prisma/issues/2069","repository_url":"https://api.github.com/repos/graphcool/prisma","labels_url":"https://api.github.com/repos/graphcool/prisma/issues/2069/labels{/name}","comments_url":"https://api.github.com/repos/graphcool/prisma/issues/2069/comments","events_url":"https://api.github.com/repos/graphcool/prisma/issues/2069/events","html_url":"https://github.com/graphcool/prisma/issues/2069","id":304201384,"number":2069,"title":"Create multiple nodes in a single mutation","user":{"login":"jhalvorson","id":10282220,"avatar_url":"https://avatars1.githubusercontent.com/u/10282220?v=4","gravatar_id":"","url":"https://api.github.com/users/jhalvorson","html_url":"https://github.com/jhalvorson","followers_url":"https://api.github.com/users/jhalvorson/followers","following_url":"https://api.github.com/users/jhalvorson/following{/other_user}","gists_url":"https://api.github.com/users/jhalvorson/gists{/gist_id}","starred_url":"https://api.github.com/users/jhalvorson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhalvorson/subscriptions","organizations_url":"https://api.github.com/users/jhalvorson/orgs","repos_url":"https://api.github.com/users/jhalvorson/repos","events_url":"https://api.github.com/users/jhalvorson/events{/privacy}","received_events_url":"https://api.github.com/users/jhalvorson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-11T22:37:28Z","updated_at":"2018-03-11T22:37:28Z","closed_at":null,"author_association":"NONE","body":"# Feature Request\r\n\r\nFeature request created due to conversation on the forum: https://www.graph.cool/forum/t/deeply-nested-create-mutations/2798\r\n\r\n**What feature are you missing?**\r\nCreate multiple nodes in a single mutation that aren't directly related.\r\n\r\nThere is more information in the forum link but here's a quick overview.\r\n\r\nIf a user has the following schema:\r\n\r\n```\r\ntype Programmes {\r\n  title: String!\r\n  weeks: [ProgrammeWeek!]!\r\n  classes: [ProgrammeClass!]! \r\n}\r\n\r\ntype ProgrammeWeek {\r\n  classes: [ProgrammeClass!]!\r\n  programme: Programme!\r\n}\r\n\r\ntype ProgrammeClass {\r\n  title: String\r\n  description: String\r\n  class: Class\r\n}\r\n\r\ntype Class {\r\n   title: String!\r\n}\r\n```\r\n\r\nThey should be able to run:\r\n\r\n```\r\nmutation {\r\n  createProgramme (\r\n    title: \"I'm a test\"\r\n    weeks: {\r\n      create: [\r\n       {\r\n        title: \"Week Title\"\r\n        classes: {\r\n           create: [\r\n             {\r\n               class: {\r\n                 connect: {\r\n                 id: \"cjeeu4m2r00100124quldgnji\"\r\n               }\r\n            },\r\n           {\r\n              class: {\r\n                 connect: {\r\n                   id: \"cjeeu4m2r00100124quldgnji\"\r\n               }\r\n            }\r\n         },\r\n      ]\r\n    }\r\n  )\r\n}\r\n```\r\n\r\nIdeally, the above mutation should add the newly created `classes` inside of `weeks` to the `Programme` type and `ProgrammeWeek` type. Currently it only adds them to the `ProgrammeWeek` type.\r\n\r\n**How could this feature look like in detail? Tradeoffs?**\r\n"}}
{"actor":{"display_login":"jhalvorson"}}