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

    Ehsan Sarshar

    11/07/2019, 11:15 AM
    Do using mongodb version 4.2 with prisma cause any problem ?
  • a

    Albert

    11/07/2019, 11:19 AM
    Hi, I've posted an issue and I'm asking here. Maybe someone has a quick answer: [N:M Relation over a table with two @relation(link: INLINE)](https://github.com/prisma/prisma/issues/4932) (See thread for contents)
    • 1
    • 1
  • a

    Albert

    11/07/2019, 12:38 PM
    Anyone?
  • q

    Quentin

    11/07/2019, 7:03 PM
    Hi Guys. Does anyone know how to handle the error "duplicate keys" when prisma is trying to create the migration table on a mysql db?
  • s

    Spencer Olsen

    11/07/2019, 10:12 PM
    We have an apollo server where we stitch our prisma schema (along with a couple others), and directly expose that out to our clients. We are looking to migrate and use Apollo Federation. Has anyone figured out how to get the prisma schema in the format so that you can use the Apollo
    buildFederatedSchema()
    function?
  • r

    romain.charretteur

    11/08/2019, 11:12 AM
    Hello everyone 🖖, I am upgrading from prisma 1.27 to 1.34 so going to v1.1 syntax. I follow prisma guide on how to do that. Prisma introspect does not work, So I update manually prisma files. First try without data: prisma deploy work and all of my test passed. But now I need to upgrade prisma with data. I put table relation everywhere in order to not loose any data. (by default prisma put inline) Prisma deploy does not show any warning about switching relation but a global one. "Warnings: Global ! You are migrating from the old datamodel syntax to the new one. Make sure that you understand the listed changes because the semantics are different now. Then perform the deployment with the
    --force
    flag. Ignoring warnings because you provided --force." I do not know what I miss. I try with --force and as expected I loose data. Indeed it updated id column on all my table. "foo (Type) ~ Updated field `id`" MetadataDefinitionToFooMetadata (Relation) - The id column
    id
    in link table
    _MetadataDefinitionToFooMetadata
    has been removed. It was a Prisma legacy column that is not in use anymore." Did anyone face this issue and success to solve it ? Thank you in advance and for reading my paving stone 🙂
  • r

    romain.charretteur

    11/08/2019, 5:04 PM
    Did anyone meet this issue https://github.com/prisma/prisma/issues/4216 ?
  • m

    Matthias Goossens

    11/09/2019, 8:07 PM
    I have this code in a mutation and get an error that ‘OWNER’ is an invalid value because it expects a value for the Role enum.
    Copy code
    const owner = await ctx.db.mutation.createGroupMember(
        {
          data: {
            user: { connect: { id: userId } },
            role: { set: 'OWNER' },
          },
        },
        `{ id }`,
      );
    • 1
    • 2
  • p

    prisma2user

    11/09/2019, 8:20 PM
    Recently discovered Prisma / Prisma2 and was looking to test it out for a project at work, but ran into an issue with running
    npm install -g prisma2
    since it looks like there is a call out to an s3 bucket to download a binary which in our environment we dont have access to directly proxy out to get this. Our npm packages are proxied through an artifact repository / proxy like Artifactory or Nexus. Was wondering if there is a way to change the CDN download url so that it could be downloaded through the artifact repository where we configure it to connect out to the s3 bucket. Or wondering if maybe there would be a better / preferred way to handle this type of use case
  • k

    koia

    11/09/2019, 8:53 PM
    Hi, I'm having an issue after upgrading to Prisma 1.34.10 and is that every time I query or delete an entity it won't retrieve the associated entity.. for example if I have a Wallpaper that belongs to a User, when I delete said Wallpaper it won't return the User associated with it.... any help?.. Note if I try in the GraphQL Playground it works wonderfully..🤔
  • k

    koia

    11/09/2019, 9:07 PM
    Copy code
    const user = await prisma.deleteWallpaper({
        id: wallpaperId
      }).user()
    console.log(user)
    That code does work, but the one bellow doesn't
    Copy code
    const wallpaper = await prisma.deleteWallpaper({
        id: wallpaperId
      })
    console.log(wallpaper.user)
    The result is
    undefined
  • k

    koia

    11/09/2019, 9:12 PM
    I thought that the query for the associated entity should be eager in this case, like it was before.. or am I mistaken ?😕
  • s

    Svitlana Shepitsena

    11/09/2019, 9:59 PM
    @Caas, did you try with }, info) in the end?
  • k

    koia

    11/09/2019, 10:48 PM
    @Svitlana Shepitsena I don't get it? What do you mean?
    s
    • 2
    • 1
  • k

    koia

    11/09/2019, 10:48 PM
    Copy code
    const wallpaper = await prisma.deleteWallpaper({
        id: wallpaperId
      }, info)
    ???
  • k

    koia

    11/09/2019, 10:53 PM
    It doesn't work either !! 😕
  • s

    Svitlana Shepitsena

    11/09/2019, 11:00 PM
    sorry, try const wallpaper = await prisma.deleteWallpaper({ id: wallpaperId }, include: { user: true } )
  • k

    koia

    11/09/2019, 11:14 PM
    Nope, it doesn't work neither🙄
  • k

    koia

    11/09/2019, 11:14 PM
    @Svitlana Shepitsena
  • k

    koia

    11/09/2019, 11:24 PM
    What I find weird is that I can perform the fallowing mutation without any issues in the GraphQL Playground:
    Copy code
    mutation {
      deleteWallpaper(where: {
        id: "ck2s13oj0059b0898fi0ronz0"
      }){
        id
        wallpaperId
        source
        user {
          id
          name
          email
        }
      }
    }
    It brings the User without any issues🤖
  • s

    Svitlana Shepitsena

    11/09/2019, 11:31 PM
    sorry, wait for the developers... you may take a look here as well. https://www.prisma.io/docs/prisma-client/basic-data-access/reading-data-JAVASCRIPT-rsc2/#selecting-fields What I would do - temp. get the user before you delete Wallpaper and then do delete it. WHen you get hint from developers - do it right with one query. Good luck
  • k

    koia

    11/09/2019, 11:41 PM
    @Svitlana Shepitsena yeah I can find a workaround, it's not like a big issue at the moment.. Thanks a lot for your time 😃
  • s

    Svitlana Shepitsena

    11/09/2019, 11:41 PM
    👍
  • e

    Elias Ramirez

    11/10/2019, 2:32 AM
    Hi guys, good evening. I'm new to Prisma, i have read the documentation and have done some small projects. Now i'm in a big project of an Architectural Application, but i am having issues with the schema of it. As you can see below, i have a type called
    GraphicColumn
    , there i save the data of some columns of an Architectural model, but the amount of columns can vary in every kind of model, and that columns have multiple data entries to save, so i'm trying to do the next thing:
    Copy code
    type GraphicColumn {
    id: ID! @id
    data: [{
      column: Int!
      columnData: [Float]
    }]
    }
    As you see, in the object, it will be the number of the column specified and the data values of that column, so it's an object for the
    column 1
    and an amount of
    Int
    values for the data of it, and so on for the
    column 2
    ,
    column 3
    ... May vary between 4 and 6 colums per model, but i'm getting errors with the
    data
    definition whem running
    prisma deploy
    . The error message is the following:
    Copy code
    ERROR: Syntax error while parsing GraphQL query. Invalid input "{\n  id: ID! @id\n  name: String!g\n}", expected IgnoredNoComment, ImplementsInterfaces, DirectivesConst or FieldDefinitions (line 1, column 11):
    type User {
            ^
    
    {
    "data": {
      "deploy": null
    },
    "errors": [
      {
        "locations": [
          {
            "line": 2,
            "column": 9
          }
        ],
        "path": [
          "deploy"
        ],
        "code": 3017,
        "message": "Syntax error while parsing GraphQL query. Invalid input \"{\\n  id: ID! @id\\n  name: String!g\\n}\", expected IgnoredNoComment, ImplementsInterfaces, DirectivesConst or FieldDefinitions (line 1, column 11):\ntype User {\n          ^",
        "requestId": "local:ck2sd5dbg000i0773z3pkpwx9"
      }
    ],
    "status": 200
    }
    Do you know how can i replace that to some definition that works?🤔 Thanks and good night!😁
  • k

    kyler

    11/10/2019, 4:19 PM
    Hey can anyone point me to requirements for running prisma on kubernetes? cpu/ram etc
  • g

    Greg

    11/10/2019, 6:45 PM
    I have a general question. I have been trying out Prisma over the weekend It looks to me like 1. I add my types to datamodel.prisma file 2. Then when you run prisma deploy it will push out the new types to a database in the cloud. It works really well. Great job! I have used GraphQl in the .Net space alot. I typically use it for joining together existings services, databases or api's. I was hoping that I could use Prisma in the same way, but take advantage of the database generation for certain types. IE have some parts that are generated but others that link to my existing services For example, I might store an AuditLog in Prisma but use an existing service to link to User. 1. I already have a User service in my company 2. I don't want to store this again in the Prisma generated DB. Is this possible? I could keep the Prisma GQL seperate and only use it to store types that are generated. Then have a seperate graphq l which references the generated prisma-client and combines the existings services . Althought I was hoping to have a single GQL where I could join these all together. Is there another option?
  • g

    Greg

    11/10/2019, 7:13 PM
    Perhaps the answer is schema stitching? 1. Prisma GQL - That just looks after at the generated types 2. My existing GQL - All the existing services and api's 3. Then a third that stitches them together? Thoughts? Sounds about right and probably ? Avoids a single big solution
    r
    m
    • 3
    • 5
  • j

    Junsu Kim

    11/11/2019, 7:25 AM
    Empty @scalarList returned if parent type uses integer id... What's the solution?
    a
    • 2
    • 3
  • d

    Dodo

    11/11/2019, 12:53 PM
    Is there a tool to generate an UML Diagram from the prisma datamodel?
    m
    • 2
    • 2
  • g

    gt44m

    11/11/2019, 4:32 PM
    Hello, newbie here. I'm building an app with python and flask. Is there a way to use prisma with that?
1...330331332...637Latest