graphql-nexus / nexus-plugin-prisma

Deprecated
MIT License
828 stars 118 forks source link

Schema generation error with the latest prisma2 release #605

Closed impowski closed 4 years ago

impowski commented 4 years ago

OS: MacOS Prisma Version: 2.0.0-preview022 Nexus Version: 0.12.0-rc.11 Nexus Prisma Version: 0.9.1

When I generate schema with nexus-prisma I keep getting this error.

/Users/impowski/Projects/loaders/node_modules/nexus-prisma/src/publisher.ts:126
          .map(field => ({
           ^
TypeError: Cannot read property 'map' of undefined
    at Object.definition (/Users/impowski/Projects/loaders/node_modules/nexus-prisma/src/publisher.ts:126:12)
    at SchemaBuilder.walkInputType (/Users/impowski/Projects/loaders/node_modules/nexus/src/builder.ts:1365:9)
    at SchemaBuilder.walkTypes (/Users/impowski/Projects/loaders/node_modules/nexus/src/builder.ts:679:16)
    at SchemaBuilder.getFinalTypeMap (/Users/impowski/Projects/loaders/node_modules/nexus/src/builder.ts:787:10)
    at makeSchemaInternal (/Users/impowski/Projects/loaders/node_modules/nexus/src/builder.ts:1585:15)
    at Object.makeSchema (/Users/impowski/Projects/loaders/node_modules/nexus/src/builder.ts:1630:49)
    at Object.<anonymous> (/Users/impowski/Projects/loaders/packages/server/src/schema.ts:6:23)
    at Module._compile (internal/modules/cjs/loader.js:816:30)
    at Module.m._compile (/Users/impowski/Projects/loaders/node_modules/ts-node/src/index.ts:814:23)
    at Module._extensions..js (internal/modules/cjs/loader.js:827:10)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
arvindell commented 4 years ago

Hello. Is there any workaround I until this issue is fixed?

RafaelKr commented 4 years ago

This should be fixed by https://github.com/prisma-labs/nexus-prisma/pull/608 It's included in release 0.10.0 https://github.com/prisma-labs/nexus-prisma/releases/tag/0.10.0

arvindell commented 4 years ago

@RafaelKr I just updated it and it's fixed. Thanks