Send a Cookie header field in relay request

不羁的心 提交于 2019-12-04 16:51:42

Set your cookies in the usual way (using browser APIs) then configure fetch as follows to have them sent along with each request:

Relay.injectNetworkLayer(
  new Relay.DefaultNetworkLayer('/graphql', {
    credentials: 'same-origin',
  })
);

See also: https://github.com/facebook/relay/issues/437

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!