https://www.prisma.io/ logo
Join SlackCommunities
Powered by
# prisma-client
  • m

    musbell

    09/17/2018, 9:09 PM
    Hello
  • m

    musbell

    09/17/2018, 9:16 PM
    I would like to ask if prisma-client can be used with Apollo or Redux
  • m

    musbell

    09/17/2018, 9:17 PM
    or an alternative
  • m

    musbell

    09/17/2018, 9:18 PM
    to either both
  • h

    Henry

    09/17/2018, 9:53 PM
    Figured here might be a better place to ask this
  • m

    musbell

    09/22/2018, 6:20 AM
    My question has been answered here by @tim2 in the comments section: https://www.prisma.io/blog/prisma-client-beta-ahph4o1umail/
  • e

    Entrepreneur3

    09/23/2018, 1:13 PM
    Hello guys, I am currently struggling with the prisma.io documentation. I don't know where my question fits best even though it is a server-side question I think it fits more here in the prisma-client channel since there is no other one for the server side thing. I can't find any reference where I can learn how I use an array of IDs to connect an Object Type with another one. Example: Role:
    Copy code
    type Role {
        id: ID!
        title: String!
        permissions: [Permission!]!
    }
    Permission:
    Copy code
    type Permission {
        id: ID!
        title: String!
    }
    Mutation:
    Copy code
    createRole(
            title: String
            permissions: [ID!]
        ): Role
    Resolver:
    Copy code
    createRole(root, args, context) {
                return context.prisma.createRole(
                    {
                        title: args.title,
                        permissions: {
                            connect: args.permissions <-- This does not work I get always an error from the GraphQL playground, what's the solution?
                        }
                    }
                )
            },
    I am new to this kind of server side programming I am coming from the iOS-World. Would appreciate any help since I kinda feel that the prisma.io documentation lacks on information. I don't know if that is the case but it really feels so. If that questions fits somewhere else better than here then please tell me
  • n

    nilan

    09/25/2018, 7:49 PM
    https://www.prisma.io/forum/t/help-understanding-prisma-clients-value-proposition/4394/17?u=nilan
    šŸ‘ 2
  • a

    Alireza Ghamkhar

    10/07/2018, 8:07 PM
    hi everyone. don't know if its the right channel to ask this question but anyone could follow this?: https://www.howtographql.com/react-apollo/1-getting-started/ i get error in setting up the backend. i don't work on backend i just want to learn Appolo in react/react native. i couldn't find any other useful tutorial. would appreciate if anyone could help šŸ™‚
  • t

    TangoJuliett

    10/29/2018, 9:25 PM
    I’m getting an error when trying to generate the Prisma client, it’s generating the following:
    Copy code
    export const Prisma = makePrismaClientClass<ClientConstructor<Prisma>>({typeDefs, endpoint: `${process.env['PRISMA_ENDPOINT, '<http://localhost:4466/currentbusiness>'']}`})
    from:
    Copy code
    endpoint: ${env:PRISMA_ENDPOINT, '<http://localhost:4466/currentbusiness>'}
    in my prisma.yml file
    s
    • 2
    • 4
  • e

    Elfayer

    10/30/2018, 1:27 AM
    I have a problem with Prisma client (compared to prisma-binding), it does not get the relationship of a requested resource. Let's say I want to get the
    type User
    which would contain
    posts: [Post!]!
    , I'd receive
    null
    for
    posts
    . The only way to get the users with the posts in prisma client is with a fragment (as far as I am aware). This makes resolvers much more verbose to define (and update on model modifications). Is this an expected behavior?
    ā˜ļø 1
  • m

    Martin Hunt

    10/30/2018, 4:10 AM
    Hi all, I'm wondering how I can import my typedefs from the generated files in to my schema.graphql to avoid having to duplicate all that data. Is this possible with prisma-client and is it a terrible idea?
    e
    • 2
    • 2
  • m

    misha

    10/31/2018, 2:46 PM
    Hi there! I've got my core app working great. Now I have a separate repo where I want to access my DB with Prisma Client in the same way. It seems like I should be able to just
    prisma generate
    using an endpoint and secret, but it says
    datamodel
    is required. Am I thinking about this correctly? Perhaps I should just stick with a mono-repo?
  • p

    prilutskiy

    11/07/2018, 5:10 PM
    Guys, please take a look
  • p

    prilutskiy

    11/07/2018, 5:10 PM
    https://github.com/prisma/prisma/issues/3429 https://github.com/prisma/prisma/pull/3438
  • l

    Luke

    11/13/2018, 4:42 AM
    How do you all import your types from
    datamodel.prisma
    into
    schema.graphql
    so I don’t need to re write them ?
    b
    v
    • 3
    • 4
  • j

    JĆørgen V

    11/21/2018, 1:25 PM
    Copy code
    mongo     | 2018-11-21T13:18:31.002+0000 I FTDC     [ftdc] Unclean full-time diagnostic data capture shutdown detected, found interim file, some metrics may have been lost. OK
    prisma    | Exception in thread "main" java.lang.RuntimeException: Unable to load Prisma config: java.lang.RuntimeException: Please provide a valid Mongo connection uri.
    Hmmm. How can I see what connection string prisma is using? The docker-compose.yml seems correct to me .
    n
    • 2
    • 1
  • k

    kyleshevlin

    11/22/2018, 4:33 AM
    If I'm generating the
    javascript-client
    , does it make sense to import the
    typeDefs
    from
    prisma-client.js
    into whatever I'm using to make my graphql server? The Prisma tutorials have you create your own
    schema.graphql
    file to supply the
    typeDefs
    , but that seems redundant to rewrite your schema after writing it in the
    datamodel.prisma
    file.
    n
    b
    • 3
    • 13
  • p

    prilutskiy

    11/22/2018, 8:27 AM
    @kyleshevlin What if you'll need add a property to your model that doesn't exist in database? What if don't wanna expose something that's stored in database to the client? You have to define your schema in `schema.graphql`: either by adding whatever queries your project needs or by copying queries from generated
    prisma.graphql
    and delegating the call to the prisma-client.
  • k

    kyleshevlin

    11/22/2018, 5:39 PM
    the
    javascript-client
    generator doesn't generate a
    prisma.graphql
    file.
  • k

    kyleshevlin

    11/22/2018, 5:39 PM
    Can you run multiple generators?
    n
    • 2
    • 2
  • k

    kyleshevlin

    11/22/2018, 5:39 PM
    Because I haven't seen documentation that suggests I can do that.
  • k

    Ken

    11/23/2018, 12:56 AM
    const contactPromise = prisma.contact({authSysId}); const userPromise = contactPromise.user(); Promise.all([contactPromise, userPromise]) .then((value: [Contact, User]) => { I expected the promise to resolve as one user and one contact. However, value has the same user record: (2) [{…}, {…}] 0: createdAt: "2018-11-22T235844.160Z"id: "cjot9cqta002a0a34clfbckop"isAdmin: falsename: ""updatedAt: "2018-11-22T235844.160Z"userAttributes: null__proto__: Object1: createdAt: "2018-11-22T235844.160Z"id: "cjot9cqta002a0a34clfbckop"isAdmin: falsename: ""updatedAt: "2018-11-22T235844.160Z"userAttributes: null__proto__: Objectlength: 2__proto__: Array(0) Am I doing something wrong or is this a bug?
  • k

    Ken

    11/23/2018, 1:06 AM
    and the more general question is what is the best way to get fields from two tables on a 1:1 join. In SQL or GraphQL against the model would be easy. When I use the generated TypeScript client, I'm struggling to see a simple way to do so.
  • r

    Rostislav Simonik

    11/30/2018, 4:25 PM
    Hello, I’d like ask if you can redirect me to some example or to give me some hints how to do result mapping in resolver to outer scheme inner scheme:
    Copy code
    a: {
        b: {
           c: {
               d: 1,
           },
        },
    }
    outer scheme:
    Copy code
    a: {
       c: {
          d: 1,
       },
    }
    so node b is internal and don’t want to expose it to external consumers. Is that achievable at this moment ? Thanks a lot.
    a
    • 2
    • 2
  • r

    rooneyK

    12/07/2018, 7:51 AM
    Any feedback on this would be greatly appreciated.
    s
    • 2
    • 1
  • d

    Drew Delianides

    12/07/2018, 5:26 PM
    is it possible to do CRUD operations with the
    updateMany
    mutation in prisma-client? It works in prisma-bindings but at least in the types those fields aren't available.
    s
    • 2
    • 3
  • d

    Drew Delianides

    12/07/2018, 5:31 PM
    Copy code
    ctx.prisma.updateManyFoo({
      data: {
        field: {
          create: [ { ... } ]
        },
      },
      where: {
        id,
      },
    });
  • d

    Drew Delianides

    12/07/2018, 5:32 PM
    the above fails typecheck because relations aren't in
    FooUpdateManyMutationInput
    .
  • s

    siyfion

    12/13/2018, 3:07 PM
    Given a Prisma client request such as:
    Copy code
    prisma.user({ email: context.email }).following({ where: {
            lists_some: {
              name: 'Been',
              items_some: {
                venue: {
                  id: venueId
                }
              }
            }
          }})
    How would I go about getting a
    count
    back for the number of ā€œfollowersā€, rather than getting all the data and doing a
    .length
    ?
    n
    • 2
    • 3
12345...23Latest