{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/relay/issues/1215","repository_url":"https://api.github.com/repos/facebook/relay","labels_url":"https://api.github.com/repos/facebook/relay/issues/1215/labels{/name}","comments_url":"https://api.github.com/repos/facebook/relay/issues/1215/comments","events_url":"https://api.github.com/repos/facebook/relay/issues/1215/events","html_url":"https://github.com/facebook/relay/issues/1215","id":160315167,"number":1215,"title":"How to dynamically change the network layer? ","user":{"login":"ron-liu","id":1534952,"avatar_url":"https://avatars.githubusercontent.com/u/1534952?v=3","gravatar_id":"","url":"https://api.github.com/users/ron-liu","html_url":"https://github.com/ron-liu","followers_url":"https://api.github.com/users/ron-liu/followers","following_url":"https://api.github.com/users/ron-liu/following{/other_user}","gists_url":"https://api.github.com/users/ron-liu/gists{/gist_id}","starred_url":"https://api.github.com/users/ron-liu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ron-liu/subscriptions","organizations_url":"https://api.github.com/users/ron-liu/orgs","repos_url":"https://api.github.com/users/ron-liu/repos","events_url":"https://api.github.com/users/ron-liu/events{/privacy}","received_events_url":"https://api.github.com/users/ron-liu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-06-15T00:35:20Z","updated_at":"2016-06-15T11:27:46Z","closed_at":null,"body":"How to call injectNetworkLayer without token when bootstrapping, and then overwrite the networklayer after signing in, like the following code shows:\r\n\r\n```javascript\r\n// when bootstrapping\r\nRelay.injectNetworkLayer(\r\n    new Relay.DefaultNetworkLayer('http://some-server/graphql')\r\n);\r\n\r\n// after signing in\r\nsignIn().then(token => {\r\n   Relay.injectNetworkLayer(\r\n    new Relay.DefaultNetworkLayer('/graphql'), {\r\n        headers: {\r\n            Authorization: `Bearer  ${token}`\r\n        }\r\n    } \r\n   // Currently, the above sentence will throw exception and prevent overwriting, what is the other way to accomplish?  \r\n\r\n});\r\n```"},"comment":{"url":"https://api.github.com/repos/facebook/relay/issues/comments/226160481","html_url":"https://github.com/facebook/relay/issues/1215#issuecomment-226160481","issue_url":"https://api.github.com/repos/facebook/relay/issues/1215","id":226160481,"user":{"login":"ron-liu","id":1534952,"avatar_url":"https://avatars.githubusercontent.com/u/1534952?v=3","gravatar_id":"","url":"https://api.github.com/users/ron-liu","html_url":"https://github.com/ron-liu","followers_url":"https://api.github.com/users/ron-liu/followers","following_url":"https://api.github.com/users/ron-liu/following{/other_user}","gists_url":"https://api.github.com/users/ron-liu/gists{/gist_id}","starred_url":"https://api.github.com/users/ron-liu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ron-liu/subscriptions","organizations_url":"https://api.github.com/users/ron-liu/orgs","repos_url":"https://api.github.com/users/ron-liu/repos","events_url":"https://api.github.com/users/ron-liu/events{/privacy}","received_events_url":"https://api.github.com/users/ron-liu/received_events","type":"User","site_admin":false},"created_at":"2016-06-15T11:27:46Z","updated_at":"2016-06-15T11:27:46Z","body":"I already in 0.9.0, I am sure when calling injectNetworkLayer second time, it will cause an exception.\r\n\r\n@nodkz, thanks for your powerful library, I will use it soon. "}}
{"actor":{"display_login":"ron-liu"}}