Hacker News new | ask | show | jobs
by xiaomai 2582 days ago
GraphQL is amazing. Building an API and then playing around with it in GraphiQl is really a exciting experience.

I've played with Relay (relay-modern looks great, but when I needed to pick a graphql client it hadn't been released yet). Apollo is frustrating: it's big and complicated and obsessed with stuff that I don't want (link-state and a bunch of product up-sells).

I'm glad urql is getting some more attention and I'll definitely give it a spin.

2 comments

I was just looking for a smaller/simpler graphQL client. But I cannot try this yet as I need SSR (I'd need to remove SSR from my app in order to implement this library)

I hope SSR support is included soon!

Yes, we're already working on SSR support! https://github.com/FormidableLabs/urql/issues/218

Since we didn't want to go down the same road as some other libraries that use renderToStaticMarkup and a promise-queue, we've already built a supporting package so that we can implement SSR-support using suspense. (At least the unstable API of suspense; which is as simple for us as adding throwing promises to our components and hooks) https://github.com/FormidableLabs/react-ssr-prepass

Will definitely try it when it comes out.
Quick update: We've just published v1.1 with server-side rendering support! https://github.com/FormidableLabs/urql/releases/tag/v1.1.0
What is GraphQL like in production at scale? It seems like a neat concept but how do traditional web technologies like edge caching work?
It tips it all on it's head. It's generally a POST request and so doesn't cache at alls (you can configure it with a long GET request). All caching is done client side but at object level, including not requesting fields that you might have already requested previously on other calls.
It's fantastic at scale for web applications (far better than the REST apis it has replaced since over-fetching isn't a concern). I don't work on content sites or anything where edge caching applies though, so YMMV. (All our static content is served via CDN but API content is not generally cachable).