A GraphQL Service for Asset Control

A GraphQL Service for Asset Control

In this post, I would like to show how to implement a GraphQL service for FX rates stored in Asset Control. In a subsequent article I will then make use of the GraphQL data in a small React app to generate charts for these FX rates.

In this blog post, I would like to show how to implement a GraphQL service for FX rates stored in  Asset Control. In a  subsequent article I will then make use of the GraphQL data in a small React app to generate charts for these FX rates.

While this article targets Asset Control, you can see how the implementation of a GraphQL service as shown is applicable to other systems.

You can find the source code here:  https://github.com/mhmtio/ac-graphql

Firstly, what is GraphQL?

What is GraphQL?

According to  https://graphql.org/GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data.

Most of you will be familiar with REST APIs where a request to a (potentially parameterised) URL returns a response in JSON format. While a GraphQL service still returns JSON, the beauty and relative strength lies in its — yes — query language. In a fast-forward to what we are going to build, please look at the below query:

{
  fxRatesByBaseCurrency(baseCurrency: "GBP") {
    quoteCurrency
    timeseries {
      date
      rate
    }
  }
}

We are interested in FX rates which we query by their base currency. And we specify that the result should contain the quote currency as well as the timeseries with its date and rate values.

asset-control graphql react

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

How native is React Native? | React Native vs Native App Development

Article covers: How native is react native?, React Native vs (Ionic, Cordova), Similarities and difference between React Native and Native App Development.

How to Create plotting FX rates for Asset Control with React and GraphQL

In this article, we will show how you to use the previously implemented GraphQL service for Asset Control in a React app to dynamically generate graphs of FX rates. How to Create plotting FX rates for Asset Control with React and GraphQL

Build a simple React Native Pokemon app with React-Navigation

As we start learning new technologies we want to start building something or work on a simple project to get a better understanding of the technology.

How to build a Trello-like application using React Hooks and GraphQL

Learn how to build a Trello-like application using React Hooks and GraphQL. Learn how to use React Hooks and a GraphQL server to create a Trello-like application with drag-and-drop features. Building a Trello clone with React Hooks and GraphQL

Share Code Between React Native and React JS

React provides support for the server-side and frontend. Today, React development services are in demand as more and more organizations are considering software solutions that are crafted from the framework.