{"action":"created","issue":{"url":"https://api.github.com/repos/mattkrick/cashay/issues/159","repository_url":"https://api.github.com/repos/mattkrick/cashay","labels_url":"https://api.github.com/repos/mattkrick/cashay/issues/159/labels{/name}","comments_url":"https://api.github.com/repos/mattkrick/cashay/issues/159/comments","events_url":"https://api.github.com/repos/mattkrick/cashay/issues/159/events","html_url":"https://github.com/mattkrick/cashay/issues/159","id":200316214,"number":159,"title":"mutation selectors should not include @live fields","user":{"login":"dustinfarris","id":1087165,"avatar_url":"https://avatars.githubusercontent.com/u/1087165?v=3","gravatar_id":"","url":"https://api.github.com/users/dustinfarris","html_url":"https://github.com/dustinfarris","followers_url":"https://api.github.com/users/dustinfarris/followers","following_url":"https://api.github.com/users/dustinfarris/following{/other_user}","gists_url":"https://api.github.com/users/dustinfarris/gists{/gist_id}","starred_url":"https://api.github.com/users/dustinfarris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dustinfarris/subscriptions","organizations_url":"https://api.github.com/users/dustinfarris/orgs","repos_url":"https://api.github.com/users/dustinfarris/repos","events_url":"https://api.github.com/users/dustinfarris/events{/privacy}","received_events_url":"https://api.github.com/users/dustinfarris/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-01-12T09:25:01Z","updated_at":"2017-02-15T00:32:37Z","closed_at":null,"body":"If you have a mutation that returns an object (not a scalar), e.g.\r\n\r\n```\r\nschema {\r\n  mutation: {\r\n    updateProject: Project\r\n```\r\n\r\ncashay will build the mutation to select fields for that type to fulfill any active queries.\r\n\r\nbut cashay seems to ignore `@live` directives (and possibly `@cached` as well?)\r\n\r\ne.g. if you have a query\r\n\r\n```\r\nproject (id: $project_id) @live {\r\n  id\r\n  name\r\n  projectTodos @live {\r\n    id\r\n    description\r\n  }\r\n}\r\n```\r\n\r\nwhen you run the mutation\r\n\r\n```\r\ncashay.mutate('updateProject', ...\r\n```\r\n\r\ncashay sends this to the server:\r\n\r\n```\r\nmutation ($id: ID!, $name: String!) {\r\n  updateProject(id: $id, name: $name) {\r\n    projectTodos @live {\r\n      id\r\n      description\r\n    }\r\n    id\r\n    name\r\n  }\r\n}\r\n```\r\n\r\nwhich causes graphql to throw: `Unknown directive \"live\".`"},"comment":{"url":"https://api.github.com/repos/mattkrick/cashay/issues/comments/279881525","html_url":"https://github.com/mattkrick/cashay/issues/159#issuecomment-279881525","issue_url":"https://api.github.com/repos/mattkrick/cashay/issues/159","id":279881525,"user":{"login":"dustinfarris","id":1087165,"avatar_url":"https://avatars.githubusercontent.com/u/1087165?v=3","gravatar_id":"","url":"https://api.github.com/users/dustinfarris","html_url":"https://github.com/dustinfarris","followers_url":"https://api.github.com/users/dustinfarris/followers","following_url":"https://api.github.com/users/dustinfarris/following{/other_user}","gists_url":"https://api.github.com/users/dustinfarris/gists{/gist_id}","starred_url":"https://api.github.com/users/dustinfarris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dustinfarris/subscriptions","organizations_url":"https://api.github.com/users/dustinfarris/orgs","repos_url":"https://api.github.com/users/dustinfarris/repos","events_url":"https://api.github.com/users/dustinfarris/events{/privacy}","received_events_url":"https://api.github.com/users/dustinfarris/received_events","type":"User","site_admin":false},"created_at":"2017-02-15T00:32:37Z","updated_at":"2017-02-15T00:32:37Z","body":"@mattkrick thanks, yeah i figured that much out.  i do think there should be an error from cashay for such a mutation that selects live fields—but feel free to close if that's more of a roadmap thing"}}
{"actor":{"display_login":"dustinfarris"}}