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

    Stef

    06/14/2019, 12:16 PM
    Hi all, does anyone know of a reliable data export script for Graphcool? I have a bunch of data I need to extract, but the official command-line tool fails and doesn’t restart from where it left off it you try again.
  • t

    Taylor

    06/14/2019, 2:09 PM
    hey guys
    👋 1
  • t

    Taylor

    06/14/2019, 2:09 PM
    any documentation on connecting prisma with mongodb atlas?
    p
    • 2
    • 1
  • j

    Jose Garcia

    06/14/2019, 2:13 PM
    Hey guys, So I have this one to many relationshipt setup:
    Copy code
    type User @db(name: "user") {
      id: ID! @id
      createdAt: DateTime! @createdAt
      updatedAt: DateTime! @updatedAt
      firstCreatedAt: DateTime
      lastSignedInAt: DateTime
      lastDailyCheckin: DateTime
      password: String
      passwordHash: String
      salt: String
      name: String
      email: String @unique
      reports: [Report!]!
    }
    
    type Report @db(name: "report") {
      id: ID! @id
      status: REPORT_STATUS! @default(value: PAID)
      saleAmount: Float!
      commission: Float!
      date: DateTime!
      user: User! @relation(link: INLINE)
      affLink: String!
      affiliate: Affiliate @relation(link: INLINE)
    }
    But when I try to query reports from a user type:
    Copy code
    query {
    	user(where:{id: "cjwsa0fhe01ll0933ekxbihre"}){
        id
        name
        email
        reports {
          id
        }
      }
    }
    And I get this:
    Copy code
    Cannot query field \"reports\" on type \"User\".
    How could I make this query possible?
    j
    h
    • 3
    • 2
  • j

    James Heywood

    06/14/2019, 3:38 PM
    👋 hi all
  • j

    James Heywood

    06/14/2019, 3:38 PM
    quick question - apologies for time wasting, found the answer - see threads below if interested
  • j

    James Heywood

    06/14/2019, 3:39 PM
    Is there a way to programatically supply the endpoint to
    prisma deploy
    - for example so I can automate deployment to local, staging and production prisma servers via my CI/CD pipeline?
    • 1
    • 1
  • j

    James Heywood

    06/14/2019, 3:39 PM
    or do I have to edit the prisma.yml file in situ during my CI/CD pipeline build process?
  • j

    James Heywood

    06/14/2019, 3:40 PM
    seems like the latter is a bit hacky - would expect there to be a way to deploy same server to various endpoints for this very reason
    • 1
    • 1
  • g

    Gio Gunn

    06/14/2019, 4:25 PM
    🤔Hi, Here’s the thing, I’m currently building an express backend for a test case frontend project. I’m using type-graphql/Typeorm/postgres/Typescript. Having seen a demo Prisma/graphqlgen I am keen to build my backend with the latter. But I don’t understand the docker version, though. Anyone out there with a torch to shed light on this… Many thanks in advance.🤔
    h
    • 2
    • 1
  • j

    Jose Garcia

    06/14/2019, 5:30 PM
    Also, has anyone from windows have an issue where
    docker-compose
    runs the container but you can't make a request to it?
    h
    d
    +2
    • 5
    • 12
  • m

    Matt Abrams

    06/14/2019, 6:29 PM
    Are there any examples of a full kubernetes deployment of microservices including a prisma server, database, and graphql server? So far, I’ve only found prisma + database, but never incorporated with a graphql server in the same repository.
  • h

    H

    06/14/2019, 10:53 PM
    Are there anyone that knows how to solve the ENAMETOOLONG error when you deploy to the same stage of prisma service 😢?
    😢 1
  • k

    Kianoosh

    06/15/2019, 8:24 AM
    Hey guys, I'm using
    express
    and
    prisma
    to build a REST API and i have a problem with reading relations with
    prisma
    , Say for instance we have two type as the official example has:
    Copy code
    type User {
      id: ID! @id
      email: String! @unique
      name: String
      posts: [Post!]!
    }
    
    type Post {
      id: ID! @id
      published: Boolean! @default(value: false)
      title: String!
      content: String
      author: User!
      createdAt: DateTime! @createdAt
      updatedAt: DateTime! @updatedAt
    }
    And one of my endpoints:
    Copy code
    <http://app.post|app.post>(`/post`, async (req, res) => {
      const { title, content, authorEmail } = req.body
      const result = await prisma.createPost({
        title: title,
        content: content,
        author: { connect: { email: authorEmail } },
      })
      res.json(result)
    })
    Now what i expect from the response is to have the author id or something arbitrary about it, The respose is like:
    Copy code
    {
      "updatedAt": "2019-06-15T08:10:29.853Z",
      "published": false,
      "id": "cjwx8qxjx002p0880y8tijtze",
      "createdAt": "2019-06-15T08:10:29.853Z",
      "content": "test",
      "title": "test"
    }
    How could i have author id or email alongside of the response ?
    b
    • 2
    • 2
  • d

    darren

    06/15/2019, 10:46 AM
    Hi guys, i am trying to create Prisma server with inside Docker. May i know is their any ways to create container without using docker compose?
  • m

    Mali

    06/16/2019, 7:23 AM
    Hi guys, does anyone know how to pass
    datamodel
    recursive files path, instead of entering the
    .prisma
    file under
    models
    folder every time I create a new one. Can we set it like this
    datamodel: ./models/*.prisma
    or a similar one?
    h
    n
    • 3
    • 4
  • g

    gem

    06/16/2019, 11:24 AM
    Hello guys got some problem with subscriptions with Prisma, works fine in playground but when using in app it shows me “Cannot read property ‘id’ of null”
    • 1
    • 1
  • g

    gem

    06/16/2019, 11:25 AM
    anyone has an idea ?
  • t

    Taylor

    06/16/2019, 12:44 PM
    Hey all, does anyone know why I am getting this error when trying to run a mutation in production env?
    h
    • 2
    • 1
  • t

    Taylor

    06/16/2019, 12:44 PM
    Shoot!GraphQL Error: { "0": "<", "1": "!", "2": "D", "3": "O", "4": "C"
  • t

    Taylor

    06/16/2019, 12:45 PM
    literally renders out the entire html of the page for some unknown reason? I am using Cheerio to scrape an external website, so maybe something to do with that?
  • g

    gem

    06/17/2019, 3:21 AM
    what do you guys use to deploy your prisma server + node ?
  • g

    gem

    06/17/2019, 3:51 AM
    do some people host prisma on one server and a node on the same connecting to prisma using localhost:4466 ?
    b
    • 2
    • 1
  • m

    Montana Flynn

    06/17/2019, 5:57 AM
    Hi I'm trying to use prisma for my existing postgresql database
  • m

    Montana Flynn

    06/17/2019, 5:57 AM
    ```
  • m

    Montana Flynn

    06/17/2019, 5:57 AM
    when I run
    prisma deploy
    I get these errors:
  • m

    Montana Flynn

    06/17/2019, 5:57 AM
    Copy code
    Op
        ✖ One field of the type `Op` must be marked as the id field with the `@id` directive.
    
      Subscription
        ✖ The type `Subscription` has is using a reserved type name. Please rename it.
  • m

    Montana Flynn

    06/17/2019, 5:58 AM
    Not sure where I would even fix them
  • m

    Montana Flynn

    06/17/2019, 5:58 AM
    I don't want to change my database
  • m

    Montana Flynn

    06/17/2019, 5:58 AM
    Copy code
    Deployment canceled. Please fix the above errors to continue deploying.
    Read more about deployment errors here: <https://bit.ly/prisma-force-flag>
1...281282283...637Latest