matty
09/19/2017, 3:20 AMbe4r
09/19/2017, 4:16 AMconst networkInterface = createNetworkInterface({
uri: 'my-uri',
opts: {
credentials: 'same-origin',
},
});
const client = new ApolloClient({
networkInterface,
});
and in my server with the cors
package,
var corsOptions = {
origin: '<insert uri of front-end domain>',
credentials: true // <-- REQUIRED backend setting
};
app.use(cors(corsOptions));
but when I console.log(req)
in the server, what am i supposed to look for to extract the credential token?matty
09/19/2017, 4:17 AMmatty
09/19/2017, 4:18 AMbe4r
09/19/2017, 9:45 PMconst componentApollo = compose(
withApollo,
graphql(getAllAssets, {name: 'getAllAssets'}),
graphql(getUserAssets, {
options: ({user}) => ({variables : {userId: user.id}})
})
)(ComponentContainer)
so the easiest way i found is to just query the user in a parent component and then pass it down as props into this ComponentContainermatty
09/20/2017, 1:39 AMquery { user { firstName, lastName, emailAddress } }