🌐
Nexusjs
nexusjs.org
GraphQL Nexus · Declarative, Code-First GraphQL Schemas for JavaScript/TypeScript
GraphQL Nexus is a declarative syntax layered on the graphql-js library.
🌐
Reddit
reddit.com › r/graphql › replacing nexus
r/graphql on Reddit: Replacing Nexus
June 24, 2022 -

I just finished the State of Graphql survey and the Schema Builders questions got me thinking if I shouldn't be using Nexus? I'm not a huge fan of the errors or the API to write custom types. I'm also using Prisma, so it feels like I'm typing out my types twice every time I add a query or a mutation.

It's okay, but is there a better option? What's your favorite? Why?

These were the options in the survey:

  • Nexus

  • TypeGraphQL

  • Pothos

  • Strawberry

  • Sangria

  • gqlgen

  • Graphql Zeus

  • Genql

  • Graphql Code Generator

Top answer
1 of 5
7
My favorites are Pothos and gqtx . In terms of documentation and adoption Pothos definitely wins over gqtx. You might also want to check out the "I'm struggling to find proper Graphql Stack" Reddit thread .
2 of 5
6
Hey, I'm the author of Pothos. Wanted to add a few things to some of the other comments here. I think Pothos is one of the best options for building type safe GraphQL APIs, but based on your question and other comments here I wanted to point out a few design considerations that may not align with your priorities: Pothos has a strong focus on NOT tying your data to your schema which may go against one of the main issues you mentioned in your initial question. There is a plugin (simple-objects) that lets you define GQL types that don't need type definitions or resolvers, but for the most part Pothos is about mapping your typed data into a graphql API while explicitly defining the shape of the API (rather than inferring it from your data). This means you are often still defining 2 schemas (one for the data, and one for graphql). Most of the time this is fairly transparent, and the shape of the data comes from things like your Prisma schema, a type-safe API client, or from a plugin like simple objects. But for VERY simple APIs this might feel like there is some duplication. What you get in return is great type-safety, great flexibility in how you define your API, a much better path for changing how data is resolved in the future as your backend evolves, and a plugin system that lets you define lots of other pieces inline that previously might have again felt like defining another schema (auth is a great example of this). If you have a simpler use case gqtx is lighter weight, and works very well. If you have a single full stack repo and only care about typescript/web clients trpc gives you an awesome way to define simple rest style API where you have type-safe inputs and outputs with everything flowing through a single endpoint. It doesn't have GraphQLs advanced graph style querying, and doesn't work well if you have clients in other languages, but works great for smaller apps that are full stack typescript.
🌐
GitHub
github.com › graphql-nexus › nexus
GitHub - graphql-nexus/nexus: Code-First, Type-Safe, GraphQL Schema Construction · GitHub
import { queryType, stringArg, makeSchema } from 'nexus' import { GraphQLServer } from 'graphql-yoga' const Query = queryType({ definition(t) { t.string('hello', { args: { name: stringArg() }, resolve: (parent, { name }) => `Hello ${name || 'World'}!`, }) }, }) const schema = makeSchema({ types: [Query], outputs: { schema: __dirname + '/generated/schema.graphql', typegen: __dirname + '/generated/typings.ts', }, }) const server = new GraphQLServer({ schema, }) server.start(() => `Server is running on http://localhost:4000`) More examples can be found in the /examples directory: githunt-api ·
Author   graphql-nexus
🌐
Medium
medium.com › swlh › graphql-js-vs-typegraphql-vs-graphql-nexus-2a8036deb851
GraphQL.js vs. TypeGraphQL vs. GraphQL Nexus | by Matt Lim | The Startup | Medium
September 29, 2020 - GraphQL Nexus — Similarly to TypeGraphQL, this implementation builds upon the reference implementation and adds built-in TypeScript support. However, the approach taken is much different.
🌐
PkgPulse
pkgpulse.com › home › guides › pothos vs typegraphql vs nexus 2026
pothos vs TypeGraphQL vs nexus 2026 — PkgPulse Guides
March 9, 2026 - TypeGraphQL uses decorators and class-based definitions — familiar for developers coming from NestJS, works with class-validator for input validation. nexus (from Prisma team) pioneered code-first TypeScript GraphQL but development has slowed — ...
🌐
Reddit
reddit.com › r/graphql › why i prefer graphql.js over typegraphql and graphql nexus
r/graphql on Reddit: Why I prefer GraphQL.js over TypeGraphQL and GraphQL Nexus
September 28, 2020 -

