Andrew Ross
10/06/2021, 5:30 PMAndrew Ross
10/06/2021, 5:45 PMDante
10/07/2021, 2:15 AMAndrew Ross
10/07/2021, 3:10 AMJosef Henryson
10/11/2021, 1:50 PMJosef Henryson
10/12/2021, 9:56 AMSteven
10/12/2021, 10:52 AMt.field(PrismaModel.myJsonFieldNameHere)
Steven
10/12/2021, 10:57 AMJosef Henryson
10/12/2021, 12:02 PMJosef Henryson
10/12/2021, 12:10 PMJosef Henryson
10/15/2021, 7:59 AMAkshay Kadam (A2K)
10/20/2021, 1:26 PMnpm
script:
TypeError: chalk_1.default.Instance is not a constructor
at Object.<anonymous> (~/my-app/node_modules/@nexus/logger/src/chalk.ts:9:22)
The npm
script looks like:
cross-env GENERATE=true cross-env DOTENV_CONFIG_PATH=.env.example ts-node -r tsconfig-paths/register --require dotenv/config --transpile-only -P nexus.tsconfig.json src/server/graphql/schema.ts
Akshay Kadam (A2K)
10/20/2021, 1:26 PMAkshay Kadam (A2K)
10/20/2021, 1:28 PMnexus-plugin-prisma
but now I've opted for nexus-prisma
& it stopped working. I did change the underlying code but I can't find a complete example of nexus-prisma
anywhere on Github. I mean there are hardly few repos but none of them work for meAkshay Kadam (A2K)
10/20/2021, 1:29 PM@nexus/logger
which is a sub-dependency of:
└─┬ nexus-prisma@0.34.0
└─┬ setset@0.0.7
└── @nexus/logger@0.2.0
Akshay Kadam (A2K)
10/20/2021, 1:35 PMgenerate:nexus
so does that mean I can remove the script completely because nexus-prisma
's generator is called in schema.prisma
?Josef Henryson
10/21/2021, 3:50 PMJosef Henryson
10/21/2021, 4:10 PMPatrick
10/21/2021, 9:50 PMJosef Henryson
10/25/2021, 9:03 AMAkshay Kadam (A2K)
10/26/2021, 12:58 PMschema.graphql
file when using prisma
+ nexus-prisma
→ (https://github.com/prisma/nexus-prisma) & thus unable to generate GraphQL Codegen (i tried this on my working setup that deleting schema.graphql
throws the same error)
It throws the following error:
Failed to load schema from ./server/graphql/schema.graphql:My
codegen.yml
looks like:
schema: ./server/graphql/schema.graphql
documents:
- '**/*.graphql'
- '!/server/graphql/schema.graphql'
generates:
/client/graphql/types.generated.ts:
plugins:
- typescript
./:
preset: near-operation-file
presetConfig:
baseTypesPath: /client/graphql/types.generated.ts
plugins:
- typescript-operations
- typescript-urql
And my server/graphql/schema.ts
looks like:
import { makeSchema } from 'nexus'
import path from 'path'
import User from './User'
const shouldGenerateArtifacts =
process.env.NODE_ENV === 'development' || !!process.env.GENERATE
export const schema = makeSchema({
types: [User],
plugins: [],
// Type the GraphQL context when used in Nexus resolvers
contextType: {
module: path.join(process.cwd(), 'pages/api/index.ts'),
export: 'GraphQLContext',
},
// Generate the files
shouldGenerateArtifacts,
outputs: {
typegen: path.join(
process.cwd(),
'server/graphql/nexus-types.generated.ts'
),
schema: path.join(process.cwd(), 'server/graphql/schema.graphql'),
},
})
How do I make sure it creates server/graphql/schema.graphql
before graphql-codegen runs?
Repro is available on prisma
branch → https://github.com/deadcoder0904/twitter-api-v2-3-legged-login-using-next-connect/tree/prismaJosef Henryson
11/01/2021, 2:33 PMMatheus Assis
11/05/2021, 2:30 PMextendType
since it modifies the original type
(similar to inheritance on OOP)Josef Henryson
11/15/2021, 12:15 PMSamson Ssali
11/15/2021, 4:47 PMCannot read properties of undefined (reading 'engineType')
I get it when I run npm generate
My nexus - prisma set up failed with this error:
Error: @prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.
That's why I tried npm generate
Kelly Copley
11/16/2021, 6:48 PM./graphql/types/division.ts:14:15
Type error: Property 'dateTime' does not exist on type 'Omit<InputDefinitionBlock<"DivisionInput">, "nonNull" | "nullable">'.
Kelly Copley
11/17/2021, 2:59 AMAwey
11/18/2021, 10:46 AMAwey
11/25/2021, 3:28 PMAnton Pokhylenko
11/27/2021, 11:34 AMnexus-prisma: not found
node version is 16.13.0
I've also tried with prisma client version 2.30.0 and got same error
what am I missing here?