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

    Nasser Alsaeed

    10/30/2019, 6:40 PM
    any idea why this happens
  • n

    Nasser Alsaeed

    10/30/2019, 6:51 PM
    it's on prisma 2
  • c

    Charlie

    10/31/2019, 12:47 AM
    hi everyone, i’m new to prisma and trying to set up a many:many relationship. this involves having the concept of “users” and “workspaces” where a user can belong to many workspaces, and a workspace can have many users. I am trying to set up a query where, when creating a user, I can also assign them to multiple workspaces at the same time. because of this I’m trying to use an updateMany method to find all of the applicable workspaces and add the newly created user to them. i’m sure it’s a matter of me not understanding the correct syntax, but this is what I have:
    Copy code
    const createUser = async (parent, args, context, info) => {
      const user = await context.prisma.createUser({
        name: args.name
      });
    
      const workspaces = await context.prisma.updateManyWorkspaces({
        where: {
          id_in: args.workspaces
        }, 
        data: {
          users: [{
            connect: {
              id: user.id
            }
          }]
        }
      });
    
      return user;
    }
  • c

    Charlie

    10/31/2019, 12:48 AM
    The error I’m getting is:
    Variable '$data' expected value of type 'WorkspaceUpdateManyMutationInput!' but got:...
    does anyone have any suggestions for fixing the above query?
  • c

    Corey Snyder

    10/31/2019, 1:56 AM
    Is there any way to avoid this? Seems like I should be able to make the first part of that query only once.
    Copy code
    const flightController = await context.prisma.droneBuild({id: args.buildId}).flightController()
          const esc = await context.prisma.droneBuild({id: args.buildId}).esc()
          const vtx = await context.prisma.droneBuild({id: args.buildId}).vtx()
          const receiver = await context.prisma.droneBuild({id: args.buildId}).receiver()
          const camera = await context.prisma.droneBuild({id: args.buildId}).camera()
          const motor = await context.prisma.droneBuild({id: args.buildId}).motor()
          const propeller = await context.prisma.droneBuild({id: args.buildId}).propeller()
          const frame = await context.prisma.droneBuild({id: args.buildId}).frame()
          const antenna = await context.prisma.droneBuild({id: args.buildId}).antenna()
          const battery = await context.prisma.droneBuild({id: args.buildId}).battery()
    r
    • 2
    • 2
  • d

    deactivateduser

    10/31/2019, 10:46 AM
    if I want to save an object which has a value which is another object, e.g.
    Copy code
    {
      "entity": {
        "type": {
          "id": 1,
          "filter": true
        }
      }
    }
    Is my only option to create another type for "type"? If so, what if I want to insert that entity now but the "type" is not in the database (no type with id 1)? Can I create both in one operation?
  • c

    Chris Zempel

    10/31/2019, 12:52 PM
    Probably an easy-to-answer question inside this thread w/r/t getting the author for an invitation - /thread
    • 1
    • 2
  • d

    Daniel Engdahl

    10/31/2019, 2:44 PM
    Hello everyone! I'm having issues running
    prisma deploy
    on Windows due to our network policys/self signed certificates. It seems as
    prisma
    does not use the
    .npmrc
    config to read my custom certification file. Is there any way to set a custom cafile for
    prisma
    or any other way around this issue? Posting error message in thread.
    • 1
    • 1
  • e

    evan

    10/31/2019, 3:55 PM
    Hey guys, I’m using type-graphql with prisma (v1.x). In the prisma datamodel, you can define automatically updated createdAt and updatedAt fields like so:
    Copy code
    type Account {
      createdAt: DateTime! @createdAt
      updatedAt: DateTime! @updatedAt
    }
    I have the corresponding type-graphql type:
    Copy code
    @ObjectType()
    export class Account {
      @Field()
      createdAt: Date
    
      @Field()
      updatedAt: Date
    }
    However, createdAt and updatedAt are never applied to the record. Any ideas?
  • h

    Hugo Marques

    10/31/2019, 8:46 PM
    Hello guys, I am new to prisma, and I have 1 question: When we change the schema on datamodel, and that also generates the primsa schema, do I still need to update the schema.graphql ? I am a bit lost. Using just graphql, we just change graphql.schema, when working with prisma, what are the best practices?
  • d

    deactivateduser

    10/31/2019, 8:50 PM
    damn impossible to get some help huh
  • g

    gem

    10/31/2019, 9:16 PM
    hello, do some people run prisma in production and have often memory quota excess on Heroku ?
  • l

    lucid_frog

    10/31/2019, 10:29 PM
    If i’ve deployed my prisma server to prisma cloud, where/how should I deploy my node api?
  • l

    lucid_frog

    11/01/2019, 2:06 AM
    currently working on a node server with prisma and typescript, when building a package is throwing an error and I couldn’t find a way to fix it, any clue? heres my
    tsconfig.json
    file:
    Copy code
    {
      "compilerOptions": {
        "moduleResolution": "node",
        "noImplicitAny": false,
        "removeComments": true,
        "preserveConstEnums": true,
        "outDir": "./build",
        "sourceMap": true,
        "lib": ["es2016", "esnext.asynciterable", "dom"],
        "types": ["bcrypt", "body-parser", "cors", "express", "passport", "jsonwebtoken"]
      },
      "include": [
        "src/**/*"
      ],
      "exclude": [
        "node_modules",
        "node_modules/apollo-utilities",
        "build",
        "**/*.spec.ts",
      ]
    }
  • v

    vigneshkb

    11/01/2019, 6:47 AM
    Hi All, iam trying to create custom mutation .i am getting error while
    prisma deploy
    .Deploying service
    default
    to stage
    default
    to server
    default
    773ms Errors: Mutation ✖️ One field of the type
    Mutation
    must be marked as the id field with the
    @id
    directive. ✖️ The type
    Mutation
    has is using a reserved type name. Please rename it.
    datamodel.prisma
  • r

    Richard Ward

    11/01/2019, 6:56 AM
    I think it’s because you don’t put the mutation in the dataModel file. The datamodel is to define your “tables”
    👍 1
  • v

    vigneshkb

    11/01/2019, 8:49 AM
    hello, how to write custom mutation query in datamodel.prisma
  • c

    Constantinos N

    11/01/2019, 12:25 PM
    Hi All. I am a self-taught developer, started with front-end (Vue) and now I am trying to learn back-end. My question is about the general stack I can use with Prisma. I was thinking of using NodeJS, GraphQL, Apollo Server 2, with Prisma 2 but my question is.. do I need to use ExpressJS also? Thats useful only if I need features such as authentication? Or I can have authentication with Apollo Server 2 without ExpressJS? Trying to understand what I should be learning.
    j
    f
    • 3
    • 5
  • s

    Sullivan Senechal

    11/01/2019, 4:05 PM
    Hi all, I am discovering prisma while the v2 is on preview. As the roadmap says a stable version would be online starting 2020, I decided to directly learn v2. But I rapidely got stuck on some blocking issues link not available long text (https://github.com/prisma/lift/issues/116) which is a quite big limitation to develop any website. I would like to know what is the ETA of the v2. Is it still under development? Is it still planned for 2020? I don't see a lot of commits on the projects since some months, so I'm wondering. I understand you have some reasons about the low commit activity, I personnaly do some open-source stuff too, I just want to be sure of what am I using. I have to deliver the first features of my project at the end of this month. What would be your advice? Start with prisma1 and go back to v2 later ? Find something else ? Many thanks! 🙂
  • s

    Sullivan Senechal

    11/01/2019, 4:12 PM
    Also, I saw nexus-prisma, very useful tool, is not supporting prisma v1 on the last version. Is it safe to use it with prisma 1 and getting stuck with v0.3 of nexus-prisma ?
    👍 1
    a
    • 2
    • 8
  • a

    Andrew O.

    11/01/2019, 5:55 PM
    I was just at GraphQL summit in SF, there was a noticeable absence of Prisma there.
  • n

    Nesh

    11/01/2019, 6:06 PM
    I agree with @Andrew O.
    a
    n
    • 3
    • 8
  • n

    Nesh

    11/01/2019, 6:06 PM
    I was there and felt the same way.
  • a

    ArcticSpaceFox

    11/01/2019, 6:44 PM
    Well hello
  • a

    ArcticSpaceFox

    11/01/2019, 6:52 PM
    I wanted to ask if in prisma2 there could be a question if it should use yarn or npm, since yarn is way faster 😛 If that's stupid then please tell me, cause I am new to this 🙂
  • s

    Sullivan Senechal

    11/01/2019, 7:35 PM
    @ArcticSpaceFox yarn and npm are both usable since prisma is a npm package. I'm not sure to understand your question. 🤔
  • r

    Rocketninja16

    11/01/2019, 8:47 PM
    Hello all, Quick question about your experiences deploying Prisma from an existing Postgresql database. It introspects fine for me, but when I try and deploy the service, I get an error from Postgresql stating some fields already exist. The only way I can bypass this is by deleting the offending table and letting Prisma re create them, but then I lose the data. My understanding from the docs and the getting started page is that I should be able to launch a service from an existing DB without issue and without data loss. Is there something fundamental I'm missing here from the way Prisma deploys the service? I don't see why Prisma would need to create a table if it's already there? Am I missing a setting in my docker-compose file perhaps? Thanks!
  • j

    Jose Segura

    11/01/2019, 9:24 PM
    hi
  • j

    Jose Segura

    11/01/2019, 9:25 PM
    i have somethings issues with prisma. When try to make a deploy i get this error.
  • a

    ArcticSpaceFox

    11/01/2019, 9:27 PM
    Simple, just add your auth token to your header 😛
1...327328329...637Latest