https://medium.com/@pencilflip/graphql-js-vs-typegraphql-vs-graphql-nexus-2a8036deb851

Here are my thoughts on choosing a JavaScript GraphQL implementation. I talk about three popular options - GraphQL.js, TypeGraphQL, and GraphQL Nexus - and why I prefer using GraphQL.js.

🌐
StackShare
stackshare.io › stackups › graphql-nexus-vs-graphql-yoga
graphql-yoga vs GraphQL Nexus | What are the differences?
Type-safe: GraphQL Nexus provides built-in type-safety and TypeScript support by leveraging TypeScript's static type checking capabilities. It ensures that the schema is always in sync with the code and catches potential errors at compile-time.
🌐
npm
npmjs.com › package › nexus
nexus - npm
March 5, 2022 - Declarative, code-first and strongly typed GraphQL schema construction for TypeScript & JavaScript.
      » npm install nexus
    
Published   Mar 05, 2022
Version   1.3.0
Find elsewhere
🌐
Medium
resilient-tech.medium.com › code-first-graphql-with-nexus-2f2a01aa371d
Code-first GraphQL with Nexus. by Bryan Li, Software Engineer @… | by Resilient Tech | Medium
September 15, 2021 - At runtime, this file is executed as vanilla Javascript since we do not use ts-node in production. Therefore, we need to make sure path resolutions will still work after transpilation, and we need to consider the effect of having no Typescript. At pre-build time, this file is invoked to generate the necessary types for Typescript. Remember that we have been generously importing typegen-nexus to use the type from our GraphQL schema ?
🌐
Medium
medium.com › novvum › typegraphql-and-graphql-nexus-a-look-at-code-first-apis-7728f26d7e0d
TypeGraphQL and GraphQL Nexus — A Look at Code-First APIs
April 19, 2019 - TypeGraphQL uses classes and relies on an experimental TypeScript feature called decorators (the lines of code that start with the @ symbol). GraphQL Nexus uses native JavaScript syntax.
🌐
LogRocket
blog.logrocket.com › home › how graphql nexus can help you create better apis
How GraphQL Nexus can help you create better APIs - LogRocket Blog
June 4, 2024 - The types property is where you can pass your GraphQL types. In the outputs property, you can pass two properties called schema and typegen. GraphQL Nexus is going to generate a file called schema.graphql for you with your entire GraphQL schema and a file called typing.ts with all of our types.
🌐
StackShare
stackshare.io › stackups › apollo-vs-graphql-nexus
Apollo vs GraphQL Nexus | What are the differences? | StackShare
Apollo - Build a universal GraphQL ... waiting on backend changes. GraphQL Nexus - It is a declarative, code-first and strongly typed GraphQL schema construction for TypeScript & JavaScript....
🌐
Nexus Schema
nexusjs.org › docs
Nexus Documentation (Concepts, Reference & Guides)
Nexus doesn't have a hard requirement for it yet but may in a future non-breaking release. As documented in the API reference GraphQL Nexus provides a consistent, scalable approach to defining GraphQL types in code.
🌐
Reddit
reddit.com › r/graphql › i've been trying out nexus framework (typescript) for the last days and it seems amazing
r/graphql on Reddit: I've been trying out Nexus Framework (Typescript) for the last days and it seems amazing
September 13, 2020 -

I've been looking for a backend framework for graphql for a while and I'll list the main ones I've tried with the problems I've faced

Nestjs(Graphql) - Not really well documented, had many troubles setting up different stuff, ex: dataloaders, file upload, imported custom scalars, had to bring in a decorator orm, has some code duplication, current choices are TypeORM (which is slowly dying) and MikroORM (which is not very much used compared to typeorm, but seems fine).

Typegraphql - Better documentations and probably bigger community (graphql-wise), same problem as above with the orms and code duplication, has many built-in features that I don't like/use and is relatively slow (or at least it has been in the past, I think it kind of got better now).

Postgraphile - seems like a great option, is perfectly customizable, amazing performance, makes you design the database in a great way and autogenerates logic for crud operations, It's generally definitely a good choice, problem being the tooling around building custom resolvers/gql and postgres which doesn't help too much with the autocomplete (you CAN do it but requires some workarounds from what I understood).

