Комментарии:
merci bro
ОтветитьDo we need to add a query component when fetching data from graphql? Thanks.
Ответитьman, can you give me new tutorial using apollo 2, thanks
ОтветитьMan, you are the greatest teacher ever!
ОтветитьCan't follow, im new to react :(
ОтветитьTypeError: Object(...) is not a function in const mutation = gql`mutation ...` someone knows?
Ответитьgood stuff. im on cloud 9 so i had to use cors as well. configuring like this seems to work:
server.use('*', cors({ origin: <whitelisted url aka client> }));.
the npm package - concurrently - is pretty cool too. lets you run both apps with one npm start command easily.
psyched i have the time to check this series out, my first time not using mongoDB, i didn't know previously but postgres is pre installed into c9 workspaces. i like how you pass models into context, this really cuts down on the amount of code i would normally use in resolvers. i wonder a similar approach works with a mongo setup.
i usually import each model separately, idk creating new data in mongoose is a little different.
Hey Ben, great video. I am getting this error in my console: `bundle.js:sourcemap:29431 Uncaught TypeError: (0 , _reactApollo.gql) is not a function` and am not sure what it means.
Ответитьimport React from 'react';
import { gql, graphql } from 'react-apollo';
const Home = ({ data: { allUsers = [] } }) => allUsers.map(u => <h1 key={u.id}>{u.email}</h1>);
const allUsersQuery = gql`
{
allUsers {
id
email
}
}
`;
export default graphql(allUsersQuery)(Home);
const allUsersQuery = gql`
{
allUsers {
id
email
}
}
`;
I am getting this error: TypeError: Object(...) is not a function
./src/routes/Home.js
src/routes/Home.js:6
I can't figure it out. Code look exactly as yours, but there is something I'm missing. Any help would be appreciated. I am still searching for an answer.
you'll probably want
```
env: {
'browser': true
},
```
in the eslint config instead of explicitly defining the global