https://www.prisma.io/ logo
Join Slack
Powered by
# orm-help
  • r

    rem

    01/29/2019, 2:12 PM
    I'm testing
    prisma.$subscription
    in Jest, and I get the
    node()
    return value, but it's not clear how to close the socket (from the prisma docs). Any clues?
    h
    r
    • 3
    • 11
  • d

    dan

    01/29/2019, 2:33 PM
    • 1
    • 7
  • s

    Slackbot

    01/29/2019, 2:54 PM
    This message was deleted.
    d
    d
    • 3
    • 6
  • r

    rawriclark

    01/29/2019, 3:05 PM
    Is there any details regarding prisma performance overhead?
  • r

    rawriclark

    01/29/2019, 3:05 PM
    maybe benchmarks
  • r

    rawriclark

    01/29/2019, 3:05 PM
    maybe thats a good article to do
  • r

    rawriclark

    01/29/2019, 3:06 PM
    raw MySQL Select vs Prisma Select
    👍 2
  • k

    Kris Temmerman

    01/29/2019, 3:31 PM
    Hi guys Ive been having some trouble deploying prisma to my server
  • k

    Kris Temmerman

    01/29/2019, 3:31 PM
    Copy code
    ERROR: Cannot read property 'managementApiSecret' of null
    
    {
      "data": {
        "generateClusterToken": null
      },
      "errors": [
        {
          "message": "Cannot read property 'managementApiSecret' of null",
          "locations": [
            {
              "line": 3,
              "column": 9
            }
          ],
          "path": [
            "generateClusterToken"
          ],
          "code": 222
        }
      ],
      "status": 200
    }
    v
    d
    • 3
    • 2
  • k

    Kris Temmerman

    01/29/2019, 3:32 PM
    I have set the PRISMA_MANAGEMENT_API_SECRET="secretpassword" in my .env file
  • c

    CJ Fravel

    01/29/2019, 4:55 PM
    Is there a slack integration for the 'prisma deploy' command when using the heroku deployments?
  • s

    Samuel Roth

    01/29/2019, 6:08 PM
    Hey all. I have a schema with Users that have Posts, and friends of type User. I’d like to get all posts for some user and all their friends, ordering by post time stamp. Should I be using fragments or is there a better way to do this? I think it might just be easier to use a raw SQL query.
  • d

    dan

    01/29/2019, 6:13 PM
    Copy code
    User: {
    		posts(parent, args, ctx, info) {
    			return ctx.db.user({ id: parent.id }).posts()
    		},
    
    		friends(parent, args, ctx, info) {
    			return ctx.db.user({ id: parent.id }).friends()
    		},
    	},
  • d

    dan

    01/29/2019, 6:14 PM
    this is in my user resolver
  • d

    dan

    01/29/2019, 6:14 PM
    then just add those fields to the user schema as well
  • d

    dan

    01/29/2019, 6:14 PM
    Copy code
    posts: [Post]!
    friends: [User]!
  • j

    Joseph Carrington

    01/29/2019, 6:38 PM
    I have a kind of theory question. Suppose I have a user object, and that user object has a node called cart. That cart is a collection of CartItem objects. There is a 1-many relation between user and cartItems.
    Copy code
    type CartItem {
      id: ID! @unique
      quantity: Int! @default(value: 1)
      owner: PortalUser! @relation(name: "ItemOnUser")
      productId: ID!
      createdAt: DateTime!
      updatedAt: DateTime!
      dummy: String! @default(value: "Dummy")
    }
    
    type PortalUser {
      portalId: String! @unique
      createdAt: DateTime!
      updatedAt: DateTime!
      cart: [CartItem!]! @relation(name: "ItemOnUser", onDelete: CASCADE)
      isGuest: Boolean! @default(value: "true")
      dummy: String! @default(value: "Dummy")
    }
    Now I want to import a cart form one user to another. I’d like to run something like
    Copy code
    `
    updateManyCartItems(where: 
      {
        owner: oldOwner
      } data {
       owner: newOwner
      })
    But I cannot batch edit the owners of cartItems (it’s just not an option under updateManyCartItems’ data arg). Why is this? I am sure this is trying to tell me something, but I am not sure what I should be learning from it. Thanks!
  • i

    impowski

    01/29/2019, 6:48 PM
    I clicked
    DELETE NODE
    inside Prisma Admin a couple times and my server got this:
    -.js
    d
    h
    h
    • 4
    • 21
  • s

    Samuel Roth

    01/29/2019, 6:48 PM
    This was the solution I ended up going with
    i
    c
    • 3
    • 5
  • a

    arush

    01/29/2019, 8:22 PM
    Hi, doesn’t prisma support UUID types for id fields? we’re running into this issue in postgres: https://github.com/prisma/prisma/issues/2750
    • 1
    • 1
  • a

    Anthony

    01/29/2019, 8:33 PM
    @arush I've only ever used regular ID! but prisma uses postgres unique id generation behind the scenes is there any reason you needed UUID?
  • a

    Andriana Angelevska

    01/29/2019, 9:15 PM
    Hi everyone! We're about a week away from writing our articles about what we've learned from our GraphQL survey but I wanted to give everyone here a chance to give some last minute insights! In case you didn't know we've been surveying companies that have moved over to GraphQL about why they did and what benefits they received as a result. I've attached the link below if you're interested in participating. It should only take a few minutes! https://fullerton.qualtrics.com/jfe/form/SV_6xocDeRUsCKonFr
  • d

    dan

    01/29/2019, 9:34 PM
    Looking for a WAY better way to handle this:
  • d

    dan

    01/29/2019, 9:34 PM
    Untitled.js
  • d

    dan

    01/29/2019, 9:35 PM
    Is there a way to query for an individual shop that belongs to a user?
    r
    m
    • 3
    • 17
  • d

    dan

    01/30/2019, 1:22 AM
    Anyone have any solutions for the thread above?
  • d

    dan

    01/30/2019, 1:24 AM
    There seems to be something pretty major missing here, I would assume someone is doing something as trivial as this when it comes to querying and mutating resources that only belongs to the user requesting. At the moment I can only do so when getting a list of the resources. I would like to be able to fetch and update a single record with relationships in the where arguments.
    c
    • 2
    • 1
  • s

    soqt

    01/30/2019, 3:01 AM
    What test framework do you guys use? I’m currently use AVA but it doesn’t support native Prisma Client request so I couldn’t mock data
  • j

    James Hunyar

    01/30/2019, 3:49 AM
    Been stuck on this one for a few evenings. I have a node/graphql-yoga project that uses Prisma with postgres, and I am trying to understand how to best handle GraphQL-Errors that happen at a stage prior to my resolvers. The primary example is when a user initiates a createUser mutation with an email that violates a unique constraint. I want to handle any potential errors in my resolver, which looks like this:
  • j

    James Hunyar

    01/30/2019, 3:49 AM
    -.js
1...199200201...637Latest