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

    Jscott388

    06/19/2019, 2:39 PM
    Has anyone used Prisma as a search source? Like elastic search. Could I use GraphQL for searching? Or is elastic search going to be a better choice?
    z
    • 2
    • 2
  • s

    ScottAgirs

    06/19/2019, 2:54 PM
    [SOLVED]:
    connect
    field was missing due to absence of a field with
    @unique
    directive
    No
    connect
    field on
    BuildingCreateManyWithoutCoursesInput
    . I have two identical datatypes (
    Home
    ,
    Apartment
    ) that relate to another (
    Building
    ) and for some reason Prisma generated
    connect
    field for
    Home
    &
    Apartment
    , but not for
    Building
    to
    Home
    . Any ideas?
    Copy code
    type Home {
      id: ID! @id
      buildings: [Building]
      slug: String! @unique
    }
    
    type Building {
      id: ID! @id
      homes: [Home]
      apartments: [Apartment]
      slug: String! @unique
    }
    
    type Apartment {
      id: ID! @id
      buildings: [Building]
      slug: String! @unique
    }
    Trying to connect Apartment to Building, when creating new Apartment
    j
    j
    +2
    • 5
    • 10
  • a

    Adrian Lineweaver

    06/19/2019, 5:33 PM
    hello
    👋 1
  • s

    Synthseth

    06/19/2019, 7:39 PM
    What are the reasons for the Rust rewrite? I just read the post on Prism v2 and I am interested in the decision because I was looking into learning Rust eventually.
    ✅ 1
  • s

    Synthseth

    06/19/2019, 7:42 PM
    Sorry for asking. It was already mentioned here https://www.prisma.io/blog/prisma-2-is-coming-soon-mwwfhevie993/ .
    👍 2
  • i

    impowski

    06/19/2019, 7:54 PM
    Hey guys,
    tslint
    gives me this error and I don’t know how to fix it, I’m using a `Prisma2`:
    Module '@generated/photon' is not listed as dependency in package.json
    • 1
    • 1
  • b

    Bkc

    06/19/2019, 9:28 PM
    Not looking for a easy pass, but I have been stuck understanding multi-tenancy, and I was hoping if someone could correct me. As pictured, that is how I am looking for my architecture to look like. Please let me know if my logical processes are correct. I'd have a total of 4 deployments to Heroku PLUS 2 deployments for every tenant (1) product data/prisma server (2) aggregate data/prisma server (3) the yoga server (all revolvers are shared among tenants, restricts certain fields through directives so only the SaaS owner can access those fields ) (4) admin sub-domain (so tenants can mutate data) for each tenant (5) order, customer data/ prisma server (postgres database is not shared, but prisma server that runs on top is shared) (6) tenant sub-domain For every tenant, I create a prisma service with
    prisma-multi-tenant
    . It will do the following
    (1) Create a unique database instance by copying datamodel.prisma (2) Connect the unique database to a shared Prisma/Heroku server (3) Connect each tenant to the product data/server
  • g

    gem

    06/20/2019, 3:44 AM
    i have a websocket error in production using subscriptions, but works fine
  • g

    gem

    06/20/2019, 3:44 AM
    did it happens to someone ?
  • g

    gem

    06/20/2019, 3:44 AM
    [Error] WebSocket connection to ‘wss://xxx.com/subscriptions’ failed: WebSocket is closed before the connection is established.
  • s

    Synthseth

    06/20/2019, 5:34 AM
    Say we have a basic Post -> User mapping. Upon a createPost Mutation, can you return the author(User) along with it? It seems that it will only return post contents while connect will just establish the link between post and author.
    • 1
    • 1
  • a

    arto

    06/20/2019, 5:38 AM
    Anyone have a friend / co-worker who would like to have a ticket to GraphQL Conf today & tomorrow? I have one spare 🙂 https://twitter.com/artoliukkonen/status/1141447560944586758
  • a

    Armaan Dhanji

    06/20/2019, 6:05 AM
    any update on if the talks from Prisma Day will be posted online? Really hoping to see some of them..
    1️⃣ 2
    ➕ 3
    h
    n
    • 3
    • 2
  • w

    welink

    06/20/2019, 9:37 AM
    看见你
  • t

    Tanjim Hossain

    06/20/2019, 10:27 AM
    i've no idea why env(DB_URL) or env("DB_URL") is not working 😞
  • v

    vnadygin

    06/20/2019, 10:47 AM
    Hey guys. I am using prisma for a long time and so happy about it. But I have a problem, I am trying to use Prisma with Digital Ocean managed database. After following all instructions am getting an error:
    Copy code
    WARNING: SQLException occurred while connecting to <http://db-postgresql-lon1-28856-do-user-3676973-0.db.ondigitalocean.com:25060|db-postgresql-lon1-28856-do-user-3676973-0.db.ondigitalocean.com:25060>
    prisma_1  | org.postgresql.util.PSQLException: FATAL: database "postgres" does not exist
    Copy code
    environment:
          PRISMA_CONFIG: |
            port: 4433
            # uncomment the next line and provide the env var PRISMA_MANAGEMENT_API_SECRET=my-secret to activate cluster security
            # managementApiSecret: my-secret
            databases:
              default:
                connector: postgres
                host: <http://db-postgresql-lon1-28856-do-user-3676973-0.db.ondigitalocean.com|db-postgresql-lon1-28856-do-user-3676973-0.db.ondigitalocean.com>
                database: defaultdb
                schema: public
                user: doadmin
                password: password
                ssl: true
                rawAccess: true
                port: 25060
                migrations: true
  • v

    vnadygin

    06/20/2019, 10:48 AM
    Looks like
    database: defaultdb
    is not passing to the config
  • g

    gem

    06/20/2019, 11:12 AM
    i put prisma in prod thanks to https://www.prisma.io/tutorials/deploy-prisma-to-aws-fargate-ct14 works very well. However the aws fargate endpoint is http, could it be https ? anyone had that problem before ?
    h
    • 2
    • 1
  • j

    Jovaanc

    06/20/2019, 1:20 PM
    Hi, do you speak english?
  • j

    Jovaanc

    06/20/2019, 1:21 PM
    french* sorry
  • j

    Jovaanc

    06/20/2019, 1:22 PM
    I've a problem with prisma, I installed prisma-cli and just after choosing "use existing database" it crashes, I can't choose, everything is blocked...
  • j

    Jovaanc

    06/20/2019, 1:23 PM
    it's the same if I choose "create new databases"
  • c

    Corey Snyder

    06/20/2019, 2:26 PM
    Does Prisma fund
    <https://www.howtographql.com>
    ? Curious b/c they’re so tightly integrated and referenced. I don’t mind either way. Prisma has been a pleasure to work with.
    t
    n
    • 3
    • 2
  • c

    Corey Snyder

    06/20/2019, 2:29 PM
    These have been quite enlightening.
  • c

    Corey Snyder

    06/20/2019, 3:16 PM
    Is there a design pattern that offers a more conventient way to not have to retype roughly the same info into your datamodel.prisma
    Copy code
    type FlightController{
        id: ID! @id
        name: String!
        releaseDate: DateTime!
        uarts: Int!
        GyroOne: Float
        GyroTwo: Float
        weightInGrams: Float
        cpu: String!
        dimensions: String
        holePattern: String!
        voltageInputMin: Float!
        voltageInputMax: Float!
        osd: Boolean!
        accelerometer: Boolean!
        barometer: Boolean!
        spektrumPort: Boolean!
        usbInterface: Boolean!
        LedWS2812Support: Boolean!
        RSSIPad: Boolean!
        currentSensor: Boolean!
        beeperPad: Boolean!
        beeperOnBoard: Boolean!
        antiVibrationGrommets: Boolean!
        builtInReceiver: String #"CROSSFIRE/DSMX/FRSKY"
        postedBy: User
    }
    schema.graphql Query
    Copy code
    type FlightController {
      id: ID!
      name: String!
      releaseDate: String!
      uarts: Int!
      weightInGrams: Float
      cpu: String!
      dimensions: String!
      holePattern: String!
      voltageInputMin: Float!
      voltageInputMax: Float!
      osd: Boolean!
      accelerometer: Boolean!
      barometer: Boolean!
      spektrumPort: Boolean!
      usbInterface: Boolean!
      ledOutput: Boolean!
      builtInReceiver: ReceiverProtocol
    }
    and then again in your mutation
    Copy code
    type Mutation {
        addFlightController(
          # ... all the things here again
        ) : FlightController!
    }
    t
    • 2
    • 1
  • c

    Corey Snyder

    06/20/2019, 3:17 PM
    This last part is where I’m unsure of b/c those are properties defined of the function, so I don’t think I can just drop an object in there w/ the spread operator right? It seems broken to have to go and update the same list of items in 3 different places.
  • t

    tafelito

    06/20/2019, 5:37 PM
    having this schema
    Copy code
    type User {
      id: ID! @id
      email: String! @unique
      password: String!
      name: String
      cart: UserCart
    }
    type CartItem {
      id: ID! @id
      product: Product!
      quantity: Float!
    }
    
    type UserCart {
      id: ID! @id
      user: User! @relation(link: INLINE)
      items: [CartItem]
    }
    how can I query UserCart by user id?
  • t

    tafelito

    06/20/2019, 5:40 PM
    I know I can do userCarts and use the where there, but I was wondering if it’s possible to query just 1 item with a filter
    b
    • 2
    • 8
  • r

    rein

    06/20/2019, 5:48 PM
    Is there anyone here that played a bit with Prisma 2 / nexus and was able to get autocomplete when adding field definitions in your objectType
    d
    • 2
    • 1
  • m

    Mike Stecker

    06/20/2019, 7:33 PM
    Still learning here but I have a question on deleting things that I'm trying to wrap my brain around. Say I have this schema:
    Copy code
    type User {
      id: ID! @id
      email: String! @unique
      password: String!
    }
    type BlockUser {
      id: ID! @id
      user: User! @relation(name: "UserBlocking")
      blocked: User! @relation(name: "UserBlocked")
      dateBlocked: DateTime! @createdAt
    }
    If one of the two users is deleted, would the entire entry here be deleted? I tried adding
    , onDelete: CASCADE
    to both `@relation`'s but when I delete a user in the Prisma admin (http://localhost:4466/_admin), it goes to a white screen and seems to freak out because a page reload in the browser shows nothing happened when I tried to delete one of these two users.
    j
    • 2
    • 38
1...283284285...637Latest