patrick_madx
05/18/2019, 1:16 PMUmeed
05/24/2019, 7:41 PMMichał Chmura
05/29/2019, 1:47 PMPrisma
and jest
?marceloogeda
05/29/2019, 1:57 PMHyo
05/31/2019, 6:39 AMazure fabric mesh service
?JorgeAM
06/02/2019, 6:00 AMBunthon
06/03/2019, 9:57 AMprisma export -e .
or not? it seem doesn't create a zip file for me.
Note: i also tried this `prisma export --path /var/www/cronSchedules/backup/`date +"%d-%m-%Y-%H:%M:%S"``Travis
06/03/2019, 2:52 PMCliff
06/08/2019, 2:19 AMAlan
06/13/2019, 4:42 PMctx
from a GraphQLServer/express (Rest API) ? I am stuck..Alan
06/13/2019, 4:42 PMPeter Rogov
06/13/2019, 4:49 PM// this is my prisma auto generated client file
import Prisma from "../prisma";
// put the same config there as for the graphql server
const prismaInstance = new Prisma(prismaConf);
server.express.get('/route', async (req, res, done) => {
const params = req.body;
// Invoke prisma from here
let smth = await prismaInstance.query.users(...);
});
However, if your route accepts graphql and you want to pass it to prisma then you will have to take care of parsing it. If that is not the case then you might try the code above.
P.S. I use the very same code to issue auth tokens in a regular rest api route where I use prisma to fetch data about a user from DBAlan
06/13/2019, 4:52 PMPeter Rogov
06/13/2019, 4:53 PMAlan
06/13/2019, 4:54 PMgraphql-yoga
Alan
06/13/2019, 4:55 PMconst server = new GraphQLServer({
typeDefs,
resolvers,
directiveResolvers,
context: req => ({
...req,
db: new Prisma({
typeDefs: path.join(__dirname, './generated-schema.graphql'),
endpoint: '<http://localhost:4466/nacho/prod>',
}),
}),
})
Peter Rogov
06/13/2019, 4:56 PMconst prismaClient = new Prisma({
typeDefs: path.join(__dirname, './generated-schema.graphql'),
endpoint: '<http://localhost:4466/nacho/prod>',
});
const server = new GraphQLServer({
typeDefs,
resolvers,
directiveResolvers,
context: req => ({
...req,
db: prismaClient,
}),
})
server.express.get('/route', async (req, res, done) => {
const params = req.body;
// Invoke prisma from here
let smth = await prismaClient.query.users(...);
});
Peter Rogov
06/13/2019, 4:56 PMPeter Rogov
06/13/2019, 4:58 PMTaylor
06/16/2019, 12:46 PMBrielle
06/18/2019, 6:24 PMBrielle
06/18/2019, 6:24 PManthony
06/20/2019, 8:52 AMAndre Coetzee
06/20/2019, 9:02 AMAndre Coetzee
06/20/2019, 9:03 AMSira Sujjinanont
06/20/2019, 12:48 PMJovaanc
06/20/2019, 1:38 PMPeter Rogov
06/20/2019, 6:32 PMdocumentNumber
which is supposed to be a string. If, say my record ID is 15 then documentNumber must be smth like “A00015’“. is there a way I can make Prisma to generate this string property for me when creating new record in DB? Obviously I could first create the record and then update it with new string. But in this case I would have to do 2 queries to DB instead of one and also I will have to leave documentNumber
optional (nullable) field which is wrong in my case.
Any ideas?Peter Rogov
06/20/2019, 6:34 PMtype Document {
id: Int @id
documentNumber: string
}
Every time new Document
is created I need documentNumber
to have document.id
as a substringHarvey Ramer
06/21/2019, 6:52 PM