Adding the context configuration to apollo server
This commit is contained in:
1 parent
fa02ee7593
commit
b85dcb474f
1 file changed
+4
@@ -29,6 +29,10 @@ const server = new ApolloServer({
|
||||
'editor.cursorShape': 'line',
|
||||
},
|
||||
},
|
||||
context: ({ req }) => ({
|
||||
userId: req.headers.userid,
|
||||
authorization: req.headers.authorization,
|
||||
}),
|
||||
formatError: error => ({
|
||||
code: error.extensions.exception.code,
|
||||
message: error.message,
|
||||
|
||||
Reference in new issue
Block a user