Open Source GraphQL Client for React Hits 1.0 Release
While there are several React clients for GraphQL, the popular API query language open-sourced by Facebook several years back, Seattle, Wash.-based Formidable, developer of the Universal React Query Library (URQL), said in its announcement of the beta product back in January 2018 that it wanted to release a "simpler" client that was easier to get started with, "especially for beginners," as well as provide a smaller footprint.
With the officially announced release of URQL 1.0 on Friday, the developers said they've changed their vision slightly, although the goal is still to make URQL easy to get started and work with.
"The initial version of URQL attempted to hit the sweet spot between these two approaches. It made it easy to get started, and provided all the functionality we needed in simple GraphQL projects. But as we worked with various GraphQL applications, we began to understand...every project has slightly different requirements, and supporting them all leads to inevitable complexity," the company explained in the launch announcement.
"Instead of going down the same path, we wanted to keep the core of URQL small and easy to work with, and provide an extensibility mechanism that allows app authors...to scale and customize their GraphQL library to suit their needs."
The developers said they've done this through the introduction of a new extensibility mechanism called "Exchanges."
Like Apollo's links (another React client for GraphQL), it handles the GraphQL requests, but according to the URQL developers, "all logic" for these queries are built into URQL's Exchanges: "Exchanges are an operation pipeline that allows you to customize and augment every aspect of the GraphQL client from how data is cached to how components receive their data."
The release comes with a number of prebuilt Exchanges, including ones designed to handle network requests, deduplication of in-flight requests and cache-focused requests, among others.
"The great thing about URQL Exchanges is that they are flexible, composable and interchangeable," the developers commented. "We've already had some great suggestions from our users, and we look forward to an ecosystem of Exchanges growing as the community begins to adopt the new version."
More information on what URQL 1.0 offers users can be found in the links above. Documentation for URQL can be found here. You can download the product on GitHub here.
Becky Nagel is the vice president of Web & Digital Strategy for 1105's Converge360 Group, where she oversees the front-end Web team and deals with all aspects of digital strategy. She also serves as executive editor of the group's media Web sites, and you'll even find her byline on PureAI.com, the group's newest site for enterprise developers working with AI. She recently gave a talk at a leading technical publishers conference about how changes in Web technology may impact publishers' bottom lines. Follow her on twitter @beckynagel.