Ich folge this tutorial und versuche, graphQl zu implementieren. Es gibt ein Problem mit der folgenden Zeile:ApolloClient ist kein Konstruktor react-apollo
const client = new ApolloClient();
Seltsamer ich nichts in der react-apollo
GitHub Seite für diese finden kann. Ist da etwas Dummes, dass ich falsch mache?
import React, { Component } from 'react';
import ChannelsList from './ChannelsList.js';
import './App.css';
import {
ApolloClient,
gpl,
graphql,
ApolloProvider
} from 'react-apollo';
//issue with this line
const client = new ApolloClient();
const channelsListQuery = `
query ChannelsListQuery {
channels {
id,
name
}
}
`;
const ChannelsListWithData = graphql(channelsListQuery)(ChannelsList);
class App extends Component {
render() {
return (
<ApolloProvider client={client}>
<ChannelsListWithData />
</ApolloProvider>
);
}
}
export default App;
Haben Sie versucht, ApolloClient von 'apollo-client' zu importieren? – magnat