Awey
07/21/2020, 11:03 PMJavanie Campbell
07/22/2020, 12:47 PMMichael Gardner
07/22/2020, 4:23 PM@prisma/client@2.3
) with nexus
. i’ve narrowed it down to the package nexus-plugin-prisma@0.16.1
using an older version of prisma (@prisma/client@2.1.3
) as a dependency, causing a conflict between the the two versions due to naming convention changes in the recent releases.
As far as I know, I cannot change the version in npx
because that always get the latest version of @prisma/client
, which means i need to figure out a way to bump the version in nexus-plugin-prisma
? Any suggestions?Awey
07/23/2020, 2:35 PMnexus
resolver when I try using the prisma crud operations, its showing my outdated fields from my prisma.schema
even though I've run the save and up
commands after changing and restarted nexus? It doesn't seem to have recognized the updated schema.DeanMo
07/23/2020, 8:57 PMryan
07/24/2020, 1:21 AMluhagel
07/24/2020, 9:20 AMFieldResolver
out of the nexus
package? Currently transitioning from @nexus/schema
and I can't really find itPeter
07/24/2020, 10:41 AMargs: {
startData: schema.scalarType()
},
in model I have
model x {
id String @id @default(uuid())
startDate DateTime
}
It is possible to import from prisma somehow enum types also?Michael
07/25/2020, 3:22 PMMichael
07/26/2020, 7:14 AMcreate-nexus-type
CLI. Works nice so far.
Now I want to add some file uploads and I wonder how that fits together. I found this reference, which I'm trying to follow.
The generated CRUD assumes that there's a mapping from the input to the output types. But with the file upload, this pattern is broken as far as I can see. The input type will be some Upload
scalar and the output type some custom File
type.
does this make sense? does anyone have a hint for me how to handle this?Michael
07/26/2020, 7:17 AMaddCrudResolvers
from the react-admin data provider.jferrettiboke
07/26/2020, 11:18 AMnexus dev
on Windows? Context: https://github.com/graphql-nexus/nexus/issues/1277Janus Reith
07/26/2020, 1:48 PMPeter
07/27/2020, 8:57 AMt.field('user', { type: 'User' })
Peter
07/27/2020, 1:41 PMschema.extendType({
type: 'Query',
args: { id: intArg('id of the user') },
definition(t) {
...
},
})
but a get error
Argument of type '{ type: "Query"; args: { id: any; }; definition(t: OutputDefinitionBlock<"Query">): void; }' is not assignable to parameter of type 'NexusExtendTypeConfig<"Query">'.
Object literal may only specify known properties, and 'args' does not exist in type 'NexusExtendTypeConfig<"Query">'
Philip
07/28/2020, 12:17 PMJohn M
07/29/2020, 3:07 PMnexus-prisma
, so I'm curious to hear what others have done. Do you do everything in graphql middleware? Do you implement the resolve
function in the resolver of a mutation? Are you using Prisma Client's new support for middleware? What works for you? I'm thinking about things like user permissions, complex validation logic, performing side effects, and so on. Thank you!!Awey
07/30/2020, 8:21 PMupdate
correctly?
schema.inputObjectType({
name: 'UpdateProjectInput',
definition(t) {
t.string('projectId', { required: true })
t.string('name')
t.string('description')
},
})
t.field('updateProject', {
type: 'Project',
nullable: false,
args: {
data: schema.arg({ type: 'UpdateProjectInput', required: true }),
},
resolve(_root, args, ctx) {
return ctx.db.project.update({
where: {
id: args.data.projectId,
},
data: {
name: args.data.name,
description: args.data.description,
},
})
},
})
model Project {
id String @id @default(uuid())
name String
description String?
columns Column[]
}
Inside the data
object, I keep getting this error for the name
field.
Type 'string | null | undefined' is not assignable to type 'string | undefined'.
Type 'null' is not assignable to type 'string | undefined'.ts(2322)
index.d.ts(1771, 3): The expected type comes from property 'name' which is declared here on type 'ProjectUpdateInput'
Munkhtegsh Munkhbat
08/02/2020, 5:25 PMbntzio
08/02/2020, 7:28 PMt.field('createJobPost', {
type: 'JobPost',
args: {
title: stringArg({ nullable: false }),
logo: stringArg({ nullable: false })
},
resolve: (_, { title, logo }): any => {
return prisma.jobPost.create({
data: {
title,
logo
}
})
}
})
bkrausz
08/03/2020, 5:53 PMAwey
08/05/2020, 12:28 AMmodel Project {
id String @id @default(uuid())
name String @unique
description String?
columns Column[]
}
Why would this resolver have issues with types?
https://i.postimg.cc/rsnQkvkx/Screen-Shot-2020-08-04-at-6-28-09-PM.png▾
mikkelsl
08/05/2020, 7:01 AMmikkelsl
08/05/2020, 10:59 AMprisma/.env
and .env
via nexus dev
, but after running nexus build
and then node .nexus/build
, the build won't recognize env variables. Is there a way to achieve this?Meiri Anto
08/05/2020, 6:45 PMloginWithMagicLink
via just clicking the URL from the email. Is it possible to do a GraphQL mutation request via just a URL? or are only queries allowed?Pieter
08/05/2020, 7:34 PMcompanies
or userProfiles
table. When I run prisma introspect
it generates models that matches the table names, which results in nexus
generating "singular" and plural typings for the models, both being the actual table and model names (plural) so it results in duplicates in the typescript typings which means code doesn't compile.
I got over 3000 lines generated by prisma introspect and there's no proper intellisense to rename a model and all fields related to itPieter
08/06/2020, 8:04 AMMichael Gardner
08/06/2020, 4:30 PMMichael Gardner
08/06/2020, 4:33 PMt.crud
and put your own logic in the resolve the args’s types don’t match up with the requirements of the database from the context
. I’ve gone through and set the args myself then and tell them {nullable: false}
and null still appears as an option for the typing on arguments being passed in. Any suggestions how to correct this behavior?