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

    Rashmi Bidanta

    10/23/2019, 1:11 PM
    also looks like a few links are broken in the README file
  • r

    Rashmi Bidanta

    10/23/2019, 2:51 PM
    @nikolasburk Is there a channel where we can discuss stuff related to migrating prisma1 to prisma2?
    n
    • 2
    • 2
  • c

    Carl Bowen

    10/23/2019, 5:56 PM
    Hi guys. Actively looking to get into the AWS ecosystem. Can anyone point me in the direction of resources to really learn and get to grips with it effectively please?
    d
    • 2
    • 2
  • c

    Corey Snyder

    10/23/2019, 6:00 PM
    I’ve got a SCHEMA question. Am I going about this relationship correctly? I have a bunch of products added to my DB, all of different types of drone parts denoted by the
    type
    property. Now I’m starting on the piece where
    DroneBuilds
    can be constructed of those parts.
    Copy code
    type DroneBuild{
      id: ID! @id
      frame: Product @relation(name: "DroneBuildFrame", onDelete: SET_NULL) # When a drone build is deleted, I don't care for anything to happen with the product. Does this need to be defined anyway?
    }
    
    type Product{
      id: ID! @id
      ...... lots more fields......
      type: ProductType! # FLIGHT_CONTROLLER, FRAME, ETC
      flightController: FlightController @relation(name: "ProductFlightController", link: TABLE, onDelete: CASCADE)
      motor: Motor @relation(name: "ProductMotor", link: TABLE, onDelete: CASCADE)
      frame: Frame @relation(name: "ProductFrame", link: TABLE, onDelete: CASCADE)
      ... Lots more product specific fields ...
      #### NEW FIELDS
      droneBuildsFrame: [DroneBuild] @relation(name: "DroneBuildFrame", onDelete: SET_NULL) # When a product is deleted, I absolutely want it nulled out on the drone build so it doesn't throw errors trying to retrieve a part that is gone. 
    }
    • 1
    • 1
  • l

    LC Carrier

    10/23/2019, 10:48 PM
    I'm trying to deploy the Prisma2 rest-express example on Heroku and I get this error repeatedly. I'm able to run the server locally just fine. I've tried to delete node_modules / package.json a few times and nothing works. The error persist if I create another server. Anybody can help? It's really appreciated.
    Untitled
    r
    h
    z
    • 4
    • 21
  • r

    Ricco

    10/23/2019, 11:33 PM
    How does one relate when doing a create?
    • 1
    • 3
  • l

    Luke

    10/24/2019, 3:09 AM
    I'm using Prisma 2 with RDS MySQL. Do I need to use
    lift
    to generate the initial DB tables ?
  • s

    Sohail Khan

    10/24/2019, 5:32 AM
    I want to store geospatial data in MongoDB to be specific polygon data: *I want to store in this format and so far I don't know any way to store this format data with Prisma datamodel*(if yes then its may solve my issue)
    Copy code
    javascript
    {
      ...otherFields,
      area: {
        type: "Polygon",
        coordinates: [
          [
            [longitude(float), latitude(float)],
            ...
            [longitude(float), latitude(float)]
          ]
        ]
      }
    }
    EXCEPT Json format but the problem with JSON is the Prisma store JSON as a string that means I cannot create an index for that field to run geospatial queries with native MongoDB (since as far as I know there is no way to do a geospatial query with Prisma). Now let's say if I do all thing from inserting, updating, reading data from native MongoDB for specific that data along with side Prisma then when I run
    Copy code
    prisma deploy
    it will wipe out all my data which I wrote manually to the database without in contact with Prisma, and since I wrote most of my resolvers with Prisma now I cannot write all of them in native MongoDB(or using other ORM or library) due to project deadline, now, what am I supposed to do? Versions (please complete the following information): - Connector:
    MongoDB
    - Prisma Server:
    1.34.0
    -
    prisma
    CLI: prisma/1.34.10 (linux-x64) node-v10.16.3 - OS:
    Ubuntu 19.04
    - other dependencies:
    prisma-client
  • z

    Zane Helton

    10/24/2019, 5:48 AM
    Probably a bad time to ask, but I just updated my GitHub issue: https://github.com/prisma/prisma2/issues/826#issuecomment-545754440 I'm getting an issue now that I think is related to:
    Copy code
    const handler = extensionStack && extensionStack.willResolveField(source, args, context, info);
    
        // If no resolver has been defined for a field, use the default field resolver
        // (which matches the behavior of graphql-js when there is no explicit resolve function defined).
        // TODO: Find a way to respect custom field resolvers, see <https://github.com/graphql/graphql-js/pull/865>
        try {
          const result = (fieldResolver || defaultFieldResolver)(source, args, context, info);
  • j

    Jesper O. Christensen

    10/24/2019, 7:00 AM
    When enabling slow queries, they are printed out as an array.. are those queries, in the array, from 1 request to prisma?
  • j

    joar

    10/24/2019, 8:06 AM
    Any way to do a partial query against the DB with prisma1? Right now every query is
    SELECT * FROM
    which is less than ideal
    j
    • 2
    • 1
  • n

    Naman Singh

    10/24/2019, 9:38 AM
    How can i transfer existing data from Prisma to MongoDB Atlas...?
  • s

    Sohail Khan

    10/24/2019, 11:09 AM
    @Naman Singh you can inspect you docker container (if using) then you can use mongodump command to transfer from local to mongodb atlas
  • s

    Sohail Khan

    10/24/2019, 11:09 AM
    Copy code
    mongodump  --host <from_host> --db <from_db> --archive | mongorestore --host <to_host> --archive
  • n

    Naman Singh

    10/24/2019, 11:23 AM
    Thanks @Sohail Khan
  • h

    Hansen

    10/24/2019, 2:18 PM
    Hey everyone. May I ask you for help, please. I have a resolver, where I want to look if product is created by logged In user. Therefore the idea is to compare id of user with id of field createdBy. Problem const prostedBy is handeld as an object.
  • h

    Hansen

    10/24/2019, 2:18 PM
    But if I return postedBy, I get this as a string.
  • h

    Hansen

    10/24/2019, 2:20 PM
    I get: "isUsersOwn": "ck24e1j9l068b0919xpvilefz" }, But why I can not compare userId with it. How do I get the string inside my resolver function isUsersOwn() 🤔🙇‍♂️
    j
    • 2
    • 3
  • m

    Mark Cahill

    10/24/2019, 5:33 PM
    where is the place to ask questions about graphql-request?
  • g

    Globolobo

    10/24/2019, 8:50 PM
    Hey guys, i understand Prisma 1 is in maintenance mode now, however, the docs aren't super thorough on introspection. I'm trying to understand how to use the new datamodel file after an
    introspect
    ?
  • i

    isemaj

    10/24/2019, 9:14 PM
    does prisma 1 cloud support connecting non local mongodb (atlas)?
  • j

    James

    10/25/2019, 10:04 AM
    With prisma 1 can I define extra fields on a many-to-many relationship. As an example, lets say I have
    Student
    and
    Class
    types. A student can belong to many classes and a class has many students. That's easy to do, but what if I want to have an extra column on the studentOnClass table. Let's say I want to assign a seat number to every student in each class. How can I do it?
    j
    l
    • 3
    • 4
  • k

    kubo.motyl

    10/25/2019, 3:27 PM
    is there someone here who can point me to some docs on forking/building my own version of prisma repository? I'd like to try fork the prisma-client-lib extension, but I can't seem to find anything on building the actual project...
  • z

    Zane Helton

    10/25/2019, 5:28 PM
    'Morning! Does anyone have ideas for this issue? https://github.com/prisma/prisma2/issues/826#issuecomment-545754440
  • e

    evondev

    10/27/2019, 9:56 AM
    anyone know how to merge or split schema.graphql. I have researched and always get error with import * from prisma. Thanks a lot
  • b

    Basix

    10/27/2019, 4:00 PM
    just curious, is there any good reason to create
    @id
    field if I already have a unique field in the model?
    c
    • 2
    • 1
  • l

    lucid_frog

    10/27/2019, 6:23 PM
    anyone managed to make the pagination work properly? my case: I have 10 posts
    Copy code
    prisma.postsConnection({
        first: 2,
        skip: 2,
    })
    I would expect this to return the following:
    { nodes: [{...}, {...}], pageInfo: { hasNextPage: true, hasPreviousPage: true, endCursor: "...", startCursor: "..."} }
    however, the
    hasPreviousPage
    is always
    false
    . Don’t know if feature doesn’t work or if I’m missing something
  • l

    Larry

    10/27/2019, 7:48 PM
    Hi I've recently been playing around with primsa2 and just have one question: I have mutiple javascript files, and want to share a database instance with all of them. Should I pass in the photon instance to each of them in turn or will it automatically use the one that was already created.
  • i

    isemaj

    10/28/2019, 7:08 AM
    is it possible to create custom directive for datamodel?
  • e

    Ehsan Sarshar

    10/28/2019, 2:30 PM
    why “where” clause only have AND operator not OR. what can be the reason
    h
    • 2
    • 7
1...325326327...637Latest