这可能是由于Apollo Server Express 3缓存了数据导致的。可以尝试在Apollo Server实例化的时候使用一个“cacheControl”选项来禁用缓存,该选项应该是一个带有“noCache:true”属性的对象。例如:
const server = new ApolloServer({
typeDefs,
resolvers,
cacheControl: {
noCache: true
}
});
另外,检查代码中是否有执行错误处理的代码,因为如果未处理错误,则可能会导致返回空值。
上一篇:ApolloServerExpress-Playground无法访问
下一篇:ApolloServerExpressv4GraphQLthis.findOneByIdisnotafunction