Remix.run Logo
c-hendricks 2 days ago

And the fetching in a single request?

WickyNilliams 2 days ago | parent | next [-]

There is json-schema which is a sort of dialect/extension of OpenAPI which offers support for fetching relations (and relations of relations etc) and selecting a subset of fields in a single request https://json-schema.org/

I used this to get a fully type safe client and API, with minimal requests. But it was a lot of work to get right and is not as mainstream as OpenAPI itself. Gql is of course much simpler to get going

lateforwork 2 days ago | parent | prev [-]

The question I answered was regarding contracts. Fetching in a single request can be handled by your BFF.

iterateoften 2 days ago | parent [-]

So make things more complicated than gql?

0x696C6961 2 days ago | parent [-]

gql is clearly the more complicated of the two ...

iterateoften 2 days ago | parent [-]

a gql server in python is about as simple as you can possibly go to exposing data via an API. You can use a raw http client to query it.

JAlexoid a day ago | parent [-]

You still require gql requests to deal with. There's pretty much the same amount of code to build in BFF as it is to build the same in GQL... and probably less code on the frontend.

The value of GQL is pretty much equivalent to SOA orchestration - great in theory, just gets in the way in practice.

Oh and not to mention that GQL will inadvertently hide away bad API design(ex. lack of pagination).. until you are left questioning why your app with 10k records in total is slow AF.

c-hendricks a day ago | parent [-]

Your response is incredibly anecdotal (as is mine absolutely), and misleading.

GQL paved the way for a lot of ergonomics with our microservices.

And there's nothing stopping you from just adding pagination arguments to a field and handling them. Kinda exactly how you would in any other situation, you define and implement the thing.

0x696C6961 a day ago | parent [-]

Yeah I love it when a request turns into an N+1 query because the FE guys needed 1 more field.

c-hendricks 17 hours ago | parent [-]

What's that old saying, "fool me once ..."