Nexus-plugin-prisma: Document nexus-prisma-generate

Created on 20 Feb 2019  路  2Comments  路  Source: graphql-nexus/nexus-plugin-prisma

Is there a way to generate javascript files instead of typescript?

Maybe adding something to the generate command.

npx nexus-prisma-generate --client ./src/generated/prisma-client --output ./src/generated/nexus-prisma

I get the below error when trying to use with a javascript project. I think the problem is that the generated/nexus.ts and generated/schema.graphql files are not getting generated.

Expected path for outputs.typegen to be a string, saw src/generated/nexus.ts
notprisma1 typdocs

Most helpful comment

Hey there,

nexus-prisma-generate does have an option to generate javascript file, just add --js in your command such as:
npx nexus-prisma-generate --client ./src/generated/prisma-client --output ./src/generated/nexus-prisma --js

That's something we should better document though, so I'll keep this issue opened til we document that.

For the record, here's the help of the nexus-prisma-generate CLI

  nexus-prisma-generate prisma-client-dir output

  > Generate the TypeScript types for nexus-prisma

  -----

  Inputs should be relative to the root of your project

  --client (required): Path to your prisma-client directory (eg: ./generated/prisma-client/)
  --output (required): Path to directory where you want to output the typings (eg: ./generated/nexus-prisma)
  --js     (optional): Whether to generate the types for Javascript

All 2 comments

Hey there,

nexus-prisma-generate does have an option to generate javascript file, just add --js in your command such as:
npx nexus-prisma-generate --client ./src/generated/prisma-client --output ./src/generated/nexus-prisma --js

That's something we should better document though, so I'll keep this issue opened til we document that.

For the record, here's the help of the nexus-prisma-generate CLI

  nexus-prisma-generate prisma-client-dir output

  > Generate the TypeScript types for nexus-prisma

  -----

  Inputs should be relative to the root of your project

  --client (required): Path to your prisma-client directory (eg: ./generated/prisma-client/)
  --output (required): Path to directory where you want to output the typings (eg: ./generated/nexus-prisma)
  --js     (optional): Whether to generate the types for Javascript

Hi, I with Relay as front-end framework, that mean I need connectionType for pagination and I found that Prisma2(I just try it in the past few days, I really like it) may not compatible with nexus-prisma-generate, right? so, I need implement it by myself? (I just wonder if it has been implemented and not document yet maybe)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jasonkuhrt picture jasonkuhrt  路  4Comments

jamesopti picture jamesopti  路  4Comments

ndom91 picture ndom91  路  4Comments

RAW4RMCS picture RAW4RMCS  路  3Comments

adarnon picture adarnon  路  3Comments