Merge pull request #63 from AAVikings/master
fixing issue with geting user
This commit is contained in:
1 file changed
+6
-6
+6
-6
@@ -13,13 +13,13 @@ import logger from './logger'
|
||||
|
||||
async function getUserId (authId) {
|
||||
try {
|
||||
const userDate = await axios({
|
||||
url: process.env.USERS_API_URL,
|
||||
const userData = await axios({
|
||||
url: process.env.GRAPHQL_API_URL,
|
||||
method: 'post',
|
||||
data: {
|
||||
query: `
|
||||
{
|
||||
userByAuthId(authId: "${authId}")
|
||||
users_UserByAuthId(authId: "${authId}")
|
||||
{
|
||||
id
|
||||
}
|
||||
@@ -27,7 +27,7 @@ async function getUserId (authId) {
|
||||
`
|
||||
}
|
||||
})
|
||||
return userDate.data.data.userByAuthId.id
|
||||
return userData.data.data.users_UserByAuthId.id
|
||||
} catch (error) {
|
||||
return (error)
|
||||
}
|
||||
@@ -147,11 +147,11 @@ async function run () {
|
||||
schema,
|
||||
context,
|
||||
formatError: error => {
|
||||
logger.error('An error ocurred inside a module: %s', error)
|
||||
logger.error('An error ocurred inside a module: ' + error)
|
||||
return error
|
||||
},
|
||||
formatResponse: response => {
|
||||
logger.debug('Response from Apolo Server: %s', response)
|
||||
logger.debug('Response from Apolo Server: ' + response)
|
||||
return response
|
||||
},
|
||||
playground: {
|
||||
|
||||
Reference in new issue
Block a user