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

    jdoyle112

    09/13/2018, 5:49 PM
    I don’t understant why I would need to define every crud operation on the server when prisma is supposed to expose all those operations through their api
  • p

    patrickdevivo

    09/13/2018, 5:49 PM
    so
    prisma
    creates a graphql api for your database(s) with all the crud operations, which you can then call in your own graphql server, which you will have to set-up and define
  • p

    patrickdevivo

    09/13/2018, 5:50 PM
    the point is that you probably dont want to expose every crud operation to your frontends
  • p

    patrickdevivo

    09/13/2018, 5:50 PM
    but that might be your use case, if so then you wont need an intermediate graphql server
  • p

    patrickdevivo

    09/13/2018, 5:51 PM
    some operations you might want to jsut “pass through” which you can do easily
  • p

    patrickdevivo

    09/13/2018, 5:51 PM
    if you look on the homepage, there’s some good examples in the with/without prisma: https://www.prisma.io/
  • j

    jdoyle112

    09/13/2018, 5:52 PM
    Ok gotcha, thanks. So is it basically an ORM for graphql?
  • j

    jdoyle112

    09/13/2018, 5:56 PM
    The reason I ask is I really like everything graphcool offers but the shared hosting for it is performing terribly. My requests take multiple seconds. So I thought I’d check out prisma… but maybe I should just look into self hosting for graphcool.
  • j

    Jerry Jäppinen

    09/13/2018, 5:58 PM
    What I personally find super convenient with Prisma is that you can use it to prop up a new database locally or on any hosting provider based on your schema. As a service they also provide Heroku integration which is super nice in theory, but still has a few quirks still
  • j

    jdoyle112

    09/13/2018, 6:19 PM
    Thanks for the help guys, makes more sense now
  • c

    Chris

    09/13/2018, 6:26 PM
    I noticed an issue when using the “request” method with javascript prisma-binding library. Depending on the server’s location I get different results. In some cases the response object has the property “data”, and others it excludes it. For example: My server in NYC
    Copy code
    const result = await client.request(`
      query {
        users {
          id
        }
      }
    `);
    
    console.log(result)
    >> {"data":{"users":[{"id":"SOMEUSERID"},]}}
    My server in DC area:
    Copy code
    console.log(result)
    >> {"users":[{"id":"SOMEUSERID"},]}
    Has anyone else experienced this issue?
  • m

    Moritz

    09/13/2018, 8:10 PM
    Hi, what If I wanted to expose an existing graphql-api trough a gateway, but I would want to override a type field, i.e. replace
    author: String!
    by a locally defined type like
    author: User!
    on a
    Post
    type. Now, when I query the existing api through its binding passing the
    info
    object, it will complain about the
    info
    object, since the
    author
    field specified there is no longer of the scalar type
    String
    but of an object type
    User
    , which is unexpected for the exposed api. Is there a more elegant way to solve this issue then to modify the
    info
    object? Thanks for your input!
    ✅ 1
    • 1
    • 1
  • z

    zstrike

    09/13/2018, 11:04 PM
    I commented on this issue already but hoping someone here might have some insight on the magical back relations. (https://github.com/prisma/prisma/issues/2693) Are we no longer able to use these back relations in our resolvers? We were using them and now they are no longer generated when doing a codegen to our server. They are still generated when deploying locally though. Is there a recommended way to reverse lookup through types? We have the following resolver that no longer seems to work remotely:
    Copy code
    async getDebitTransactionsForWriteOffReport(_, args, ctx: Context, info) { return ctx.db.query.debitTransactions({ where: { _MagicalBackRelation_DebitTransactionsInClaim_every: { _MagicalBackRelation_ClaimsForPatient_every: { _MagicalBackRelation_PatientsInWriteOffReport_every: { id: args.id } } } } }, info)
    d
    • 2
    • 1
  • a

    Andres Montoya

    09/14/2018, 4:43 AM
    Hi someone know how can I save the state of redux in the localstorage on nextjs?
    l
    h
    • 3
    • 17
  • a

    Angel Martinez

    09/14/2018, 1:57 PM
    Hello everyone! I had a DB generated with prisma datamodel, when I make the introspection of this database the datamodel generated looks like. And when I try to run
    prisma deploy
    the following error occurs:
    Could not find the model table _UserHasProfile in the database
    Does anyone know how to solve this?
    -.txt
    s
    • 2
    • 1
  • t

    Tracy

    09/14/2018, 3:19 PM
    anyone else having widespread timeouts on the simple API? (back up after about 5 minutes down, this seems to happen a lot)
    d
    g
    • 3
    • 13
  • a

    aman06

    09/14/2018, 3:23 PM
    I noticed when prisma deploy locally, the magical back relation functions exist but when I prisma deploy to my service, the magical back relations get removed. Is this expected behavior and if so, is there a way to use magical back relation?
    d
    • 2
    • 3
  • d

    dennisko

    09/14/2018, 3:38 PM
    can anyone point me to a working prisma-client-typescript repo/example?
    d
    • 2
    • 6
  • h

    hw

    09/14/2018, 3:50 PM
    How do I get the client IP address ?
  • e

    Errorname

    09/14/2018, 4:17 PM
    Hi everyone. prisma green I am currently looking into the security of my app with Prisma. I am wondering: how do I protect the Prisma Server (not my backend) against unwanted requests ? I found documentation on how to protect the management api (with management_api_secret). But I can't find informations about how to secure the rest (services/endpoints). Do you guys have information on this ?
    h
    p
    m
    • 4
    • 13
  • s

    Simme

    09/14/2018, 5:44 PM
    Is forwardTo removed in Prisma client?
    d
    • 2
    • 1
  • c

    cedric

    09/14/2018, 8:29 PM
    Second, inputs and outputs are hashes
    a
    • 2
    • 1
  • d

    D.C. Thompson

    09/14/2018, 8:35 PM
    What about SQLite adapter?
    ☝️ 1
    👀 1
    p
    s
    • 3
    • 5
  • e

    ericsonluciano

    09/14/2018, 11:57 PM
    Hey everyone need some help after not working with prisma few months and i try to make it again here my issue when
    prisma deploy
    Copy code
    User
        ✖ You are creating a required relation, but there are already nodes that would violate that constraint.
      Department
        ✖ You are creating a required relation, but there are already nodes that would violate that constraint.
    here my datamodel
    Copy code
    type Department {
      createBy: User! @relation(name: "DepartmentsByUser")
      company: Company! @relation(name: "CompanyDepartments")
    }
    
    type Company {
      id: ID! @unique
      createBy: User! @relation(name: "CompanyByUser")
      department: [Department!]! @relation(name: "CompanyDepartments", onDelete: CASCADE)
    }
    
    type User {
      id: ID! @unique
      department: [Department!]! @relation(name: "DepartmentsByUser", onDelete: CASCADE)
      company: Company! @relation(name: "CompanyByUser", onDelete: CASCADE)
    }
    h
    w
    • 3
    • 3
  • v

    vacom

    09/15/2018, 12:41 AM
    Hey guys where can I find some good tuts on prisma version 1.17?
  • x

    Xiaoyun Yang

    09/15/2018, 3:10 AM
    With the new prisma-client, how can we conveniently import the generated type to our app's
    schema.graphql
    like we previously did from
    src/generated/prisma.graphql
    ? Do we need to copy and paste the type to
    schema.graphql
    now? Previously I think we can do
    # import User from './generated/prisma.graphql'
    if we want to use the
    User
    type in
    schema.graphql
    , but now in prisma-client, the schema is defined in a
    .js
    file and I am not sure how to import that.
    g
    • 2
    • 2
  • e

    ericsonluciano

    09/15/2018, 5:40 AM
    Anyone have idea how i can implement mutation with nested / relation i’m still figure out how this you see all my question at hereh https://www.prisma.io/forum/t/mutations-nested/4430
  • p

    perseon

    09/15/2018, 9:40 AM
    hello. I would like to migrate a database and I think I'll manage to generate the normalized data format. I have one single problem: What do I have to take into account when generating the 15 bytes IDs? They aren't completely random as far as I can see.
  • m

    Moritz

    09/15/2018, 11:32 AM
    Hi, how does
    graphql-import
    work? This is my situation:
    Copy code
    type Query {
      object(where: ObjectWhereUniqueInput!): Object
    }
    FAILS, unknown type
    ObjectWhereUniqueInput
    . Adding
    Copy code
    # import ObjectWhereUniqueInput from "./schemas/object-service.graphql"
    solves the issue. However, adding
    Copy code
    # import huhu from "./schemas/object-service.graphql"
    Also solves the issue. Is this a bug or am I overlooking something? Should I open an issue?
  • j

    Jerry Jäppinen

    09/15/2018, 3:50 PM
    Has anyone installed Prisma on DigitalOcean? I’m following this guide but stuck at step 10: https://www.prisma.io/docs/1.14/tutorials/deploy-prisma-servers/digital-ocean-(docker-machine)-texoo9aemu
    • 1
    • 2
1...118119120...637Latest