tRPC: Building type-safe APIs with TypeScript

tRPC: Building Type-Safe APIs with TypeScript

Jake Everhart API Development, Articles, Development Technologies & Tools, GraphQL, JavaScript, TypeScript Leave a Comment

Over the years, weโ€™ve seen many approaches to HTTP API design. While REST APIs are still very popular throughout the industry, they offer no inherent guarantees that the clientโ€™s assumptions about the response structures will be valid.

GraphQL fills this gap to an extent by allowing client-side code greater control over the resulting structures but at the cost of added complexity. RPC (remote procedure call) frameworks attempt a different solution by sharing generated type definitions between the client and server implementations. What if there was a way to achieve the type safety of RPC by simply inferring the type definitions from the serverโ€™s code?

Enter tRPC. Since JavaScript (and specifically TypeScript) can already span across client and server implementations, tRPC allows a client to directly consume structures defined by the serverโ€™s exposed procedures. Essentially, you import your dependencies from the server to access these procedures, their return types are inferred and checked at build time, and your client code can confidently consume the returned data.

In this post, weโ€™ll look at how it achieves these goals and what limitations it places on your project stack.

Apollo Client and GraphQL

Apollo Client: State Management for GraphQL Made Easy

Braden Niswonger API Development, Articles, Development Technologies & Tools, GraphQL, JavaScript, Programming, React Leave a Comment

In this post, we will explore Apollo Client integrated with a React application and how it provides an abstraction layer between a JavaScript application and a GraphQL server. The features Apollo Client offers make it a prime choice for devs also using GraphQL.

We’ll begin by discussing what Apollo Client is and how it can be advantageous over other state management libraries. And finally, we will look at some example React queries for retrieving and mutating data.

Let’s get started.

Part 4: Creating an FHIR API – Wrapping Things Up

Zach Gardner API Development, Articles, Cloud, Creating an FHIR API, Healthcare, Tutorial Leave a Comment

Welcome to the fourth and final installment of Creating an FHIR API with GCP. So far, weโ€™ve covered a lot!

We discussed the differences between Google and Azure, landing on GCP as the best option for FHIR in Part 1. We began our implementation in Part 2, creating both the BigQuery resources and your FHIR repository resources. And finally, in Part 3, we tackled authentication methods and populating data in our FHIR repository.

This time, weโ€™ll wrap everything up with a nice little bow. First, weโ€™ll finish our implementation, and then, Iโ€™ll share the limitation I found – for the sake of transparency. Letโ€™s dive in.

Part 3: Creating an FHIR API – Implementation Part B

Zach Gardner API Development, Articles, Cloud, Creating an FHIR API, Healthcare, Tutorial Leave a Comment

This is Part 3 of our series on creating an FHIR API using Google Cloudโ€™s offering. In the last installment, we began implementing an FHIR using GCP. We covered creating both the BigQuery resources and your FHIR repository resources. if you missed Part 1 and Part 2, be sure you go back to read those – theyโ€™re critical to understanding!

This time, weโ€™re continuing the implementation. Iโ€™ll explain the authentication methods, and weโ€™ll also tackle populating data in our FHIR repository.

Creating an FHIR API Part 2

Part 2: Creating an FHIR API – Implementation Part A

Zach Gardner API Development, Articles, Cloud, Creating an FHIR API, Healthcare, Tutorial Leave a Comment

Welcome back to our series, Creating an FHIR API. This is Part 2 in our 4-part series on standing up an FHIR using GCP. In Part 1, we talked through two of the offerings out there, Google and Azure, and based on the pros and cons, I decided to use GCP FHIR Cloud Healthcare API.

In this part, we’ll start in on our implementation. A forewarning: we won’t be able to finish it during this installment, so stay tuned for parts 3 and 4! Let’s dive in.