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

    Kervin Vasquez

    08/20/2020, 5:12 PM
    HI Everyone, what platform would you recommend to deploy Nexus? other than vercel
    d
    r
    • 3
    • 2
  • o

    Ole Martin

    08/20/2020, 5:43 PM
    Hi all, I am trying to run "prisma generate --endpoint", because playground can not show my schema. But I end up getting the error: ▸ [WARNING] in /home/aa/workspace/aa/prisma.yml: A valid environment variable to satisfy the declaration 'env:PRISMA_ENDPOINT' could not be found. Downloading schema ! ▸ Cannot read property 'getToken' of undefined Get in touch if you need help: https://slack.prisma.io To get more detailed output, run $ export DEBUG="*" (node:28930) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated I can't really figure out where this error originates from. Any input is appreciated 🙂
    g
    j
    • 3
    • 4
  • a

    Alex Reyne

    08/20/2020, 10:27 PM
    Is there a way to findOne with two terms?
    Copy code
    const winnerSearch = await prisma.entries.findOne({
                where: {
                    user: winner,
                    lotto_id: parseInt(x)
                }
            })
    Gives me an error
    d
    r
    p
    • 4
    • 7
  • p

    Petr Homoky

    08/21/2020, 9:55 AM
    Hey! Is it possible to run command for migrating up in code? For testing purposes, we create new DB for that test, we need to upload the current schema and create client with source (database link, i know this is possible). Thanks!
    r
    • 2
    • 2
  • j

    Jayanth

    08/21/2020, 10:40 AM
    Hello Guys. How do we deploy prisma 2 if it doesn't support prisma cloud unlike prisma 1. I am new to prisma. I learned a tutorial in prisma 1 want to make a side project in prisma 2. Any help is appreciated. Thank you!
    r
    • 2
    • 4
  • c

    charpell

    08/21/2020, 12:55 PM
    Hello everyone. Is the enum keyword scrapped in Prisma 2? I get this error when using Enum `error: Error validating: You defined the enum
    Status
    . But the current connector does not support enums.`
    j
    r
    j
    • 4
    • 9
  • r

    Regan Iwadha

    08/21/2020, 3:59 PM
    Hey all, I was wondering if it's possible for prisma to automatically convert bigint types to string?
    j
    • 2
    • 5
  • o

    Ole Martin

    08/21/2020, 4:53 PM
    Thanks for the reply. I managed to get rid of the file error, but when I try to click on the schema tab on playground, I just get an blank page. When looking at the console via developer tools I get the following errors:
    Untitled
  • m

    Matheus Assis

    08/21/2020, 6:11 PM
    How would be the recommended way to count a list that is linked using an indirect relationship? Looks like I can't do:
    ctx*.*_prisma_*.*_user_*.*findOne({ where: { id: root*.*_id_ } })*.*_contacts.count(args)_
    as
    contacts.count
    doesn't exist in that situation ----- Edit: I used
    ctx.prisma.contact.count({ where: { user: { some: { id: root*.*_id_ } } } })
    But idk if it's the correct/most optimized way of doing it
    r
    • 2
    • 2
  • k

    KJReactor

    08/21/2020, 6:35 PM
    how do I check the existence of an entity before create a new one?
  • k

    KJReactor

    08/21/2020, 6:36 PM
    .prisma.[].create does not have this functionality. I used to use prisma.$exists.[] back in prisma 1
    m
    • 2
    • 2
  • m

    Michael Aubry

    08/21/2020, 10:05 PM
    Careful when you guys introspect. I forgot I made some manual changes in my schema.prisma and blew things up 🤦
    j
    • 2
    • 3
  • a

    Adrian Roach

    08/21/2020, 11:02 PM
    Hey peeps, does anyone know where to find better documentation on GraphQL.js? A lot of low-level functions seem to have no documentation such as
    GraphQL*Type.toConfig()
  • m

    Manthan Mallikarjun

    08/22/2020, 5:20 AM
    Curious, is there a library for generating typescript types? Or do you just do magical string concat to generate them?
    r
    • 2
    • 2
  • k

    KJReactor

    08/22/2020, 1:00 PM
    I keep getting a PrismaClientKnownRequestError: ...value for column is too long. Code: P2000
  • k

    KJReactor

    08/22/2020, 1:13 PM
    here is the complete error:
    Copy code
    PrismaClientKnownRequestError: 
    Invalid `prisma.user.create()` invocation in
    /.../dev/resolvers/Mutation.js:25:36
    
    
      The provided value for the column is too long for the column's type. Column: <unknown>
        at PrismaClientFetcher.request (.../node_modules/@prisma/client/runtime/index.js:1:226003)
        at processTicksAndRejections (internal/process/task_queues.js:97:5) {
      code: 'P2000',
      meta: { column_name: '<unknown>' }
    }
    r
    • 2
    • 1
  • k

    Kevin Dench

    08/22/2020, 11:08 PM
    Good evening, I am working on following the Prisma tutorial. However I am confused about a couple of things. When I run
    npx prisma generate --schema ./prisma/schema.prisma
    I get an error saying
    Syntax Error: Unexpected Name "datasource"
    So then I ran the command like this part of the docs, but encountered an unknown flag
    --schema
    error! It has been really hard to figure out what is going on via Google. I have a folder in the root of my project called
    prisma
    that contains my
    datamodel.prisma
    prisma.yml
    . Those files look like this:
    Copy code
    # datamodel.prisma
    datasource postgresql {
      provider = "postgresql"
      url      = env("DATABASE_URL")
    }
    
    generator client {
      provider = "prisma-client-js"
    }
    
    model Schedule {
        id Int @id @default(autoincrement())
        scheduledPhase ScheduledPhase @relation(fields: [phaseId], references: [id])
        phaseId Int
        name String?
        description String?
        startDate DateTime
        endDate DateTime
    
        @@index([startDate, endDate])
    }
    
    model ScheduledPhase {
        id Int @id @default(autoincrement())
        name String
        description String
        schedules Schedule[]
    }
    
    # prisma.yml
    endpoint: ${env:PRISMA_ENDPOINT}
    datamodel: datamodel.prisma
    secret: ${env:PRISMA_SECRET}
    
    generate:
      - generator: javascript-client
        output: ./src/generated/prisma-client/
    
    hooks:
      post-deploy:
        - graphql get-schema -p prisma
    Could I get some help figuring out how to get past this barrier, please? Thank you for any help in advance. This is my first time using Prisma and I think it would be really cool, if I can get it up and running. Debug output:
    Copy code
    WARNING: Error: [WARNING] in /Volumes/DevDench/development/prisma-test/planning/prisma/prisma.yml: A valid environment variable to satisfy the declaration 'env:PRISMA_ENDPOINT' could not be found.
        at /Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/prisma-cli-engine/src/Output/index.ts:227:41
        at SimpleAction.ActionBase.pause (/Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/prisma-cli-engine/src/Output/actions/ActionBase.ts:81:22)
        at Output.warn (/Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/prisma-cli-engine/src/Output/index.ts:224:17)
        at Variables.warnIfNotFound (/Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/prisma-yml/src/Variables.ts:265:16)
        at /Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/prisma-yml/src/Variables.ts:107:20
        at bound (domain.js:426:14)
        at runBound (domain.js:439:12)
        at tryCatcher (/Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/bluebird/js/release/util.js:16:23)
        at Promise._settlePromiseFromHandler (/Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/bluebird/js/release/promise.js:547:31)
        at Promise._settlePromise (/Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/bluebird/js/release/promise.js:604:18)
        at Promise._settlePromise0 (/Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/bluebird/js/release/promise.js:649:10)
        at Promise._settlePromises (/Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/bluebird/js/release/promise.js:729:18)
        at _drainQueueStep (/Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/bluebird/js/release/async.js:93:12)
        at _drainQueue (/Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/bluebird/js/release/async.js:86:9)
        at Async._drainQueues (/Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/bluebird/js/release/async.js:102:5)
        at Immediate.Async.drainQueues [as _onImmediate] (/Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/bluebird/js/release/async.js:15:14)
        at processImmediate (internal/timers.js:456:21)
        at process.topLevelDomainCallback (domain.js:137:15)
    WARNING: Error: [WARNING] in /Volumes/DevDench/development/prisma-test/planning/prisma/prisma.yml: A valid environment variable to satisfy the declaration 'env:PRISMA_SECRET' could not be found.
        at /Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/prisma-cli-engine/src/Output/index.ts:227:41
        at SimpleAction.ActionBase.pause (/Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/prisma-cli-engine/src/Output/actions/ActionBase.ts:81:22)
        at Output.warn (/Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/prisma-cli-engine/src/Output/index.ts:224:17)
        at Variables.warnIfNotFound (/Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/prisma-yml/src/Variables.ts:265:16)
        at /Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/prisma-yml/src/Variables.ts:107:20
        at bound (domain.js:426:14)
        at runBound (domain.js:439:12)
        at tryCatcher (/Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/bluebird/js/release/util.js:16:23)
        at Promise._settlePromiseFromHandler (/Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/bluebird/js/release/promise.js:547:31)
        at Promise._settlePromise (/Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/bluebird/js/release/promise.js:604:18)
        at Promise._settlePromise0 (/Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/bluebird/js/release/promise.js:649:10)
        at Promise._settlePromises (/Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/bluebird/js/release/promise.js:729:18)
        at _drainQueueStep (/Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/bluebird/js/release/async.js:93:12)
        at _drainQueue (/Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/bluebird/js/release/async.js:86:9)
        at Async._drainQueues (/Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/bluebird/js/release/async.js:102:5)
        at Immediate.Async.drainQueues [as _onImmediate] (/Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/bluebird/js/release/async.js:15:14)
        at processImmediate (internal/timers.js:456:21)
        at process.topLevelDomainCallback (domain.js:137:15)
    
    Generating schema... !
    Syntax Error: Unexpected Name "datasource"
    
    GraphQL request:1:1
    1 | datasource postgresql {
      | ^
    2 |   provider = "postgresql"
        at syntaxError (/Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/graphql/error/syntaxError.js:15:10)
        at Parser.unexpected (/Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/graphql/language/parser.js:1463:41)
        at Parser.parseDefinition (/Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/graphql/language/parser.js:157:16)
        at Parser.many (/Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/graphql/language/parser.js:1518:26)
        at Parser.parseDocument (/Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/graphql/language/parser.js:111:25)
        at Object.parse (/Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/graphql/language/parser.js:36:17)
        at RelationalParser.DefaultParser.parseFromSchemaString (/Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/prisma-datamodel/src/datamodel/parser/parser.ts:31:20)
        at parseInternalTypes (/Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/prisma-generate-schema/src/index.ts:21:45)
        at generateCRUDSchema (/Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/prisma-generate-schema/src/index.ts:34:11)
        at Object.generateCRUDSchemaString [as default] (/Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/prisma-generate-schema/src/index.ts:64:22)
        at GenerateCommand.<anonymous> (/Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/prisma-cli-core/src/commands/generate/generate.ts:89:48)
        at step (/Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/prisma-cli-core/dist/commands/generate/generate.js:45:23)
        at Object.next (/Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/prisma-cli-core/dist/commands/generate/generate.js:26:53)
        at fulfilled (/Users/gkxdhr1/.nvm/versions/node/v12.16.1/lib/node_modules/prisma/node_modules/prisma-cli-core/dist/commands/generate/generate.js:17:58)
        at processTicksAndRejections (internal/process/task_queues.js:97:5)
    (node:15435) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
      output Exiting with code: 1 +0ms
    j
    r
    • 3
    • 7
  • v

    vh13294

    08/23/2020, 12:54 PM
    Github issue is not sorting correctly on page load (not newest). https://github.com/prisma/prisma/issues
    j
    • 2
    • 1
  • a

    Alex Reyne

    08/23/2020, 8:38 PM
    How would one use prisma to select only the first X out of find many? (code in replies_
    j
    • 2
    • 4
  • s

    Slackbot

    08/24/2020, 2:41 PM
    This message was deleted.
    m
    j
    • 3
    • 5
  • b

    Brad Garropy

    08/24/2020, 6:37 PM
    Is this the right place to ask questions about
    graphql-playground-react
    ?
    j
    • 2
    • 1
  • c

    Charles Gaudreau Jackson

    08/25/2020, 12:11 AM
    Hi! Is there an official guide or tutorial on how to publish the server to heroku and how to manage the local vs the production endpoint?
  • m

    Marcel Overdijk

    08/25/2020, 7:52 AM
    In this post https://t.co/CCAF3STlPE it is also mentioned that Prisma Client could also be used with other languages in the future and that there is already an alpha version for Go. Are there plans to support other languages?
    r
    • 2
    • 2
  • d

    Daniel Norman

    08/25/2020, 2:29 PM
    I’ll be going live in 2 hours for part 3 of the modern backend series. In this episode, I’ll go into the principles behind authentication and implement email-based passwordless authentication (with JWT) and authorization for the REST API implemented with Prisma, Hapi, PostgreSQL, and TypeScript.

    https://www.youtube.com/watch?v=yuhjO0Nj99U&amp;feature=youtu.be▾

    prisma green 5
    prisma rainbow 3
    😎 2
    💯 5
    party postgres 3
    🚀 5
    prisma cool 1
    c
    n
    • 3
    • 2
  • k

    KJReactor

    08/25/2020, 3:28 PM
    I have a one to many relation between i.e. Product and Store. I can already create new Products that refer to their one Store like this: `` return await ctx.prisma.product.create({ data: { ..._data, // establish connection with store store_productTostore: { connect: { store_id }, }, }, }); ``
    data
    contains the input for the new
    product
    I checked the table it indeed refers to the designated home. However, I can't get the
    products
    column in Home to refer to the set of keys it has
    products
    is an array of the same type of key.id. I tried changing the above to this but it doesn't work: `` return await ctx.prisma.store.update({ where: { store_id }, data: { products: { create: { ...data } } } }); ``
    n
    • 2
    • 3
  • j

    Jonathan

    08/25/2020, 3:46 PM
    Anyone use a particular workflow for ci/cd migration when merging pull requests? Eg automatically execute migration when setting new docker image
    prisma cool 1
    n
    • 2
    • 2
  • n

    Natalia

    08/25/2020, 3:48 PM
    Reminder: Daniel’s livestream starts soon! fast parrot
    fast parrot 1
    🦜 1
    cool early bird 1
    c
    • 2
    • 1
  • k

    KJReactor

    08/25/2020, 4:25 PM
    Can anyone help me enter values for the many side of a one-to-many relationship?
  • a

    Alex Reyne

    08/25/2020, 8:40 PM
    Is it possible to orderBy a field randomly
    n
    • 2
    • 1
  • a

    Alex Reyne

    08/25/2020, 8:40 PM
    I specifically do not want it asc or desc
1...393394395...637Latest