{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/relay/issues/193","labels_url":"https://api.github.com/repos/facebook/relay/issues/193/labels{/name}","comments_url":"https://api.github.com/repos/facebook/relay/issues/193/comments","events_url":"https://api.github.com/repos/facebook/relay/issues/193/events","html_url":"https://github.com/facebook/relay/issues/193","id":103973549,"number":193,"title":"Accessing variables in RelayContainer fragments","user":{"login":"drabinowitz","id":7275304,"avatar_url":"https://avatars.githubusercontent.com/u/7275304?v=3","gravatar_id":"","url":"https://api.github.com/users/drabinowitz","html_url":"https://github.com/drabinowitz","followers_url":"https://api.github.com/users/drabinowitz/followers","following_url":"https://api.github.com/users/drabinowitz/following{/other_user}","gists_url":"https://api.github.com/users/drabinowitz/gists{/gist_id}","starred_url":"https://api.github.com/users/drabinowitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drabinowitz/subscriptions","organizations_url":"https://api.github.com/users/drabinowitz/orgs","repos_url":"https://api.github.com/users/drabinowitz/repos","events_url":"https://api.github.com/users/drabinowitz/events{/privacy}","received_events_url":"https://api.github.com/users/drabinowitz/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-31T02:19:39Z","updated_at":"2015-08-31T19:51:32Z","closed_at":"2015-08-31T03:33:49Z","body":"I would like to access variables in my fragments outside of the GraphQL fragments (specifically I would like to use a different fragment depending on the variables).  However, when I took a look at the passed in variables they are GraphQLCallVariables without an immediately apparent way for me to access their values.  I was wondering if Relay exposes a public method to get the values from these variables:\r\n\r\n```javascript\r\ngame: variables => {\r\n  if (variables.foo /*this is a GraphQLCallVariable*/) {\r\n    return fooQL;\r\n  } else {\r\n    return barQL;\r\n  }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/facebook/relay/issues/comments/136481287","html_url":"https://github.com/facebook/relay/issues/193#issuecomment-136481287","issue_url":"https://api.github.com/repos/facebook/relay/issues/193","id":136481287,"user":{"login":"yungsters","id":55161,"avatar_url":"https://avatars.githubusercontent.com/u/55161?v=3","gravatar_id":"","url":"https://api.github.com/users/yungsters","html_url":"https://github.com/yungsters","followers_url":"https://api.github.com/users/yungsters/followers","following_url":"https://api.github.com/users/yungsters/following{/other_user}","gists_url":"https://api.github.com/users/yungsters/gists{/gist_id}","starred_url":"https://api.github.com/users/yungsters/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yungsters/subscriptions","organizations_url":"https://api.github.com/users/yungsters/orgs","repos_url":"https://api.github.com/users/yungsters/repos","events_url":"https://api.github.com/users/yungsters/events{/privacy}","received_events_url":"https://api.github.com/users/yungsters/received_events","type":"User","site_admin":false},"created_at":"2015-08-31T19:51:32Z","updated_at":"2015-08-31T19:51:32Z","body":"The `variables` is intentionally opaque. In fact, the function `variables => ...` is only ever executed once and memoized for subsequent access. This allows structural comparison of fragments without having to traverse the entire query tree."}}