Facebook Relay: An Evil And/Or Incompetent Attack on REST
31–40 of 166 posts
Re: Facebook Relay: An Evil And/Or Incompetent Attack on REST
#32Re: Facebook Relay: An Evil And/Or Incompetent Attack on REST
#33There seems to be a lot of attacking the messenger rather than the message in these comments. Interesting.
Re: Facebook Relay: An Evil And/Or Incompetent Attack on REST
#34I'm not going to pick through the OP post, except this line:
"a REST endpoint can return whatever you want"
Yep. I know this and have done that: an endpoint to return complex data. And it never felt right - either I make a bunch of special endpoints losing all of the nice consistency of REST, or I have endpoints that return too much or too little. Or I have a highly parameterized endpoint that essentially lets me pass it a query (cough like GraphQL!)
At the start of the year, I was thinking about how I would like to write my applications client and what I (conceptually, I never got to implement it) came up with was rather similar in concept to Relay/GraphQL in that UI components declaratively state what data they are interested in and the system keeps it in sync by querying the server similar to how Relay/GraphQL do.
I personally find that model much nicer than REST.
But... as a consumer of third-party API's, I do love REST and worry about what a shift might do. However, from a SPA application development point of view, I love the concepts behind Relay and GraphQL more than REST.
But hey - I guess I just don't understand REST well enough (actually, I really don't - I'd be the first to admit it!), despite spending a long conscious effort in trying to. Which is the problem: this mythical "proper" REST seems too difficult to understand and use, so everyone kinda just makes up their own flawed flavour and calls it REST.
Re: Facebook Relay: An Evil And/Or Incompetent Attack on REST
#35Why is this upvoted so much? It's a complete strawman. Facebook's own intro at https://facebook.github.io/react/blog/2015/05/01/graphql-int... states: "There is actually much debate about what exactly REST is and is not. We wish to avoid such debates. We are interested in the typical attributes of systems that self-identify as REST, rather than systems which are formally REST." "We believe there are a number of weakn…
Re: Facebook Relay: An Evil And/Or Incompetent Attack on REST
#36Facebook is not trying to kill REST. It just doesn't work well for their use-case. So, they make their own system that suits them better. What's wrong with that?
Re: Facebook Relay: An Evil And/Or Incompetent Attack on REST
#37Earlier quoted context omitted.
"So we have to make endpoints around every possible subset?" No, you use the query in querystring. One way or another you're offering a query interface. A lot of REST is just about how you offer the same interfaces you were planning on offering anyhow. Which is probably a source of a lot of the frustration REST advocates experience. If you're genuinely doing something that REST can't do very well, OK then, but if you…
> No, you use the query in querystring. Ok, but doing that straight on top of HTTP, will only cache queries that are exactly equal to previous ones. Not queries that are a subset of previous queries.
I actually don't deny there's a use case here necessarily, but it may not be all that large, even to Facebook.
Re: Facebook Relay: An Evil And/Or Incompetent Attack on REST
#38I have to agree with this article. There is a tendency in tech to reinvent what we don't understand properly, and from experience of using third-party APIs (and from my own ignorance too) - HTTP is the thing we seem to know the least about (well actually one could argue TCP/IP is ...) I read this article from top to bottom and I didn't feel the comments were extreme or purist. It did leave me thinking we need to spen…
If you have to say "oh, this thing is universally great, you all just don't understand it," I will bet hard against you at the first opportunity and I'll usually win in the process.
Re: Facebook Relay: An Evil And/Or Incompetent Attack on REST
#39This article is a load of bullshit. When Facebook announced Relay it made immediate sense to me. The problem of fetching the right data from the backend is a pain in the ass for anyone that has built more than a simple todo app. To me it is like sending a SQL query to the backend and instead of getting rows back you get objects nested in a way you specify. The problem when using REST "correctly" is that the way your…
Re: Facebook Relay: An Evil And/Or Incompetent Attack on REST
#40Earlier quoted context omitted.
> No, you use the query in querystring. Ok, but doing that straight on top of HTTP, will only cache queries that are exactly equal to previous ones. Not queries that are a subset of previous queries.
If the [data returned following a] query is a subset [of data points already returned] why do you need to get it again; if you actually need to re-retrieve it then it being cached is no use unless you dumped it from local cache mistakenly - that shouldn't be an often enough occurrence to need to cache the data. Or did I miss something?
I imagine this is useful at facebook, for example for loading parts of public peoples pages, etc.
You are right, that if the data is only used by you, you can just have an advanced cache in the client, sorting it out for you.