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

    ed

    07/29/2019, 8:49 AM
    Hi guys, I have a doubt about prisma, You know for graphcool you had some meta to return a count
  • e

    ed

    07/29/2019, 8:49 AM
    -.txt
  • e

    ed

    07/29/2019, 8:50 AM
    but for prisma it seems those nested aggregates isnt available, is there any solution for this? thanks in advance
    h
    • 2
    • 1
  • g

    Gamaranto

    07/29/2019, 4:12 PM
    Hey, anyone else experiencing that
    Copy code
    prisma deploy
    is very slow on 1.34?
    h
    • 2
    • 1
  • m

    matus.congrady

    07/29/2019, 4:20 PM
    Hello, I have 3 questions regarding prisma2 and it’s GraphQL capabilities: 1. Will I be able to interact with my database using GraphQL? 2. Will Prisma2 autogenerate GraphQL schema for my datamodel? 3. Will I be able to build my GraphQL APIs similarly to what I did using prisma-binding (using info object/selection set)? E.g.:
    Copy code
    const query = {  
      games: async (_parent, args, context, info) => {
        return context.db.query.games(args, info);
      }
    }
    👍 1
    n
    • 2
    • 2
  • j

    John M

    07/29/2019, 6:09 PM
    Hello! Has anyone attempted to use Prisma across hundreds of models? We're attempting to transition over to using Prisma, but we have over 400 tables in our Postgres database. From that, we generated the SDL types to create the
    datamodel.primsa
    file. When I try running
    prisma generate
    to generate the TypeScript files, it seems to hang for quite a while. Recently it crashed and there was a report.json file created by node specifying it ran out of memory. I'm running prisma again, this time with more memory:
    NODE_OPTIONS=--max_old_space_size=8192 prisma generate
    . For now it's still churning along, but I'm wondering if there is anything I could be doing better or differently?
    h
    • 2
    • 1
  • j

    John M

    07/29/2019, 6:16 PM
    Looks like it just finished. Took about an hour to run, but it worked! 🎉
  • i

    Isaac Weber

    07/29/2019, 6:24 PM
    We are looking to use Prisma to rebuild a legacy application. We are somewhat constrained to older APIs. Most of the apis we are using return XML. Is there a good solution to pull XML directly to Prisma? Or maybe if we could have access to the database we could manually store data from XML into postregress DB or something. Any thoughts?
    h
    • 2
    • 1
  • a

    Andrés Villalobos

    07/29/2019, 6:57 PM
    About Prisma 2: Is there any strategy planned, or set of recommendations to prepare a Prisma 1 application for a transition to Prisma 2? Things like no subscriptions, or no Graphql by default stuff, any thoughts? I'm slightly scared, I did promote Prisma 1 on my company for a couple of apps that should on production on a couple months, wondering how much would break on the transition 😬
    h
    • 2
    • 2
  • j

    Jehun

    07/29/2019, 7:55 PM
    Why onDelete: CASCADE not working? on MariaDB
  • j

    Jehun

    07/29/2019, 7:56 PM
    Copy code
    type Member {
      webhardPay: [WebhardPay] @relation(onDelete: CASCADE)
    }
    
    type WebhardPay @db(name: "mmsv_webhard_pay") {
      member: Member @relation(onDelete: SET_NULL)
    }
  • j

    John M

    07/29/2019, 8:05 PM
    Will Prisma2 offer better support for the situation where I have hundreds of models?
    h
    • 2
    • 1
  • j

    John M

    07/29/2019, 8:10 PM
    Is it possible to split my models into different files rather than one monolithic file?
  • j

    Jehun

    07/29/2019, 8:20 PM
    In mariadb got error
    Copy code
    Member
        ✖ The field `webhardPay` must provide a relation link mode. Either specify it on this field or the opposite field. Valid values are: `@relation(link: TABLE)`,`@relation(link: INLINE)`
    
      WebhardPay
        ✖ The field `member` must provide a relation link mode. Either specify it on this field or the opposite field. Valid values are: `@relation(link: TABLE)`,`@relation(link: INLINE)`
    h
    • 2
    • 1
  • j

    Jehun

    07/29/2019, 8:21 PM
    even though copy on prisma example
    Copy code
    User
        ✖ The field `blog` must provide a relation link mode. Either specify it on this field or the opposite field. Valid values are: `@relation(link: TABLE)`,`@relation(link: INLINE)`
    
      Blog
        ✖ The field `owner` must provide a relation link mode. Either specify it on this field or the opposite field. Valid values are: `@relation(link: TABLE)`,`@relation(link: INLINE)`
  • j

    Jehun

    07/29/2019, 8:22 PM
    Why?
  • t

    Totoro

    07/29/2019, 10:43 PM
    This is my data model
    Copy code
    type User {
      id: ID! @id
      firstName: String!
      lastName: String @default(value: "")
      email: String! @unique
      passwordHash: String
      emailVerified: Boolean! @default(value: false)
      verifyToken: String
      avatar: String
      userSource: UserSource!
      identities: [Identity!]
      createdAt: DateTime! @createdAt
      updatedAt: DateTime! @updatedAt
    }
    
    type Identity {
      id: ID! @id
      service: ServiceType!
      serviceId: String!
      username: String!
      email: String!
      name: String
      accessToken: String! @db(name: "access_token")
      tokenType: String! @db(name: "token_type")
      expiresAt: DateTime @db(name: "expires_at")
      refreshToken: String! @db(name: "refresh_token")
      idToken: String @db(name: "id_token")
      user: User! @relation(link: INLINE)
    }
    I'm trying to list identities and get the email from array of identities like this:
    Copy code
    const id = await prisma
                  .user({ id: user.id })
                  .identities({
                    where: {
                      service: USER_SOURCE.GOOGLE,
                    },
                  });
    console.log(id.email);
    When I
    console.log(id)
    , I can see all the values but
    console.log(id.email);
    shows nothing to me
    h
    • 2
    • 1
  • t

    Totoro

    07/29/2019, 10:46 PM
    Can somone please point out where am I going wrong
  • m

    matus.congrady

    07/30/2019, 9:41 AM
    Hello, will I be able to somehow use “Prisma studio” even in production? Do you plan to make a standalone build, that I’d be able to host myself (ideally on lambda function)? It was very practical to use prisma admin (for prisma 1).
    h
    • 2
    • 1
  • m

    Marvin

    07/30/2019, 9:45 AM
    Hey guys, I have read about the
    authentication
    &
    authorization
    basics (https://www.prisma.io/tutorials/graphql-rest-authentication-authorization-basics-ct20) and there is something I don't understand. I understand the difference between these two but solves
    graphql-shield
    both of them or just the authorization? I also looked into the
    graphql-auth
    example (https://github.com/prisma/prisma-examples/tree/master/node/graphql-auth). It seems like I just need
    graphql-shield
    which protects my routes. Is that correct? Thank you! 🙂
    h
    • 2
    • 1
  • j

    James

    07/30/2019, 1:39 PM
    I have an Int field on a type and I want to batch update. Is there a simple way to update the int to current value + 1 using prisma client
    h
    • 2
    • 3
  • j

    James

    07/30/2019, 1:44 PM
    In SQL, that's "UPDATE theTable SET theColumn = theColumn + 1;" what about prisma client?
  • t

    Tarzan

    07/30/2019, 6:56 PM
    hi!
    h
    • 2
    • 1
  • t

    Tarzan

    07/30/2019, 6:57 PM
    I need little help here.... I was trying to use Prisma today with MongoDB, but have noticed that some logical operators are missing ( like OR and NOT ) .... BUT... when I use Postgres as DB, all three logical operators are there -> AND, NOT, OR
  • t

    Tarzan

    07/30/2019, 6:57 PM
    am i MISSING something? please...
  • j

    Josh

    07/30/2019, 8:23 PM
    This may be mentioned somewhere else but what is the timeline for stability and moving out of preview mode for prisma2?
    h
    • 2
    • 1
  • f

    faure

    07/30/2019, 10:21 PM
    Is there a library that helps map an object to its input type?
  • f

    faure

    07/30/2019, 10:22 PM
    For example: say I have an animal object which contains a lot of other objects (declared types too) as children. I make changes on it and I want to do an update mutation.
  • f

    faure

    07/30/2019, 10:22 PM
    Rather than having to write each object in a relevant
    {update: object }
    , is there a way to automate this?
    t
    • 2
    • 2
  • s

    Sanjay

    07/31/2019, 12:07 AM
    I believe there may be an issue with the prisma Helm chart. Getting
    Error: Couldn't find key postgres-password in Secret prisma/prisma-postgresql
    • 1
    • 3
1...296297298...637Latest