I use react-relay-router and created very simple app.
Fetching to graphql server using relay is working correctly and I get desired response, but the component inside the container does not get that data correctly.
Here is my component.
class Home extends React.Component {
render() {
console.log(this.props.viewer) // {__dataID__: "Vmlld2VyOnZpZXdlcg=="}. it should have 'anonymous: true' and 'user: null'
return (
<div>
{this.props.children}
</div>
)
}
}
export default Relay.createContainer(Auth, {
fragments: {
viewer: (params) => {
return Relay.QL`
fragment on Viewer {
anonymous
user {
name
email
}
}
`;
},
},
});
Sorry, it seems my environment problem. Deleting all webpack generated files and rebuild fixed this issue.
Using happyhack and DllPlugin might do something, I will check into it.
I use react-relay-router and created very simple app. Fetching to graphql server using relay is working correctly and I get desired response, but the component inside the container does not get that data correctly.
Here is my component.
queries passed to router is very simple.
then, graphql sent to the server is like this,
the response json is like this. the user is null because I haven't logged in yet. it's ok.
as written above, the graphql request is correctly sent and also got correct response. But the component inside the container does not get the props.
What should I supposed to do here?