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

    henrique

    03/21/2019, 9:05 PM
    How are you doing to seed enums? e.g.
    Copy code
    # enums.graphql
    enum PlaceCategory {
      LANDSCAPE
      FOOD
      COFFEE
    }
    
    # types.graphql
    type Place {
      categories: [PlaceCategory!]!
    }
    
    // seed.js
    await prisma.createPlace({
      categories: ['FOOD']
    })
    This doesn’t work for me I get the follow error:
    Error: Variable '$data' expected value of type 'PlaceCreateInput!'
    h
    • 2
    • 3
  • f

    faure

    03/22/2019, 2:29 AM
    @henrique I think you can pass enum values by name
  • f

    faure

    03/22/2019, 2:29 AM
    For example:
    FOOD
    rather than
    'FOOD'
  • f

    faure

    03/22/2019, 2:30 AM
    I'm about to migrate my resolvers to Nexus, and the only edge case I haven't figured out very well is interfaces
  • f

    faure

    03/22/2019, 2:31 AM
    How could I achieve something like this with nexus: https://itnext.io/graphql-interfaces-and-union-types-with-prisma-and-yoga-7224f9e1d9ad
  • j

    James

    03/22/2019, 8:37 AM
    I'm looking for a minimal client. It's easy to use fetch to do queries and mutations against my prisma graphql server, but I need subscriptions. Is there a simple client available which supports subscriptions. I would like to explore alternatives to Apollo client.
    a
    o
    • 3
    • 5
  • v

    Vittorio Adamo

    03/22/2019, 10:18 AM
    Hello guys, I’m happy to announce that adidas Speedfactory service is live in 🇺🇸 🐘 + prisma rainbow + graphql PostgreSQL exposed by Prisma consumed by GraphQL Application Service, everything self-hosted on our Kubernetes cluster, 80 thousands requests per hour and it’s a charm... 🧘‍♀️ Without any campaign, we’ve already got a good number of participants! Let’s see how it’ll be the impact of social campaigns and emails/push notifications. 🤞 I would like to say thanks for all the help received in these days: - prisma-admin is amazing, I’m faster and I’ve quick feedbacks on my DB ops. - ❤️ data-model v1.1 && nexus is a powerful combination that increased my productivity! a special thanks to @divyendu that supported me with all my silly newbie questions! 🙏 Next steps are to spread the verb in the adidas software engineering community and move more crucial parts to the new software arch! here a little video of the result.. and if u wanna try it - download the adidas app. (there are some bugs on android...sorry) 🐛
    💚 9
    💯 7
    fast parrot 13
    graphql 8
    prisma green 8
    🙌 5
    🚀 10
    n
    t
    b
    • 4
    • 11
  • v

    Vittorio Adamo

    03/22/2019, 10:19 AM
    am4_creators_club.mp4
  • n

    nuno

    03/22/2019, 12:45 PM
    Now that Prisma Admin is out of "invite-only preview", should we continue to open issues in https://github.com/prisma/prisma-admin-feedback or in the main prisma repo?
    n
    • 2
    • 1
  • a

    Andrei Bacescu

    03/22/2019, 2:16 PM
    Hello guys! I have two models: User and Image where a user could have many images. Now, I have the next situation: User A has images a, b and c saved in the database. If on updateUser mutation I will send just two images, for example, image a and d, I want image b and c to be deleted. My resolver's current flow is: 1) Check all images associated with the current user 2) Compare images from 1) with images sent as arguments and create one array ( KeepArray ) with images that will be kept (in my case, image a and d because those images are sent as argument) and one more array ( DeleteArray ) which contain what images will be deleted (b and c in my case, because those images aren't sent as arguments) 3) Inside updateUser mutation I'll delete all images from DeleteArray and for images from KeepArray I use upsert My question is: Can I do those operations in a more efficient way? Here I present a simple example but in my code, I have more complex situations and I want to know if there exists a better way to do that. Thank you in advance.
  • d

    Discere

    03/22/2019, 2:50 PM
    Hello all, I am getting a number of 504 timeouts, anyone else getting them?
  • j

    José Gomes

    03/22/2019, 2:55 PM
    hello! shouldn't this query only return projects where the manager has a certain id? : { projects(where: { managedBy_every: { user: { id: "some_id" } } }) { id name managedBy { user { id } } } }
  • j

    José Gomes

    03/22/2019, 3:01 PM
    my bad, it seems i should use _some
    b
    • 2
    • 1
  • r

    rem

    03/22/2019, 3:31 PM
    Just wondering about times I need to get nested field/object using Prisma - does this look right?
    Copy code
    Promise.all([
      prisma.tender({ id: tenderId }).organisation(),
      prisma.tender({ id: tenderId }).primaryPracticeArea(),
      prisma.tender({ id: tenderId }).category(),
    ]).then(([organisation, primaryPracticeArea, category]) => {
      // …
    })
    h
    • 2
    • 2
  • r

    rem

    03/22/2019, 3:32 PM
    Or could I reuse the result from
    prisma.tender({ id … })
    ?
  • r

    rem

    03/22/2019, 3:32 PM
    feels like I'm running 6 underlying queries here instead of possibly 4 (or somehow 1 if prisma is able to combine them cleverly)
  • j

    José Gomes

    03/22/2019, 3:32 PM
    prisma will cache every "prisma.tender({ id: tenderId })" as far as i know
  • j

    José Gomes

    03/22/2019, 3:33 PM
    with an inside dataloader
  • j

    José Gomes

    03/22/2019, 3:33 PM
    so, yeah, 4 queries
  • r

    rem

    03/22/2019, 3:37 PM
    @José Gomes cheers.
  • c

    cedric

    03/22/2019, 4:43 PM
    hi all, is there an SDL directive for a custom column name that isn't based on relation? for example, i have a pre-existing postgres database schema with a field called
    id
    , and that field is reserved by prisma for ID types. i'm looking for something like
    myID: Int @pgColumn(name="id")
    h
    • 2
    • 1
  • c

    cedric

    03/22/2019, 4:45 PM
    i see
    @pgRelation
    but it seems like that's geared toward FKs
  • s

    Sebastian

    03/22/2019, 4:46 PM
    How can I modify the top code to get both user and posts? The bottom one doesn't feel very intuitive.
    -.js
    m
    • 2
    • 1
  • t

    TerribleDev

    03/22/2019, 5:02 PM
    hi i need a help 😞 when I try to deploy locally. remains blocked without giving any useful info. the containers seem to me to be working the terminal stays stucked like this
  • t

    TerribleDev

    03/22/2019, 5:02 PM
  • i

    Ian

    03/22/2019, 5:02 PM
    Hi, iI have a question RE: implementing Prisma into an event driven design. Say I have an API thats hooked onto a schema thats in Repo A , which generates the prisma client for that API. I would like to have multiple consumers that will congest events from the queue, then write to the same DB, preferably through a mutation thats in Repo A. Would that mean that I would have to generate a new prisma client for each consumer and somehow maintain all consumers to hace the same schema as repo A? Or would it be better to have the consumers talk to the API and have auth to hit those mutations?
  • m

    Michael Schonfeld

    03/22/2019, 6:16 PM
    hi guys. probably an amateur question, but, do i not need to worry about creating indexes in my PG db?
  • m

    Michael Schonfeld

    03/22/2019, 6:16 PM
    say i do many User lookups by a given column (say,
    email
    ), shouldn’t my PG (or prisma, for that matter) create an index based on that lookup column?
  • l

    levi chimezie

    03/22/2019, 7:53 PM
    Hi all, How can I use different databases with the Prisma Server and use different apps to connect to their respective database
  • d

    Devion Villegas

    03/22/2019, 8:48 PM
    Been awhile since I've used prisma but when looking at the docs today I noticed a couple bugs.
    👍 1
1...240241242...637Latest