React Hooks with Apollo GraphQL

preview_player
Показать описание
We'll transform some React code using the Query component from Apollo GraphQL to use hooks! The code ends up being WAY cleaner and easier to reason about.

Рекомендации по теме
Комментарии
Автор

Thanks Leigh for covering some of the newer technologies such as hooks and graphql. You do an excellent job with your presentations and explanation of material. Thanks again for providing your awesome videos!

markthrasher
Автор

Great, thank you for starting me in the right direction Leigh. Would have been helpful to see the Mutation example as well, but hopefully the docs for it are obvious.

Thumbs up !

gkr
Автор

good job! "import { ApolloProvider } from 'react-apollo-hooks'" just works. I guess we don't need to import twice now

lucasquinnlife
Автор

I tend to avoid using the Query/Mutation components by instead using compose(). I even use compose when I have only one query or mutation for the simple benefit avoiding the ugly Query/Mutation syntax.

Just curious if there's any reason you WOULDN'T use compose() that I'm not aware of? Compose seems to do a similar, but not quite as neat, amount of cleanup. Just wondering if there's something i'm losing by using compose to wrap the export I'm not aware of.

Anyways, super helpful vid. Def gonna put this to use ASAP.

keepforever
Автор

Nice video. This video is a few years old but if you still read this can you tell me if the data here is fetched on the server if not(i assume it's on the client) is there anyway we can use it in the ssr with hooks?

panicatthedisconnect
Автор

Why are we putting two Apollo Providers? I tried and it works, just want to know the reason.

agrawalnikhil
Автор

Hi Leigh

Do you know anything about writing tests for components using the useQuery Hook? I’ve been trying to figure out how to write test for some components, and I’ve struggled.

jd_addy
Автор

How can we pass links parameter in hooks as pass this.props.match.params , ,means how can define unique id

muizuddeenahmad