如何在图内或React中进行编辑

时间:2019-03-18 12:13:20

标签: javascript node.js graphql

我有一个graphql查询,该查询返回一个URL,我想通过Header中的Basic Auth将我的客户端发送到该URL,我尝试访问graphql中的res变量

    app.use('/graphql', express_graphql( (req, res) => ({
      schema: schema,
      rootValue: root,
      graphiql: true,
      context: {
         req: req,
         res: res,
      }
    })));

在查询中,我这样做了

res.redirect(301, "http://google.com")

但是不行,还有其他解决方法吗?

0 个答案:

没有答案