Our great sponsors
-
Defining your schema and the resolvers simultaneously led to some issues for developers, as it was hard to decouple the schema from the (business) logic in your resolvers. The SDL-first approach introduced this separation of concerns by defining the complete schema before connecting them to the resolvers and making this schema executable. A version of the SDL-first approach was introduced together with GraphQL specification, and the core implementation for in JavaScript called graphql-js.
-
You can find an example of a modern code-first way to build a GraphQL server is the Python library graphene. You can use Graphene build servers that connect with data sources like a database or custom Python objects. Below you can see what a basic implementation of a GraphQL server with Graphene looks like:
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
-
Instead of constructing an object, it uses classes to define the types and operations for the schema that it generates. The schema generated by this implementation will have the same structure as the schema created with graphql-js. Using classes to define your schema has the advantage of being less mutable and more structured when writing code. Similar implementations can be found for TypeScript with the library TypeGraphQL or Sangria GraphQL for Scala.
-
Instead of constructing an object, it uses classes to define the types and operations for the schema that it generates. The schema generated by this implementation will have the same structure as the schema created with graphql-js. Using classes to define your schema has the advantage of being less mutable and more structured when writing code. Similar implementations can be found for TypeScript with the library TypeGraphQL or Sangria GraphQL for Scala.
-
With an SDL-first approach, you directly write your schema and write resolvers afterward. A schema created SDL-first with graphql-js, could be made into a server by using Express or any other Node library to set up an HTTP server. An example implementation of an SDL-first approach in JavaScript will require you to define a schema using SDL:
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
Related posts
- Is there a place with a bunch of free API's I can use to practice making CRUD applications?
- Security implications of cross-origin resource sharing (CORS) in Node.js
- I need recommendations for creating an API. Start from scratch, or are there projects I can build from?
- Easy Tutorial: How to Create an Express API for Beginners
- Monoliths to Microservices using the Strangler Pattern