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

    freshtonic

    08/14/2019, 1:06 AM
    Are there any plans to provide an Elixir Prisma client?
    ❤️ 1
    h
    • 2
    • 2
  • c

    conor

    08/14/2019, 2:21 PM
    Hi I'm looking to hire a Prisma developer for a part time 2 month role, experienced in using Prisma with the following stack React.js / Node.js / GraphQL.. I can be reached on Skype id magictime.uk
    🙂 1
    🤟 1
  • t

    tafelito

    08/14/2019, 6:23 PM
    Having this schema
    Copy code
    type Product {
      id: ID! @id
      ....
    }
    
    type CartItem {
      id: ID! @id
      product: Product!
      quantity: Float!
      cart: Cart!
    }
    
    type Cart {
      id: ID! @id
      user: User! @relation(name: "Cart", link: INLINE)
      items: [CartItem] @relation(onDelete: CASCADE)
    }
    the CRUD operations generated by prisma does not allow to update a CartItem based on a product.id, is there any other way to do this other than manually add productId to the cartItem?
    Copy code
    type CartItem {
      id: ID! @id
      productId: ID! @unique
      product: Product!
      quantity: Float!
      cart: Cart!
    }
    Basically, I want to update an item of a Cart where instead of doing it by CartItem.id I want to do it by CartItem.product.id or even by Cart.id
  • r

    Ryan Rickerts

    08/14/2019, 8:16 PM
    Can anyone tell me with the latest version of Prisma 1.34 what is the story with migrations and default@default? I have an external MySQL database holding my data, and the seed worked out fine. All the data is there.
    prisma deploy
    seems to work, the GraphQL playground works, but when I go to Prisma Admin, I’m getting logs about
    Scheduling deployment for project default@default
    and
    prisma reset
    says: “Are you sure that you want to reset the data of default in stage default?” Where is this default@default getting created? Is it at all related to my docker-compose.yml that specified the Prisma config? Mine is something like the following:
    Copy code
    network_mode: host    
    environment:
          PRISMA_CONFIG: |
            port: 4466
            databases:
              proteus:
                connector: mysql
                host: 127.0.0.1
                database: nest_prisma1
                user: root
                password: changedThis
                rawAccess: true
                port: '3306'
                migrations: true
    Should it be looking for
    proteus@nest_prisma1
    ? Where would I change that configuration? The migration docs for Prisma v1.14 talk about ‘multi-tenancy’ and ‘single-tenant’ https://www.prisma.io/docs/reference/service-configuration/data-model/migrations-ao8viesh2r “Currently it is only possible to configure a single database and it has to be called default. In the future it will be possible to configure multiple named databases and use them from the same service.” but in the 1.34 docs this page does not look the same.
    • 1
    • 5
  • n

    Nelson Pecora

    08/14/2019, 8:55 PM
    Hey folks, I’ve got a nexus question (since I’ve finally been convinced that code-first makes sense for large projects). With
    nexus
    , where should I put business logic that I want to run when fetching/saving types? i.e. not just field resolvers, but whole types
    • 1
    • 7
  • a

    Andrew O.

    08/14/2019, 11:14 PM
    Is there a way to introspect multiple schemas on the Same DB and output the results to the same datamodel?
  • s

    Sebastian Berg

    08/15/2019, 9:23 AM
    Having problems when deploying a GraphQL/graphGL-yoga/react project on Heroku, any masters with a kind soul around that could have a look? https://github.com/SebastianBerg/bookingservice
    t
    • 2
    • 1
  • j

    Javid Abdullaev

    08/15/2019, 1:32 PM
    Hi guys! I'm kinda new to the GraphQL teck so got a question: I have used prisma in the backend with nest.js . I deployed it on prisma , tested it on prisma playground and its working just fine, but I am confused about how to use it with angular. How do i make an API call. As far as I understand I should use apollo client?
    d
    • 2
    • 4
  • k

    Karan Dwivedi

    08/15/2019, 4:19 PM
    Hi all! I have a Message model that implements custom authorization logic. If a Graphql endpoint accesses that message, I can test to see whether the viewer has permission or not. Suppose I want to list all messages a user can see. I can query with filters for the viewer and union all results. However, this leads to repetition of logic code (Same logic 2 times: In filtering for list query and in individual object query). Is it possible to to this in a better way?
  • r

    Ronnie Gauny

    08/15/2019, 5:46 PM
    I have more info for you on the Prisma deploy error #4724 if you introspect and there is the foreign key between the 2 tables the relationship shows in the generated model but when deploying it it tries to regenerate “alter” the table and add the relationship...idk why it’s trying to alter when migrations is set to false. Query is: ALTER TABLE portal_beta.publishers ADD COLUMN source_id int NULL , ADD FOREIGN KEY (source_id) REFERENCES portal_beta.sources(id) ON DELETE SET NULL; at org.mariadb.jdbc.internal.util.LogQueryTool.exceptionWithQuery(LogQueryTool.java:146) at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executeQuery(AbstractQueryProtocol.java:217) at org.mariadb.jdbc.MariaDbPreparedStatementClient.executeInternal(MariaDbPreparedStatementClient.java:218) ... 15 more this is on MySQL
    • 1
    • 1
  • j

    Jared

    08/15/2019, 6:42 PM
    quick question: In mongo, if there's an array, should i expect the order of the array to be preserved?
  • n

    Nelson Pecora

    08/15/2019, 6:51 PM
    oh wait. what’s the difference between
    @prisma/nexus
    and
    nexus
    on npm? also, is
    nexus-prisma
    a thing? (I’m generating
    @generated/nexus-prisma
    )
  • c

    Corey Snyder

    08/15/2019, 8:23 PM
    Last month I followed a tutorial to spin up a prisma DB & API using AWS Fargate. This month I got a bill for $46.97, with a projection of next month to be $96. WOW! 🤯 . Anyone know how much it should cost to get it running on Digital Ocean instead? $50+ is too expensive for a project which doesn’t really even get traffic yet.
    h
    • 2
    • 2
  • n

    Neal

    08/15/2019, 8:25 PM
    Can please somebody explain me when to use
    @relation
    and when not, to I can't find any clear reason 😞
  • n

    Neal

    08/15/2019, 8:25 PM
    Sometimes prisma complains when trying to deploy
  • n

    Neal

    08/15/2019, 8:26 PM
    sometimes not
  • n

    Neal

    08/15/2019, 8:26 PM
    😕
  • c

    Corey Snyder

    08/15/2019, 8:27 PM
    I use
    @relation
    when I have duplicate connections between two types that are for different purposes. Such as:
    Copy code
    addedFlightControllers: [FlightController!]! @relation(name: "AddedFlightControllers")
        editedFlightControllers: [FlightController!]! @relation(name: "EditedFlightControllers")
    🙂 1
  • c

    Corey Snyder

    08/15/2019, 8:27 PM
    I also started using it b/c I feel like it helps document my connections between types. So I mostly always use them with names that make sense.
  • n

    Neal

    08/15/2019, 8:35 PM
    @Corey Snyder Hmm interesting, so you only define it on 1 side then?
  • n

    Neal

    08/15/2019, 8:35 PM
    Why doesn't it automatp then btw?
  • n

    Neal

    08/15/2019, 8:35 PM
    automap*
  • c

    Corey Snyder

    08/15/2019, 8:36 PM
    postedBy: User @relation(name: "AddedFlightControllers")
    << I define it on the other side too
  • l

    LQ

    08/15/2019, 8:36 PM
    when i have an inline relation, does prisma automatically sort the response by IDs when i do a query on it?
  • l

    LQ

    08/15/2019, 8:36 PM
    if yes, is there any way to stop that?
  • n

    Neal

    08/15/2019, 8:36 PM
    Still so confused 😕
  • n

    Neal

    08/15/2019, 8:37 PM
    Copy code
    type User {
    	id: ID! @id
    }
    
    type Company {
    	id: ID! @id
    	createdBy: User
    	members: [User!]!
    }
  • n

    Neal

    08/15/2019, 8:37 PM
    This is basically my case
  • n

    Neal

    08/15/2019, 8:38 PM
    Can I put 2x the
    @relation
    on the id of the
    User
    type then?
  • n

    Neal

    08/15/2019, 8:38 PM
    When I remove
    members
    it automaps
1...300301302...637Latest