API Layer with App Dir

Hi all, With tRPC still in limbo with the new app directory, I’m tempted to go back to GraphQL as my API layer for new projects going forward. I love tRPC for the most part, but having a backend so tightly coupled to the inner workings of Next.js means that significant changes (like the app directory) now seems risky to me. I’ve played with tRPC in Next.js 13.4 using the “hacks” floating around online, but none seem to have that “magic” that tRPC had back in the pages directory. I’m curious what you all are currently using for new projects. Are you switching API layers? Are you moving to the app directory? Do we even need APIs anymore? I want to know your thoughts.
2 Replies
Neto
Neto13mo ago
The app dir projects I have seen around or they use a basic API request with casting Or they use some sdk/edge orm to make operations Something like drizzle, or maybe a pocketbase, or whatever you need
cje
cje13mo ago
The problem isn’t APIs or fetching data, both tRPC and other solutions do that just fine in the app dir It’s people’s expectations around state management and invalidation
Want results from more Discord servers?
Add your server
More Posts
Is there a way with app dir layouts to do something like "island" based pages?I am making a dashboard where various sections are shown depending on the url. Is there a way I can Add token requirement to public TRPC endpoint to add to DB (create-t3-app)I've created a public TRPC endpoint on the exampleRouter like so: ``` export const exampleRouter = Javascript / Typescript ORMs like Drizzle or PrismaGuys sorry i know this is a very beginner question. I've been mostly a backend developer most of my VSCode Debugging - Does Client Side debugger break points work?So I've got server side debugging working in VSCode with breakpoints but I can't for the life of me Data fetching in NextJs 13.4+I have a question about this statement - In this new model, we recommend fetching data directly in tUPLOADTHING_URL is still set to localhost:3000I have my app on vercer server and I'm still getting this error: `Access to fetch at 'http://localhoSession recording tools?Hey! I want to monitor my next app, and before I look for a logging and tracking solution, I want a What is the name of the service cname.vercel-dns.com hosted on?I’m wanting to have a multi tenant app, so I need to configure my own nameserver that tenants point How to use google fonts in a T3 appLooking for recommendations for what you think is the best way to use google fonts in a T3 appCan i front a (non-prod) netlify(or other providers) app with cloudflare?Netlify has just been blocked where i live, i can't access any site with **.netlify.app Is it possib