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

    Thomas Georgiadis

    03/17/2021, 10:56 PM
    Wondering if there's a way to update multiple nested records in the one statement, with each nested record having it's own set of data. Like by providing an array of posts in this example https://www.prisma.io/docs/concepts/components/prisma-client/relation-queries#update-a-specific-related-record. Eg something like:
    Copy code
    const update = await prisma.user.update({
        where: {
          id: 6,
        },
        data: {
          posts: {
            update: [
              {
                where: {
                  id: 9,
                },
                data: {
                  title: 'Posts 9 title',
                },
              },
              {
                where: {
                  id: 10,
                },
                data: {
                  title: 'Post 10 title is different',
                },
              },
            ]
          },
        },
      })
  • s

    Sergio Bilello

    03/18/2021, 3:50 AM
    Hello! Is there any demo java graphql example project that contains also monitoring some alternative to apollo studio? Is it collecting metrics via Graphana and Prometheus?
  • k

    Kha

    03/18/2021, 7:00 AM
    Having some trouble with updating data with some nested creates and connects. Can someone help?
    m
    r
    • 3
    • 31
  • p

    propagandalf

    03/18/2021, 7:34 AM
    Having the current database table setup (User & Post) tables with a one-to-many relation on the User->Post I can't get the cascade delete to work, because of a relation conflict. What would be the way to go about this? (SQLITE) Error: "PrismaClientKnownRequestError2 [PrismaClientKnownRequestError]: The change you are trying to make would violate the required relation 'PostToUser' between the
    Post
    and
    User
    models."
    r
    • 2
    • 2
  • j

    Justin

    03/18/2021, 7:50 AM
    Hi all! Happy to join the community 🙂 I am new to Graphql Yoga and would like to set up my server to support wss connections, can anybody help me with this? I have been readings the docs for a couple hours :/
    👋 2
    r
    • 2
    • 3
  • m

    mxstbr

    03/18/2021, 9:41 AM
    I wrote a little bit about why I love Prisma and have used it exclusively for years now: https://twitter.com/mxstbr/status/1372483017722187776 prisma rainbow
    prisma rainbow 11
    💪 10
    🇳🇬 1
    🇦🇹 6
    ❤️ 9
    😍 3
    party postgres 2
  • j

    Julien Goux

    03/19/2021, 10:11 AM
    Hello all, general question 😄 How do you deal with i18n in your backend ?
  • j

    Julien Goux

    03/19/2021, 10:11 AM
    Do you translate your error messages directly in the backend? Do you just send a code + default english message and handle it on the frontend?
  • n

    Nicolas Toulemont

    03/19/2021, 10:13 AM
    I personally prefer to send back errors with code / keys in english and handle the i18n in the frontend 🙂
  • j

    Julien Goux

    03/19/2021, 10:13 AM
    ok so you don’t have any i18n logic in your backend?
  • j

    Julien Goux

    03/19/2021, 10:14 AM
    I think this is the easiest path and the one I’ll take 😄
  • j

    Julien Goux

    03/19/2021, 10:16 AM
    I was starting to setup i18next for my graphql API with Nexus but I don’t think it’s worth it
    n
    • 2
    • 1
  • n

    Nicolas Toulemont

    03/19/2021, 10:16 AM
    My only i18n logic in the back end is related to multi lingual lists (genders, countries, etc...) which are saved as JSON fields like this
    Copy code
    {
      "en": {
        "title": "Content"
      },
      "fr": {
        "title": "Contenu"
      }
    }
  • j

    Julien Goux

    03/19/2021, 10:16 AM
    Makes sense
  • n

    Nicolas Toulemont

    03/19/2021, 10:18 AM
    This way I access them with with router params like this, pretty straight forward
    Copy code
    object[i18n].title
  • r

    Ryan Bethel

    03/19/2021, 5:44 PM
    $disconnect general question. If I have a query that is taking excessively long and I run $disconnect inside a setTimeout before that query returns will it release the connection or will it continue to wait until the query returns before disconnecting?
    r
    • 2
    • 2
  • e

    Eric Hosick

    03/19/2021, 7:12 PM
    Can Prisma support multiple PostgreSQL schemas? The Postgresql db connector seem to imply you can only have one (postgresql://USER:PASSWORD@HOST:PORT/DATABASE?schema=myschema). Is there a way in the schema.prisma file to define which PostgreSQL schema a model is defined? We have multiple schemas and we are trying to make a single PosgreSQL schema by adding SQL views that reference the other schemas BUT Prisma doesn’t seem to have much support for SQL Views.
    r
    • 2
    • 1
  • l

    Lars Ivar Igesund

    03/20/2021, 11:14 AM
    Is there a tool to create a graph/diagram of a datamodel.prisma file?
    k
    • 2
    • 1
  • d

    DevThoughts

    03/21/2021, 12:34 PM
    I have just started with Prisma, is it open source and free to use for the production ready app?
    👍 1
    l
    • 2
    • 1
  • j

    Joey

    03/21/2021, 1:30 PM
    Has anyone else faced this;
  • j

    Joey

    03/21/2021, 1:31 PM
    Copy code
    import { PrismaClient } from "@prisma/client";
             ^^^^^^^^^^^^
    SyntaxError: Named export 'PrismaClient' not found. The requested module '@prisma/client' is a CommonJS module, which may not support all module.exports as named exports.
    CommonJS modules can always be imported via the default export, for example using:
    
    import pkg from '@prisma/client';
    const { PrismaClient } = pkg;
  • j

    Joey

    03/21/2021, 1:32 PM
    This is in a
    node
    application using
    type: "module"
    in
    package.json
    r
    • 2
    • 1
  • c

    chrisdhanaraj

    03/21/2021, 10:56 PM
    👋 Eyo! So I just updated to the newest version of Prisma and I'm running into a scenario where
    npx prisma db seed --preview-feature
    flags a "No seed file found." This has worked in the past though - I have a
    prisma/seed.sh
    file and I'm not quite sure what it's doing. Any tips on trying to debug this?
    r
    • 2
    • 4
  • r

    Robin

    03/22/2021, 7:51 AM
    a colleague cloned my project which makes use of prisma. I thought the
    npm instal
    will also run the generate, wont it?
  • r

    Robin

    03/22/2021, 7:51 AM
    because he get an `@prisma/client"' has no exported member 'PrismaClient'`error which looks like the prisma client was not generated
    r
    • 2
    • 2
  • h

    huv1k

    03/22/2021, 7:51 AM
    👋 Hey, I wonder when will be possible to "join" data on
    groupBy
    queries grouped by FK 🤔 Example
    Copy code
    await prisma.post.groupBy({
      by: ['userId'],
      sum: {
        likes: true,
      },
    })
    So we can get/select
    user
    in this query instead of running another query for users 🤔
    r
    • 2
    • 2
  • h

    Harsh Makwana

    03/22/2021, 9:15 AM
    I’m using prisma 1 and I need records from the table which contains
    createdAt
    with exact given date. but when I’m passing full date with ISO format it’s not returning any records from the table.
  • s

    stephan levi

    03/22/2021, 11:24 AM
    im running prisma1 deploy getting error message - “Workspace fixefy does not exist” i am a little confused here why am i supposed to have a workspace trying to do prisma1 logout, prisma1 login did not work
    r
    • 2
    • 22
  • s

    Sascha

    03/22/2021, 1:57 PM
    Is it still ok to ask nexus questions here btw? I'm curious if it's somehow possible that custom field resolver are only triggered if a field is actually being requested? By default it seems like all fields are being resolved..
    r
    • 2
    • 9
  • a

    adashi

    03/22/2021, 3:47 PM
    Hello! I’m getting an error when running
    npm i
    on a prisma project. I’m upgrading from
    2.10.0
    to
    2.19.0
    . Tried to clear the node_modules folder before, but got the same result.
    Copy code
    API/node_modules/prisma/node_modules/@prisma/engines/download/index.js:43
    `,CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"	",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:""}});var Im=m((w2,Om)=>{"use strict";const sR=Bs(),{MAX_LENGTH:km,CHAR_BACKSLASH:La,CHAR_BACKTICK:iR,CHAR_COMMA:oR,CHAR_DOT:aR,CHAR_LEFT_PARENTHESES:cR,CHAR_RIGHT_PARENTHESES:lR,CHAR_LEFT_CURLY_BRACE:uR,CHAR_RIGHT_CURLY_BRACE:hR,CHAR_LEFT_SQUARE_BRACKET:Pm,CHAR_RIGHT_SQUARE_BRACKET:Cm,CHAR_DOUBLE_QUOTE:fR,CHAR_SINGLE_QUOTE:pR,CHAR_NO_BREAK_SPACE:dR,CHAR_ZERO_WIDTH_NOBREAK_SPACE:mR}=Am(),gR=(e,t={})=>{if(typeof e!="string")throw new TypeError("Expected a string");let r=t||{},n=typeof r.maxLength=="number"?Math.min(km,r.maxLength):km;if(e.length>n)throw new SyntaxError(`Input length
    
    ReferenceError: globalThis is not defined
        at m (/home/api/API/node_modules/prisma/node_modules/@prisma/engines/download/index.js:43:34150)
        at /home/api/API/node_modules/prisma/node_modules/@prisma/engines/download/index.js:1:164
        at m (/home/api/API/node_modules/prisma/node_modules/@prisma/engines/download/index.js:43:34284)
        at /home/api/API/node_modules/prisma/node_modules/@prisma/engines/download/index.js:1:164
        at Ot (/home/api/API/node_modules/prisma/node_modules/@prisma/engines/download/index.js:43:35834)
        at /home/api/API/node_modules/prisma/node_modules/@prisma/engines/download/index.js:1:164
        at Ct (/home/api/API/node_modules/prisma/node_modules/@prisma/engines/download/index.js:43:39183)
        at /home/api/API/node_modules/prisma/node_modules/@prisma/engines/download/index.js:1:164
        at cc (/home/api/API/node_modules/prisma/node_modules/@prisma/engines/download/index.js:43:42525)
        at /home/api/API/node_modules/prisma/node_modules/@prisma/engines/download/index.js:1:164
1...423424425...637Latest