$chiubaca / notes / fleeting / 2021-03-06
  • Completed creating a set of REST API endpoints as part of the Super Forum project in Full-Stack-React-TypeScript-and-Node. Returning data back from an PostgreSQL db using TypeORM all makes sense. Now back in GraphQL land and adding Apollo as an Express middleware to expose a graphql endpoint. The same old boilerplate logic as previously learnt about. Once setup, it’s a quite a repetitive pattern of first defining your typeDef, i,e defining the shape of all the data schemas up front, the types of mutations and the types of queries which can be performed. Once all defined its writing the “real” logic in the resolvers.
  • Learning __resolveType. If a query of mutation resolves to a union type, it’s important that the type is also implemented using __resolveType. Further reading
Edit on GitHub ✏️

Hey I'm Alex Chiu 👋. These are my notes for literally anything.

I'm using the Zettelkasten method to organise my thoughts here.

My more polished writings are published to my main blog at chiubaca.com

Follow me on: Github / X (Twitter) / Mastodon / LinkedIn