kitze
06/16/2020, 3:53 PMnexus-plugin-shield
plugin but even with empty rules
object I'm always getting this error: err JsonWebTokenError: jwt malformed
kitze
06/16/2020, 3:53 PMTyson
06/16/2020, 6:59 PMnexus-plugin-prisma
. How do I get access to Prisma in my post method here?
<http://server.express.post|server.express.post>(
stripeEndpoint,
bodyParser.raw({ type: 'application/json' }),
async (req: any, res) => {
let event
try {
event = stripe.webhooks.constructEvent(
req.rawBody,
req.headers['stripe-signature'],
stripeWebhookSecret
)
} catch (err) {
console.log(err)
console.log(`⚠️ Webhook signature verification failed.`)
console.log(
`⚠️ Check the env file and enter the correct webhook secret.`
)
return res.sendStatus(400)
}
// Extract the object from the event.
const dataObject = event.data.object
switch (event.type) {
case 'invoice.payment_failed':
/ *** How do I access prisma here? ***/
break
default:
break
}
res.sendStatus(200)
}
)
Sytten
06/17/2020, 6:28 PMSytten
06/19/2020, 12:16 PMjasonkuhrt
Peter
06/19/2020, 3:35 PM"error": [
{
"message": "Cannot query field \"name\" on type \"AuthPayload\".",
"locations": [
{
"line": 3,
"column": 5
}
]
},
{
"message": "Cannot query field \"email\" on type \"AuthPayload\".",
"locations": [
{
"line": 4,
"column": 5
}
]
},
{
"message": "Cannot query field \"password\" on type \"AuthPayload\".",
"locations": [
{
"line": 5,
"column": 5
}
]
}
].
Peter
06/19/2020, 3:36 PMTimo
06/20/2020, 12:27 PMpost
t.model.id()
t.model.content()
t.model.author({type:'Profile'})
And author
t.model.id()
<http://t.model.post|t.model.post>()
t.field('isCool', { type: 'Boolean', nullable: true })
And I'm using prisma to return a post + author const post = await prisma.post.findOne({where: {id: '123'}, include: {author: true}})
and then *I want to add another field to author inside the resolver (*`post.author.isCool = true` )
However, in reality, I will get an author with isCool: null
as the author
is being fetched directly from prisma.
Is there anything I can do there? It kind of feels like a waste of computing space, that multiple queries are being made instead of simply including
other fields and having a longer query? Or am I missing something?
If I'd use t.field
instead of t.model
I need to add another resolve
method, or I'd get Property 'resolve' is missing
DeanMo
06/22/2020, 7:23 AMAndrew Leung
06/22/2020, 1:21 PMgenerator prisma_client {
provider = "prisma-client-js"
binaryTargets = ["native", "rhel-openssl-1.0.x"]
}
I’m able to get the express server running on the lambda (graphql and playground endpoints are live), however when it attempt to run prisma, I get the following error:
"\nInvalid `prisma.user.findMany()` invocation in\n/var/task/node_modules/nexus-prisma/dist/builder.js:202:93\n\n\n EROFS: read-only file system, chmod '/var/task/node_modules/.prisma/client/query-engine-rhel-openssl-1.0.x'"
This lead me to https://github.com/prisma/prisma-client-js/issues/476 which theorizes to be a Windows issue, however like I said, I’m compiling via darwin. I’m trying to understand a bit more of what’s happening under the hood here so I can see if I can’t get this deployment to work.Aashish Jain
06/23/2020, 5:04 AMAlbert Gao
06/23/2020, 11:58 PMAashish Jain
06/24/2020, 2:01 AMAlbert Gao
06/24/2020, 2:33 AM{ users: {name age} company: {name id} }
, it has two entities,
will it be translated to 1 SQL statement in the end
or two calls to database where one for each entity?weakky
06/24/2020, 10:11 AMSamrith Shankar
06/24/2020, 10:56 PMapi.graphql
file in my root directory. Any idea why?Albert Gao
06/26/2020, 3:36 AMSamrith Shankar
06/26/2020, 9:40 AMCannot read property 'response' of null
. Anyone else facing this issue and know how to fix it?Samrith Shankar
06/26/2020, 1:28 PMrequest
and response
in schema.middleware
? I need it to retrieve headers from my request and parse it for my logic and if it succeeds, then return next.Aryeh
06/29/2020, 4:45 AMDeanMo
06/29/2020, 5:22 PMDeanMo
06/29/2020, 5:23 PMandykay
06/30/2020, 4:32 PMnexus:schema Your GraphQL schema is empty. This is normal if you have not defined any GraphQL types yet. If you did however, check that your files are contained in the same directory specified in the `rootDir` property of your tsconfig.json file.
Alex Vilchis
07/01/2020, 2:51 AMgraphql/
) from my schema.prisma
file?mikkelsl
07/02/2020, 5:47 AMreq
, res
and session
in order to get autocomplete and accurate type safety?
schema.addToContext(() => ({ req, res, session }))
When I use ctx to access session (jwt) data like f.i.:
ctx.db.address.findMany({ where: { organizerId: { equals: ctx.session.organizerId } } })
Peter
07/02/2020, 4:29 PMPeter
07/02/2020, 4:30 PMTaras Protchenko
07/03/2020, 2:30 PMid
, but your Prisma model 'ChapterLink' has no such field.` I think it connected with multi-field id. My code:
objectType({
name: 'ChapterLink',
definition(t) {
t.model.id()
t.model.title()
t.model.createdAt()
t.model.updatedAt()
t.model.fromChapter()
t.model.fromId()
t.model.toChapter()
t.model.toId()
},
})
====
model ChapterLink {
title String
fromChapter Chapter? @relation(name: "ChapterToChapterLink_fromChapter", fields: [fromId], references: [id])
fromId String?
toChapter Chapter? @relation(name: "ChapterToChapterLink_toChapter", fields: [toId], references: [id])
toId String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@id([fromId, toId])
}
"nexus-plugin-prisma": "^0.16.1",
Alex Vilchis
07/04/2020, 8:11 AMinvalid json response body at <http://localhost:4000/> reason: Unexpected token < in JSON at position 0