Merge remote-tracking branch 'origin/master'

This commit is contained in:
Nikola Bjelo committed 2018-11-06 18:47:20 +01:00
commit e4a55de951
2 files changed
+21 -3

No files matched your search

+15
View File
@@ -73,8 +73,23 @@ const authLink = setContext((_, { headers }) => {
const cache = new InMemoryCache().restore(window.__APOLLO_STATE__)
const defaultOptions = {
watchQuery: {
fetchPolicy: 'cache-and-network',
errorPolicy: 'all'
},
query: {
fetchPolicy: 'cache-and-network',
errorPolicy: 'all'
},
mutate: {
errorPolicy: 'all'
}
}
export const client = new ApolloClient({
link: ApolloLink.from([authRetryLink, authLink, httpLink]), // replaced link with httpLink
cache,
defaultOptions,
connectToDevTools: true
})
+6 -3
View File
@@ -18,12 +18,15 @@ async function getUserId (authId) {
}
const userData = await axios({
url: process.env.GRAPHQL_API_URL,
url: process.env.USERS_API_URL,
method: 'post',
headers: {
preshared: process.env.USERS_API_PRESHARED
},
data: {
query: `
{
users_UserByAuthId(authId: "${authId}")
userByAuthId(authId: "${authId}")
{
id
}
@@ -31,7 +34,7 @@ async function getUserId (authId) {
`
}
})
return userData.data.data.users_UserByAuthId.id
return userData.data.data.userByAuthId.id
} catch (error) {
return (error)
}