A configurable network layer for Relay Classic with middleware support for request manipulation, batching, and error handling.
ReactRelayNetworkLayer is a customizable network layer for Relay Classic that provides middleware support for manipulating GraphQL requests and responses. It solves common networking challenges like query batching, authentication, retries, and logging by allowing developers to plug in middleware functions that intercept and modify network traffic.
Developers using Relay Classic who need fine-grained control over GraphQL network requests, such as adding authentication headers, batching queries, or implementing custom retry logic.
It offers a modular middleware architecture that extends Relay's default network layer, enabling features like automatic token refresh, request batching, and detailed logging without requiring changes to Relay's core.
ReactRelayNetworkLayer with middlewares and query batching for Relay Classic.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides a composable middleware system that lets developers intercept and modify Relay requests and responses on the fly, enabling custom logic like headers or retries without touching Relay core.
Combines multiple GraphQL queries into a single HTTP request via batchMiddleware, reducing network overhead and latency, as detailed in the server and client setup examples.
Automates token management with authMiddleware, including automatic refresh on 401 errors, which is crucial for maintaining seamless user sessions.
Offers retryMiddleware with customizable delays and status codes, allowing resilience against transient network failures without manual intervention.
Only supports Relay Classic, which is outdated compared to Relay Modern; the README explicitly directs users to a separate package for modern versions, reducing its long-term viability.
Requires manual integration of multiple middlewares and server-side adjustments for features like batching, increasing initial development time and potential for errors.
Relies on global fetch, necessitating additional polyfills for older browsers or environments like Node.js, which adds boilerplate and compatibility concerns.