News for hackers. Stuff that matters.
Re:Why, after 6 years, I'm over GraphQL by zer00eyz on Thursday May 30, 2024 @05:09AM (#40521605)
GraphQL is the peanut butter to Reacts chocolate at FB.

It works there because

1. Every user is logged in. Is there anything you can do at FB without giving up something to the Zuck?

2. Because it's all behind a login, you can front load the first login/request with a giant SPA and then run all the custom queries you want.

3. everything at FB is some sort of blended context (my user, someone else's user, a permissions interaction)... security is baked in to every field.

4. Because of permissions, and login requirement it's hard to be a bad actor (FB just locks you out, nothing is public).

If you have a SPA and logged in user requirement and that robust permissions model then GraphQL might make sense... Otherwise its a shining example of conways law and might not be fit for your org... The same can be said for react too.

Re:Why, after 6 years, I'm over GraphQL by daxfohl on Thursday May 30, 2024 @12:03PM (#40525278)
Does TAO help? I imagine it's a lot easier to embed all this additional logic and metametametadata in a single service than distribute.
Re:Why, after 6 years, I'm over GraphQL by gaogao on Thursday May 30, 2024 @05:06PM (#40528711)
Nah, it's one level up having basically everything as an Ent (ORM object) with an associated data access policy that does that.
Re:Why, after 6 years, I'm over GraphQL by graemep on Thursday May 30, 2024 @06:21AM (#40522048)
FB have a lot of resources to manage the complexity of this.

For most people "security is baked in to every field" is going to be very expensive.

Re:Why, after 6 years, I'm over GraphQL by zer00eyz on Thursday May 30, 2024 @06:28AM (#40522093)
Candidly, I think a lot of the "security" is baked into the data model of what FB is... Are we linked on the graph, are we linked directly, what do your permissions allow me to do based on that relationship. It isn't a difficult query to wrap most requests in. I dont think FB needs that many people keeping an eye on this.

That having been said, outside that data model, your absolutely correct that its going to be costly to maintain those extra layers of relationships.

Re:Why, after 6 years, I'm over GraphQL by UweSchmidt on Thursday May 30, 2024 @05:56AM (#40521909)
What if Facebook wanted to open up parts of the site for users without an account, would that require a major reengineering? I've wondered why Facebook (and Instagram) are so strict about not showing anything to logged-out users, could technical reasons be part of that decision?
Re:Why, after 6 years, I'm over GraphQL by tomlong on Thursday May 30, 2024 @05:59AM (#40521925)
I think this currently exists in some shape or other, I don’t have a facebook account but I can click on profiles of businesses and get their opening hours and pictures of their menus or whatever. In think there must be some stuff with a public context.
Re:Why, after 6 years, I'm over GraphQL by 9dev on Thursday May 30, 2024 @06:09AM (#40521975)
My guess would be they SSR those pages and partially hydrate the page on the client if the user is logged in.
Re:Why, after 6 years, I'm over GraphQL by dumbo-octopus on Thursday May 30, 2024 @09:48AM (#40523688)
Are they? I have full access to all the Instagram reels, posts, comments, etc. friends send me, without being logged in.
Re:Why, after 6 years, I'm over GraphQL by Kwpolska on Thursday May 30, 2024 @10:00AM (#40523828)
Not really, it’s 100% business reasons. Facebook and especially Instagram used to be much more open to logged-out users in the past.
Re:Why, after 6 years, I'm over GraphQL by BiteCode_dev on Thursday May 30, 2024 @07:47AM (#40522594)
No, GraphQL makes sense at facebook because at their scale, dealing with the consequence of allowing all possible queries was less work that having to create dedicated enpoints for all the possible client queries.

People completely missed the point of GraphQL, which is you TRADE flexibility for the client for added cost on the server.

Which in a app and team as huge as facebooks' made sense, especially since they have the so-called facebook apps that could do... anything.

Re:Why, after 6 years, I'm over GraphQL by hot_gril on Thursday May 30, 2024 @11:49AM (#40525096)
Yep, GQL can make sense if you have tons of clients.
Re:Why, after 6 years, I'm over GraphQL by aprilthird2021 on Thursday May 30, 2024 @11:50PM (#40531298)
> People completely missed the point of GraphQL, which is you TRADE flexibility for the client for added cost on the server.

I mean, isn't this THE selling point of GraphQL? How was it missed so badly? I think every elementary resource about the technology covers this in the pros and cons section...

Re:Why, after 6 years, I'm over GraphQL by jamesrr39 on Thursday May 30, 2024 @05:46AM (#40521840)
presumably there is still some authorization requirements though? The logged in user is authorized to see details about Friend 123, but not about Non-Friend 456?
Re:Why, after 6 years, I'm over GraphQL by andrelaszlo on Thursday May 30, 2024 @06:02AM (#40521943)
That might be what they meant by "robust permissions model".