June 30th, 2024

Remix is better than GraphQL

Remix and GraphQL are compared for data loading in applications. Remix offers type-safe data fetching with loaders, while GraphQL allows selective data queries but may face challenges with authorization and performance. Remix is favored for simpler authorization and is recommended for full-stack teams, while GraphQL suits separating backend and frontend teams with expertise.

Read original articleLink Icon
Remix is better than GraphQL

The article discusses the comparison between Remix and GraphQL in terms of loading data for applications. Remix, a full-stack React framework, uses "loaders" to return data to route segments, providing type-safety and efficient data fetching without excessive prop drilling. On the other hand, GraphQL allows UI components to specify data queries with type-safety and selective data fetching. While both approaches have their pros and cons, GraphQL is noted for its generality but can pose challenges with authorization, performance, and security. In contrast, Remix loaders are more specific and easier to authorize, reducing the risk of bad inputs. The article suggests that GraphQL is suitable for separating backend and frontend teams with expertise in GraphQL, while Remix is beneficial for full-stack teams seeking a simpler development experience. Both technologies have their strengths and are recommended based on specific team structures and project requirements.

Related

AI-powered conversion from Enzyme to React Testing Library

AI-powered conversion from Enzyme to React Testing Library

Slack engineers transitioned from Enzyme to React Testing Library due to React 18 compatibility issues. They used AST transformations and LLMs for automated conversion, achieving an 80% success rate.

Understanding React Compiler

Understanding React Compiler

React's core architecture simplifies app development but can lead to performance issues. The React team introduced React Compiler to automate performance tuning by rewriting code using AST, memoization, and hook storage for optimization.

Elixir for Humans Who Know Python

Elixir for Humans Who Know Python

The article explores transitioning from Python to Elixir, emphasizing Elixir's concurrency, Phoenix framework, LiveView feature, immutability, and pattern matching. It compares Elixir's functionalism and control flow to Python, showcasing Elixir's efficiency for web development.

Understanding React Compiler

Understanding React Compiler

React's core architecture simplifies development but can lead to performance issues. The React team introduced the React Compiler to automate performance tuning by rewriting code. Transpilers like Babel convert JSX for efficiency. Compilers, transpilers, and optimizers analyze and produce equivalent code. React Compiler enhances functionality using Abstract Syntax Trees, memoization, and hook storage for optimized performance.

It's not just you, Next.js is getting harder to use

It's not just you, Next.js is getting harder to use

Next.js 13 introduces App Router with Server Components and enhanced caching, but users face challenges in utilizing features like Layouts and cookies. The shift to a more complex framework raises debates on balancing functionality and user-friendliness.

Link Icon 8 comments
By @graypegg - 5 months
I’m having a bit of trouble getting the point here, this is more sort of just a passing thought I guess. But yeah, like the article ends with, querying with graphql from the front end, and using loaders from Remix are 2 choices for different situations where they’re ideal. (Unlike the superlative title implies)
By @aleksiy123 - 5 months
It's like they are designed for completely different use cases.

Graphql is designed to be flexible for when you want to expose your data to many clients who may be other teams and need different models of the data.

Obviously, if you just need a simple consistent API, there's no need for all the extra complexity.

By @andrewingram - 5 months
If I were using Remix, I'd probably trigger GraphQL queries from route loaders, one doesn't really obviate the other. Yes, there are challenges with using GraphQL well, but there's no inherent tension between it and the loader approach.
By @fswd - 5 months
this is so bizarre? I use GraphQL with Remix in my loader. It's a great combination. 7ms response from SQL. I can't understand the article. Sorry this person doesn't understand GraphQL nor Remix. might be AI generated
By @paulddraper - 5 months
Conway's law.

REST/GraphQL is the result of different teams/orgs working on frontend and backend.

Backend-for-frontend/Remix is the result of the same team working on frontend and backend.

By @kamma4434 - 5 months
And Elixir LiveView is better than Remix as you don’t have a client at all…