During the Thursday session of the 2019 GraphQL conference in Berlin Germany, Tim Greisser, Software Engineer at Cypress.io, presented the benefits of using GraphQL Nexus for taking a “code first” approach to GraphQL API development. GraphQL Nexus is a development library that allows GraphQL developers to do strong-type programming when creating a GraphQL API.
GraphQL Nexus uses TypeScript as the foundation of its development experience. TypeScript allows developers to program using classes, interfaces, and generics in a manner found in formal Object-Oriented Programming languages such as Java, C# and C++. Typescript enabled development platforms such as Visual Studio Code to perform type checking as developers write code. Thus, errors are uncovered immediately.
GraphQL Nexus provides an SDL Converter tool that will transform GraphQL schemas written in SDL into TypeScript.
Also, the project published the online Nexus Playground. Developers can use Nexus Playground to get direct hands-on experience working the GraphQL Nexus features such as autocomplete and syntax checking.
During the talk, Griesser pointed out that the goal of Nexus is to allow developers to create better code at faster rates by taking advantage of the power and safety that code-first programming promoted by Nexus facilitates.
The Nexus is published as an open source project on GitHub. The GitHub repository found here also provides a variety of examples that demonstrates the capabilities of Nexus.