当使用apollo服务器和graphql工具时,我没有得到相应的扩展
我有一个graphql服务器,它充当到serval graphql api服务器的网关,由于某些原因,我没有在响应的扩展中获得自定义字段 我正在使用当使用apollo服务器和graphql工具时,我没有得到相应的扩展,graphql,apollo,graphql-js,apollo-server,Graphql,Apollo,Graphql Js,Apollo Server,我有一个graphql服务器,它充当到serval graphql api服务器的网关,由于某些原因,我没有在响应的扩展中获得自定义字段 我正在使用graphql工具mergeSchema函数和apollo服务器库 const expressApp = express(); const server = new ApolloServer({ schema, tracing: true, cacheControl: true, }); 我的回答
graphql工具
mergeSchema函数和apollo服务器
库
const expressApp = express();
const server = new ApolloServer({
schema,
tracing: true,
cacheControl: true,
});
我的回答是这样的:
"data":{....},
"extensions": {
"tracing": {}
"cacheControl":{}
}
如果我在没有网关的情况下查询graphql api,我会在响应中的扩展部分中获得自定义字段,但似乎apollo服务器
库或graphql工具
会从扩展中发出自定义字段
注意:我尝试使用formatResponse,如下面的答案,但未成功获取扩展中的自定义字段-
谢谢你的帮助