How can I use graphql-request with prisma secret (like it work with prisma-binding)? #611
Replies: 2 comments
-
Hi @adamsultan7, thanks for your question! To use import { GraphQLClient } from 'graphql-request'
const client = new GraphQLClient('my-endpoint', {
headers: {
Authorization: 'Bearer YOUR_GENERATED_TOKEN',
},
})
const query = `{
Movie(title: "Inception") {
releaseDate
actors {
name
}
}
}`
client.request(query).then(data => console.log(data)) Another question: Have you tried to use the |
Beta Was this translation helpful? Give feedback.
-
Thank you for your answer @schickling , I already did that but the token automatically end and become not valid so I asked this question. No actually I didn't use .request of prisma-binding, I can't use prisma-binding because I don't have the first mandatory parameter of it (typeDefs) in the frontend code. Any other solution for this? Thanks again |
Beta Was this translation helpful? Give feedback.
-
Hello,
Can you help me to call my Prisma database with graphql-request without have to build an auth system with prisma-binding for that?
I need to call the database securely using prisma secret key but I don't need to build an api on top of Prisma DB to do that
Help please.
Beta Was this translation helpful? Give feedback.
All reactions