--Originally published at Stories by Luis Arturo Mendoza on Medium
Thanks Brian for this great tuto!
I have a problem with the auth part, I got this error:
{
“data”: {
“getUser”: null
},
“errors”: [
{
“message”: “User not authenticated”,
“locations”: [
{
“line”: 2,
“column”: 3
}
],
“path”: [
“getUser”
],
“extensions”: {
“code”: “INTERNAL_SERVER_ERROR”,
“exception”: {
“stacktrace”: [
“Error: User not authenticated”,
“ at field.resolve (/Users/luisarturomendozareyes/Documents/node_graphql_apollo_template/src/graphql/directives/auth.directive.ts:27:15)”,
“ at field.resolve (/Users/luisarturomendozareyes/Documents/node_graphql_apollo_template/node_modules/graphql-extensions/src/index.ts:207:30)”,
“ at resolveFieldValueOrError (/Users/luisarturomendozareyes/Documents/node_graphql_apollo_template/node_modules/graphql/execution/execute.js:479:18)”,
“ at resolveField (/Users/luisarturomendozareyes/Documents/node_graphql_apollo_template/node_modules/graphql/execution/execute.js:446:16)”,
“ at executeFields (/Users/luisarturomendozareyes/Documents/node_graphql_apollo_template/node_modules/graphql/execution/execute.js:293:18)”,
“ at executeOperation (/Users/luisarturomendozareyes/Documents/node_graphql_apollo_template/node_modules/graphql/execution/execute.js:237:122)”,
“ at executeImpl (/Users/luisarturomendozareyes/Documents/node_graphql_apollo_template/node_modules/graphql/execution/execute.js:85:14)”,
“ at Object.execute (/Users/luisarturomendozareyes/Documents/node_graphql_apollo_template/node_modules/graphql/execution/execute.js:62:35)”,
“ at Promise.resolve.then (/Users/luisarturomendozareyes/Documents/node_graphql_apollo_template/node_modules/apollo-server-core/src/runQuery.ts:235:23)”,
“ at process._tickCallback (internal/process/next_tick.js:68:7)”
]
}
}
}
]
}
(I created an user y put the JWT into the header)
I tried to fixed it, but I new with TypeScript and GraphQL. Any idea to fixed it?
Thanks!