nexus

Code-First, Type-Safe, GraphQL Schema Construction (by graphql-nexus)

Nexus Alternatives

Similar projects and alternatives to nexus

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a better nexus alternative or higher similarity.

nexus reviews and mentions

Posts with mentions or reviews of nexus. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-12-19.
  • What to use with Apollo Server v4 to achieve type-safety?
    3 projects | /r/graphql | 19 Dec 2022
  • What do you think about nexus? I'm new at this and wondering if I should use it in my project.
    3 projects | /r/graphql | 19 May 2021
    There are multiple ways available of constructing a graphql schema. Usually, you can break down those into "SDL" First and "Code" First. A simple example of a Code First approach is the programmatic graphql.js API using `new GraphQLObjectType`. You define your schema with code. In an SDL First approach, you write your schema in the GraphQL SDL (as text) and define a resolver map. You can find some examples over here: https://graphql.org/graphql-js/constructing-types/ A lot of tooling has emerged of those two methods of building GraphQL schemas and you usually have to choose whether you wanna stick to Code First or SDL First. Tools like gqtx (https://github.com/sikanhe/gqtx), giraphql (https://github.com/hayes/giraphql), and nexus (https://github.com/graphql-nexus/nexus) are built around the Code First approach and improve the developer experience over the programmatic API form graphql.js by providing a more type-safe API when utilizing TypeScript. They ultimately all do the same, with slightly (more or less opinionated) different APIs. On the other hand tooling for SDL has also evolved. graphql-tools provides a more advanced interface over how you define the resolvers map and a lot of utilities for constructing your schema from SDL/resolver map partials distributed across different files (https://www.graphql-tools.com/docs/generate-schema/). Together, with graphql-codegen resolver type generation (https://www.graphql-code-generator.com/docs/plugins/typescript-resolvers) you can bring this to the next level if you are working with TypeScript and generate fully typed resolvers from the GraphQL SDL. You have to find out for yourself which approach is best suited for you. I have been using both on different projects and they both have benefits and trade-offs. My opinion is mostly based on the TypeScript developer experience. Code First seems to be the better pick for me if you have lots of computed fields that cannot be mapped 1:1 to the data sources, where you would have to add a lot of type resolver mappings configuration for codegen. With SDL I like that I have the feeling that I can write the schema faster and less clumsy, and the SDL is immediately readable. On Code First you, however, can still generate an SDL file from the coding schema. Maybe there is a niche open for an approach that combines Code and SDL First approaches. We will have to see what the future brings. Here are some more articles/threads regarding the topic: https://www.prisma.io/blog/the-problems-of-schema-first-graphql-development-x1mn4cb0tyl3 https://www.reddit.com/r/graphql/comments/fpkx7a/codefirst\_vs\_schemafirst\_development/ https://blog.logrocket.com/code-first-vs-schema-first-development-graphql/ Also, note that most GraphQL server/transports do or should not care about the way you construct your schema. E.g. the apollo-server docs show you only an SDL first way of constructing the schema (https://www.apollographql.com/docs/apollo-server/schema/schema/), but it is also possible to provide a schema instance(https://www.apollographql.com/docs/apollo-server/api/apollo-server/#schema). apollo-server defaults to advocating creating a schema with SDL (by using an old graphql-tools@4 version under the hood).
    3 projects | /r/webdev | 18 May 2021
    Tools like gqtx (https://github.com/sikanhe/gqtx), giraphql (https://github.com/hayes/giraphql), and nexus (https://github.com/graphql-nexus/nexus) are built around the Code First approach and improve the developer experience over the programmatic API form graphql.js by providing a more type-safe API when utilizing TypeScript. They ultimately all do the same, with slightly (more or less opinionated) different APIs.
  • Nexus and directive
    2 projects | /r/graphql | 29 Mar 2021
    If you want in-dept examples of plugins in nexusjs, I suggest that you have a look at how the default plugins are written here.
  • A note from our sponsor - SurveyJS
    surveyjs.io | 18 Apr 2024
    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. Learn more →

Stats

Basic nexus repo stats
4
3,371
1.1
5 months ago

graphql-nexus/nexus is an open source project licensed under MIT License which is an OSI approved license.

The primary programming language of nexus is TypeScript.

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.
workos.com