PRJ – 10

Monday 17/08: 12PM – 4PM

Today I started working on my new task while I wait for some help to finish the printing task. My new task is to switch out an API for an existing application and integrate it into the new API as a service. The old API is using GraphQL and .NET while the new API is using GraphQL and TypeScript. Jesse helped me get started and nudged me in the right direction.

GraphQL provides a different way of creating an API for your application. Instead of accessing loads of endpoints for different data like in a REST API, GraphQL provides an application with just a single end point where all the applications data can be accessed from and provides a more flexible and robust system for retrieving data.

This image visualises how a typical REST API retrieves data from multiple end points.

source: https://www.howtographql.com/basics/1-graphql-is-the-better-rest/

This image visualizes how GraphQL does it with just one end point

source: https://www.howtographql.com/basics/1-graphql-is-the-better-rest/

To set up a GraphQL API you must define a schema, this contains all your queries you can perform (reading data) and all the mutations you can perform (writing data). This schema relies on the developer to set types for your data so your application knows what it’s actually dealing with. When you have defined your schema you must set up resolvers which actually retrieve the data from your database.

Currently, the application I am working with has it’s GraphQL schema, resolvers and mutations set up in .NET and retrieves data from a MSSQL server. The new API is going to have it’s database hosted in the cloud so I will also need to set up the new database. I will be using Knex for this.

Today I defined the GraphQL schema with all the queries, mutations and types and I also set up the first database migration which is going to build my new database through Knex. The next step will be to start setting up resolvers for the queries to actually return data.

Leave a comment

Design a site like this with WordPress.com
Get started