nadav-dav / apollo-smart-query

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PoC - Apollo smart query.

This repo is a PoC that allows you to handle local state management using Apollo Graphql resolvers.

The gist

In the resolvers.ts file you can see how to create a watched variable, much like Apollo had created in version 3. But unlike the new version, my system is using the regular local resolvers and not the typePolicies of the cache (the api there is really uncomfortable...).

Hooks

Using the query hooks is exactly like Apollo's useQuery, but instead, I use useSmartQuery . Check it out in Display.tsx.

Any questions? Please feel free to discuess it here :)

Nadav

About


Languages

Language:TypeScript 66.4%Language:HTML 21.8%Language:CSS 11.8%