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

    Enitan

    04/20/2019, 12:24 PM
    Getting an error, in the db I can see:
  • e

    Enitan

    04/20/2019, 12:24 PM
    ERROR: relation "public.users_permissions" does not exist
    s
    • 2
    • 2
  • e

    Enitan

    04/20/2019, 12:25 PM
    but in my datamodel I do have a relationship:
  • e

    Enitan

    04/20/2019, 12:25 PM
    Copy code
    enum Permission {
      ADMIN
      SUPERUSER
      USER
    }
    
    type User @db(name: "users") {
      id: ID! @id
      firstName: String
      lastName: String
      createdAt: DateTime! @createdAt
      updatedAt: DateTime! @updatedAt
      phoneNumber: String
      permissions: [Permission!]! @scalarList(strategy: RELATION)
      emailVerified: Boolean! @default(value: false)
    }
    
    type LocalUser @db(name: "local_users") {
      id: ID! @id
      email: String! @unique
      password: String!
      resetToken: String
      resetTokenExpiry: Float
      user: User! @relation(link: INLINE)
      createdAt: DateTime! @createdAt
      updatedAt: DateTime! @updatedAt
    }
  • e

    ezeikel

    04/20/2019, 1:02 PM
    Hey! I have a
    profilePicture
    field on my
    User
    type that is being returned as null even though I can see the data is there in the database. I have the following setup:
    Copy code
    // datamodel.prisma
    
    enum ContentType {
      IMAGE
      VIDEO
    }
    
    type Content @embedded {
      type: ContentType! @default(value: IMAGE)
      url: String
      publicId: String
    }
    
    type User {
      id: ID! @id
      name: String
      username: String! @unique
      profilePicture: Content
      website: String
      bio: String
      email: String! @unique
      phoneNumber: Int
      gender: Gender! @default(value: NOTSPECIFIED)
      following: [User!]! @relation(name: "Following", link: INLINE)
      followers: [User!]! @relation(name: "Followers", link: INLINE)
      likes: [Like!]! @relation(name: "UserLikes")
      comments: [Comment!]! @relation(name: "UserComments")
      password: String!
      resetToken: String
      resetTokenExpiry: String
      posts: [Post!]! @relation(name: "Posts")
      verified: Boolean! @default(value: false)
      permissions: [Permission!]! @default(value: USER)
      createdAt: DateTime! @createdAt
      updatedAt: DateTime! @updatedAt
    }
    Copy code
    // schema.graphql
    
    type User {
      id: ID!
      name: String!
      username: String!
      profilePicture: Content
      website: String
      bio: String
      email: String!
      phoneNumber: Int
      gender: Gender!
      following: [User!]!
      followers: [User!]!
      verified: Boolean
      posts: [Post!]!
      likes: [Like!]!
      comments: [Comment!]!
      permissions: [Permission!]!
    }
    Like I said there is data in the database but when I run the below query in Playground I get `null`:
    Copy code
    // query
    {
      user(id: "5c8e5fb424aa9a000767c6c0") {
        profilePicture {
          url
        }
      }
    }
    Copy code
    // response
    {
      "data": {
        "user": {
          "profilePicture": null
        }
      }
    }
    Any idea why?
    ctx.prisma.user(({ id }), info);
    doesn’t return
    profilePicture
    even though the field exists in
    generated/prisma.graphql
  • c

    CCBCodeMonkey

    04/20/2019, 3:44 PM
    @ezeikel everything you are doing looks right to me
  • c

    CCBCodeMonkey

    04/20/2019, 3:46 PM
    you are sure there is data there? like if you run an update query to that user immediately before running your query to get the profile picture you get nothing?
  • c

    CCBCodeMonkey

    04/20/2019, 3:46 PM
    also with this
    ctx.prisma.user(({ id }), info);
    you might have to add a fragment to get the sub fields for profilePicture
  • c

    CCBCodeMonkey

    04/20/2019, 3:48 PM
    like well you are passing info, so you shouldn't have to, but the way yours works is different than mine, mine would be like ctx.db.prisma.user, to use prisma binding which accepts info
    e
    • 2
    • 4
  • a

    Alexandre Alencar Vilela

    04/20/2019, 4:27 PM
    Hi everyone,
  • a

    Alexandre Alencar Vilela

    04/20/2019, 4:28 PM
    I have a problem with
    prisma generate
    on version 1.31.1
  • a

    Alexandre Alencar Vilela

    04/20/2019, 4:28 PM
  • a

    Alexandre Alencar Vilela

    04/20/2019, 4:29 PM
    I could not find any similar issue on github
  • a

    Alexandre Alencar Vilela

    04/20/2019, 4:32 PM
    Just read the guidelines and will open an issue on GH
    s
    • 2
    • 1
  • w

    Wallop

    04/20/2019, 5:21 PM
    Trying to run prisma on an invision forum database, any way to avoid this error?
    Copy code
    Syntax Error: Unexpected single quote character ('), did you mean to use a double quote (")?
    
    GraphQL request (77:73)
    76:   entryLocked: Boolean @db(name: "entry_locked") @default(value: 0)
    77:   entryMetaData: Boolean! @db(name: "entry_meta_data") @default(value: b'0')
                                                                                ^
    78:   entryName: String @db(name: "entry_name")
  • a

    alexis

    04/20/2019, 7:12 PM
    hi all, would this be the right channel to ask questions about the graphql playground electron app?
  • a

    Akrem

    04/20/2019, 8:37 PM
    Hi there, could anyone help with this https://www.prisma.io/forum/t/user-is-not-allowed-to-do-action-find-on-prisma-migration/6776
  • g

    Gints Polis

    04/21/2019, 4:54 AM
    I imagine there is some improvements for generated typescript client. (I would like to know what people think, before I do somthing about it) • would like to be able to switch to [Standard](https://standardjs.com/) formating • generated code should be ready to publish as NPM package, so I can use it as dependency for other microservices. • ability to register client for service discovery like [Consul](https://www.consul.io/)
  • e

    ericsonluciano

    04/21/2019, 6:11 AM
    anyone here have idea to implement this and how transfer points work in graphql? for example i have a 2 user and 1 user will send a points to other user using random number to generated user id.
  • y

    YErii

    04/21/2019, 7:41 AM
    is this some bug? in the datamodelv1.1, we can set the id field with the decorator @sequence(name: … initialValue: … allocationSize: 123), but it seems not to restrict the size in deed even if we insert 124 records
  • m

    mux

    04/21/2019, 7:43 AM
    how do we use scalar lists with basic scalar types (strings, int, etc) in datamodel 1.1? the documentation for 1.31 shows that it can still be used like this, but it doesn't work:
    Copy code
    type Article {
      tags: [String!]!
    }
  • m

    mux

    04/21/2019, 7:43 AM
    that example returns an error:
    Valid values for the strategy argument of '@scalarList' are: RELATION.
    y
    p
    h
    • 4
    • 13
  • p

    prilutskiy

    04/21/2019, 12:55 PM
    I’m trying to fetch entities using the following where clause:
    entities({ where: { field: null } })
    However, seems like TS client uses
    field?: string
    instead of
    field?: string | null
    Any workarounds for this?
  • r

    Rafael Gamboa

    04/22/2019, 2:00 AM
    Hi how are you? i'm learning to use Prisma, but i have a problem, Docker, my pc doesn't support Docker, there´s a way of use Prisma without Docker?
    n
    • 2
    • 1
  • d

    Danilo

    04/22/2019, 2:12 AM
    Use Prisma Cloud
  • r

    Rafael Gamboa

    04/22/2019, 2:15 AM
    But i work with localhost
  • r

    Rafael Gamboa

    04/22/2019, 2:26 AM
    There´s a way without Docker?
    z
    • 2
    • 2
  • l

    Lukas

    04/22/2019, 2:27 AM
    I don’t think there is. The official guide only mentioned Docker and Prisma Cloud, when it comes to Prisma.
  • a

    Andrew

    04/22/2019, 2:58 AM
    Hey all! I'm having some issues 403'ing with the playground. I'm using SAM dev and api-gateway. anywhere I should start troubleshooting?
  • v

    Vikas Kundu

    04/22/2019, 5:09 AM
    Hey all! I'm new to prisma. I am getting an error on
    Copy code
    const data = await context.prisma.analytics({
          where: {ipUrl_contains: args.filter }
      })
    . Is there an issue with how i wrote where filter?
    a
    n
    • 3
    • 6
1...258259260...637Latest