HNHacker News
TopNewBestAskShowJobs

djmashko2

572 karma · joined December 24, 2013

Frontend infrastructure engineer at Stripe, formerly open source lead at Meteor and Apollo
submissionscomments
djmashko2··on The GraphQL stack: How everything fits together
Jonas Helfer gave a talk about this: https://www.youtube.com/watch?v=coU6OmISOBM
djmashko2··on The GraphQL stack: How everything fits together
You're in luck, there are libraries that can do it for you! https://github.com/stems/join-monster

And even a system that generates your whole schema: https://github.com/postgraphql/postgraphql

Plus, the Graphcool framework allows you to bring your own DB: https://github.com/graphcool/framework

djmashko2··on The GraphQL stack: How everything fits together
(Author of the post here)

If you aren't yet familiar with GraphQL and the problems it solves, it might be better to watch the talk on YouTube, since it includes much more of an introduction from the start, plus more color and detail: https://www.youtube.com/watch?v=ykp6Za9rM58

The blog post summary glosses over the introduction and focuses on what a GraphQL-familiar audience will find new, so it's all in the context of the current GraphQL community.

You can also catch up on some of the tools and benefits, and see some case studies from people using GraphQL in production, on our Explore GraphQL site: https://www.graphql.com/

djmashko2··on The GraphQL stack: How everything fits together
> Because you can't possibly now what your API consumers use on their side.

That's the best part - with GraphQL you _do_ know, since people have to ask for every single field they want.

djmashko2··on The GraphQL stack: How everything fits together
(Author of the post here)

Thanks for the notes!

> And immediately after that the article spends two pages of text explaining how insanely complex the "becomes easy with GraphQL" really is, and offers no actual details on the "easy" part.

Hi, thanks for this piece of feedback! I could have done a better job here, since I was summarizing a 38 min talk into a few paragraphs.

These parts are actually talking about different concepts:

The first is about ensuring that a single fetch from the UI knows about all the data it needs, so you can easily avoid multiple roundtrips to the database. This is something you can do with a basic in-process caching tool called DataLoader: https://github.com/facebook/dataloader

The second is about caching _across_ requests, something that people usually have special infrastructure for in REST, such as Varnish. This talk was elaborating on how a GraphQL-specific piece of caching infrastructure might work, and sit in exactly the same place as REST caching.

> Oh, your client has to be cache aware.

I think the intention was to say that it _could_ be cache aware. It doesn't need to be, but you end up with a really nice situation.

> I would love to see an explanation how GraphQL makes caching for this easy.

My intention here was to say that GraphQL's ability to understand what fields are being asked for makes it easy to return specific cache controls, rather than having to put one on the whole query. So your server basically generates the control for you (this is something that exists today)

> It's called REST APIs and we've known how to do them since 2001.

I don't think REST has a way to automatically combine multiple REST services, and then query them all in one HTTP request without multiple roundtrips to the client, which was the goal here.

Happy to talk more, and thank you for bringing up some of the places where I can communicate more clearly in the future! The audience of the talk was a GraphQL conference, but I should definitely consider next time that people who aren't already bought into the idea of GraphQL will be taking a look as well.

djmashko2··on The GraphQL stack: How everything fits together
We've got one here you can try out, and I hope people build more!

https://www.apollographql.com/engine/

(Disclaimer: I work on Engine)

djmashko2··on The GraphQL stack: How everything fits together
(Author of the post here)

> GraphQL is above all, just an optimization. It optimizes the amount of bytes sent over the network.

This was a common thought when GraphQL was first announced, but working with organizations that are adopting it we've found just the opposite: It's actually the tooling and development velocity benefits that people get the most value of.

It's kind of like if you could design your API to be super orthogonal and fine-grained, while still getting the optimized network transport of hand-coded endpoints for each view.

> The whole "just cache it on the client" is a big joke and many people seem to underestimate getting caching right.

The post goes over a new architecture specifically for server-side caching. Caching on the client is definitely not sufficient! And Relay isn't the way most people are doing GraphQL today. Also, clients are about to start supporting cache control and TTLs, making life a lot easier. I'm curious what the comparison here is, since people using technologies like Redux with REST APIs are also usually caching responses forever.

This is really useful feedback for those of us that think GraphQL is going to be a super important technology going forward, and I hope you give it another shot in a year or two! It's still pretty fresh, especially compared to REST, but I think it will improve quickly :]

djmashko2··on The GraphQL stack: How everything fits together
(Author of the post here)

I think there are 2 differences:

1. It's very very easy to write a GraphQL query, since GraphQL comes with auto-completing tools to do so. Even non-technical staff at our company often use it to get information about customers, etc. 2. The query is written inside the client codebase, which means you don't need to redeploy the server in response to a change in client data requirements. This reduces a significant amount of the friction caused by frontend features needing to wait on backend deploys.

Other than that, you've got it 100%: GraphQL is a technology to make the Backend For Frontend pattern much easier and more flexible.

djmashko2··on The GraphQL stack: How everything fits together
Hi, author of the post here!

With GraphQL, you can think of each field as a tiny endpoint, and you do access control on that in the same way as before.

It turns out that while GraphQL allows the frontend developers to select the data they need, that doesn't result in an unlimited set of queries. You often get a number of queries which is similar to what you would get if you hand-coded specific endpoints for different UI views, which turns out to be a common pattern outside of GraphQL.

> What happens if the user doesn't have access to part of the requested data

In this case, the gateway just falls back to the underlying server implementation, and it's a cache miss.

djmashko2··on Apollo Client 2.0
Hi sumobob! Sashko here - open source lead at Apollo

