Member-only story

Why should you NOT use a GraphQL API Client

GraphQL Clients are not necessary for making GraphQL API Calls, and often complete overkill for the job at hand.

Sebastian Scholl
3 min readFeb 21, 2022
Woman in Red T-shirt Looking at Her Laptop

Imagine that your friend purchases a semi-truck because, “they run a lot of errands.” Any sane person would tell that friend that they’ve gone a little too far. Even the most modest, budget vehicle would likely do just fine for running their errands. No one needs a semi-truck to pick up hummus.

When it comes to software development, developers very often build semi-trucks when a sedan would get the job done. As a consequence, so much time then gets spent configuring, debugging, refactoring, and testing code that is complete overkill for the task that inspired it.

Take for example the following code snippet for setting up an Apollo GraphQL Client module:

import { HttpLink } from “apollo-link-http”;
import { onError } from “apollo-link-error”;
import { ApolloClient } from “apollo-client”;
import { setContext } from “apollo-link-context”;
import { InMemoryCache } from “apollo-cache-inmemory”;

/**
* A terminating link that fetches GraphQL…

--

--

Sebastian Scholl
Sebastian Scholl

Written by Sebastian Scholl

Wrestling ideas, sharing experiences.

Responses (4)