Javascript 带有代理和服务器的GraphQL错误ParseError

Javascript 带有代理和服务器的GraphQL错误ParseError,javascript,reactjs,create-react-app,apollo-server,Javascript,Reactjs,Create React App,Apollo Server,如何修复下面的错误 代理错误:无法将请求/localhost:3000/graphql从localhost:3000代理到http://localhost:3001/. 这是我的server.js const express=require('express'); const path=require('path'); const db=require('./config/connection'); const{ApolloServer}=require('apollo-server-expr

如何修复下面的错误

代理错误:无法将请求/localhost:3000/graphql从localhost:3000代理到http://localhost:3001/.

这是我的
server.js

const express=require('express');
const path=require('path');
const db=require('./config/connection');
const{ApolloServer}=require('apollo-server-express');
const{typeDefs,resolvers}=require('./schemas');
//常量路由=需要('./路由');
const{auth}=require('./utils/auth');
常量app=express();
const PORT=process.env.PORT | | 3001;
const server=新服务器({
typeDefs,
解析器,
上下文:auth中间件
});
applyMiddleware({app});
use(express.urlencoded({extended:true}));
使用(express.json());
//如果我们在生产中,将客户机/构建作为静态资产提供服务
if(process.env.NODE_env===‘生产’){
使用(express.static(path.join(u dirname,../client/build'));
}
//应用程序使用(路线);
db.one('打开',()=>{
应用程序侦听(端口,()=>{

console.log(`can you post the reply of the graphql request?从错误中可以看出,服务器正在使用非json回复进行响应。graphql request的回复在哪里?您可以在chrome dev tools的网络选项卡中找到它。它应该是对请求的uri localhost:3000/localhost:3001/graphql的post请求。请注意,您正在使用create-react-app。这是附加到代理的错误:ECONREFUSE(连接被拒绝):无法建立连接,因为目标计算机主动拒绝了它。这通常是由于尝试连接到外部主机上处于非活动状态的服务。您可以发布graphql请求的答复吗?从错误中可以看出,服务器正在使用非json答复进行响应。graphql请求的答复在哪里?您可以在chrome开发工具的“网络”选项卡中添加它。它应该是对请求的uri localhost:3000/localhost:3001/graphql的post请求。请注意,您正在使用create-react-app。这是附加到代理错误的内容:ECONREFUSE(连接被拒绝):无法建立连接,因为目标计算机主动拒绝它。这通常是由于尝试连接到外部主机上处于非活动状态的服务。