{"action":"created","comment":{"url":"https://api.github.com/repos/facebook/relay/pulls/comments/60744071","id":60744071,"diff_hunk":"@@ -0,0 +1,187 @@\n+---\n+id: api-reference-relay-renderer\n+title: Relay.Renderer\n+layout: docs\n+category: API Reference\n+permalink: docs/api-reference-relay-renderer.html\n+next: api-reference-relay-root-container\n+---\n+\n+**Relay.Renderer** is a replacement for `Relay.RootContainer` that composes a `Relay.ReadyStateRenderer` and performs data fetching for a given `queryConfig`. \n+\n+## Overview\n+\n+*Props*\n+\n+<ul class=\"apiIndex\">\n+  <li>\n+    <a href=\"#container\">\n+      <pre>Container</pre>\n+      Relay container that defines fragments and the view to render.\n+    </a>\n+  </li>\n+  <li>\n+    <a href=\"#forcefetch\">\n+      <pre>forceFetch</pre>\n+      Whether to send a server request regardless of data available on the client.\n+    </a>\n+  </li>\n+  <li>\n+    <a href=\"#onforcefetch\">\n+      <pre>onForceFetch</pre>\n+      Called whenever forceFetch is being called\n+    </a>\n+  </li>\n+  <li>\n+    <a href=\"#onprimecache\">\n+      <pre>onPrimeCache</pre>\n+      Called whenever primeCache is being called\n+    </a>\n+  </li>\n+  <li>\n+    <a href=\"#queryconfig\">\n+      <pre>queryConfig</pre>\n+       QueryConfig or Route that defines the query roots.\n+    </a>\n+  </li>\n+  <li>\n+    <a href=\"#environment\">\n+      <pre>environment</pre>\n+      The API for Relay core that provides methods for fetching/mutating data, an in-memory cache, etc.\n+    </a>\n+  </li>\n+    <li>\n+    <a href=\"#render\">\n+      <pre>render</pre>\n+      Called to render when data requirements are being fulfilled.\n+    </a>\n+  </li>\n+  <li>\n+    <a href=\"#onreadystatechange\">\n+      <pre>onReadyStateChange</pre>\n+    </a>\n+  </li>\n+</ul>\n+\n+## Props\n+\n+### Container\n+\n+```\n+Container: RelayContainer\n+```\n+\n+Must be a valid `RelayContainer`. Relay will attempt to fulfill its data requirements before rendering it.\n+\n+\n+### forceFetch\n+\n+```\n+forceFetch: boolean\n+```\n+\n+If supplied and set to true, a request for data will always be made to the server regardless of whether data on the client is available to immediately fulfill the data requirements.\n+\n+\n+### onForceFetch\n+\n+```\n+onForceFetch(\n+  querySet: RelayQuerySet,\n+  callback: (readyState: ReadyState) => void\n+): Abortable\n+```\n+\n+This callback prop is called whenever a forceFetch occurs.\n+\n+\n+### onPrimeCache\n+\n+```\n+onPrimeCache(\n+  querySet: RelayQuerySet,\n+  callback: (readyState: ReadyState) => void\n+): Abortable\n+```\n+\n+This callback prop is called whenever a primeCache call occurs.\n+\n+### QueryConfig\n+\n+```\n+queryConfig: RelayRoute\n+```\n+\n+Either an instance of `Relay.Route` or an object with the `name`, `queries`, and optionally the `params` properties.\n+\n+\n+### Environment\n+\n+```\n+environment: RelayEnvironment\n+```\n+\n+Either `Relay.Store`, an instance of `Relay.Evironment` or an object with the `forceFetch`, `getFragmentResolver`, `getStoreData`, `primeCache`, and `read` function defined.","path":"docs/APIReference-Renderer.md","position":124,"original_position":124,"commit_id":"aa49a93f4755c9e92578bb6d9548e0ec505525db","original_commit_id":"aa49a93f4755c9e92578bb6d9548e0ec505525db","user":{"login":"wincent","id":7074,"avatar_url":"https://avatars.githubusercontent.com/u/7074?v=3","gravatar_id":"","url":"https://api.github.com/users/wincent","html_url":"https://github.com/wincent","followers_url":"https://api.github.com/users/wincent/followers","following_url":"https://api.github.com/users/wincent/following{/other_user}","gists_url":"https://api.github.com/users/wincent/gists{/gist_id}","starred_url":"https://api.github.com/users/wincent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wincent/subscriptions","organizations_url":"https://api.github.com/users/wincent/orgs","repos_url":"https://api.github.com/users/wincent/repos","events_url":"https://api.github.com/users/wincent/events{/privacy}","received_events_url":"https://api.github.com/users/wincent/received_events","type":"User","site_admin":false},"body":"s/Evironment/Environment/\r\n\r\nRather than explicitly listing the methods (that may change over time), perhaps just say:\r\n\r\n> An object that conforms to the `Relay.Environment` interface, such as `Relay.Store`.","created_at":"2016-04-22T14:09:24Z","updated_at":"2016-04-22T14:09:24Z","html_url":"https://github.com/facebook/relay/pull/1076#discussion_r60744071","pull_request_url":"https://api.github.com/repos/facebook/relay/pulls/1076","_links":{"self":{"href":"https://api.github.com/repos/facebook/relay/pulls/comments/60744071"},"html":{"href":"https://github.com/facebook/relay/pull/1076#discussion_r60744071"},"pull_request":{"href":"https://api.github.com/repos/facebook/relay/pulls/1076"}}},"pull_request":{"url":"https://api.github.com/repos/facebook/relay/pulls/1076","id":67495859,"html_url":"https://github.com/facebook/relay/pull/1076","diff_url":"https://github.com/facebook/relay/pull/1076.diff","patch_url":"https://github.com/facebook/relay/pull/1076.patch","issue_url":"https://api.github.com/repos/facebook/relay/issues/1076","number":1076,"state":"open","locked":false,"title":"Added basic docs for Relay.Renderer","user":{"login":"Globegitter","id":2580254,"avatar_url":"https://avatars.githubusercontent.com/u/2580254?v=3","gravatar_id":"","url":"https://api.github.com/users/Globegitter","html_url":"https://github.com/Globegitter","followers_url":"https://api.github.com/users/Globegitter/followers","following_url":"https://api.github.com/users/Globegitter/following{/other_user}","gists_url":"https://api.github.com/users/Globegitter/gists{/gist_id}","starred_url":"https://api.github.com/users/Globegitter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Globegitter/subscriptions","organizations_url":"https://api.github.com/users/Globegitter/orgs","repos_url":"https://api.github.com/users/Globegitter/repos","events_url":"https://api.github.com/users/Globegitter/events{/privacy}","received_events_url":"https://api.github.com/users/Globegitter/received_events","type":"User","site_admin":false},"body":"It is public API but has not documentation whatsoever, which can be confusing as this could indicate that the RelayRenderer API is not (yet) meant to be used. This should make it easier to discover and more clear that the RelayRenderer API can be used.\r\n\r\nSpecifically the usage of `RelayRenderer` would solve some of our use-cases. Also having some documentation for this would mean that https://github.com/relay-tools/react-router-relay/pull/123 could be merged in.\r\n\r\nHappy to add any changes etc. I just thought it would be better to have some documentation, rather than none.","created_at":"2016-04-22T11:15:33Z","updated_at":"2016-04-22T14:09:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c76c1abb99af6d286e60287ffe3aa163497ba08c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/facebook/relay/pulls/1076/commits","review_comments_url":"https://api.github.com/repos/facebook/relay/pulls/1076/comments","review_comment_url":"https://api.github.com/repos/facebook/relay/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/relay/issues/1076/comments","statuses_url":"https://api.github.com/repos/facebook/relay/statuses/aa49a93f4755c9e92578bb6d9548e0ec505525db","head":{"label":"Globegitter:patch-2","ref":"patch-2","sha":"aa49a93f4755c9e92578bb6d9548e0ec505525db","user":{"login":"Globegitter","id":2580254,"avatar_url":"https://avatars.githubusercontent.com/u/2580254?v=3","gravatar_id":"","url":"https://api.github.com/users/Globegitter","html_url":"https://github.com/Globegitter","followers_url":"https://api.github.com/users/Globegitter/followers","following_url":"https://api.github.com/users/Globegitter/following{/other_user}","gists_url":"https://api.github.com/users/Globegitter/gists{/gist_id}","starred_url":"https://api.github.com/users/Globegitter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Globegitter/subscriptions","organizations_url":"https://api.github.com/users/Globegitter/orgs","repos_url":"https://api.github.com/users/Globegitter/repos","events_url":"https://api.github.com/users/Globegitter/events{/privacy}","received_events_url":"https://api.github.com/users/Globegitter/received_events","type":"User","site_admin":false},"repo":{"id":56392326,"name":"relay","full_name":"Globegitter/relay","owner":{"login":"Globegitter","id":2580254,"avatar_url":"https://avatars.githubusercontent.com/u/2580254?v=3","gravatar_id":"","url":"https://api.github.com/users/Globegitter","html_url":"https://github.com/Globegitter","followers_url":"https://api.github.com/users/Globegitter/followers","following_url":"https://api.github.com/users/Globegitter/following{/other_user}","gists_url":"https://api.github.com/users/Globegitter/gists{/gist_id}","starred_url":"https://api.github.com/users/Globegitter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Globegitter/subscriptions","organizations_url":"https://api.github.com/users/Globegitter/orgs","repos_url":"https://api.github.com/users/Globegitter/repos","events_url":"https://api.github.com/users/Globegitter/events{/privacy}","received_events_url":"https://api.github.com/users/Globegitter/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Globegitter/relay","description":"Relay is a JavaScript framework for building data-driven React applications.","fork":true,"url":"https://api.github.com/repos/Globegitter/relay","forks_url":"https://api.github.com/repos/Globegitter/relay/forks","keys_url":"https://api.github.com/repos/Globegitter/relay/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Globegitter/relay/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Globegitter/relay/teams","hooks_url":"https://api.github.com/repos/Globegitter/relay/hooks","issue_events_url":"https://api.github.com/repos/Globegitter/relay/issues/events{/number}","events_url":"https://api.github.com/repos/Globegitter/relay/events","assignees_url":"https://api.github.com/repos/Globegitter/relay/assignees{/user}","branches_url":"https://api.github.com/repos/Globegitter/relay/branches{/branch}","tags_url":"https://api.github.com/repos/Globegitter/relay/tags","blobs_url":"https://api.github.com/repos/Globegitter/relay/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Globegitter/relay/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Globegitter/relay/git/refs{/sha}","trees_url":"https://api.github.com/repos/Globegitter/relay/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Globegitter/relay/statuses/{sha}","languages_url":"https://api.github.com/repos/Globegitter/relay/languages","stargazers_url":"https://api.github.com/repos/Globegitter/relay/stargazers","contributors_url":"https://api.github.com/repos/Globegitter/relay/contributors","subscribers_url":"https://api.github.com/repos/Globegitter/relay/subscribers","subscription_url":"https://api.github.com/repos/Globegitter/relay/subscription","commits_url":"https://api.github.com/repos/Globegitter/relay/commits{/sha}","git_commits_url":"https://api.github.com/repos/Globegitter/relay/git/commits{/sha}","comments_url":"https://api.github.com/repos/Globegitter/relay/comments{/number}","issue_comment_url":"https://api.github.com/repos/Globegitter/relay/issues/comments{/number}","contents_url":"https://api.github.com/repos/Globegitter/relay/contents/{+path}","compare_url":"https://api.github.com/repos/Globegitter/relay/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Globegitter/relay/merges","archive_url":"https://api.github.com/repos/Globegitter/relay/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Globegitter/relay/downloads","issues_url":"https://api.github.com/repos/Globegitter/relay/issues{/number}","pulls_url":"https://api.github.com/repos/Globegitter/relay/pulls{/number}","milestones_url":"https://api.github.com/repos/Globegitter/relay/milestones{/number}","notifications_url":"https://api.github.com/repos/Globegitter/relay/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Globegitter/relay/labels{/name}","releases_url":"https://api.github.com/repos/Globegitter/relay/releases{/id}","deployments_url":"https://api.github.com/repos/Globegitter/relay/deployments","created_at":"2016-04-16T15:56:42Z","updated_at":"2016-04-16T15:56:44Z","pushed_at":"2016-04-22T11:17:25Z","git_url":"git://github.com/Globegitter/relay.git","ssh_url":"git@github.com:Globegitter/relay.git","clone_url":"https://github.com/Globegitter/relay.git","svn_url":"https://github.com/Globegitter/relay","homepage":"https://facebook.github.io/relay/","size":10686,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"facebook:master","ref":"master","sha":"05164e1e4d0e20fa4eab65163481ad81a4e65bd0","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":40508605,"name":"relay","full_name":"facebook/relay","owner":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebook/relay","description":"Relay is a JavaScript framework for building data-driven React applications.","fork":false,"url":"https://api.github.com/repos/facebook/relay","forks_url":"https://api.github.com/repos/facebook/relay/forks","keys_url":"https://api.github.com/repos/facebook/relay/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/relay/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/relay/teams","hooks_url":"https://api.github.com/repos/facebook/relay/hooks","issue_events_url":"https://api.github.com/repos/facebook/relay/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/relay/events","assignees_url":"https://api.github.com/repos/facebook/relay/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/relay/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/relay/tags","blobs_url":"https://api.github.com/repos/facebook/relay/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/relay/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/relay/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/relay/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/relay/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/relay/languages","stargazers_url":"https://api.github.com/repos/facebook/relay/stargazers","contributors_url":"https://api.github.com/repos/facebook/relay/contributors","subscribers_url":"https://api.github.com/repos/facebook/relay/subscribers","subscription_url":"https://api.github.com/repos/facebook/relay/subscription","commits_url":"https://api.github.com/repos/facebook/relay/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/relay/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/relay/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/relay/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/relay/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/relay/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/relay/merges","archive_url":"https://api.github.com/repos/facebook/relay/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/relay/downloads","issues_url":"https://api.github.com/repos/facebook/relay/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/relay/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/relay/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/relay/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/relay/labels{/name}","releases_url":"https://api.github.com/repos/facebook/relay/releases{/id}","deployments_url":"https://api.github.com/repos/facebook/relay/deployments","created_at":"2015-08-10T22:09:16Z","updated_at":"2016-04-22T08:52:45Z","pushed_at":"2016-04-22T11:17:26Z","git_url":"git://github.com/facebook/relay.git","ssh_url":"git@github.com:facebook/relay.git","clone_url":"https://github.com/facebook/relay.git","svn_url":"https://github.com/facebook/relay","homepage":"https://facebook.github.io/relay/","size":12881,"stargazers_count":6225,"watchers_count":6225,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":463,"mirror_url":null,"open_issues_count":136,"forks":463,"open_issues":136,"watchers":6225,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/relay/pulls/1076"},"html":{"href":"https://github.com/facebook/relay/pull/1076"},"issue":{"href":"https://api.github.com/repos/facebook/relay/issues/1076"},"comments":{"href":"https://api.github.com/repos/facebook/relay/issues/1076/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/relay/pulls/1076/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/relay/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/relay/pulls/1076/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/relay/statuses/aa49a93f4755c9e92578bb6d9548e0ec505525db"}}}}