SQuriL: Generate and Store Your GraphQL Schemas | by Michael Trapani | Mar, 2022

SQuriL: Generate and Store Your GraphQL Schemas | by Michael Trapani | Mar, 2022

GraphQL is a powerful query language for APIs and a runtime for fulfilling those queries with your existing data. GraphQL provides an alternative to RESTful architecture, in which developers can construct their requests from multiple sources of data in one, single API call. Through the use of schemas, queries, and resolvers, GraphQL allows developers to request a specific piece of data. There is no need to parse through every table, row, and column of a database: you only get the information that you are asking for, and this is what makes GraphQL such a powerful tool.

The benefits of using GraphQL to query in one, single API call. Source: Developedia — GraphQL

API developers use GraphQL to create a schema to describe all possible data that clients can query through that particular database. A GraphQL schema is made up of object types, which define what kind of object you can request and what field it has. As queries are received, GraphQL validates the queries against the schema — GraphQL then executes the validated queries.

GraphQL was developed by Facebook, which first began using the query language for mobile applications in 2012. The GraphQL specification was open sourced in 2015, and is now overseen by the GraphQL Foundation, which is hosted by the not-for-profit Linux Foundation.

There are a variety of open source projects that involve GraphQL, including Apollo, Offix, Graphback, and OpenAPI-to-GraphQL.

The Downsides

While the advantages of GraphQL are clear, many companies have not yet fully incorporated the querying language into their tech stacks. Simply put, the barrier of entry to fully implemented GraphQL can be high, requiring dozens — if not hundreds — of hours for full conversion. The resources just might not be available for many smaller- to mid-size companies. Developers are consistently seeking new and effective technologies to help not only with their understanding of GraphQL, but to better understand how schema’s can be generated from a given source.

This is where SQuriL comes in.

Meet SQuriL, an open source GraphQL schema generation and storage tool that creates customized, production-ready GraphQL schemas from a PostgreSQL URI for both Node.js and TypeScript compatible environments. Simply log in with your GitHub account and start generating and saving your GraphQL schemas today!

Sign In Using GitHub OAuth

No need to create a new username and password for SQuriL — users simply log in with their GitHub accounts through SQuriL’s GitHub OAuth option on the application’s main landing page.

Link Your Database and Generate Your GraphQL Schema

Copy and paste your PostgreSQL URI into the address bar at the top of the application dashboard page and hit Go. Within seconds, both your Node.js- and TypeScript-compatible GraphQL schema code will be populated within the dashboard’s code windows, displayed with the CodeMirror text editor. If you don’t have access to a PostgreSQL URI and still want to test out SQuriL, feel free to use our sample database to start generating schema.

Save Your Schema

Once generated, both Node.js- and TypeScript-compatible schemas can be saved by users to their personal accounts for future database querying needs.

Export Your Code

Users also have the option of exporting their code to .js and .ts files for local storage.

SQuriL is an open source GraphQL schema generation and storage tool that is in active development. If you’re interested in SQuriL, check us out on GitHub where our team is actively seeking feedback, monitoring issues, and answering questions from the community. You can also find us on LinkedIn.

SQuriL | LinkedIn | GitHub

Diana R. Kim | LinkedIn | GitHub

Frank Nguyen | LinkedIn | GitHub

Mark Charles Smith | LinkedIn | GitHub

Michael Trapani | LinkedIn | GitHub

Source link

Leave a reply

Please enter your comment!
Please enter your name here