https://www.prisma.io/ logo
Join Slack
Powered by
# random
  • p

    patrick_madx

    05/18/2019, 1:16 PM
    Hi folks! At Madx we're organising a coding hackathon: https://www.eventbrite.nl/e/tickets-coding-madness-first-edition-59382723324 It's an actual GraphQL / Prisma backend 😄 If you're around, get your tickets now!
  • u

    Umeed

    05/24/2019, 7:41 PM
    Hello guys, does anyone know how to know prisma server version except this code. When deploy its alwasy says that my prisma server and CLI out of sync. query { serverInfo { version } }
    s
    • 2
    • 1
  • m

    Michał Chmura

    05/29/2019, 1:47 PM
    can anyone recommend any resources for e2e and integration testing with
    Prisma
    and
    jest
    ?
    h
    • 2
    • 1
  • m

    marceloogeda

    05/29/2019, 1:57 PM
    hey guys, is anyone using Graphcool Cloud yet instead of Prisma Cloud?
  • h

    Hyo

    05/31/2019, 6:39 AM
    Can I deploy prisma application to
    azure fabric mesh service
    ?
    h
    • 2
    • 2
  • j

    JorgeAM

    06/02/2019, 6:00 AM
    Hi, prisma not support mysql or It's just me 'cause with postgres every goes well
    b
    • 2
    • 4
  • b

    Bunthon

    06/03/2019, 9:57 AM
    Hi, do anyone used to setup crontab run
    prisma 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"``
  • t

    Travis

    06/03/2019, 2:52 PM
    Hi, is it possible to use Mongo DB outside of the Prisma container? I've already got a database setup, but while working through the 'Getting Started' tutorial on Prisma.io, it appears that I'm forced to use the Mongo DB image that's part of the Prisma container. Admittedly, I'm completely new to this Docker container thing, so if anyone could point me in the right direction here, it would be much appreciated.
    h
    • 2
    • 2
  • c

    Cliff

    06/08/2019, 2:19 AM
    Just created a boilerplate for graphql server for ts + Prisma + graphqlgen @ https://github.com/Aircliff/node-graphql-ts-prisma. Feel free to chime in with any suggestions and improvements
    👍 2
    o
    j
    • 3
    • 6
  • a

    Alan

    06/13/2019, 4:42 PM
    hey! Any idea how can I get access to
    ctx
    from a GraphQLServer/express (Rest API) ? I am stuck..
  • a

    Alan

    06/13/2019, 4:42 PM
    details here: https://www.prisma.io/forum/t/how-to-create-one-route-for-receiving-rest-api-post-requests/7239 thanks!! 🙏
  • p

    Peter Rogov

    06/13/2019, 4:49 PM
    Here's what I do to achieve this. Not sure if this is the best approach though... Instead of accessing the context I simply create a new instance of prisma-client (auto-generated by prisma) and call it in my route handler.
    Copy code
    // 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 DB
    😍 1
  • a

    Alan

    06/13/2019, 4:52 PM
    Thanks so much! I will test it and get back to you!
  • p

    Peter Rogov

    06/13/2019, 4:53 PM
    In fact you may first create a prisma client instance and then pass it both to your GraphQLServer (I assume you use graphql-yoga) and to your custom routes
  • a

    Alan

    06/13/2019, 4:54 PM
    yes, im using
    graphql-yoga
  • a

    Alan

    06/13/2019, 4:55 PM
    Copy code
    const 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>',
        }),
      }),
    })
  • p

    Peter Rogov

    06/13/2019, 4:56 PM
    Copy code
    const 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(...);
    });
  • p

    Peter Rogov

    06/13/2019, 4:56 PM
    smth like this
  • p

    Peter Rogov

    06/13/2019, 4:58 PM
    You won't get the rest of the GraphQLServer context there though. Not sure if that is what you need, but the same idea can be used. Just make context builder shared between both graphql server and your custom routes
  • t

    Taylor

    06/16/2019, 12:46 PM
    Hey all, does anyone know why I am getting this error when trying to run a mutation in production env? Shoot!GraphQL Error: { "0": "<", "1": "!", "2": "D", "3": "O", "4": "C" literally renders out the entire html of the page for some unknown reason? I am using Cheerio to scrape an external website, so maybe something to do with that?
    a
    • 2
    • 1
  • b

    Brielle

    06/18/2019, 6:24 PM
    @Taylor I am going to guess that someplace you are walking a string as an array. It may also have a lot to do with how you’re creating the String
  • b

    Brielle

    06/18/2019, 6:24 PM
    Got any examples
  • a

    anthony

    06/20/2019, 8:52 AM
    Just random question. How graphql work together with REST API ?
  • a

    Andre Coetzee

    06/20/2019, 9:02 AM
    https://www.apollographql.com/docs/link/links/rest/
    👍 1
  • a

    Andre Coetzee

    06/20/2019, 9:03 AM
    @anthony apollo has good solutions for this.
    a
    • 2
    • 2
  • s

    Sira Sujjinanont

    06/20/2019, 12:48 PM
    @marcus There any link or a example that we learn how to create our own connector for Prisma?
    m
    • 2
    • 2
  • j

    Jovaanc

    06/20/2019, 1:38 PM
    Hi, do you speak french? I've a problem with prisma, I installed prisma-cli and just after choosing "use existing database" it crashes, I can't choose, everything is blocked... it's the same if I choose "create new databases"
    l
    • 2
    • 2
  • p

    Peter Rogov

    06/20/2019, 6:32 PM
    Hi guys, need a hint on a following issue: In my data model I’ve got Int auto incremented ID of a record. Also I have a field like
    documentNumber
    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?
    s
    b
    • 3
    • 3
  • p

    Peter Rogov

    06/20/2019, 6:34 PM
    Copy code
    type Document {
        id: Int @id
        documentNumber: string
    }
    Every time new
    Document
    is created I need
    documentNumber
    to have
    document.id
    as a substring
  • h

    Harvey Ramer

    06/21/2019, 6:52 PM
    Hey everyone. I've been using AWS cloud exclusively, but GraphQL with a relational database is pushing me toward Prisma. Are there others here who have made that move?
    o
    • 2
    • 2
1...313233...53Latest