GraphQL Basics NReco.GraphQL documentation
GraphQL is a new API standard that provides a more efficient, powerful and flexible alternative to REST. It was developed and open-sourced by Facebook and is now maintained by a large community of companies and individuals worldwide.
Since being introduced by Facebook, GraphQL has taken the API world by storm as an alternative to REST APIs. GraphQL fixes many problems that API developers and users have found with RESTful architecture.
Today, most applications need to fetch data from a server where data is stored in a database. The API’s responsibility is to provide an interface to the stored data that fits an application’s needs. GraphQL is often confused with being a database technology. This is a misconception. GraphQL is a query language for APIs - not databases. In that sense, it’s database agnostic and effectively used in any context where an API is used.
What is a GraphQL-to-SQL
Obviously, configuring and maintaining defined GraphQL schemas takes time and requires specialists who be able to do those changes in code-level.
NReco.GraphQL engine (based on GraphQL for .NET) allows you to define schemas extremely fast in an understandable json-format and fetch data directly from the database.
NReco.GraphQL API Overview
Class/Interface | Purpose |
---|---|
GraphqlDbAdapter | translates grapql queries to SQL; performs all necessary logic related to query execution and data loading according to the specified schema metadata. |
GraphqlConfiguration | defines schema for GraphQL-to-SQL engine (objects mapping, global settings) |
ObjectSchema | defines GraphQL object schema and mapping to database table (or view). Contains list of FieldSchema-s |
FieldSchema | defines object's field schema that corresponds to database column |