{nonsensecodes}
Published in

{nonsensecodes}

002: A Quick and Dirty Overview of GraphQL

There doesn’t seem to be a whole lot to the language, and maybe that’s what makes it so powerful.

GraphQL appears to be pretty straightforward. It’s a query language which, up until recently, I didn’t realize was its own thing. One of the many detours I took over this past year has been to look into CodeQL. It wasn’t until I started looking into GraphQL that I realized what the “QL” represents.

I know. Super sharp, right?

Anyway, the structure of GraphQL appears to be fairly simple. It’s strongly typed and provides three primary operations: query, mutation, and subscription. Beyond that, there are fragments and directives and schema. Six base pieces that combine in different ways in an Object-Oriented format to provide incredible granular control for data acquisition. Understanding this, the next challenge is in the implementation, which is next in my curriculum.

I spent my coding time reading up on queries and the history of GraphQL. I also set up an Express project with GraphQL to begin playing with it. I managed to get a GraphQL server up and running, but have some work to do in understanding how to implement GraphQL properly. I thought I could create a separate router module with the /graphql endpoint that would deliver GraphiQL when summoned in the browser. However, while the endpoint loaded, GraphiQL did not. I’ll need to revisit my implementation and learn how to properly run GraphQL alongside, or in front of, Express.

Content I worked through, read and watched:

As part of my 100 Days Of Code commitment to using Insomnia every day, I used Insomnia to test my endpoints on my attempt at an Express-GraphQL server. The homepage, which displays nothing, came back fine. The /graphql endpoint did not, but I knew as much before I plugged it in.

002/100

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store