I'm glad you've been having a great time using Apollo. I hope we've been up front with the idea that we have commercial products since the start, and I think monitoring and analytics are reasonable places to do that since pretty much all of these services are paid. We also provide paid support to large companies trying to move to GraphQL and Apollo.

On the other hand, I'm excited that having a business model will continue enabling us to build great tools, and open source as much as possible. We've been very careful to make sure that all of our tools are decoupled and flexible, and don't lock you into using any other part of the stack. For example, the monitoring in Engine is based on an open source specification called Apollo Tracing: https://github.com/apollographql/apollo-tracing

In fact you could turn on tracing in your GraphQL server and pipe that data into any service you want, so it's pretty straightforward to avoid using Engine if you don't feel it's a good value for you!

Happy to answer any other questions, we're going to keep working on our stuff! Sashko

djmashko2··on Apollo Client 2.0
For sure - we've been super busy also organizing GraphQL Summit so it's been quite a week!
djmashko2··on Apollo Client 2.0
Hi Blake! Unfortunately we did not have time to finish all of the redirects for the old site, so we have both versions up at the moment. I expect to have the redirects working properly by the end of the week, here is the new location for that page: https://www.apollographql.com/docs/react/reference/index.htm...

Thank you for building the ember integration, I’ve met a couple people at GraphQL summit that are really excited about it!

djmashko2··on Relicensing the GraphQL specification
The current license doesn’t prevent you from doing that in any way.
djmashko2··on Why Astronomer is Betting on GraphQL
Here's a page we put together with case studies of companies using GraphQL in production: https://www.graphql.com/case-studies/

There are articles from GitHub, Shopify, Artsy, Walmart, Coursera, New York Times, and more! And these are just companies that have bothered to write an entire article about their experience.

djmashko2··on Vue.js and Brunch: Webpack Alternative
New york times uses React: https://www.nytimes.com/
djmashko2··on REST in Peace. Long Live GraphQL
Yeah, it's really unfortunate that people feel the need to trash other technologies when promoting something.

I'm a big fan of GraphQL and tried to write up a more low-level comparison here: https://dev-blog.apollodata.com/graphql-vs-rest-5d425123e34b

djmashko2··on Apollo Server 1.0  – GraphQL Server for Node.js Frameworks
Yeah the diagram is intended to represent where GraphQL usually sits in your architecture.
djmashko2··on Apollo Server 1.0  – GraphQL Server for Node.js Frameworks
Just did it, thanks so much!
djmashko2··on Apollo Server 1.0  – GraphQL Server for Node.js Frameworks
This is a great answer: https://news.ycombinator.com/item?id=14816423
djmashko2··on Apollo Server 1.0  – GraphQL Server for Node.js Frameworks
It's exactly the same thing but renamed - we're going to make both names work for a few weeks and then deprecate the graphql-server name after all the resources are updated. It's exactly the same, just change your import to "apollo-server-express"
djmashko2··on Apollo Server 1.0  – GraphQL Server for Node.js Frameworks
Hey, I'm on the Apollo team! As mentioned in the blog post, this is just a thin wrapper around the regular GraphQL.js implementation, with a few small bells and whistles added!

The intention of this library isn't to change a lot about how GraphQL servers are written, it's just a stable, community focused library to bind your GraphQL server to a schema.

djmashko2··on How to GraphQL – A Fullstack Tutorial for GraphQL
The thing is that the "all" is actually _not_ generic in this case. The GraphQL server implementor has to specify a field called that specifically.
djmashko2··on React, Relay and GraphQL: Under the Hood of the Times Website Redesign
GraphQL definitely allows GET and supports HTTP caching just as well as any other kind of API!
djmashko2··on React, Relay and GraphQL: Under the Hood of the Times Website Redesign
I think the parent is saying something different: They were happy with GraphQL for their API, but weren't happy with the requirements the Relay client library imposed.

My interpretation is that they are now using a GraphQL API but fetching from it with regular HTTP fetches and managing data with Redux on the frontend.

djmashko2··on React, Relay and GraphQL: Under the Hood of the Times Website Redesign
This is definitely a real problem and we just launched a website yesterday which we hope will grow into a resource for this kind of more advanced content: http://www.graphql.com/guides/

You can also see a lot of examples of GraphQL server code for JS here: https://github.com/apollographql/launchpad

It includes connecting to DBs, APIs, etc.

djmashko2··on Launchpad: JSFiddle for GraphQL servers
Yep! Someone else posted it so didn't get to make that call :) I think we learned we need to make the UI itself have a mini tutorial.
djmashko2··on Launchpad: JSFiddle for GraphQL servers
One of the creators of Launchpad here, happy to answer any questions! If you're looking for some examples to get started with, you can find those here: https://github.com/apollographql/awesome-launchpad

Please add your own if you build something cool!

djmashko2··on Graphcool – Serverless GraphQL Back End
Really excited about this launch, Graphcool has been an awesome part of the GraphQL community, organizing the upcoming GraphQL Europe conference, and creating some great content. I work on Apollo, a set of tools for GraphQL including some client libraries, and if you're looking to get started building a full-stack app with GraphQL, Graphcool, and Apollo, there are some really great options!

1. Learn Apollo, build a simple Pokedex app: https://www.learnapollo.com/

2. Freecom, an intercom clone: https://www.graph.cool/freecom/

Getting started only takes a few minutes, and you can get a taste of the awesome experience you can get as a frontend developer building on GraphQL.

djmashko2··on Relay Modern: Simpler, faster, more extensible
For anyone that comes along, I answered in this comment: https://news.ycombinator.com/item?id=14143112
djmashko2··on Relay Modern: Simpler, faster, more extensible
I answered in this comment: https://news.ycombinator.com/item?id=14143112
← PreviousPage 2 of 5Next →