----

Now, what I was looking for was a typescript-first framework that could auto-generate crud mutations/queries but remaining fully customizable while being type-safe and have the possibility to do custom queries to the db with its db layer with as less boilerplate as possible.

Nexus Graphql - nexus uses (with its main plugin at least) prisma2 for its database access, which I personally love, the api is a joy to work with imo. It does have a crud plugin for easily generating FULLY CUSTOMIZABLE crud operations, by fully customizable I mean that you can easily change the input shape as you want, make computed properties or reutilize the full generate query wrapped by your resolver SUPER EASILY, you can reuse the same crud generator with different aliases and customization ,you can pretty much make the vast majority (if not all) of your api by just reutilizing the crud api making nested relations and connections (relay connections as well) easy even in custom resolvers. The api seems a little strange at first but I've started preferring it over decorators after not much, it removes a lot of code duplication while remaining simple and type-safe without even explicitly declaring types, same goes for context and whatever else.

The only part where there is some code duplication is between defining the schema (in the prisma model file) and defining your graphql api (for example, you want to omit the password field in the api), this remains type-safe and with code completion tho, not really a pain.

There are other useful plugins that are easy and with near 0 boilerplate to use, for example authorizing fields, or adding complexity calculator.

It is backed by prisma, the negative part is that it is still not stable (0.26), so it has some breaking changes often, and documentation is not full yet

TLDR: Overall what I love about it is how easy and super fast to build with no boilerplate everything seems to be, while being fully customizable like any other custom server and type-safe db access. Really, seems like everything I was looking for in the past months.

Really, if you like the prisma2 api definitely try this one out, it'll be a joy https://nexusjs.org/, the api seems strange at first, but I promise you'll prefer it over decorators after realizing how much it simplifies things.

DISCLAIMER: I'm not related to nexus or prisma in any way, just a random guy who is loving the framework and hopes its community will grow

🌐
npm Trends
npmtrends.com › nexus-vs-type-graphql
nexus vs type-graphql | npm trends
Comparing trends for nexus 1.3.0 which has 125,565 weekly downloads and 3,417 GitHub stars vs. type-graphql 2.0.0-rc.2 which has 251,148 weekly downloads and 8,086 GitHub stars.
🌐
StackShare
stackshare.io › graphql-nexus
GraphQL Nexus - Reviews, Pros & Cons | Companies using GraphQL Nexus
Pros of GraphQL Nexus · 1Use with Apollo · 1Code first · GraphQL · Prisma Integration · Apollo Integration · Schema Generation · Compatible with the GraphQL ecosystem · Generates SDL & TS definitions · Expressive, declarative API for building schemas ·
🌐
Nexus Schema
nexusjs.org › docs › adoption-guides › nexus-framework-users
Nexus Framework Users
Layout your Nexus type defs amongst modules under a parent dir such that each module contains a part of your GraphQL schema. Put shared parts of your GraphQL schema into shared.ts.
🌐
Ts.ED
tsed.dev › tutorials › graphql-nexus.html
GraphQL Nexus | Ts.ED a modern Node.js/Bun.js framework built with TypeScript on top of Express.js/Koa.js/Fastify.js/CLI/AWS
February 11, 2026 - GraphQL Nexus' APIs were designed with type-safety in mind. We auto-generate type-definitions as you develop, and infer them in your code, giving you IDE completion and type error catching out of the box!
🌐
LibHunt
libhunt.com › compare-type-graphql-vs-nexus
TypeGraphQL vs nexus - compare differences and reviews? | LibHunt
You can generate the schema based on your TypeScript code (e.g. TypeGraphQL), or you can generate types based on your schema (e.g. GraphQL Code Generator). We opted for the latter since it slotted right into our existing GraphQL server implementation using Apollo Server. Posts with mentions or reviews of nexus.
🌐
LibHunt
libhunt.com › compare-nexus-vs-type-graphql
nexus vs TypeGraphQL - compare differences and reviews? | LibHunt
When moving away from Apollo Server, and you're looking for a replacement built with JavaScript or TypeScript, let me give you some options. If you want to keep building your GraphQL API schema first, you might want to consider Mercurius (which relies on Fastify) or GraphQL Yoga. If you're going to build your GraphQL API code or resolver first, have a look at TypeGraphQL or Nexus.