Live data from Hacker News

Show HN: REST Alternative to GraphQL and tRPC

openapistack.co

11–20 of 76 posts

Re: Show HN: REST Alternative to GraphQL and tRPC

#11
After looking at tRPC, and having done a lot in a few jobs with GraphQL codegen & gRPC codegen, I always wondered why there were so few recent OpenAPI based codegen/client-server-contract tools. I think I was searching for this exact tool.

Love that it makes the client somewhat backend agnostic, but the tools for the OpenAPI backend also look great.

Thank you for this, I hope it is successful in achieving some adoption!

Re: Show HN: REST Alternative to GraphQL and tRPC

#12
post #9

GraphQL is well over a decade old. I'm not sure "tried and tested" is a meaningful contrast between the two approaches at this point, especially as it relates to API requests from the frontend. It's okay for people to choose REST just because they like it better, and/or aren't interested in learning something different.

Agree. GraphQL is well mature by this point.

Re: Show HN: REST Alternative to GraphQL and tRPC

#13
post #10

We're pretty pleased with using trpc. With trpc-openapi, you can set up REST-like APIs. I like this method because it uses TypeScript and not YAML.

Love tRPC! For full stack typescript teams it’s the obvious way to go. Super simple and straightforward. OpenAPI or GraphQL are great though if you’re investing into APIs as a product

Re: Show HN: REST Alternative to GraphQL and tRPC

#14

Is it just me, or do these "API contracts and type safety guarantees" all call back to SOAP?

Yes it's an interesting trend. I integrate with a good handful of systems in my current work and the most important ones we integrate with are SOAP based. The concepts behind a WSDL are great in theory, but they end up incorrect or unmaintained in practice (at least with the systems I integrate with). There's something freeing and flexible about a plain REST API that makes developing your own wrapper nice and simple, but if all communication is between internal systems, a contract based approach seems great.

Re: Show HN: REST Alternative to GraphQL and tRPC

#15

After looking at tRPC, and having done a lot in a few jobs with GraphQL codegen & gRPC codegen, I always wondered why there were so few recent OpenAPI based codegen/client-server-contract tools. I think I was searching for this exact tool. Love that it makes the client somewhat backend agnostic, but the tools for the OpenAPI backend also look great. Thank you for this, I hope it is successful in achieving some adopti…

Thanks for the encouraging words! So far it’s already nice to see these libraries being adopted slowly by more and more companies. Not nearly as big as graphql and trpc of course.

Re: Show HN: REST Alternative to GraphQL and tRPC

#16
I want this, but language agnostic.

Let me explain: standards are great, type safety is great, API contracts are great. Locked into a particular language is not great. In fact it's bad for the author. tRPC and now this assume my team has the desire and time to move to another language. The best frameworks assume none of that.

I'm not asking for implementations for every possible language given a framework. I'm asking for a framework for which any possible language can be built upon because the constructs are simple and easy to follow: graphql does this pretty well despite some of the nuances. Bonus points if the author provides examples out of the box in a variety of languages.

Re: Show HN: REST Alternative to GraphQL and tRPC

#17
There's no winning at this layer and every attempt is as doomed as medieval alchemists trying to transmute lead to gold.

The key here is overall speed, but you can't trade the time spent learning/understanding the API contract for these crazy complicated tools. The developer still has to look at the operations and data models exposed by the API, understand them, amd plan for how to integrate them into the larger application.

The big bonus of the human documentation approaches today is that time is somewhat combined with building the client. The downside of course is that it's a human doing it. My point here is that you can't take the time a human is going to spend understanding the API concepts and then tack on a bunch of time learning, configuring, and running the client gen code and associated infrastructure as well and expext that your solution is going to win.

The more complicated these codegen setups get, the less comicated just reading some docs and spinning up a few lines of client code is. And guess which I'm going to choose as a dev? Whatever is overall fastest and gets me on to the problems I'm really trying to solve.

Re: Show HN: REST Alternative to GraphQL and tRPC

#18

I want this, but language agnostic. Let me explain: standards are great, type safety is great, API contracts are great. Locked into a particular language is not great. In fact it's bad for the author. tRPC and now this assume my team has the desire and time to move to another language. The best frameworks assume none of that. I'm not asking for implementations for every possible language given a framework. I'm asking…

There are libraries out there for a lot of languages that can generate OpenAPI specs for your APIs and generate clients from OpenAPI specs.

This seems like a nice set of tools for doing so in Node/Typescript but the general pattern of using OpenAPI contracts is language agnostic.

Re: Show HN: REST Alternative to GraphQL and tRPC

#19
post #17

There's no winning at this layer and every attempt is as doomed as medieval alchemists trying to transmute lead to gold. The key here is overall speed, but you can't trade the time spent learning/understanding the API contract for these crazy complicated tools. The developer still has to look at the operations and data models exposed by the API, understand them, amd plan for how to integrate them into the larger appl…

That is why we now step back to SSR-apps. No api necessary, no extra layers, no extra bloat and it is fast and scalable enough for the most apps.

Re: Show HN: REST Alternative to GraphQL and tRPC

#20
post #17

There's no winning at this layer and every attempt is as doomed as medieval alchemists trying to transmute lead to gold. The key here is overall speed, but you can't trade the time spent learning/understanding the API contract for these crazy complicated tools. The developer still has to look at the operations and data models exposed by the API, understand them, amd plan for how to integrate them into the larger appl…

This project is precisely for devs who dislike codegen and want to just ship products fast.

1. Design your API in yaml 2. Run a mock API 3. Develop the App, iterate mock API 4. Implement backend and ship

No code generation needed. Generate types if you want.

Post reply on HN