Building strongly typed applications with ReasonML and GraphQL

ReasonML is an object-functional programming language inspired from OCaml, that compiles to JavaScript. It helps you write type-safe code while leveraging the best of OCaml and JavaScript ecosystems. It is being adopted widely in the coming years by companies such as Facebook and Onegraph due to its strong type inference, JavaScript interoperation and simplicity.

GraphQL is a query language spec for APIs defined by Facebook. People are choosing it over REST lately due to its powerful type system and the smoothe DX that it provides to the API Consumers. If implemented correctly, GraphQL solves commonly faced tedious problems like data over-fetching/under-fetching, type duplication, caching and a lot more.

In this talk, we will look at the whats and whys of ReasonML and GraphQL and we will put them together to see how they make your apps typesafe. This is especially important because frontend applications are becoming increasingly complex these days and the GraphQL-ReasonML duo makes the data flow coherently.


Outline/Structure of the Talk

  • ReasonML (15 minutes)
    • What is ReasonML?
    • Why do we need a new language like ReasonML?
    • Introduction to the syntax
    • Writing typed JavaScript and type-safing existing libraries
    • Disadvantages
  • GraphQL (10 minutes)
    • What is GraphQL?
    • The syntax
    • Benefits of GraphQL and comparison with REST
    • Realtime subscriptions
    • Disadvantages
  • ReasonML and GraphQL - example driven analysis (20 minutes)
    • Backend for a todo app
      • GraphQL types
      • Required queries and mutations
    • Frontend implementation
      • Writing the types
      • Client-server type-contract
      • The boilerplate
      • Caching
  • Resources

Learning Outcome

By the end of the talk, you will:

  • Know the advantages and disadvantages of ReasonML and GraphQL
  • Know how ReasonML fits in on the front end
  • Be in a position to evaluate GraphQL and/or ReasonML for your next project

Target Audience

1. People with web development background who want to make their applications typesafe. 2. Anybody interested in ReasonML

schedule Submitted 1 year ago

Public Feedback