danlannz
10/22/2019, 12:58 AMprisma2 generate
Zane Helton
10/22/2019, 1:06 AMprisma2 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 foundZane Helton
10/22/2019, 1:06 AMZane Helton
10/22/2019, 1:12 AMprisma2 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 errorZane Helton
10/22/2019, 1:13 AMCorey Snyder
10/22/2019, 1:51 AM@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.
updatedProduct.supportedBoardSizes = {
set: [...updatedProduct.supportedBoardSizes]
}
I’d really like to just be able to have
boardSizes: [boardSize1, boardSize2, boardSize3]
david calcus
10/22/2019, 9:27 AMtype 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?Loka
10/22/2019, 1:19 PMMaciek K
10/22/2019, 1:20 PMLoka
10/22/2019, 1:37 PMMaxim Ignatev
10/22/2019, 3:14 PMRashmi Bidanta
10/22/2019, 3:17 PMprisma2 init
, I am running node 10.14.2
Rashmi Bidanta
10/22/2019, 3:17 PM➜ 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
Rashmi Bidanta
10/22/2019, 3:17 PMRicco
10/22/2019, 3:25 PMRashmi Bidanta
10/22/2019, 3:28 PMsqllite
, also this happens when I use starter kit
option with prisma2 init hello-prisma
Rashmi Bidanta
10/22/2019, 3:30 PMRicco
10/22/2019, 3:36 PMZane Helton
10/22/2019, 5:41 PM2.0.0-preview015
and I'm still facing an issue from yesterday. Any ideas?Zane Helton
10/22/2019, 6:23 PMZane Helton
10/22/2019, 6:23 PM$ 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.
Zane Helton
10/22/2019, 6:36 PM$ 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.
Zane Helton
10/22/2019, 6:44 PMmodel Order {
creator User? @map("creatorId") @relation("OrderCreatorToUserOrder")
}
model User {
createdOrders Order[] @relation("OrderCreatorToUserOrder")
}
Zane Helton
10/22/2019, 7:12 PMprisma2 dev
to work and it even lets me insert my seed data. But yarn dev
(which should start the src/server.ts
) failsxiaoqf10
10/23/2019, 10:53 AMRashmi Bidanta
10/23/2019, 1:05 PMRashmi Bidanta
10/23/2019, 1:05 PMCategory
to Schema.prisma
fileRashmi Bidanta
10/23/2019, 1:06 PMschema.ts
file it complains about the properties
const Category = objectType({
name: 'Category',
definition(t) {
t.model.id()
t.model.name()
t.model.posts({
pagination: false,
})
},
})
Rashmi Bidanta
10/23/2019, 1:08 PMProperty 'id' does not exist on type '<CustomTypeName extends "User" | "Post">(typeName: CustomTypeName) => NexusPrismaMethods[CustomTypeName]'.
Rashmi Bidanta
10/23/2019, 1:09 PM