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

    faure

    07/30/2018, 9:43 PM
    @chrisbull many thanks, the @default directive will be useful
  • f

    faure

    07/30/2018, 9:44 PM
    What if I have some rules for the default values? Say, when creating a new column, if another column has value True then the new column should have False and viceversa?
  • j

    Jim

    07/31/2018, 11:46 AM
    Is anyone having issues with Heroku hosting? I have 2 dynamos so Im paying $50 / month. The only traffic is myself testing my site but Im still getting warnings for going over my maximum memory usage.
    j
    • 2
    • 1
  • h

    harmony

    07/31/2018, 12:52 PM
    Welcome to the jvm
    đź‘€ 2
  • h

    harmony

    07/31/2018, 12:53 PM
    đź‘€
    🦜 1
  • d

    Darryl

    07/31/2018, 2:00 PM
    Hi. I’m pretty new to GraphQL and Prisma and wondered if I could get some help. According to the docs, there’s a DateTime type that can be used in the schema (for createdAt, etc.). If I want to save a user’s date of birth, for example, I could have dateOfBirth: DateTime in the schema but I’m not sure how I’d handle this on the client-side. I’m using Apollo’s Mutation component and when writing the mutation I don’t know the type of dateOfBirth that I’m sending as part of the mutation. DateTime is just a Prisma thing, right?
  • d

    Darryl

    07/31/2018, 2:03 PM
    For example: I’m using React Native’s DatePickerIOS component and when a date is selected it returns what looks like 2018-07-31T140215.539Z (ISO 8601, I believe). The type of this is an object (not a string?) so what do I use for the type in the mutation?
  • g

    Gomah

    07/31/2018, 2:04 PM
    Your returned value
    2018-07-31T14:02:15.539Z
    is a “String” in your language, but interpreted as a DateTime in your schema; If you use the ISO 8601 format, you should be fine 👍
  • d

    Darryl

    07/31/2018, 2:06 PM
    But in the React Native app, I can log the type of what’s returned from the date picker and it’s object.
  • g

    Gomah

    07/31/2018, 2:13 PM
    I’m not familiar with RN, the date-picker probably returns a date object, not the ISOString you actually want to store, maybe just pass the date as string in your mutation using
    toISOString()
    ?
  • d

    Darryl

    07/31/2018, 2:19 PM
    Thanks. This is exactly what I get when I log what’s returned from the DatePicker (followed by its type)
    2018-07-31T14:02:15.539Z object
    I guess, as you said, I can use toISOString() to get what I want. Providing this works then, the type of dateOfBirth in my Apollo mutation would be “string” and the type received in the resolver can be DateTime, right?
    g
    • 2
    • 7
  • k

    Kien Vo

    07/31/2018, 2:40 PM
    c
    • 2
    • 7
  • c

    captaindaylight

    07/31/2018, 2:46 PM
    Copy code
    type User {
      id: ID! @unique
      email: String! @unique
      password: String!
      trips: [Trip!]! @relation(name: "TripsTraveling")
      ownedTrips: [Trip!]! @relation(name: "OwnedTrips")
    }
    
    type Trip {
      id: ID! @unique
      travelers: [User!]! @relation(name: "TripsTraveling")
      owner: User! @relation(name: "OwnedTrips")
    }
  • c

    captaindaylight

    07/31/2018, 2:47 PM
    I have trip and user relation
  • c

    captaindaylight

    07/31/2018, 2:47 PM
    but I'm getting an error:
    ERROR: There is a relation ambiguity during the migration. Please first name the old relation on your schema. The ambiguity is on a relation between Trip and User. Please name relations or change the schema in steps.
    m
    • 2
    • 5
  • c

    captaindaylight

    07/31/2018, 2:47 PM
    any thoughts?
  • c

    captaindaylight

    07/31/2018, 2:48 PM
    I'm looking at the relations in docs
  • c

    captaindaylight

    07/31/2018, 2:48 PM
    https://www.prisma.io/docs/reference/service-configuration/data-model/data-modelling-(sdl)-eiroozae8u#the-@relation-directive
  • c

    captaindaylight

    07/31/2018, 2:49 PM
    and following the "Using the name argument of the @relation directive" section
  • n

    Nick Luger

    07/31/2018, 4:34 PM
    Cannot upgrade our Prisma-hosted cluster. The new version drop-down does not work / is not selectable. Tried Safari & Chrome.
    d
    • 2
    • 4
  • h

    hez

    07/31/2018, 6:08 PM
    Using prisma binding, the following query is failing and is just returning all vehicles. I'm having a hard time finding docs on querying for the presence or absence of relations in prisma binding... anybody know what I'm doing wrong here?
    Copy code
    const vehicles =  await this.db.query.vehicles({
            filter: {
              driver_not: null,
            },
          }, '{vehicleID, driver {driverID}}')
    • 1
    • 1
  • a

    Anthony Fadale

    07/31/2018, 6:25 PM
    Does anyone have any experience with authentication using Vue/Apollo and django-graphql-jwt ?
  • z

    Zach

    07/31/2018, 8:04 PM
    Anyone know how to view prisma logs? prisma logs is deprecated and prisma cluster logs has been removed.
    d
    • 2
    • 1
  • z

    zonofthor

    07/31/2018, 8:42 PM
    Choosing database for Prisma... I'm guessing the choice doesn't matter if it''s sql/nosql/postgres... if I'm starting a fresh project (not importing data). Is there anything later on that might be affected by my choice?
    d
    • 2
    • 6
  • z

    Zach

    07/31/2018, 8:48 PM
    Looks like prisma is having intermittent connectivity issues!
    d
    • 2
    • 1
  • h

    hez

    07/31/2018, 9:10 PM
    Question: Does Prisma safeguard against SQL injection, or do we need to care for that manually?
    d
    • 2
    • 3
  • m

    Mr. Bell

    07/31/2018, 9:43 PM
    @divyendu quick question, idk if you could answer this right away, but once i run
    docker-compose up -d
    I should be able to exec into the running container by running
    docker-compose exec prisma /bin/bash
    which I can but then i can't find the directory where prisma.yml is placed.
    d
    • 2
    • 2
  • m

    Mr. Bell

    07/31/2018, 9:43 PM
    I get the following directorys
  • m

    Mr. Bell

    07/31/2018, 9:43 PM
    Copy code
    bash-4.4# ls
    app    dev    home   lib64  mnt    proc   run    srv    tmp    var
    bin    etc    lib    media  opt    root   sbin   sys    usr
  • m

    Mr. Bell

    07/31/2018, 9:43 PM
    am i missing something ?
1...929394...637Latest