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

    Lotafak

    02/27/2019, 1:47 PM
    Hey again. Once again I’m asking for help about this https://prisma.slack.com/archives/CA491RJH0/p1551189846440400. Or what is other place I could write to get help from?
    h
    • 2
    • 9
  • s

    swangy

    02/27/2019, 2:02 PM
    anyone? init a hello world prisma project to mysql?
  • s

    swangy

    02/27/2019, 2:02 PM
    Copy code
    ? Set up a new Prisma server or deploy to an existing server? Use existing database
    ? What kind of database do you want to deploy to? MySQL
    ? Does your database contain existing data? No
    ? Enter database host localhost
    ? Enter database port 8889
    ? Enter database user root
    ? Enter database password root
    
    Connecting to database !
     ▸    Connection terminated unexpectedly
    
    Get in touch if you need help: <https://www.prisma.io/forum/>
    To get more detailed output, run $ export DEBUG="*"
    b
    j
    • 3
    • 7
  • m

    Madhav

    02/27/2019, 4:41 PM
    Multi node prisma production server: My team has been trying to setup a multi node prisma production server. We referred this link: https://github.com/prisma/prisma/issues/2850, tried to do exactly what is mentioned in the post. Even after successful setup, we are getting some random errors for schema deployment. The majority of the time it complained that it couldn't reach the server, which was odd considering that we were watching the proxy logs which were returning 200 responses for POST requests to the /management endpoint of the primary node. Other times it complained about the cluster$default project not existing, and those were accompanied by 200 responses for POST reqs to the /cluster endpoint. And few times, it did worked. Knowing the fact that, we are relatively new to Prisma and multi node setup, we could be missing something very minute which is causing all the trouble. It would be to get some help on this. Thanks!
  • p

    pablo

    02/27/2019, 5:10 PM
    For anyone following this https://codesandbox.io/s/6w7581x05k example but wants to use javascript with babel instead of typescript, you need to 1.) append
    --js
    to your
    nexus-prisma-generate
    command in
    prisma.yml
    and 2.) in
    schema.js
    replace
    __dirname
    with
    path.resolve(__dirname)
    . I almost gave up on
    prisma-nexus
    until I figured this out. Took me a while to find the fix so I wanted to share.
    👍 1
  • d

    dnbkr

    02/28/2019, 4:09 AM
    hey I'm trying to do a query and filter the results of a relationship, something like this datamodel:
    Copy code
    type Event {
      id: ID!
      ticketRequests: [TicketRequest]
    }
    
    enum TicketRequestStatus {
      APPROVED
      DECLINED
      PENDING
    }
    
    type TicketRequest: {
      id: ID!
      event: Event
      status: TicketRequestStatus
    }
    schema:
    Copy code
    type Query {
      event(id: ID!): Event
    }
    and here's my query:
    Copy code
    const EVENT_QUERY = gql`
      query EVENT_QUERY(id: ID!, filter({ status: "APPROVED" }) ){
        event(id: $id){
          id
          ticketRequests {
            status
          }
        }
      }
    `
  • d

    dnbkr

    02/28/2019, 4:10 AM
    basically I'm just trying to return only the ticketRequests that have
    Copy code
    status: "APPROVED"
  • d

    dnbkr

    02/28/2019, 4:13 AM
    sorry the query should be more like
    Copy code
    filter({ ticketRequests: { status: "APPROVED" } })
    f
    • 2
    • 1
  • a

    arsan.irianto

    02/28/2019, 10:19 AM
    Hi everyone, how to running graphql server on production server? should i configure in nginx or apache ?
    j
    • 2
    • 2
  • e

    Earl

    02/28/2019, 10:30 AM
    Do I need a data loader with Prisma?
  • e

    Earl

    02/28/2019, 10:30 AM
    incase there is multiple nesting
  • k

    Kerdo

    02/28/2019, 12:19 PM
    Does anyone know why my Prisma service is not showing up after setting up a Heroku app and initialising the service onto that? 🙂
  • i

    impowski

    02/28/2019, 12:20 PM
    Hello, how do I implement something like this: When a user send a new message from the client, I need to count them at the end of the month and give user how much messages he sent during this month. I understand that I’ll need to aggregate and count them by date range, but the problem is that how do I trigger such an event. Any advice on how to implement something like that?
    j
    • 2
    • 4
  • b

    bkstorm

    02/28/2019, 12:20 PM
    Hi everyone, how to get categories which have children ( children.length > 0)?
    Copy code
    type Category {
      id: ID! @unique
      name: String!
      description: String
      parent: Category @relation(name: "SubCategories")
      children: [Category!]! @relation(name: "SubCategories")
    }
    • 1
    • 1
  • a

    Alex

    02/28/2019, 3:17 PM
    Hello everyone! I'm a bit new to back-end, and I'm currently building a server with prisma and yoga. I'd like to add some WebSocket (best w/ socket.io), but I'm having troubles finding how exactly to implement it. Might anyone know how to help me with it? Thanks.
  • c

    Cameron Gorrrie

    02/28/2019, 3:53 PM
    @Alex https://www.prisma.io/docs/prisma-graphql-api/reference/subscriptions-qwe3/
  • c

    Cameron Gorrrie

    02/28/2019, 3:54 PM
    The idiomatic way to add realtime with prisma is by using GraphQL subscriptions
  • p

    Paul Duffy

    02/28/2019, 4:29 PM
    Could anyone please point me to a comprehensive example for using nested mutations for create. I have three types, Person, Contact and Login. Person must have Contact. Login must have Person. So if I create a Login, I want to create the Person, and the Contact in the same operation. Using js examples from GraphQL and Prisma docs I keep getting errors, or null values reported on the mutation, or told that "create" is not recognised. Is there an example that shows two or three types in the schema, prisma model and the js, so I can just sanity check please? I am new to GraphQL and Prisma and to be honest just feel like going back to doing this in REST, as I have been at this for a couple of days amd
    c
    • 2
    • 6
  • n

    Nick

    02/28/2019, 6:04 PM
    @Prisma Community Why does the docs https://www.prisma.io/docs Not cover how to do unit-testing with resolver?
  • c

    CCBCodeMonkey

    02/28/2019, 6:06 PM
    @Nick this thread has some solutions on it https://www.prisma.io/forum/t/testing-prisma-and-graphql-yoga/3810/2
  • c

    CCBCodeMonkey

    02/28/2019, 6:07 PM
    you would use a mocking tool to mock out your prisma calls, and test the resolvers like you would normally unit test them
  • c

    CCBCodeMonkey

    02/28/2019, 6:07 PM
    I don't think prisma gives you any special tools for testing
  • n

    Nick

    02/28/2019, 6:08 PM
    @CCBCodeMonkey Either way the docs should have a section on how to do testing with prisma.
  • c

    CCBCodeMonkey

    02/28/2019, 6:08 PM
    don't really see why? prisma is a data store pretty much
  • c

    CCBCodeMonkey

    02/28/2019, 6:08 PM
    Postgres docs don't give you docs on testing postgres
  • c

    CCBCodeMonkey

    02/28/2019, 6:08 PM
    you would be mocking out anything prisma does?
  • c

    CCBCodeMonkey

    02/28/2019, 6:09 PM
    I guess its a nice to have doc
  • c

    CCBCodeMonkey

    02/28/2019, 6:10 PM
    if anything the docs would probably be around graphql-yoga only
  • c

    CCBCodeMonkey

    02/28/2019, 6:10 PM
    which is basically identical in my experience, pretty much, to apollo-server, so much so that I switched to just using apollo-server directly
  • c

    CCBCodeMonkey

    02/28/2019, 6:11 PM
    and there is a ton of articles, docs, etc on testing apollo-server
1...226227228...637Latest