GraphQL Working Draft
31–40 of 71 posts
Re: GraphQL Working Draft
#32Lol - the code example seems to imply that Zuckerburg's user id is 4.
Re: GraphQL Working Draft
#33Earlier quoted context omitted.
Unlike with RESTful APIs, a server basically only needs a single endpoint that parses and responds to GraphQL commands. This isn't as far off as you suppose to be the case.
The trickiness will come in handling authentication for all the nested resources (e.g., user X can only see public photos for user Y, and can't update them) and generating efficient queries to a relational datastore. Coming up with a clean architecture for that actually seems like a fun project!
Re: GraphQL Working Draft
#34Earlier quoted context omitted.
Unlike with RESTful APIs, a server basically only needs a single endpoint that parses and responds to GraphQL commands. This isn't as far off as you suppose to be the case.
The trickiness will come in handling authentication for all the nested resources (e.g., user X can only see public photos for user Y, and can't update them) and generating efficient queries to a relational datastore. Coming up with a clean architecture for that actually seems like a fun project!
Re: GraphQL Working Draft
#35Lol - the code example seems to imply that Zuckerburg's user id is 4.
Re: GraphQL Working Draft
#36Lol - the code example seems to imply that Zuckerburg's user id is 4.
Who is 1,2,3 ?
- https://www.facebook.com/1
- https://www.facebook.com/2
- https://www.facebook.com/3
My guess (and there may even be apocrypha about it), is that these were old registration test accounts that didn't survive the first Zuckerbergian purge.Re: GraphQL Working Draft
#37Earlier quoted context omitted.
GraphQL doesn't prescribe a particular approach to mutations; it allows the server developer to specify what mutations are available. For example, at Facebook we have a storyCreate mutation, and a friendRequestAdd mutation. Mutations are just top level fields, but with side effects; because they are fields, the client sends up a selection set with the mutation. This allows the client to receive whatever data it needs…
Awesome, thanks for the explanation. My team is rolling out an REST API currently and I've always wanted a Linq/SQL type of interface to REST API's. I could definitely see GraphQL evolving in that kind of direction. Some amazingly cool open source tech coming out of Facebook these days.
Re: GraphQL Working Draft
#38Earlier quoted context omitted.
Readability I guess. The new syntax looks pretty good to me. A little heavy on the (( and )) but very obvious as to what is being asked.
I wonder how important readability is in this case, though. How likely is it that this language will be written (or read) directly by people, rather than generated and consumed by programs? The potential bugs in generators and parsers (think SQL injection) seem like a real cost, which I would have thought would outweigh the benefit of improved readability.
Re: GraphQL Working Draft
#39Earlier quoted context omitted.
Who is 1,2,3 ?
You could always try... - https://www.facebook.com/1 - https://www.facebook.com/2 - https://www.facebook.com/3 My guess (and there may even be apocrypha about it), is that these were old registration test accounts that didn't survive the first Zuckerbergian purge.
Re: GraphQL Working Draft
#40Would love to see a more robust server backend for this, but I am assuming it's still a long way off. A standard is a very good start. I notice the license is BSD, but is this patent encumbered?
There's a JS server provided: https://github.com/graphql/graphql-js .
> To that end the target audience is not the client developer, but those who have or are actively interested in building their own GraphQL implementations and tools.
I guess I'm kind of happy that FB are releasing something regarding GraphQL since introducing it in February. I just thought they got busy with React Native and forgot about everything else they hyped up back in February.