Live data from Hacker News

Principled GraphQL

principledgraphql.com

31–40 of 88 posts

Re: Principled GraphQL

#31
post #30

There's nothing that says "we're really good at making front end development easier" like a website where even after I click into the main frame it completely fails to respond to up/down/pgup/pgdown ... I understand the whole "should work on mobile" thing but it should also bloody well work on a desktop too :(

Thanks, looking into it. I agree and I hope we're able fix this. We're moving all of the Apollo docs to the same system. It's built on Gatsby, which uses GraphQL under the hood.

Re: Principled GraphQL

#32

Earlier quoted context omitted.

Is there any reason you couldn't have multiple graphs essentially overlaid on top of each other? With proper tooling you could expose different subsets of the same schema in different scenarios, and still have one unified graph underneath.

See my reply to another comment. But yeah, there’s no fundamental reason. But it’s conceivable that the difference goes beyond simple subsets of fields, but entire relationships being hidden. Let’s say in your internal model there’s a relationship A - B - C. But for client apps it makes no sense to expose B, so instead you choose to represent the model as A - C. This is more than just a simple subset. Someone who und…

Since GraphQL lets you select a subset of attributes, there is no reason you can't expose C on A directly, as well as exposing the indirection through B. Redundant attributes are A-OK.

You'd have something like this::

a { b { c { x } }

as well as

a { c { x } }

or even:

a { cX }

Re: Principled GraphQL

#33
post #18

Earlier quoted context omitted.

While using GraphQL does have some benefits when dealing with a massive amount of users, that's not the reason most people choose to use it. GraphQL is simply a drastically different (and IMO better than REST) model for clients to talk to servers.

I don’t think it is - mutations (and state management) are the biggest issue. It’s ok for reads though, although even there tooling for rest is better.

I agree with RussianCow, I don't think mutations are in any way harder in GraphQL than they are in REST.

IDK what you mean re: state management. That sounds like a client side concern, nothing to do with the protocol used to communicate with the server.

Additionally, in my experience, the client-side tooling is better for GraphQL, despite it being around for only a fraction of the time of REST. In fact, that's why I chose GraphQL for my projects. I wanted the tooling (Relay, Apollo) that works out of the box with GraphQL, and requires hacks to get it work with REST.

Re: Principled GraphQL

#35
post #14

is graphql something anyone really needs unless they're facebook

You don’t “need” almost anything, the point of new tools isn’t usually that you need them it’s that they make your life easier.

Apollo Client makes a lot of things about frontend apps easier, which is possible because of the well-defined and typed interface that graphql enforces. No, you don’t need it, and there are other ways (like maybe using Swagger) that you could get similar typing for a REST interface. But, FWIW I’m not familiar with any tools that are quite as comprehensive as Apollo out of the box that don’t use graphql.

Re: Principled GraphQL

#36

The main argument I have against "One Graph", is that it's not that uncommon to have two (or more) quite distinct views of the world. At my last job, we were building a social shopping app. Behind the scenes, products were versioned so that we could deal with disputes related to attempts to defraud customers. This (along with several other things) meant that the logical internal abstraction of the data model for thin…

That's the general argument for key value storage versus normalized relational databases as well.

Can you elaborate on that?

Re: Principled GraphQL

#37
I think the single graph idea is impractical in any large organization. Every centralized model deteriorates over time due to many reasons: time pressure, carelessness and bigly varying competence levels in federated teams. A couple of years down the line everyone will hate it, and it'll be too big to discard.

Independent team structures and microservices based architectures are acknowledging that such monoliths are impossible to build and maintain.

Re: Principled GraphQL

#38
I'm experiencing some frustration with this. Click on this principledgraphql.com site and you find it's 'Apollo.' Nearly everywhere you look on the Internet regarding GraphQL you find 'Apollo' being injected.

I'm using GraphQL in production systems. One is Node (graphql-js) and another is Java (graphql-java.) I read the GraphQL specification and adopted the reference implementation and it works great. Am I missing some enormous value by naively just using GraphGL without involving Apollo?

That is a sincere question. What is the deal here?

Re: Principled GraphQL

#39
post #14

is graphql something anyone really needs unless they're facebook

You are being downvoted but I think it's a pretty legitimate question and the answer to it is: Yes. If you want to have a united interface to multiple services behind the scenes and incorporate ACL or any kind of top-level resource management, GraphQL is a great way to go about doing that.

What is the reasons for a backend service to delegate it’s authentication/authorisation to the graphql in front of it. Making the graphql server a super user for the service Sounds wrong to me

Re: Principled GraphQL

#40
post #10

Earlier quoted context omitted.

An alternative architecture (following the BFF idea): * Non-GraphQL services (speaking REST, gRPC, whatever) * GraphQL gateways, owned by frontend teams/applications. E.g. each frontend team/application owns its own schema owned by these teams. They can compose the backend services however they wish—and whatever is the most natural representation for their domain.

[author here] Yup, we see this pattern a lot. You get the benefits of fewer bytes on the wire, typed APIs, elimination of data fetching code, etc. But it leaves a lot on the table. The bigger wins come when new features can draw from all your data (in unanticipated combinations) without new API or services development, when you can make new data available for every team's use just by plugging it into the central grap…

Yeah, I'd also add that it is a huge help in ramping up new devs when understanding your schema.
Post reply on HN