
RedwoodJS Has a Free API That Gives You a Full-Stack Framework in One Command
RedwoodJS is the full-stack React framework with GraphQL, Prisma, auth, and deployment built in. One yarn rw command scaffolds everything. Cells: Data-Fetching Components // web/src/components/ProductsCell/ProductsCell.tsx import type { ProductsQuery } from " types/graphql " ; import type { CellSuccessProps , CellFailureProps } from " @redwoodjs/web " ; export const QUERY = gql ` query ProductsQuery { products { id title price scrapedAt } } ` ; export const Loading = () => < Spinner />; export const Empty = () => < div > No products found </ div >; export const Failure = ({ error }: CellFailureProps ) => < div > Error: { error . message } </ div >; export const Success = ({ products }: CellSuccessProps < ProductsQuery > ) => ( < ul > { products . map (( product ) => ( < li key = { product . id } > { product . title } — $ { product . price } </ li > )) } </ ul > ); SDL + Services: Type-Safe API Layer # api/src/graphql/products.sdl.ts export const schema = gql ` type Product { id : Int !
Continue reading on Dev.to React
Opens in a new tab


