GraphQL tools & libraries
If you’re interested in a writeup about GraphQL itself head on over here. In this piece, we’ll take a look at some of the many handy GraphQL tools that make using it even more worthwhile. Bear in mind there’s quite a few of them so we’re not going to get through the lot of them in one go.
You might think: "Yeah, but that’s just what a regular ORM library does". True, but Prisma comes with a few added functions:
- database agnostic: Prisma currently supports MySQL, PostgreSQL, MariaDB, SQLite, and AWS Aurora, with more to come soon,
- provides premade basic CRUD queries.
Relay is composed of three main loosely coupled modules:
- Relay Compiler: a GraphQL compiler that analyzes, validates, and optimizes GraphQL in your code.
- Relay Runtime: a full-featured GraphQL runtime for building higher level client APIs
- Relay/React: a product API that integrates Relay Runtime with React
Let’s look at the Apollo-client features:
- a declarative approach to data fetching, all the logic for retrieving data, tracking, loading and uploading it to the UI is contained in a single query,
- designed for modern React, the Apollo client takes advantage of the latest React features such as hooks,
- universally compatible, can be used with any GraphQL API.
Hasura is a GraphQL engine that boasts its high speed and performance. It gives you instant realtime GraphQL APIs on any Postgres database, with remote schemas for business logic and webhook triggers on database events.
The focus is to help quickly build GraphQL apps backed by Postgres or use Postgres to help move existing apps to GraphQLs:
- realtime, convert GraphQL queries to live queries via subscriptions,
- fast and instantly ready to use, simply point it to a Postgres database and instantly get a GraphQL API,
- powerful queries, Hasura has built-in filtering, pagination, pattern search, bulk insert, update, delete mutations,
- fairly new and in rapid development with a bunch of features coming soon.
urql is a versatile and highly adaptable GraphQL client by Formidable labs. It uses React hooks and components and intends to be a lighter client than the others. A versatile tool that you can customize to fit your needs and fine-tune as you get further along working with GraphQL.
The aim is hitting a middle ground, keeping it somewhat simple while also being able to handle complex assignments by:
- performance and functionality, significantly lighter than other clients,
- customization, the client provides a few default Exchanges, easily customizable code that handles interactions with the API, app or framework,
- instantly ready to use, urql is basically ready for work right off the bat and does not require extensive configuration like some other clients,
- named after an iconic sitcom character.
Well, that’s it for the first look at GraphQL tools. Remember that that’s only five of them and GraphQL has plenty of other tools to choose from. So if I missed your favorite, just mention it in the comments and stay tuned for the next parts!