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

    danlannz

    10/22/2019, 12:58 AM
    I assume it’s supposed to be
    prisma2 generate
  • z

    Zane Helton

    10/22/2019, 1:06 AM
    prisma2 generate
    works, and I can see index.d.ts, index.js, and the runtime/ folder within @generated/photon, however when I run
    yarn dev
    to start the server, it says @generated/photon can't be found
  • z

    Zane Helton

    10/22/2019, 1:06 AM
    Oh wow...it doesn't say that anymore... 1 sec
  • z

    Zane Helton

    10/22/2019, 1:12 AM
    Huh... I ran
    prisma2 generate
    and I started getting a bcrypt error (screenshot below) But once I ran
    npm rebuild
    , it took me back to the @generated/photon is missing error
    r
    • 2
    • 2
  • z

    Zane Helton

    10/22/2019, 1:13 AM
  • c

    Corey Snyder

    10/22/2019, 1:51 AM
    I am trying to save a
    @scalarList(strategy: RELATION)
    like so
    supportedBoardSizes: [BoardSizes] @scalarList(strategy: RELATION)
    . In my code I am trying to save/edit an item with a new scalar list and I cannot simply pass an array of board sizes like is required for the schema. Instead it seems I have to put the item in an object under a
    set
    property. Is there a cleaner way to do this? I don’t really want to have to do this every place I try to save a scalarList.
    Copy code
    updatedProduct.supportedBoardSizes = {
        set: [...updatedProduct.supportedBoardSizes]
    }
    I’d really like to just be able to have
    Copy code
    boardSizes: [boardSize1, boardSize2, boardSize3]
  • d

    david calcus

    10/22/2019, 9:27 AM
    Hi. I’m struggling with a self one to many relation.
    Copy code
    type Organisation {
     subOrganisations: [Organisation!] @relation(name: "OrganisationSubOrganisations")
      parentOrganisation: Organisation @relation(name: "OrganisationSubOrganisations")
    }
    When i create a sub org, I would expect that entity to have a parent org by default. But that link does not seem to be created. Anyone else doing self-relation with one to many? Do you need to create both relations manually?
  • l

    Loka

    10/22/2019, 1:19 PM
    i have this problem today anyone here why this happen and how i should fix it ENOTFOUND': request to https://eu1.prisma.sh/management failed, reason: getaddrinfo ENOTFOUND eu1.prisma.sh eu1.prisma.sh:443
    d
    m
    • 3
    • 9
  • m

    Maciek K

    10/22/2019, 1:20 PM
    me too, I'm guessing it's down in EU. Although some things work
  • l

    Loka

    10/22/2019, 1:37 PM
    so what we should do ?!!
  • m

    Maxim Ignatev

    10/22/2019, 3:14 PM
    hey guys, need some help i got a list of communities, which contains a list of followers. i want to only return communities where i am a follower. how can i do it?
  • r

    Rashmi Bidanta

    10/22/2019, 3:17 PM
    Getting an error, with
    prisma2 init
    , I am running node
    10.14.2
  • r

    Rashmi Bidanta

    10/22/2019, 3:17 PM
    Copy code
    ➜  pocs prisma2 init hello-prisma
    
    Preparing your starter kit: GraphQL API
    
    ✔  Downloading the starter kit from GitHub ...
    ✔  Extracting content to hello-prisma ...
    ⠏  Installing dependencies with: `npm install` ...
    4  Preparing your database ...
    5  Seeding your database with: `npm run seed` ...
     ERROR  Error during command execution
    
    npm WARN deprecated @types/graphql@14.5.0: This is a stub types definition. graphql provides its own type definitions, so you do not need this installed.
    npm WARN deprecated apollo-upload-server@7.1.0: Please migrate to <https://npm.im/graphql-upload> (see <https://git.io/fADhl>).
    sh: yarn: command not found
    npm WARN graphql-playground-middleware-lambda@1.7.12 requires a peer of aws-lambda@^0.1.2 but none is installed. You must install peer dependencies yourself.
    npm WARN graphql-subscriptions@0.5.8 requires a peer of graphql@^0.10.5 || ^0.11.3 || ^0.12.0 || ^0.13.0 but none is installed. You must install peer dependencies yourself.
    npm WARN apollo-server-core@1.4.0 requires a peer of graphql@^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 but none is installed. You must install peer dependencies yourself.
    npm WARN apollo-cache-control@0.1.1 requires a peer of graphql@0.10.x - 0.13.x but none is installed. You must install peer dependencies yourself.
    npm WARN apollo-tracing@0.1.4 requires a peer of graphql@0.10.x - 0.13.x but none is installed. You must install peer dependencies yourself.
    npm WARN graphql-extensions@0.0.10 requires a peer of graphql@0.10.x - 0.13.x but none is installed. You must install peer dependencies yourself.
    npm WARN typescript-graphql@ No repository field.
    npm WARN typescript-graphql@ No license field.
    
    npm ERR! file sh
    npm ERR! code ELIFECYCLE
    npm ERR! errno ENOENT
    npm ERR! syscall spawn
    npm ERR! @prisma/sdk@0.0.20 postinstall: `yarn download`
    npm ERR! spawn ENOENT
    npm ERR!
    npm ERR! Failed at the @prisma/sdk@0.0.20 postinstall script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /Users/rbidanta/.npm/_logs/2019-10-22T15_12_34_461Z-debug.log
    d
    • 2
    • 11
  • r

    Rashmi Bidanta

    10/22/2019, 3:17 PM
    do I have to fix the warnings?
  • r

    Ricco

    10/22/2019, 3:25 PM
    What is database seeding?
    n
    • 2
    • 3
  • r

    Rashmi Bidanta

    10/22/2019, 3:28 PM
    @Ricco I am using
    sqllite
    , also this happens when I use
    starter kit
    option with
    prisma2 init hello-prisma
  • r

    Rashmi Bidanta

    10/22/2019, 3:30 PM
    sorry I thought that was for the question i raised
  • r

    Ricco

    10/22/2019, 3:36 PM
    haha no worries - I was just curious
  • z

    Zane Helton

    10/22/2019, 5:41 PM
    I just upgraded to
    2.0.0-preview015
    and I'm still facing an issue from yesterday. Any ideas?
    10_22_2019.sh
  • z

    Zane Helton

    10/22/2019, 6:23 PM
    I think I might have just made an inch of progress:
  • z

    Zane Helton

    10/22/2019, 6:23 PM
    Copy code
    $ yarn prisma2 dev
    yarn run v1.19.0
    $ /Users/zane/repos/project/mono-repo/node_modules/.bin/prisma2 dev
    thread 'main' panicked at 'Did not find a relation for those for model OrganizationOrganization and field superorganizationId', src/libcore/option.rs:1034:5
    stack backtrace:
       0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
       1: std::sys_common::backtrace::_print
       2: std::panicking::default_hook::{{closure}}
       3: std::panicking::default_hook
       4: std::panicking::rust_panic_with_hook
       5: std::panicking::continue_panic_fmt
       6: rust_begin_unwind
       7: core::panicking::panic_fmt
       8: core::option::expect_failed
       9: <core::iter::adapters::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
      10: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T,I>>::from_iter
      11: <core::iter::adapters::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
      12: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T,I>>::from_iter
      13: prisma_models::datamodel_converter::DatamodelConverter::convert
      14: prisma::data_model_loader::load_data_model_components
      15: prisma::main
      16: std::rt::lang_start::{{closure}}
      17: std::panicking::try::do_call
      18: __rust_maybe_catch_panic
      19: std::rt::lang_start_internal
      20: main
    Error: process exited with a non-zero code: 101
    thread 'main' panicked at 'Did not find a relation for those for model OrganizationOrganization and field superorganizationId', src/libcore/option.rs:1034:5
    stack backtrace:
       0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
       1: std::sys_common::backtrace::_print
       2: std::panicking::default_hook::{{closure}}
       3: std::panicking::default_hook
       4: std::panicking::rust_panic_with_hook
       5: std::panicking::continue_panic_fmt
       6: rust_begin_unwind
       7: core::panicking::panic_fmt
       8: core::option::expect_failed
       9: <core::iter::adapters::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
      10: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T,I>>::from_iter
      11: <core::iter::adapters::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
      12: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T,I>>::from_iter
      13: prisma_models::datamodel_converter::DatamodelConverter::convert
      14: prisma::data_model_loader::load_data_model_components
      15: prisma::main
      16: std::rt::lang_start::{{closure}}
      17: std::panicking::try::do_call
      18: __rust_maybe_catch_panic
      19: std::rt::lang_start_internal
      20: main
    
    error Command failed with exit code 1.
    info Visit <https://yarnpkg.com/en/docs/cli/run> for documentation about this command.
    d
    • 2
    • 1
  • z

    Zane Helton

    10/22/2019, 6:36 PM
    This keeps getting weirder. I don't think I changed anything significant, now I'm getting:
    Copy code
    $ yarn prisma2 dev
    yarn run v1.19.0
    $ /Users/zane/repos/project/mono-repo/node_modules/.bin/prisma2 dev
    thread 'main' panicked at 'Did not find a relation for those for model User and field createdOrder', src/libcore/option.rs:1034:5
    stack backtrace:
       0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
       1: std::sys_common::backtrace::_print
       2: std::panicking::default_hook::{{closure}}
       3: std::panicking::default_hook
       4: std::panicking::rust_panic_with_hook
       5: std::panicking::continue_panic_fmt
       6: rust_begin_unwind
       7: core::panicking::panic_fmt
       8: core::option::expect_failed
       9: <core::iter::adapters::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
      10: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T,I>>::from_iter
      11: <core::iter::adapters::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
      12: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T,I>>::from_iter
      13: prisma_models::datamodel_converter::DatamodelConverter::convert
      14: prisma::data_model_loader::load_data_model_components
      15: prisma::main
      16: std::rt::lang_start::{{closure}}
      17: std::panicking::try::do_call
      18: __rust_maybe_catch_panic
      19: std::rt::lang_start_internal
      20: main
    Error: process exited with a non-zero code: 101
    thread 'main' panicked at 'Did not find a relation for those for model User and field createdOrder', src/libcore/option.rs:1034:5
    stack backtrace:
       0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
       1: std::sys_common::backtrace::_print
       2: std::panicking::default_hook::{{closure}}
       3: std::panicking::default_hook
       4: std::panicking::rust_panic_with_hook
       5: std::panicking::continue_panic_fmt
       6: rust_begin_unwind
       7: core::panicking::panic_fmt
       8: core::option::expect_failed
       9: <core::iter::adapters::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
      10: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T,I>>::from_iter
      11: <core::iter::adapters::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
      12: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T,I>>::from_iter
      13: prisma_models::datamodel_converter::DatamodelConverter::convert
      14: prisma::data_model_loader::load_data_model_components
      15: prisma::main
      16: std::rt::lang_start::{{closure}}
      17: std::panicking::try::do_call
      18: __rust_maybe_catch_panic
      19: std::rt::lang_start_internal
      20: main
    
    error Command failed with exit code 1.
    info Visit <https://yarnpkg.com/en/docs/cli/run> for documentation about this command.
  • z

    Zane Helton

    10/22/2019, 6:44 PM
    Relevant schema code:
    Copy code
    model Order {
        creator       User?   @map("creatorId") @relation("OrderCreatorToUserOrder")
    }
    
    model User {
        createdOrders Order[] @relation("OrderCreatorToUserOrder")
    }
  • z

    Zane Helton

    10/22/2019, 7:12 PM
    I got
    prisma2 dev
    to work and it even lets me insert my seed data. But
    yarn dev
    (which should start the
    src/server.ts
    ) fails
  • x

    xiaoqf10

    10/23/2019, 10:53 AM
    Hi everyone, how to change "INLINE" relation to "TABLE" without data loss?
  • r

    Rashmi Bidanta

    10/23/2019, 1:05 PM
    I am trying to modify schema for graphql by following the steps here https://github.com/prisma/prisma-examples/tree/prisma2/typescript/graphql
  • r

    Rashmi Bidanta

    10/23/2019, 1:05 PM
    add a new type called
    Category
    to
    Schema.prisma
    file
  • r

    Rashmi Bidanta

    10/23/2019, 1:06 PM
    but when I try to add a new object type to
    schema.ts
    file it complains about the properties
    Copy code
    const Category = objectType({
      name: 'Category',
      definition(t) {
        t.model.id()
        t.model.name()
        t.model.posts({
          pagination: false,
        })
      },
    })
  • r

    Rashmi Bidanta

    10/23/2019, 1:08 PM
    the complain is
    Property 'id' does not exist on type '<CustomTypeName extends "User" | "Post">(typeName: CustomTypeName) => NexusPrismaMethods[CustomTypeName]'.
    • 1
    • 1
  • r

    Rashmi Bidanta

    10/23/2019, 1:09 PM
    I am not sure if I am missing anything here
1...324325326...637Latest