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

    Fred The Doggy

    12/24/2021, 11:09 PM
    any idea what's wrong with this?
    Copy code
    prisma.server.create({
                data: {
                    id: guild.id,
                    groups: JSON.stringify([]),
                },
            });
    
    **Edit**: Nevermind
    m
    • 2
    • 1
  • f

    Fred The Doggy

    12/24/2021, 11:09 PM
    I'm getting
    TS2322: Type '{ id: string; groups: string; }' is not assignable to type '(Without<ServerCreateInput, ServerUncheckedCreateInput> & ServerUncheckedCreateInput) | (Without<...> & ServerCreateInput)'.   Object literal may only specify known properties, and 'groups' does not exist in type '(Without<ServerCreateInput, ServerUncheckedCreateInput> & ServerUncheckedCreateInput) | (Without<...> & ServerCreateInput)'
  • f

    Fred The Doggy

    12/24/2021, 11:09 PM
    my schema is as follows:
    Copy code
    model Server {
      id        String @id
      groups    String
      createdAt DateTime @default(now())
      updatedAt DateTime @updatedAt
    }
  • f

    Fred The Doggy

    12/24/2021, 11:09 PM
    specifically the groups line is marked as invalid
  • f

    Fishie

    12/25/2021, 11:48 AM
    https://github.com/prisma/prisma/discussions/10862a any help?
  • j

    Jin

    12/25/2021, 2:10 PM
    Hello everyone I realized that docker-compose is not supposed to run in Cloud Run. is there someone who opposes it ? 🦜
  • k

    Kristofer Pervin

    12/25/2021, 5:24 PM
    Is there a way to convert Prisma client types (such a
    Prisma.{Model}UpdateArgs
    ) into GraphQL types that don't conflict with Prisma client operations? Having to create them by hand using classes is time consuming for DTO and Services in NestJS, and various community generators dump everything into a specific folder that it messes up the
    nest generate resource
    structure
  • k

    Kristofer Pervin

    12/25/2021, 5:26 PM
    I tried using the
    prisma-nestjs-graphql
    generator and seem to get an error with comparing types
  • r

    Rune Jørgensen

    12/25/2021, 8:31 PM
    I think I remember not being able to set optional fields (defined with
    ?
    ) to NULL in prisma (meaning I had to use
    undefined
    in my TypeScript when "unsetting"/"nulling" a value), or did I misunderstand something 🙂? It seems to work fine now though (v. 3.7.0) , but then now `undefined´ doesn't work 🤔. Is it just me being insane, or does anyone know what I'm rambling about 😬?
    • 1
    • 1
  • a

    Anony Mous

    12/25/2021, 9:40 PM
    Hi everyone!
  • a

    Anony Mous

    12/25/2021, 9:40 PM
    I'm having some problems with relations
  • a

    Anony Mous

    12/25/2021, 9:41 PM
    Basically, I need to reuse a many-to-one relation for a one-to-one relation
  • a

    Anony Mous

    12/25/2021, 9:41 PM
    here is an example
  • a

    Anony Mous

    12/25/2021, 9:42 PM
    a person has books
  • a

    Anony Mous

    12/25/2021, 9:42 PM
    each book references its owner
  • a

    Anony Mous

    12/25/2021, 9:42 PM
    a person also has a favorite book
  • a

    Anony Mous

    12/25/2021, 9:43 PM
    I want to reuse the many-to-one relation
  • a

    Anony Mous

    12/25/2021, 9:43 PM
    but I can't figure out how to do that in prisma
    m
    c
    • 3
    • 8
  • j

    Jakub Figlak

    12/25/2021, 10:53 PM
    Merry Christmas everyone, I’m new here!:) I’m looking for some examples of advanced/complicated express rest apis using prisma for inspiration/reference for my own project (project architecture, controllers scaffolding best practices, etc). Could you please recommend something?
  • s

    Spencer Kifell

    12/26/2021, 3:01 AM
    How would i go about accessing prisma generated classes from client/prisma
  • s

    Spencer Kifell

    12/26/2021, 3:01 AM
    ie)
  • s

    Spencer Kifell

    12/26/2021, 3:02 AM
    Copy code
    expect(tmpUser instanceof user).toBe(true);
  • s

    Spencer Kifell

    12/26/2021, 3:02 AM
    would I have to import prisma client?
  • s

    Spencer Kifell

    12/26/2021, 3:03 AM
    "@prisma/client"
  • s

    Szymon Hrabia

    12/26/2021, 8:06 PM
    Hi! Im currently trying to create an util function “findOneBy” but i have a problem with Ts + Select. With my current implementation that function returns any | null sadparrot
    Copy code
    async findOneBy<T extends Prisma.UserSelect>(
        where: Prisma.UserWhereInput,
        select?: T,
      ) {
        return this.prisma.user.findFirst({
          where,
          select,
        });
      }
  • j

    Juan Carlos Blanco Delgado

    12/27/2021, 4:42 AM
    Hello 🙂
  • t

    Taylor Cantwell

    12/27/2021, 5:51 AM
    Hi guys, wondering if you can count the records returned using the fluent api somehow. For example, is it possible to count the amount of tweet likes returned in this example below. It doesn’t look like it .
    Copy code
    .findUnique({
            where: {
              id: tweet.id,
            },
          })
          .tweetLikes();
  • u

    user

    12/27/2021, 12:00 PM
    SemVer Explained #shorts

    https://www.youtube.com/watch?v=wvBuG89HFRc▾

    💭 Semantic versioning explained - this is what you can expect from the next Prisma versions 🧑‍💻 #shorts #semver #prisma
  • a

    Aaron Waller

    12/27/2021, 12:07 PM
    How to design the resolver when you have an “input” type in your TypeDefs? https://stackoverflow.com/questions/70494137/prisma-argument-is-missing-what-is-wrong-with-my-resolver
  • a

    Aaron Waller

    12/27/2021, 12:09 PM
    How exactly do I create the resolver for this mutation?
    Copy code
    type Mutation {
        createPost(postinput: CreatePostInput!): Post!
      }
    
    
      input CreatePostInput{
        name: String
        content: String
      }
1...526527528...637Latest