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

    gerritvk

    01/04/2019, 9:38 PM
    Can someone help me troubleshoot why I am getting the following error when running a basic query on the client playground? Error:
    Cannot return null for non-nullable field DeviceConfig.device.
    Datamodel
    Copy code
    type Device {
        ...
        model: String! @unique
        ...
        configs: [DeviceConfig] @relation(name: "DeviceConfigs", onDelete: CASCADE)
      }
    
      type DeviceConfig {
        id: ID! @unique
        device: Device! @relation(name: "DeviceConfigs", onDelete: SET_NULL)
        name: String!
        ...
      }
    Query
    Copy code
    {
      deviceConfig(id:"cjqigyian00ef0d206tg116k5"){
        name
        id
        device{
          model
        }
      }
    }
    Resolver
    Copy code
    deviceConfig: async (parent, { id }, context, info) => context.prisma.deviceConfig({ id }, info)
    Result
    Copy code
    {
      "data": null,
      "errors": [
        {
          "message": "Cannot return null for non-nullable field DeviceConfig.device.",
          "locations": [
            {
              "line": 5,
              "column": 5
            }
          ],
          "path": [
            "deviceConfig",
            "device"
          ]
        }
      ]
    }
    --- When I run the following query on the Prisma API playground it returns Query
    Copy code
    {
      deviceConfig(where:{id:"cjqigyian00ef0d206tg116k5"}){
        name
        id
        device{
          id
          model
        }
      }
    }
    Result
    Copy code
    {
      "data": {
        "deviceConfig": {
          "name": "Standard",
          "id": "cjqigyian00ef0d206tg116k5",
          "device": {
            "id": "cjqigxzs600e60d20sdw38x7p",
            "model": "7530"
          }
        }
      }
    }
    m
    k
    • 3
    • 5
  • c

    CCBCodeMonkey

    01/05/2019, 4:46 AM
    anyone got a recommendation on hosting my app.. its prisma/apolloserver, redis, and next.js for the frontend
  • c

    CCBCodeMonkey

    01/05/2019, 4:47 AM
    I would like a staging server, and a prod server that I can scale up, with continuous deployment...
  • c

    CCBCodeMonkey

    01/05/2019, 4:47 AM
    really don't want to manage my dbs
  • c

    CCBCodeMonkey

    01/05/2019, 4:47 AM
    heroku seems like a great fit but its really pricey
  • a

    anthony

    01/05/2019, 5:43 AM
    hi there, sometime i confuse. prisma endpoint it’s my API endpoint?
  • c

    CCBCodeMonkey

    01/05/2019, 5:52 AM
    prisma endpoint is the prisma endpoint, usually you create your own graphql endpoint which sits on top
  • c

    CCBCodeMonkey

    01/05/2019, 5:52 AM
    that endpoint talks to the prisma endpoint
  • c

    CCBCodeMonkey

    01/05/2019, 5:52 AM
    its like a business logic layer
  • a

    Al

    01/05/2019, 9:00 AM
    Hello and Happy new year to all folks. 😉 I'm starting the year by looking for a solution to add dynamic prisma services with related authorization/permission/role. Any ideas without using a graphql-yoga/apollo on the top of each service or this is for now the only solution?
  • s

    Slackbot

    01/05/2019, 9:00 AM
    Hi there 👋 You just said guys which excludes our non-male friends 🙂 We are an inclusive community, please use an alternative like everyone, folks or fellow humans instead. Read more in our Code of Conduct: https://github.com/prisma/prisma/blob/master/CODE_OF_CONDUCT.md
    t
    • 2
    • 1
  • v

    Viable

    01/05/2019, 9:11 AM
    slackbot [9:00 AM] Hi there 👋 You just said guys which excludes our non-male friends 🙂 We are an inclusive community, please use an alternative like everyone, folks or fellow humans instead. Read more in our Code of Conduct: https://github.com/prisma/prisma/blob/master/CODE_OF_CONDUCT.md WHAT THE HELL?
    d
    k
    • 3
    • 2
  • v

    Viable

    01/05/2019, 9:12 AM
    Would you like to link me to a dictionary of Prisma-approved words I'm allowed to use, please?
  • v

    Viable

    01/05/2019, 9:13 AM
    if you can prove there is at least 1 female here, and that she was offended, i'll apologize
  • v

    Viable

    01/05/2019, 9:28 AM
    Upon giving this message to my left-wing friends, they are pointing out that hu*man* is also sexist, perhaps you should re-write your SJW bot to include the preferred phrase of "hu-people", thank you.
    n
    • 2
    • 1
  • w

    warchantua

    01/05/2019, 2:42 PM
    Hi everyone. What role plays prisma? Lets say, I have next.js application, and I am going to use apollo server 2 to serve graphql API over Postgres. Where (in the request chain) prisma daemon will be running? What for?
    n
    • 2
    • 1
  • a

    Artur Malak

    01/05/2019, 3:36 PM
    I think my Box type from TypeScript is mixing with prisma Box type. How can I solve it?
    s
    • 2
    • 20
  • a

    Artur Malak

    01/05/2019, 3:36 PM
  • a

    Artur Malak

    01/05/2019, 3:38 PM
    Have you had problems like this with prima and TS? 😄
  • i

    Industrial

    01/05/2019, 3:55 PM
    Hi.
  • i

    Industrial

    01/05/2019, 3:55 PM
    I'm wondering, why is there no
    insertManyX
    mutation?
  • i

    Industrial

    01/05/2019, 3:55 PM
    This is what I'm doing now:
    Copy code
    await Promise.all(
        apiMarkets.map((market) => {
          return apolloClient.mutate({
            mutation: upsertMarket,
            variables: market,
          })
        }),
      )
    s
    • 2
    • 2
  • c

    CCBCodeMonkey

    01/05/2019, 7:29 PM
    it would be really cool if prisma added built in redis support to cache most used queries
    s
    • 2
    • 4
  • c

    CCBCodeMonkey

    01/05/2019, 7:30 PM
    similar to rails ORM caching
  • j

    jon.major

    01/06/2019, 12:38 AM
    👋 I wondering if this is possible in a
    .graphql
    seed file?
    a
    n
    • 3
    • 2
  • w

    warchantua

    01/06/2019, 12:34 PM
    Prisma generates CRUD for data model types. Is it possible to disable mutations and leave only queries/subscriptions?
  • i

    ivor

    01/06/2019, 12:56 PM
    Model's
    WhereInput
    are not behaving as expected in my GraphQL queries, anyone know how to get around it or is it a bug? I have a user with ID
    5c2eb7d56344590009c22341
    and when I query a user with
    id
    ,
    id_in
    ,
    id_lt
    ,
    id_gt
    ,
    id_lte
    ,
    id_gte
    ,
    id_not
    ,
    id_not_in
    I get the expected results, but not with
    id_contains
    ,
    id_ends_with
    ,
    id_starts_with
    ,
    id_not_contains
    ,
    id_not_ends_with
    ,
    id_not_starts_with
    . For instance, this returns an empty users array
    Copy code
    {
      users(where: {id_ends_with: "c22341" }) {
        id
      }
    }
    d
    • 2
    • 2
  • i

    ivor

    01/06/2019, 1:00 PM
    What's weird about this is that it's only happening with ID, the rest of the fields are returning the expected results.
  • w

    warchantua

    01/06/2019, 1:33 PM
    section “set up prisma with existing database”, does it mean that prisma can read my existing database schema and produce graphql schema out of it?
    👍 1
    d
    • 2
    • 8
  • i

    impowski

    01/06/2019, 3:22 PM
    How do I seed multiple files one by one into prisma? And in case one fails the other is still be able to work?
1...184185186...637Latest