{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/relay/issues/899","repository_url":"https://api.github.com/repos/facebook/relay","labels_url":"https://api.github.com/repos/facebook/relay/issues/899/labels{/name}","comments_url":"https://api.github.com/repos/facebook/relay/issues/899/comments","events_url":"https://api.github.com/repos/facebook/relay/issues/899/events","html_url":"https://github.com/facebook/relay/issues/899","id":138249452,"number":899,"title":"Fragment name \"viewer\" results in query error","user":{"login":"schickling","id":1567498,"avatar_url":"https://avatars.githubusercontent.com/u/1567498?v=3","gravatar_id":"","url":"https://api.github.com/users/schickling","html_url":"https://github.com/schickling","followers_url":"https://api.github.com/users/schickling/followers","following_url":"https://api.github.com/users/schickling/following{/other_user}","gists_url":"https://api.github.com/users/schickling/gists{/gist_id}","starred_url":"https://api.github.com/users/schickling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schickling/subscriptions","organizations_url":"https://api.github.com/users/schickling/orgs","repos_url":"https://api.github.com/users/schickling/repos","events_url":"https://api.github.com/users/schickling/events{/privacy}","received_events_url":"https://api.github.com/users/schickling/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-03T17:47:21Z","updated_at":"2016-03-03T19:29:25Z","closed_at":"2016-03-03T17:49:57Z","body":"I'm not sure if `viewer` used as a fragment name is a reserved keyword but it results in a query error:\r\n\r\n```\r\nError: GraphQL validation/transform error ``Cannot query field \"viewer\" on type \"Query\".`` in file `RelayPlayground`.\r\n```\r\n\r\nI've created a playground [here](https://facebook.github.io/relay/prototyping/playground.html#source=%2F**%0A%20*%20Copyright%20(c)%202013-present%2C%20Facebook%2C%20Inc.%0A%20*%20All%20rights%20reserved.%0A%20*%0A%20*%20This%20source%20code%20is%20licensed%20under%20the%20BSD-style%20license%20found%20in%20the%0A%20*%20LICENSE%20file%20in%20the%20root%20directory%20of%20this%20source%20tree.%20An%20additional%20grant%0A%20*%20of%20patent%20rights%20can%20be%20found%20in%20the%20PATENTS%20file%20in%20the%20same%20directory.%0A%20*%2F%0A%0A%2F%2F%20Welcome%20to%20Relay.%0A%2F%2F%20Allow%20us%20to%20introduce%20you%20to%20the%20four%20elements.%0A%0A%2F**%0A%20*%20%231%20-%20Your%20React%20components%0A%20*%20This%20will%20look%20familiar%20to%20React%20developers.%0A%20*%0A%20*%20To%20learn%20more%20about%20React%2C%20visit%3A%0A%20*%20%20https%3A%2F%2Ffacebook.github.io%2Freact%0A%20*%2F%0Aclass%20HelloApp%20extends%20React.Component%20%7B%0A%20%20render()%20%7B%0A%20%20%20%20%2F%2F%20Relay%20will%20materialize%20this%20prop%20based%20on%20the%0A%20%20%20%20%2F%2F%20result%20of%20the%20query%20in%20the%20next%20component.%0A%20%20%20%20var%20%7Bhello%7D%20%3D%20this.props.viewer%3B%0A%20%20%20%20return%20%3Ch1%3E%7Bhello%7D%3C%2Fh1%3E%3B%0A%20%20%7D%0A%7D%0A%0A%2F**%0A%20*%20%232%20-%20Relay%20containers%0A%20*%20Compose%20your%20React%20components%20with%20a%20declaration%20of%0A%20*%20the%20GraphQL%20query%20fragments%20that%20fetch%20their%20data.%0A%20*%0A%20*%20To%20learn%20more%20about%20Relay%20containers%2C%20visit%3A%0A%20*%20%20%20https%3A%2F%2Ffacebook.github.io%2Frelay%2Fdocs%2Fguides-containers.html%0A%20*%2F%0AHelloApp%20%3D%20Relay.createContainer(HelloApp%2C%20%7B%0A%20%20fragments%3A%20%7B%0A%20%20%20%20%2F%2F%20This%20GraphQL%20query%20executes%20against%0A%20%20%20%20%2F%2F%20the%20schema%20in%20the%20'schema'%20tab%20above.%0A%20%20%20%20%2F%2F%0A%20%20%20%20%2F%2F%20To%20learn%20more%20about%20Relay.QL%2C%20visit%3A%0A%20%20%20%20%2F%2F%20%20%20https%3A%2F%2Ffacebook.github.io%2Frelay%2Fdocs%2Fapi-reference-relay-ql.html%0A%20%20%20%20viewer%3A%20()%20%3D%3E%20Relay.QL%60%0A%20%20%20%20%20%20fragment%20on%20Greetings%20%7B%0A%20%20%20%20%20%20%20%20hello%2C%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%60%2C%0A%20%20%7D%0A%7D)%3B%0A%0A%2F**%0A%20*%20%233%20-%20Relay%20routes%0A%20*%20Define%20a%20root%20GraphQL%20query%20into%20which%20your%0A%20*%20containers'%20query%20fragments%20will%20be%20composed.%0A%20*%0A%20*%20To%20learn%20more%20about%20Relay%20routes%2C%20visit%3A%0A%20*%20%20%20https%3A%2F%2Ffacebook.github.io%2Frelay%2Fdocs%2Fguides-routes.html%0A%20*%2F%0Aclass%20HelloRoute%20extends%20Relay.Route%20%7B%0A%20%20static%20routeName%20%3D%20'Hello'%3B%20%20%2F%2F%20A%20unique%20name%0A%20%20static%20queries%20%3D%20%7B%0A%20%20%20%20%2F%2F%20Here%2C%20we%20compose%20your%20Relay%20container's%0A%20%20%20%20%2F%2F%20'greetings'%20fragment%20into%20the%20'greetings'%0A%20%20%20%20%2F%2F%20field%20at%20the%20root%20of%20the%20GraphQL%20schema.%0A%20%20%20%20viewer%3A%20(Component)%20%3D%3E%20Relay.QL%60%0A%20%20%20%20%20%20query%20GreetingsQuery%20%7B%0A%20%20%20%20%20%20%20%20viewer%20%7B%0A%20%20%20%20%20%20%20%20%20%20%24%7BComponent.getFragment('viewer')%7D%2C%0A%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%60%2C%0A%20%20%7D%3B%0A%7D%0A%0A%2F**%0A%20*%20%234%20-%20Relay%20root%20containers%0A%20*%20Compose%20a%20Relay%20container%20with%20a%20Relay%20route.%0A%20*%20This%20enables%20Relay%20to%20synthesize%20a%20complete%20query%0A%20*%20to%20fetch%20the%20data%20necessary%20to%20render%20your%20app.%0A%20*%0A%20*%20To%20learn%20more%20about%20Relay%20root%20containers%2C%20visit%3A%0A%20*%20%20%20https%3A%2F%2Ffacebook.github.io%2Frelay%2Fdocs%2Fguides-root-container.html%0A%20*%2F%0AReactDOM.render(%0A%20%20%3CRelay.RootContainer%0A%20%20%20%20Component%3D%7BHelloApp%7D%0A%20%20%20%20route%3D%7Bnew%20HelloRoute()%7D%0A%20%20%2F%3E%2C%0A%20%20mountNode%0A)%3B%0A).\r\n\r\nHere is the relevant code:\r\n\r\n```js\r\n// Route\r\n  static queries = {\r\n    // Here, we compose your Relay container's\r\n    // 'greetings' fragment into the 'greetings'\r\n    // field at the root of the GraphQL schema.\r\n    viewer: (Component) => Relay.QL`\r\n      query GreetingsQuery {\r\n        viewer {\r\n          ${Component.getFragment('viewer')},\r\n        },\r\n      }\r\n    `,\r\n  };\r\n\r\n// ...\r\n\r\n// Container\r\n  fragments: {\r\n    // This GraphQL query executes against\r\n    // the schema in the 'schema' tab above.\r\n    //\r\n    // To learn more about Relay.QL, visit:\r\n    //   https://facebook.github.io/relay/docs/api-reference-relay-ql.html\r\n    viewer: () => Relay.QL`\r\n      fragment on Greetings {\r\n        hello,\r\n      }\r\n    `,\r\n  }\r\n```"},"comment":{"url":"https://api.github.com/repos/facebook/relay/issues/comments/191926200","html_url":"https://github.com/facebook/relay/issues/899#issuecomment-191926200","issue_url":"https://api.github.com/repos/facebook/relay/issues/899","id":191926200,"user":{"login":"josephsavona","id":6425824,"avatar_url":"https://avatars.githubusercontent.com/u/6425824?v=3","gravatar_id":"","url":"https://api.github.com/users/josephsavona","html_url":"https://github.com/josephsavona","followers_url":"https://api.github.com/users/josephsavona/followers","following_url":"https://api.github.com/users/josephsavona/following{/other_user}","gists_url":"https://api.github.com/users/josephsavona/gists{/gist_id}","starred_url":"https://api.github.com/users/josephsavona/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josephsavona/subscriptions","organizations_url":"https://api.github.com/users/josephsavona/orgs","repos_url":"https://api.github.com/users/josephsavona/repos","events_url":"https://api.github.com/users/josephsavona/events{/privacy}","received_events_url":"https://api.github.com/users/josephsavona/received_events","type":"User","site_admin":false},"created_at":"2016-03-03T19:29:25Z","updated_at":"2016-03-03T19:29:25Z","body":"The website version runs the latest tagged release at time of publish, but if you run locally it's on master"}}