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

    onePunchMan

    12/28/2018, 8:41 AM
    prisma follows the opencrud specification, but I can not find a query-filter that represents case sensitive and case insensitive query
  • t

    Todd

    12/28/2018, 10:21 AM
    hello I love you all 👋🏻🔼
    👋 3
  • p

    Patrikk Sørensen

    12/28/2018, 1:00 PM
    Hi, i attended to a talk (called something about "getting started with graphql and typescript") during the api days conference in paris and remembered a link in the slides to a github example project. Does anyone know where they can be found?
  • a

    ardit

    12/28/2018, 5:21 PM
    Hi all, I wanna ask related to docker. I'd like to setup on my local computer which already has mysql that runs on vagrant. Is it possible for prisma that runs on docker to connect to the mysql?
    h
    • 2
    • 23
  • c

    chpeters

    12/28/2018, 6:44 PM
    hi all, question about prisma client. I have a type Activity that has a datetime field. Is there a way to get the latest result, or null if there aren't any Activity stored at all? I can obviously filter on activities by ordering it by date, but I only want one result, and I'd prefer it not to be in an array.
    h
    • 2
    • 1
  • i

    impowski

    12/28/2018, 8:55 PM
    I’m building some sort of real-time chat application and would like to understand some things. For example I already have a
    Subscription
    method
    receiveMessages
    which sends me new messages when they are created and a
    Query
    method
    getMessages
    which utilises
    Connection
    with cursor-based pagination. So, when a user log in into an application, he opens chat and have some messages in cache and then receiving other other messages which he missed. We take the latest available message in cache and pass it to our
    getMessages
    method and get everything after that message. And if we scroll back to top, it will load with the same method 10 previous messages before last message on the screen at the top. And the problem which I’m trying to figure out is the possibility of loosing any messages on receive when some sort of disconnecting happened on the client side. If anyone could help me out and describe the proper flow for such application I would be glad to hear it out!🙏
    h
    • 2
    • 1
  • a

    Andres Montoya

    12/29/2018, 2:06 PM
    Hi, someone knows any alternative to MySQL workbench? I only use it to see how the database will be. All about create the table or doing the relationships I use orms...
    h
    r
    • 3
    • 3
  • c

    CCBCodeMonkey

    12/30/2018, 3:52 AM
    think this doc is messed up: https://www.prisma.io/docs/prisma-graphql-api/reference/queries-qwe1/#pagination
  • c

    CCBCodeMonkey

    12/30/2018, 3:52 AM
    for the pagination area, all the code samples don't seem to line up with what they are talking about
  • c

    CCBCodeMonkey

    12/30/2018, 5:19 AM
    I am reading this blog post to solve an issue I had with using the info object and nesting a type within another type, basically exactly the scenerio the blog post points out: https://www.prisma.io/blog/graphql-server-basics-demystifying-the-info-argument-in-graphql-resolvers-6f26249f613a My question is, around creating a separate resolver so you can correctly pass the info object to the nested resolver, in this example:
    Copy code
    const resolvers = {
      Query: {
        async feed(parent, { authorId }, ctx, info) {
          // build filter
          const authorFilter = authorId ? { author: { id: authorId } } : {}
    
          // retrieve (potentially filtered) posts
          const posts = await ctx.db.query.posts({ where: authorFilter }, `{ id }`) // second argument can also be omitted
    
          // retrieve (potentially filtered) element count
          const postsConnection = await ctx.db.query.postsConnection(
            { where: authorFilter },
            `{ aggregate { count } }`,
          )
          return {
            count: postsConnection.aggregate.count,
            postIds: posts.map(post => post.id), // only pass the `postIds` down to the `Feed.posts` resolver
          }
        },
      },
      Feed: {
        posts({ postIds }, args, ctx, info) {
          const postIdsFilter = { id_in: postIds }
          return ctx.db.query.posts({ where: postIdsFilter }, info)
        },
      },
    }
  • c

    CCBCodeMonkey

    12/30/2018, 5:20 AM
    in the above example, I like how elegantly it solves the issue code wise, but what I don't like is that it is essentially running the same query twice, once to get the ID's and once again to get the real data by using the info object... and it means that if you kept adding more nested resolvers they would all have to run twice.. isn't this pretty imperformant?
  • c

    CCBCodeMonkey

    12/30/2018, 5:46 AM
    also anyone using
    extend type
    in their apollo server schema to extend prisma types? It doesn't seem to work within the
    schema.graphql
    as per this issue: https://github.com/prisma/graphql-import/issues/42 I am doing this hackity hack as workaround:
    Copy code
    const importedTypeDefs = importSchema(path.join(__dirname, '/schema.graphql'));
    // stupidly type extensions can only go in here right now..
    const typeDefs = gql`
          ${importedTypeDefs}
          extend type ExtendedType {
            extendedProp: String
          }
        `;
  • c

    CCBCodeMonkey

    12/30/2018, 5:46 AM
    if there is a better way please let me know
  • s

    serum

    12/30/2018, 10:46 AM
    I'm trying to write a Query
    filterUser
    , that given the name of a friend, say alice, returns all users that are friends with alice. to achieve this, I need to be able to filter users based on the name of the friends-relation, but afaics the prisma client currently (?) doesn't allow this. do I need to implement the filter in the resolver myself, or am I missing something here?
    h
    • 2
    • 9
  • n

    Nick

    12/30/2018, 12:16 PM
    Anyone familiar with the Nestframework I have added an issue on github https://github.com/howtographql/howtographql/issues/853
    👍 1
  • j

    jevakallio

    12/30/2018, 9:05 PM
    [question deleted. user error 😄 ]
  • m

    M

    12/31/2018, 5:22 AM
    Is it a good idea to use MongoDB for ecommerce platform where I will have Categories and Sub Categories?
  • o

    Oq Vinesto Riyadi

    12/31/2018, 8:37 AM
    Hello everyone, how to use prisma init on git bash ?, cause when i call prisma init on git bash on windows 10 the arrow indicator doesnt move
    h
    • 2
    • 2
  • s

    serum

    12/31/2018, 10:06 AM
    still having issues with this: 😅 given
    Copy code
    type Bla {
      foos: [Foo!]!
    }
    
    type Foo {
      bla: Bla!
      text: String!
    }
    
    type Query {
      findBlasWithFooTextContaining(search: String!): [Bla!]!
    }
    using the playground I now have figured out how to filter
    Foo
    and then query for
    bla
    . to do this in the resolver I need to use a fragment, or the prisma-bindings, afaiu. but then, the result is still a
    [Foo]
    , instead of the intended
    [Bla]
    . any pointers highly appreciated!
    d
    • 2
    • 1
  • s

    sapkra

    12/31/2018, 10:53 AM
    Hey guys I have a question related to a rolling deployment on kubernetes: When I deploy my graphql server (prisma client) with a rolling deployment they should only be connected to a compatible prisma server. How can I solve this when I have to deploy a new datamodel?
  • b

    Bram

    12/31/2018, 3:32 PM
    hey guys
  • b

    Bram

    12/31/2018, 3:32 PM
    How do you translate the prisma docker-compose yml multiline string to a shell environment variable?
  • b

    Bram

    12/31/2018, 3:33 PM
    I wanna use docker run instead of docker-compose
  • b

    Bram

    12/31/2018, 3:33 PM
    in production
  • b

    Bram

    12/31/2018, 3:33 PM
    Copy code
    -e PRISMA_CONFIG= `
            port: 4466
              databases:
                default:
                  connector: postgres
                  host: postgres
                  database: database
                  user: username
                  password: password
                  rawAccess: true
                  port: 5432
                  migrations: true`
    h
    • 2
    • 11
  • b

    Bram

    12/31/2018, 3:33 PM
    this doesn't work
  • b

    Bram

    12/31/2018, 3:36 PM
    like how does this convert to shell script:
    Copy code
    environment:
          PRISMA_CONFIG: |
            port: 4466
            databases:
              default:
                connector: postgres
                host: postgres
                database: database
                user: username
                password: password
                rawAccess: true
                port: 5432
                migrations: true
    
    `
  • b

    Bram

    12/31/2018, 3:37 PM
    im baffled 😛
  • b

    Bram

    12/31/2018, 3:38 PM
    it is like a string in yml style so I guess i should pass the PRISMA_CONFIG an multiline yml string
  • b

    Bram

    12/31/2018, 3:38 PM
    but how do you even do that 😛
1...181182183...637Latest