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

    Gorodov Maksim

    11/23/2018, 11:12 AM
    Is there a way to define a schema like this? (look at the key
    value
    )
    Copy code
    type RuleExampleOption {
      id: ID! @unique
      name: String!
      value: RuleExampleOptionValue! or Boolean!
      example: RuleExample!
    }
    n
    • 2
    • 2
  • u

    UsulPro

    11/23/2018, 11:16 AM
    Hello, our company have a paid graph.cool/cloud account Could someone point me the best way to reach graphcool support?
    t
    • 2
    • 1
  • t

    taikn

    11/23/2018, 11:20 AM
    prisma-eu1 dev server is pretty slow recently
  • k

    kris

    11/23/2018, 2:07 PM
    @channel can someone help me with this issue "https://github.com/prisma/Mongo-Connector-Preview/issues/9"
  • r

    Ramin B

    11/23/2018, 2:11 PM
    Hi everyone, I was able to successfully get Prisma up and running on Heroku using a Dockerfile and some deploy scripts (based off of https://github.com/jhalborg/prisma-heroku-token-replication && https://github.com/dpetrick/prisma-heroku). Here’s a gist of all the files you need to get this going: https://gist.github.com/i8ramin/f4202e7c234c059f9b6f75e20d3bf09c
    t
    • 2
    • 1
  • e

    ervindraganovic

    11/23/2018, 2:25 PM
    Guys, anyone have issues getting in to Prisma Console? #network error - unexpected token
  • e

    Emil Forsmann

    11/23/2018, 2:26 PM
    same here…
  • k

    k0ff33

    11/23/2018, 2:26 PM
    Same here but for deployments - error 502
  • k

    k0ff33

    11/23/2018, 2:26 PM
  • a

    Alex

    11/23/2018, 2:36 PM
    if everything continues as planned the current beta 1.22 from yesterday should become stable in two week?
    👍 1
    d
    • 2
    • 1
  • t

    tylim

    11/23/2018, 5:36 PM
    hello guys, what kind of datamodel should i use if i want to store chat data?
  • g

    geabenitez

    11/23/2018, 8:01 PM
    Hello to all. I am new working with prisma, I found it as it is part of a course I am taking on udemy about graphql by Andrew Mead.
    🦜 1
  • g

    geabenitez

    11/23/2018, 8:01 PM
    So far looks really great. Still need to get used to it though. But I'll use it really soon on a new project my company is working on.
  • g

    geabenitez

    11/23/2018, 8:11 PM
    By the way, I deploy some changes in my db, then I drop the tables directly on my DB (Yeah, I know, dumb mistake) now I cant deploy the types anymore, any idea?
    • 1
    • 1
  • m

    Michael

    11/23/2018, 8:26 PM
    I am looking at the docs (https://www.prisma.io/docs/data-model-and-migrations/introspection-mapping-to-existing-db-soi1/), because I am having an issue with a specific join type. Similar to what is in the docs here
    Copy code
    type Bill @pgTable(name: "bill") {
      bill: String!
      id: Int! @unique
      bill_products: [Bill_product]
    }
    
    type Bill_product @pgTable(name: "bill_product") {
      bill: Bill @pgRelation(column: "bill_id")
      product: Product @pgRelation(column: "product_id")
      some_other_column: String!
    }
    
    type Product @pgTable(name: "product") {
      id: Int! @unique
      product: String!
      bill_products: [Bill_product]
    }
    I am trying to access
    some_other_column
    data when I query
    Copy code
    query {
      bill(where: { id: 1 }){
        id
        bill_products {
          product {
            id
            product
          }
          some_other_column
        }
      }
    }
    When I run the SQL from the docs, add the types to my
    app.prisma
    file then run
    prisma deploy
    I get 3 errors
    Bill_product ✖ The required field 'id' is missing and has to have the format: id: ID! @unique or id: UUID! @unique or id: Int! @unique.
    Copy code
    Bill ✖ The relation field ‘bill_products’ has the wrong format: ‘[Bill_product]’ Possible Formats
    : ‘Bill_Product’, ‘Bill_product!‘, ‘[Bill_product!]\!’
    Copy code
    Products ✖ The relation field ‘bill_products’ has the wrong format: ‘[Bill_product]’ Possible Formats
    : ‘Bill_Product’, ‘Bill_product!‘, ‘[Bill_product!]\!’
    When I resolve these 3 errors and run
    prisma deploy
    all is well When I try to query
    Copy code
    query {
      bill(where: { id: 1 }){
        id
        bill_products {
          product {
            id
            product
          }
          some_other_column
        }
      }
    }
    I get errors in PostgreSQL
    Copy code
    ERROR:  column Alias.id does not exist at character 217
    STATEMENT:  select 
      "Alias"."id", 
      "RelationTable"."id" as "__RelatedModel__", 
      "RelationTable"."bill_id" as "__ParentModel__"
    from "public"."bill_product" as "Alias"
      join "public"."bill_product" as "RelationTable"
      on "Alias"."id" = "RelationTable"."id"
    where "RelationTable"."bill_id" in ($1)
    order by "RelationTable"."id" asc
  • l

    Luke

    11/23/2018, 9:52 PM
    Is there any way for me to start using Prisma Admin ?
    💆‍♂️ 1
  • l

    Luke

    11/23/2018, 9:53 PM
    even in beta ?
  • y

    yolen

    11/23/2018, 10:00 PM
    Is it possible to set the id on creation? Need it to save a roundtrip when uploading files to my file storage
  • k

    Ken

    11/23/2018, 10:23 PM
    I'm being plagued by silent failures. I call a generated function (probably with some sort of error) and promise doesn't resolve or reject. Logs (docker logs) show nothing. Anybody have any suggestions?
  • g

    Gillinghammer

    11/23/2018, 11:16 PM
    👋 Can someone help me adjust my docker settings so I can access localhost? I have subscription that posts to a webhook (on localhost) and cannot test it at the moment
    m
    • 2
    • 2
  • q

    qirex

    11/24/2018, 11:24 AM
    Anyone else getting Timeouts using Prisma Cloud? Short queries work but trying to fetch more than 20 items gives timeouts. Am I hitting some sort of rate limit here?
    Anyone_else_still_getting_Timeouts_using_Prisma_Cloud_.txt
    t
    v
    • 3
    • 5
  • g

    Gorodov Maksim

    11/24/2018, 11:37 AM
    gosh, why is fetching data in app.prisma.io is THAT SLOW?
    h
    t
    • 3
    • 21
  • g

    Gorodov Maksim

    11/24/2018, 11:39 AM
    I have such models (simplified):
    Copy code
    type Rule {
      id: ID! @unique
      name: String! @unique
      examples: [RuleExample!]! @relation(name: "RuleOnRuleExample" onDelete: CASCADE)
    }
    
    type RuleExample {
      id: ID! @unique
      correct: String!
      incorrect: String!
      rule: Rule @relation(name: "RuleOnRuleExample")
    }
    I created a rule with field examples - http://prntscr.com/lmdo4b And now when I'm trying to get it like this:
    Copy code
    query {
      rule(name: "getter-return") {
        examples {
          correct
          incorrect
        }
      }
    }
    I get
    null
    inside
    examples
    field. Why? Here is the code of this query:
    Copy code
    const rule = (_, args, context, info) => {
      return context.prisma.rule(
        args.id ? { id: args.id } : { name: args.name.toLowerCase() },
      );
    };
    n
    • 2
    • 2
  • g

    Gorodov Maksim

    11/24/2018, 11:47 AM
    I have an updating mutation:
    Copy code
    const updateRule = async(_, args, context, info) => {
      return context.prisma.updateRule(
        {
          where: args.id ? { id: args.id } : { name: args.name.toLowerCase() },
          data: {
            examples: args.examples ? {
              create: {
                options: args.examples.options ? {
                  create: args.examples.options.map((exampleOption) => ({
                    name: exampleOption.name,
                    value: exampleOption.value,
                  })),
                } : null,
                correct: args.examples.correct,
                incorrect: args.examples.incorrect,
              },
            } : null,
          },
        },
      );
    };
    And I'm interested in this - if the
    Rule
    has field
    examples
    but I passed
    null
    to it, will field
    examples
    become
    null
    or not?
    h
    • 2
    • 3
  • t

    tylim

    11/24/2018, 12:34 PM
    hello guys, why cant i link service in docker compose? i try to link psql to prisma but never success
  • t

    tylim

    11/24/2018, 12:34 PM
    Untitled.txt
    h
    • 2
    • 4
  • t

    tylim

    11/24/2018, 12:36 PM
    at line 18 if i change the value to host.docker.internal, it works, but why it cant work with service alias name?
  • f

    fgreinus

    11/24/2018, 5:37 PM
    Hey folks! Has anyone ever done/built a testing setup with graphql-yoga and prisma involved? am really wondering how to properly mock the prisma service or use another db for testing purposes
  • l

    Lobo

    11/24/2018, 10:19 PM
    hey guys! any more information on database migrations? I've only found this on the documentation: https://www.prisma.io/docs/data-model-and-migrations/migrations-asdf/
  • l

    Lobo

    11/24/2018, 10:19 PM
    I've added a new required field to a table and since I already have data on that table I wanted to do a migration to add information to that field on the existing rows
1...164165166...637Latest