type-graphql - Create GraphQL schema and resolvers with TypeScript, using classes and decorators!

  •        65

We all know that GraphQL is so great and solves many problems that we have with REST API, like overfetching and underfetching. But developing a GraphQL API in Node.js with TypeScript is sometimes a bit of pain. Why? Let's take a look at the steps we usually have to make. The biggest problem is the redundancy in our codebase, which makes it difficult to keep things in sync. To add a new field to our entity, we have to jump through all the files - modify an entity class, the schema, as well as the interface. The same goes with inputs or arguments. It's easy to forget to update one piece or make a mistake with a single type. Also, what if we've made a typo in field name? The rename feature (F2) won't work correctly.

https://19majkel94.github.io/type-graphql/
https://github.com/19majkel94/type-graphql

Dependencies:

@types/glob : ^7.1.1
@types/graphql : ^14.0.2
@types/node : *
class-validator : >=0.9.1
glob : ^7.1.3
graphql : ^14.0.2
graphql-query-complexity : ^0.2.2
graphql-subscriptions : ^1.0.0
tslib : ^1.9.3

Tags
Implementation
License
Platform

   




Related Projects

apollo-server - :earth_africa: GraphQL server for Express, Connect, Hapi and Koa

  •    TypeScript

Apollo Server is a community-maintained open-source GraphQL server. It works with pretty much all Node.js HTTP server frameworks, and we're happy to take PRs for more! It works with any GraphQL schema built with the graphql-js reference implementation.Apollo Server is super easy to set up. Just npm install apollo-server-<variant>, write a GraphQL schema, and then use one of the following snippets to get started. For more info, read the Apollo Server docs.

graphql-up - Get a ready-to-use GraphQL API for your schema

  •    Javascript

graphql-up is the fastest way to get a free & ready to use GraphQL API. It works out of the box with Apollo & Relay and supports GraphQL subscriptions.You only need to provide the schema, graphql-up will create a GraphQL API for you. The actual magic happens on the servers sponsored by Graphcool.

graphql-up - Get a ready-to-use GraphQL API for your schema

  •    Javascript

graphql-up is the fastest way to get a free & ready to use GraphQL API. It works out of the box with Apollo & Relay and supports GraphQL subscriptions. You only need to provide the schema, graphql-up will create a GraphQL API for you. The actual magic happens on the servers sponsored by Graphcool.

graphqlgen - ⚙️ Generate type-safe resolvers based upon your GraphQL Schema

  •    TypeScript

Programming in type-safe environments can contribute toward great confidence in your code's integrity. graphqlgen aims to leverage the GraphQL type system to make your resolvers completely type-safe. This is important because resolvers are the heart of any graphql service and yet the hardest to statically type due to their dynaminism. Edit ./my-app/src/schema.graphql to your heart's content.


apollo-resolvers - Expressive and composable resolvers for Apollostack's GraphQL server

  •    Javascript

When standing up a GraphQL backend, one of the first design decisions you will undoubtedly need to make is how you will handle authentication, authorization, and errors. GraphQL resolvers present an entirely new paradigm that existing patterns for RESTful APIs fail to adequately address. Many developers end up writing duplicitous authorization checks in a vast majority of their resolver functions, as well as error handling logic to shield the client from encountering exposed internal errors. The goal of apollo-resolvers is to simplify the developer experience in working with GraphQL by abstracting away many of these decisions into a nice, expressive design pattern. apollo-resolvers provides a pattern for creating resolvers that work, essentially, like reactive middleware. By creating a chain of resolvers to satisfy individual parts of the overall problem, you are able to compose elegant streams that take a GraphQL request and bind it to a model method or some other form of business logic with authorization checks and error handling baked right in.

apollo-tooling - :pencil2: Tooling for development and production Apollo workflows

  •    TypeScript

Apollo CLI brings together your GraphQL clients and servers with tools for validating your schema, linting your operations for compatibility with your server, and generating static types for improved client-side type safety. Generate static types for GraphQL queries. Can use the published schema in Apollo Engine or a downloaded schema.

apollo-codegen - :pencil2: Generate API code or type annotations based on a GraphQL schema and query documents

  •    TypeScript

This is a tool to generate API code or type annotations based on a GraphQL schema and query documents.It currently generates Swift code, TypeScript annotations, Flow annotations, and Scala code, we hope to add support for other targets in the future.

graphql-middleware - Split up your GraphQL resolvers in middleware functions

  •    TypeScript

Split up your GraphQL resolvers in middleware functions. GraphQL Middleware is a schema wrapper which allows you to manage additional functionality across multiple resolvers efficiently.

apollo-cli - :pencil2: Command line tool for development and production Apollo workflows

  •    TypeScript

Apollo CLI brings together your GraphQL clients and servers with tools for validating your schema, linting your operations for compatibility with your server, and generating static types for improved client-side type safety. Checks your GraphQL operations for compatibility with the server. Checks against the published schema in Apollo Engine.

graphql-anywhere - :icecream: Run a GraphQL query anywhere, against any data, with no schema.

  •    TypeScript

Run a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with graphql-tag.I think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in Apollo Client to read data from a Redux store with GraphQL.

nexus - GraphQL Nexus: Code-First, Type-Safe, GraphQL Schema Construction

  •    TypeScript

GraphQL Nexus is independent from Prisma. To learn how it can best be combined with Prisma, check out the nexus-prisma plugin. You can find the docs for GraphQL Nexus here.

prisma-binding - GraphQL Binding for Prisma (using GraphQL schema delegation)

  •    TypeScript

Note: Unless you explicitly want to use schema delegation we recommend to use Prisma client to build a GraphQL server see tutorial. prisma-binding provides a convenience layer for building GraphQL servers on top of Prisma services. In short, it simplifies implementing your GraphQL resolvers by delegating execution of queries (or mutations) to the API of the underlying Prisma database service.

graphql-api - Write type-safe GraphQL services in Haskell

  •    Haskell

graphql-api helps you implement a robust GraphQL API in Haskell. By the time a query makes it to your handler you are dealing with strong, static types that make sense for your problem domain. All your handlers are normal Haskell functions because we derive their type signature from the schema. If you have used servant, this will sound familiar. The library provides type combinators to create a GraphQL schema, and functions to parse and evaluate queries against the schema.

apollo-client - :rocket: A fully-featured, production ready caching GraphQL client for every server or UI framework

  •    TypeScript

Apollo Client is a fully-featured caching GraphQL client with integrations for React, Angular, and more. It allows you to easily build UI components that fetch data via GraphQL. To get the most value out of apollo-client, you should use it with one of its view layer integrations.To get started with the React integration, go to our React Apollo documentation website.

Searchkit - GraphQL API & React UI components for Elasticsearch.

  •    TypeScript

Searchkit is a tool allowing you can quickly build a search experience using predefined GraphQL resolvers and React components. Built on the top of Apollo GraphQL, React & Elasticsearch, Searchkit makes building a high-quality API a lot easier. The library provides GraphQL resolvers dedicated to handling the most common use cases you could think of when using filtering oriented API beginning with basic operations such as simple querying, ending on more tricky ones such as efficient facet filtering or pagination.

elm-graphql - GraphQL for Elm

  •    TypeScript

elm-graphql generates Elm code for making GraphQL queries in a type-safe manner.At compile time, elm-graphql takes GraphQL schema and named queries in a .graphql file and generates corresponding Elm types. The schema is obtained by introspection of a live GraphQL server.





We have large collection of open source products. Follow the tags from Tag Cloud >>


Open source products are scattered around the web. Please provide information about the open source projects you own / you use. Add Projects.