DEV Community

A year of large scale GraphQL - the biggest takeaways

Peter Nycander on June 01, 2019

GraphQL has been around for quite a while now, and it has been a hot topic as a possible candidate for the next generation of data fetching. I hav...
Collapse
 
tahv0 profile image
Tuomas Aho

I made an hybrid API and used both REST and GraphQL at the same time. I make fetch queries and mutations through REST and then use only GraphQL Subscriptions from GraphQL. I could use pure WebSockets too, but I liked to make typeDefs and Apollo's client side libs were easy to use.

Collapse
 
peternycander profile image
Peter Nycander

Interesting! How do you like it? Do you in hindsight wish you did anything different?

Collapse
 
tahv0 profile image
Tuomas Aho

So far decisions I made feels quite good actually.

Thread Thread
 
mathieucaroff profile image
Mathieu CAROFF

7 month later, has there been changes in this approach? Maybe you have some advice?

Collapse
 
khola profile image
Kuba Holak

With AppSync serverless gql subscriptions are simple and seamless!

Collapse
 
peternycander profile image
Peter Nycander

It sure looks like cool tech, but I don't really understand how you implement non-trivial resolvers by reading the docs 🤔. I'll have to play with it sometime!

Collapse
 
tuukkapod profile image
TuukkaPod

You do it with Lambda function.

Thread Thread
 
peternycander profile image
Peter Nycander • Edited

Neat. Do you have experience with such use cases? Would love to read something more in-depth.

For example; on the top of my head when I'm looking at the lambda resolvers, I am thinking about the dataloader-situation. We make heavy use of dataloaders, which are placed in our graphql context. Those mutable objects can't really be transferred to a lambda function right? How would you go about solving that with AppSync? Would that be another layer of lambdas with batching logic, could something like that even work 😕?

Edit: found medium.com/@dadc/aws-appsync-the-u... , good read! I wonder if any new updates has changed the scene...

Thread Thread
 
khola profile image
Kuba Holak

All those things from medium article are true, but most of the limits are reasonable IMO :) I've never used dataloaders, but it's an interesting topic to investigate. Our team uses AppSync heavily, it's possible to create very non-trivial resolvers using VTL only, we are using it heavily with EalsticSearch and DynamoDB.

We are even using AppSync with Redshift (via Lambda), and there we use subscriptions to serve clients with long taking queries - this was the point of my comment, you surely CAN go 100% serverless with GQL subscription and Lambdas :)

Thread Thread
 
tuukkapod profile image
TuukkaPod

Yeah there are definitely still limitations. Not sure how much it has evolved since the update on the article as we just got started with it couple of months ago. It has been so far sufficient for our needs, but yeah data loader sounds like a lot more trickier problem, I'v yet to try to solve that.

Thread Thread
 
khola profile image
Kuba Holak

Of course, every serverless service has its limitations, but if used wisely it can cover most of modern apps scenarios IMO, and then if your case is complex and needs fine-tuning, then maybe serverless is not for you and you should use something else :)

 
peternycander profile image
Peter Nycander

Hey, that is really cool! Thank you for sharing. If the need arises for subscriptions at scale I know where to look :).

Collapse
 
agustif profile image
Agusti Fernandez

Thanks for the post Peter, if you want, you can use (SOFA)[medium.com/the-guild/sofa-the-best...] in order to expose your graphql-backend as a REST API.

You can also checkout the newly release Apollo Federation for graphql Schema stitching!

Collapse
 
victorzamfir profile image
Victor Zamfir

Apollo Federation solves the gateway problem - apollographql.com/docs/apollo-serv...

Collapse
 
peternycander profile image
Peter Nycander

Maybe! I like the approach a lot more than stitching for sure. I am a little afraid to try it though due to my history with stitching.

Collapse
 
victorzamfir profile image
Victor Zamfir

I don't think you should be. Federation is meant to replace it, as stiching has become deprecated now.

Thread Thread
 
peternycander profile image
Peter Nycander

I will follow the discussion for sure, and see how people like it! Might just join in a little late on this one if it turns out to be great.

Collapse
 
jipingwang profile image
Jay

Good one. Been there 10 years ago, same architecture, different jargons: domain query language, stiched query,