{"action":"created","issue":{"url":"https://api.github.com/repos/nuwave/lighthouse/issues/124","repository_url":"https://api.github.com/repos/nuwave/lighthouse","labels_url":"https://api.github.com/repos/nuwave/lighthouse/issues/124/labels{/name}","comments_url":"https://api.github.com/repos/nuwave/lighthouse/issues/124/comments","events_url":"https://api.github.com/repos/nuwave/lighthouse/issues/124/events","html_url":"https://github.com/nuwave/lighthouse/issues/124","id":324495218,"number":124,"title":"Is there an easy way to make a relay friendly create Mutation? ","user":{"login":"alexwhb","id":4073691,"avatar_url":"https://avatars1.githubusercontent.com/u/4073691?v=4","gravatar_id":"","url":"https://api.github.com/users/alexwhb","html_url":"https://github.com/alexwhb","followers_url":"https://api.github.com/users/alexwhb/followers","following_url":"https://api.github.com/users/alexwhb/following{/other_user}","gists_url":"https://api.github.com/users/alexwhb/gists{/gist_id}","starred_url":"https://api.github.com/users/alexwhb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexwhb/subscriptions","organizations_url":"https://api.github.com/users/alexwhb/orgs","repos_url":"https://api.github.com/users/alexwhb/repos","events_url":"https://api.github.com/users/alexwhb/events{/privacy}","received_events_url":"https://api.github.com/users/alexwhb/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-05-18T17:38:38Z","updated_at":"2018-05-18T18:10:04Z","closed_at":"2018-05-18T18:05:27Z","author_association":"NONE","body":"So currently I'm trying to make a create mutation that has the edge and a client mutation ID so that my mutations are easy to manage on the Relay side.. is there a somewhat easy way to do this? I am getting errors when just using the `@create()` directive, which is not too surprising. I was thinking of doing a `@field(resolver: \"some resolver\")` but I'm not really sure how you resolve multiple unrelated fields with data types that are not simple like a single modle. Any help with this would be greatly appreciated. \r\n\r\nand I currently have a `relayCreate()` custom directive in there... this currently is exactly the same as the `@create()` directive.... but I would like to maybe create a directive that automates this pattern, since I will be using it every time I make a new record. \r\n\r\nhere's what this looks like in my schema currently: \r\n\r\n```graphql\r\n\r\ntype AddLibraryPayload {\r\n    viewer: User!\r\n    libraryEdge: UserLibraryEdge!\r\n    clientMutationId: String!\r\n}\r\n\r\n#currently this has to be redefined because\r\n#lighthouse does not recognize it from the automatic \r\n#@hasMany generation of this type unfortunately.\r\ntype UserLibraryEdge {\r\n    node: Library\r\n    cursor: String!\r\n}\r\n\r\ninput AddLibraryInput {\r\n    name:String\r\n    clientMutationId:String\r\n}\r\n\r\ntype Mutation @group(namespace: \"App\\\\Http\\\\GraphQL\\\\Mutations\") {\r\n    addLibrary(input:AddLibraryInput): AddLibraryPayload @relayCreate(model:\"App\\\\Models\\\\DB\\\\Library\")\r\n}\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/nuwave/lighthouse/issues/comments/390288390","html_url":"https://github.com/nuwave/lighthouse/issues/124#issuecomment-390288390","issue_url":"https://api.github.com/repos/nuwave/lighthouse/issues/124","id":390288390,"user":{"login":"alexwhb","id":4073691,"avatar_url":"https://avatars1.githubusercontent.com/u/4073691?v=4","gravatar_id":"","url":"https://api.github.com/users/alexwhb","html_url":"https://github.com/alexwhb","followers_url":"https://api.github.com/users/alexwhb/followers","following_url":"https://api.github.com/users/alexwhb/following{/other_user}","gists_url":"https://api.github.com/users/alexwhb/gists{/gist_id}","starred_url":"https://api.github.com/users/alexwhb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexwhb/subscriptions","organizations_url":"https://api.github.com/users/alexwhb/orgs","repos_url":"https://api.github.com/users/alexwhb/repos","events_url":"https://api.github.com/users/alexwhb/events{/privacy}","received_events_url":"https://api.github.com/users/alexwhb/received_events","type":"User","site_admin":false},"created_at":"2018-05-18T18:10:04Z","updated_at":"2018-05-18T18:10:04Z","author_association":"NONE","body":"@kikoseijo that's very true... it complains a lot. lol Apollo is much more lax. I use Apollo on a Node stack for a side project I have, and I have to say... I think Relay is better. Vuex or Redux or what ever data store you end up with end up being a lot more manual and difficult to manage in my opinion. "}}
{"actor":{"display_login":"alexwhb"}}