react-apollo Network error: Server response was missing for query 'Hello'

react-apollo Network error: Server response was missing for query 'Hello'

我正在尝试使用此代码设置 react-apollo:

import React from 'react';
import {render} from 'react-dom';

import gql from 'graphql-tag';
import { ApolloProvider, graphql } from 'react-apollo';
import { ApolloClient } from 'apollo-client';
import { HttpLink } from 'apollo-link-http';
import { InMemoryCache } from 'apollo-cache-inmemory';


const client = new ApolloClient({
  link: new HttpLink({ uri: 'http://localhost:5000/graphql' }),
  cache: new InMemoryCache()
});



class App extends React.Component {
  render () {
    return <p> Hello React project</p>;  }
}
const MY_QUERY = gql`query Hello { hello }`;

const AppWithData = graphql(MY_QUERY)(App)
render(
  <ApolloProvider client={client}>
    <AppWithData />
  </ApolloProvider>,
  document.getElementById('app')
);

但是,我收到此错误:

查看 chrome 开发工具中的“网络”选项卡,我可以看到请求正在通过:

我想知道我是否缺少一些配置设置来获得正确格式的响应?或者我可能需要 return 来自我的 graphql 端点的不同格式的数据?感谢任何建议,我只是在学习 graphql 和 apollo,所以它可能是非常明显的。谢谢!

问题是我需要将响应包装在 'data' 键中,所以我需要的响应是:

{
    "data": {
         "hello": "hello"
    }   
}

正如我所说,我是 graphql/apollo

的新手