{"action":"created","issue":{"url":"https://api.github.com/repos/graphql-python/graphene/issues/59","labels_url":"https://api.github.com/repos/graphql-python/graphene/issues/59/labels{/name}","comments_url":"https://api.github.com/repos/graphql-python/graphene/issues/59/comments","events_url":"https://api.github.com/repos/graphql-python/graphene/issues/59/events","html_url":"https://github.com/graphql-python/graphene/issues/59","id":119621637,"number":59,"title":"Add Documentation for Relay Edge implementation","user":{"login":"thebritican","id":3099999,"avatar_url":"https://avatars.githubusercontent.com/u/3099999?v=3","gravatar_id":"","url":"https://api.github.com/users/thebritican","html_url":"https://github.com/thebritican","followers_url":"https://api.github.com/users/thebritican/followers","following_url":"https://api.github.com/users/thebritican/following{/other_user}","gists_url":"https://api.github.com/users/thebritican/gists{/gist_id}","starred_url":"https://api.github.com/users/thebritican/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thebritican/subscriptions","organizations_url":"https://api.github.com/users/thebritican/orgs","repos_url":"https://api.github.com/users/thebritican/repos","events_url":"https://api.github.com/users/thebritican/events{/privacy}","received_events_url":"https://api.github.com/users/thebritican/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/graphql-python/graphene/labels/question","name":"question","color":"cc317c"},{"url":"https://api.github.com/repos/graphql-python/graphene/labels/work%20in%20progress","name":"work in progress","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-01T01:41:06Z","updated_at":"2015-12-14T07:52:30Z","closed_at":null,"body":"In the [Relay mutation docs](https://facebook.github.io/relay/docs/guides-mutations.html#range-add), performing **RANGE_ADD** requires that the new edge created by the mutation is provided in the payload.\r\n\r\nI do not know how to provide the correct cursor/`Edge` construction within the `relay.ClientIDMutation` subclass. \r\n\r\nThe following code I wrote:\r\n\r\n`new_object_edge = graphene.Field('ObjectEdge')`\r\n\r\n I believed would solve my issue, with a proper `resolve_new_object_edge(...)` resolver.\r\n\r\nHowever, my resolver cannot reference the `relay.ConnectionField` that is specified on one of the other object types in my mutation, since it only has the context of my (in this case, Django) objects.\r\n\r\nI experimented with `relay.Edge.for_node(SomeObjectType)` as well but all of the solutions I have tried so far modify the schema correctly but cannot return the appropriate `Edge`.\r\n\r\nThe implementation of this scenario in javascript can be found [here](https://github.com/facebook/relay/blob/master/examples/todo/data/schema.js#L140) in the Relay examples directory.\r\n\r\nAny idea of a best approach? I can take this question to stack overflow, but felt that people using Relay & Graphene would enjoy seeing an example solution in the docs."},"comment":{"url":"https://api.github.com/repos/graphql-python/graphene/issues/comments/164371230","html_url":"https://github.com/graphql-python/graphene/issues/59#issuecomment-164371230","issue_url":"https://api.github.com/repos/graphql-python/graphene/issues/59","id":164371230,"user":{"login":"syrusakbary","id":188257,"avatar_url":"https://avatars.githubusercontent.com/u/188257?v=3","gravatar_id":"","url":"https://api.github.com/users/syrusakbary","html_url":"https://github.com/syrusakbary","followers_url":"https://api.github.com/users/syrusakbary/followers","following_url":"https://api.github.com/users/syrusakbary/following{/other_user}","gists_url":"https://api.github.com/users/syrusakbary/gists{/gist_id}","starred_url":"https://api.github.com/users/syrusakbary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/syrusakbary/subscriptions","organizations_url":"https://api.github.com/users/syrusakbary/orgs","repos_url":"https://api.github.com/users/syrusakbary/repos","events_url":"https://api.github.com/users/syrusakbary/events{/privacy}","received_events_url":"https://api.github.com/users/syrusakbary/received_events","type":"User","site_admin":false},"created_at":"2015-12-14T07:52:29Z","updated_at":"2015-12-14T07:52:29Z","body":"@thebritican meanwhile you can use raw `graphql-core` objects as fields.\r\n\r\nSo this would work:\r\n```python\r\nclass AddTodo(relay.Mutation):\r\n    class Input:\r\n        text = graphene.String(required=True)\r\n    todoEdge = graphene.Field(theGraphQLCoreType)\r\n```\r\n\r\nI will try to have this working with graphene around this week.\r\n\r\nPS: Graphene is using `graphql-relay` library under the hoods, but the function `cursor_for_object_in_connection` is not yet implemented there, so probably I will implement this in `graphql-relay` before anything else."}}