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

    Suhail

    05/15/2020, 6:42 AM
    @channel https://github.com/prisma/prisma-content-feedback/issues/138
  • r

    Rizwan Anwar

    05/15/2020, 8:54 AM
    Hey guys! I had initialize prisma project made changes and then run prisma deploy my server started correctly and provided urls. Now i open my pc again and i dont know how do i restart my prisma server without running prisma deploy. Can anyone help.
    r
    • 2
    • 12
  • s

    Suhail

    05/15/2020, 9:31 AM
    Where do we ask questions? Is there a separate group for it? Most of my questions have gone unanswered. Even the community on SO is too small that most of the questions go unanswered.
    r
    • 2
    • 1
  • d

    Dulara Malindu Colombage

    05/15/2020, 11:45 AM
    how can I get distinct result set using prisma client? the following query to prisma server gives my intended output. but I need a help to make it callable inside my resolver.
    r
    • 2
    • 2
  • d

    Dulara Malindu Colombage

    05/15/2020, 11:46 AM
    this is what I tried. but failed with no luck. is this is possible to achieve?
  • d

    Dulara Malindu Colombage

    05/15/2020, 12:35 PM
    I found this on prisma docs. there is has a syntax like this
    Copy code
    const userWithPosts = await prisma.users().$fragment(fragment)
    but I can’t use $fragment method like it has been used on this mentioned scenario. I am using the prisma image prismagraphql/prisma:1.29.1 do I need to update in order to use fragments?
  • d

    Dulara Malindu Colombage

    05/15/2020, 12:36 PM
    I saw that syntax on this page https://v1.prisma.io/docs/1.34/prisma-client/basic-data-access/reading-data-JAVASCRIPT-rsc2/#selecting-fields
    r
    • 2
    • 4
  • n

    nikolasburk

    05/15/2020, 3:36 PM
    Hey Prisma 1 users 👋 We're currently working on proper upgrade guides and dedicated tooling that'll help you with the upgrade process from Prisma 1 to Prisma 2.0! prisma rainbow We already published a number of resources in the new Prisma 2.0 docs (e.g. here), and we'd love to get your feedback for them! 📚 • Do they address your main questions and concerns? • How and where should they be improved? • What resources are you still missing? We also created a dedicated repository that you can use to share information about your personal upgrade scenario, ask questions or raise issues and other concerns about the upgrade process 🙏 Please check it out and open new issues, we'll use the feedback to further improve your upgrade experiences as much as possible! 🙌
    ❤️ 8
    prisma green 1
  • g

    Guillermo Lopez

    05/16/2020, 5:42 PM
    Quick question: Is Nexus already compatible with Schema directives?
  • t

    Toby

    05/16/2020, 6:07 PM
    Hello everyone! I am new to prisma and I tried deploying my prisma server but I keep getting this error, please how do I solve this issue??
    r
    • 2
    • 1
  • r

    Roy

    05/16/2020, 6:48 PM
    Hi guys. I have a problem with a mutation with a connection and need some help. This is my schema.prisma:
    Copy code
    model Menu {
      id        Int          @default(autoincrement()) @id
      name      String
      company   Company      @relation(fields: [companyId], references: [id])
      companyId Int
      isActive  Boolean
      items     ItemOnMenu[]
    }
    
    model ItemOnMenu {
      id          Int           @default(autoincrement()) @id
      item        Item          @relation(fields: [itemId], references: [id])
      itemId      Int
      ItemOnOrder ItemOnOrder[]
      course      String
      Menu        Menu          @relation(fields: [menuId], references: [id])
      menuId      Int
    }
    In graphql.ts i have:
    Copy code
    schema.objectType({
      name: 'Menu',
      definition(t) {
        t.model.id();
        t.model.name();
        t.model.items();
        t.model.company();
        t.model.companyId();
        t.model.isActive();
      },
    });
    
    schema.objectType({
      name: 'ItemOnMenu',
      definition(t) {
        t.model.id();
        t.model.item();
        t.model.itemId();
        t.model.ItemOnOrder();
        <http://t.model.Menu|t.model.Menu>();
        t.model.menuId();
        t.model.course();
        t.model.price();
      },
    });
    When i run the following mutation, it will give me an error. The id is in my database, i verified that. This is the mutation:
    Copy code
    mutation createNewItemOnMenu(
      $item: "test"
      $course: "testCourse"
      $price: 2.75
    ) {
      createOneItemOnMenu(
        data: {
          item: { create: { name: $item } }
          course: $course
          price: $price
          Menu: { connect:{id: 60} }
        }
      ) {
        id
        item {
          name
        }
      }
    }
    This is the error which gives me a really big headache.
    Copy code
    "message": "\n\u001b[31mInvalid \u001b[1m`prisma.itemOnMenu.create()`\u001b[22m invocation:\u001b[39m\n\n Null constraint violation on the fields: (`id`)",
    Anyone there who can help me? I am running:
    Copy code
    "@prisma/cli": "^2.0.0-beta.4",
    "@prisma/client": "^2.0.0-beta.4",
    "nexus-plugin-prisma": "^0.8.0-next.9",
  • m

    Manthan Mallikarjun

    05/17/2020, 7:42 PM
    Hey, so I want to follow both JS and Postgres convention which means I want my column names to be underscore but my code to have camelCase. Is there an automatic way to do this or do I have to use
    @map
    on everything
    r
    • 2
    • 1
  • c

    cfree

    05/17/2020, 11:26 PM
    Is there a migration guide for those that want to use their data from the Prisma Admin with Prisma 2?
    r
    n
    • 3
    • 8
  • e

    ezeikel

    05/18/2020, 2:46 AM
    Picking up an old project that uses Prisma and its a bit confusing. Im using the latest version of Prisma 1 and using the Mongo connector. Should I wait to try and switch over to Prisma v2 when there is a clearer migration? I’ve also been thinking about ditching graphql-yoga and using Apollo Server instead?
    d
    r
    • 3
    • 3
  • a

    Ahmad

    05/18/2020, 2:35 PM
    Hi, I'm new to Prisma. I have a legacy code in Prisma 1. I added a new Table/datamodel and then
    prisma deploy
    after than
    prisma generate
    , But do I have to write Query and Mutation related
    schema.graphql
    and
    schemaTypes.graphql
    by hand? I have alot of modules in code where these files are present and look very much auto gen. But
    prisma generate
    doesn't seem to have any command for this neither does
    graphqlgen
    (0.5.0).
    r
    • 2
    • 3
  • j

    jt

    05/18/2020, 7:05 PM
    i've deployed my own prisma server using docker. I'm using the PRISMA_MANAGEMENT_API_SECRET env, but whenever I access my prisma server on port 4466, even when I'm logged out, I can see all my data, which is not good. How do I fix this for production?
    r
    • 2
    • 2
  • o

    Omar Harras

    05/18/2020, 8:29 PM
    Hello folks, anyone knows the reason of
    cannot not return null for non-nullable field
    error ? because when I run my query in the prisma playground it works but not in my localhost playground, anyone can help please ?
    j
    r
    • 3
    • 2
  • s

    Shivam Patel

    05/18/2020, 10:03 PM
    Anyone have experience deploying prisma onto google cloud run? I have to connect to a cloud SQL instance through a proxy, and I can connect to the database using the proxy on my local machine but I'm unable to access my cloud SQL instance when I deploy it on cloud run (google says it automatically configures the proxy for you).
  • c

    Corey Snyder

    05/19/2020, 2:04 AM
    I just started back up on an old project I was working on in November using Prisma 1. Do you guys recommend letting the project live on with prisma1? And if not, is there a path forward to migrating everything to the newer Prisma2?
    r
    • 2
    • 2
  • b

    bob

    05/19/2020, 7:48 AM
    hey does anyone know how to get this working?
    Copy code
    typeDefs: [KeycloakTypeDefs, "./src/schema.graphql"],
    schemaDirectives: KeycloakSchemaDirectives,
    KeycloakTypeDefs or KeycloakSchemaDirectives
    im not sure which one, comes with an
    @auth
    type but i dont know how to use it in my schema file
    l
    • 2
    • 63
  • s

    S Khan

    05/19/2020, 8:48 AM
    Hey guys, new here. I’m using
    graphql-yoga
    for a project and noticed a slight issue and potential security vulnerability. Maybe it’s a known issue but basically the validation rules aren’t forwarded down to
    subscriptions-transport-ws
    which means if you were to disable Introspection, it would only be applicable to queries over http and not subscriptions. I’ve patched this locally in my project, any objections to me opening a PR for the same in graphql-yoga? or anything I missed?
  • t

    TEMILOLUWA OJO PHILIP

    05/19/2020, 11:08 AM
    Hi guys, incase anyone works with nextjs like i do and needs to configure nextjs to work with subscriptions. I made this nextjs + with apollo subscription starter kit to help solve that. Please give it a star just incase you find it helpful. https://github.com/themmyloluwaa/with-apollo-subscriptions
    💯 1
  • r

    reem

    05/20/2020, 12:26 AM
    What's the easiest way to preload some example queries and mutations when I start my playground?
  • r

    reem

    05/20/2020, 12:27 AM
    Is
    tabs
    what I'm looking for?
    r
    • 2
    • 2
  • a

    Ahmad

    05/20/2020, 8:31 AM
    Hi, I have a legacy code, it's on Prisma 1.26.6. I'm getting 503 from Heroku when trying to Deploy. I saw a related GitHub issue, It said that 1.26.5 (version that doesn't exits on npm now) should work and not cause
    Timeout
    error resulting in 503.
    r
    • 2
    • 5
  • s

    stephan

    05/20/2020, 8:31 AM
    is there anyway i can invoke a method each time prisma wants to insert a new entity to db ? i want to augment each entity with the CREATED_AT, CREATED_BY fields
  • a

    Ahmad

    05/20/2020, 8:32 AM
    I can't upgrade to 1.34 as there are major schema relation changes.
  • c

    Conner Novicki

    05/20/2020, 4:04 PM
    I'm trying to introspect an existing SQLite database with prisma 2. Does this functionality exist?
    r
    • 2
    • 1
  • c

    Chazzz

    05/20/2020, 4:16 PM
    Hi all 👋 New here. -- The app I'm working on (react CRA only, no B/E) uses Prisma1 on demo with https://app.prisma.io/. It's a MVP/Beta no trafic as of today. Before launch I have a few concerns : • how much can we rely (if it's even an option) on https://app.prisma.io/ before an install on our own server becomes mandatory? • how demanding is the migration from prisma1 to prisma2? • how do I know what kind of server size I need to host prisma2? • what is the easiest (as easy as the demo) way to use prisma ? Thanks 🙏
    a
    l
    • 3
    • 6
  • s

    sorenbs

    05/20/2020, 6:30 PM

    Prisma 2.0 Demo by its Core-Team member Nikolas Burk aka @nikolasburk▾

    👍 3
    prisma rainbow 3
    🚀 2
1...373374375...637Latest