gql.tada makes me miss GraphQL…
HTML-код
- Опубликовано: 25 авг 2024
- If gql.tada existed years ago, things might have turned out very different for me. This is a lot of why I loved tRPC bundled into a very convenient typescript plugin.
LINK github.com/0no...
MATT VID • Everyone's talking abo...
My GraphQL Conf talk • The Right Size For Gra...
Check out my Twitch, Twitter, Discord more at t3.gg
S/O Ph4se0n3 for the awesome edit 🙏
5 years tada experience.
this looks like lightweight Relay
Added this to my project last week and it's pretty awesome.
The Typescript plugin feature is great and allows these type of features for language extension
Typescript's type system is wild, it's literally a language on it's own
Tbf, it's not hard to become Turing complete, just look up Rule 110
Insane! pretty cool seeing new stuff coming, love learning new data-fetching/mutation patterns!
I got my relay degree. I dont need lesser versions.
gql-tada is such an impressive project (though I still wish it was called graphql-tada). Nice overview!
It’s wild how much configurability that TS allows these days
This tool is amazing! Looking forward to using it in my next project 👌
"Be careful scrolling through their twitter profile" i'm dead
We've been using zod to validate and type our GQL responses (manually building/maintaining schemas) but it's tricky because we don't want a single element failing to cause a whole response to error, especially when we consider the data to be optional but it is exceptionally difficult to track what data is required vs optional on a large scale. The unused decorator would be very helpful too.
The DX is pretty much the same as with existing solutions. But it is really cool that you don't have to have a background codegen process running in order to achieve type safety.
Whats your thoughts on Hono and Hono RPC (not graphql related), since you touched upon elysiajs
IMO, when you have a frontend/backend that are tightly coupled, it makes sense to use t3/remix/etc.
If you have an API that needs to be consumed by various clients (web app, native app, API users, etc), GraphQL is nice.
I've been working on such an API for ~4 years now, and honestly graphql has been a nice experience
Trpc looks amazing but I like GraphQL for the idea of not writing specific endpoints / procedures for each views, but just query data in the client in any shape I need.
I think this is good, but I would have a few concerns: 1. RAM usage, 2. Introductions of non-standard API's, 3. Making your front-end your "SSOT" for your backend API shape (unless you have a monorepo or something), 4. Over-reliance on libraries to "magic away" complexity instead of letting developers work through it. (might be a little "back in my day"-y, but yeah)
Can you elaborate on 3 point? It's the same og graqhql client, where you just don't need codegen for schema types
For those of us using relay, we've been coding in 2050. Welcome to the future yall
Going to test this vs apollo and see which one has better DX.
Is it doing TS type inference on that string template everytime anything changes ?
This is why probably my interests are leaning towards rust because here, we'll be doing heavy type inference and still struggle to achieve what those languages provide natively.
They should use a template tag to avoid issues with the formatter.
You can even send email with graphql
How does this differ from GQless (now called GQty) ?
GQty programmatically generates the GraphQL queries / mutations at runtime whereas GraphQL Tada just introduces type safety to the traditional way of defining graphql queries / mutations.
If you follow apolli server guidelines is it that big deal to manage you backend? I was responsible for this topic, but as far i got it, it not that hard. Trpc is reqlly nice, but it is hard to manage on microservices
I'm preferring graphql queries written in plain typescript (ex genql)
Refactor Gang 😂
I hate graphql because I love graph theory
Light node AND 4-space indentation 🤢
"TypeScript Language Service plugin" Wow! That's not something I've heard all that much.
This is so STUPID! The moment you step out of basic querying, like using Fragments, it turns into spaghetti code and adds another layer of abstraction to your code. Another 'cool' JavaScript tool, with a cool demo, just ends up being trash underneath.
I wonder if something like this is possible with OpenAPI 3?
Don't you just add the #graphql comment after the backtick and it keeps the backtick in place and hints the IDE to highlight it with GraphQL syntax? I do that all the time, should I not?
Is there way to make tada work with react query like graphql codegen doesa
yeah
What's th benefit of this lib over Graphql code generator?
There’s not much of an added benefit beyond skipping the code generation step
No code generation
@@gucciburg This... the codegen part is fine though. I'm not sure what the concern is. I never had problems with it on some pretty huge codebases.
@@CoryTheSimmons I think theo is saying the benefit is the type feedback is immediate on edit and doesn't require a watch on the file save and the generation of files, but other wise, it's similar.
code gen is so annoying. You have to set it up, it's another running process, you probably need it in CI/CD. Just awful. I just want my code to work.
This is the same as Relay. What's new here?
Notification gang
why Apollo not enough for you guys?))
GraphQL Tada isn’t a GraphQL client so it doesn’t replace Apollo-it just enables type safety for graphql documents.
Yeah I figured it's like a graphql-codegen killer is it?
Gql.tada would work really well with Apollo client, not exclude it. If you look at the example, you can replace Urql with Apollo client and it would work the same. It's just a language server that is generating TS types on the output of the graphql query wrapping function based on the graphql server's introspect query. (some times it's just a tagged template literal that looks like gql`query...`)
isn’t that just what relay already does?
Relay doesn’t add type safety to graphql documents and it’s not a replacement for relay
@@gucciburgrelays does two things correctly type safety and caching. Dont spread nonsense.
@@Bu7MaiD075 Relay relies on code generation-it doesn’t directly infer types from graphql documents.
@@gucciburgthe relay compiler comes with watchman and a vscode extension. i never leave my tsx file and I get type safety/autocomplete, better fragment support and on save compilation.
@@gucciburgwhile i get your point on what tada does. i dont see it as necessary when running relay maybe some other gql clients my find it beneficial.
I avid string abuser 😬
Can't you just put a "!" when you know you're gonna have it? You're the one making the query anyway 😉
Light mode is shit lol, dark mode should be the default 😉