Urql GraphQL what are exchanges and why their order matters

Introduction So I recently ran into a nasty bug where urql, the GraphQL client I was using, seemed broken. Turned out I messed up the order of my exchanges. And I want to prevent others from making this mistake. :) What are exchanges? Exchanges are basically middleware. For those not really familiar with middleware in this context, middleware is a piece of software which every request goes through. So you could for example have middleware which will add an arbitrary HTTP header to every request. ...

February 15, 2023 · 2 min · Fabian

Nodejs graphql-upload Replacement

Introduction Ever since graphql-upload v14, the maintainer has made the controversial decision to force deep imports. This means that you can no longer do this: import {GraphQLUpload} from 'graphql-upload'; Now you have to change that to this: import GraphQLUpload from 'graphql-upload/GraphQLUpload.mjs'; Although this is dubious at best, this seems like a quick fix. It is, except when you use TypeScript. The Proposed “Solutions” Now I’m not going to document all the proposed solutions from the maintainer and the community alike here. I’ve spent quite a few hours trying to fix this myself. I’ve followed this, this, this, that and probably a lot more when I went deep into the rabbit hole. But nothing seemed to work, and even if it did, the “solutions” often meant changing your tsconfig.json to allow JavaScript and **** like that. ...

November 21, 2022 · 1 min · Fabian