Hello nexus@0.12 or Lower User!

This guide is for you if you're a nexus user prior to version 0.20.

Prior to version 0.20, the nexus package comprised only the schema component of the Nexus framework. The last version of this schema-only version of the nexus package was 0.12. Subsequent versions moved to the package @nexus/schema. Meanwhile, nexus 0.20 and above became the framework package. It builds, in part, on top of @nexus/schema. You can read the announcement about the transition of Nexus from a schema library to a full-fledged framework in this GitHub issue.)

You can remain a Nexus schema library user by using the @nexus/schema package. Or you can upgrade to the framework by using the latest version of the nexus package. The following sections show how to migrate either way.

Migrating to @nexus/schema

Remove nexus, add @nexus/schema and update imports throughout your codebase accordingly. E.g.:

1npm remove nexus
2npm add @nexus/schema
- import { makeSchema } from "nexus";
+ import { makeSchema } from "@nexus/schema";

If you are a nexus-prisma user, note that the package has migrated to nexus-plugin-prisma. You can learn more about the transition in this Github issue.

To migrate, please remove nexus-prisma, @prisma/client, @prisma/cli, add nexus-plugin-prisma, and update imports throughout your codebase accordingly. E.g.:

1npm remove nexus-prisma @prisma/client @prisma/cli
2npm add nexus-plugin-prisma
- import { nexusPrismaPlugin } from 'nexus-prisma'
+ import { nexusSchemaPrisma } from 'nexus-plugin-prisma/schema'

Migrating to nexus Framework

For this path, please refer to our migration guide for Nexus Schema users. The only difference is that instead of going from @nexus/schema to nexus you will be going from nexus@0.12 (or lower) to nexus@latest.

Edit this page on Github