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

    joshhopkins

    01/22/2019, 7:31 PM
    Anyone else having issues keeping subscriptions alive using
    $subscribe
    ?
    h
    • 2
    • 5
  • a

    Ash Berlin-Taylor

    02/01/2019, 3:26 PM
    Is there any reference docs on the (node) prisma client? It took me about 40 mins just now to work out the difference between
    await prisma.createUser(mutation)
    and
    prisma.createUser(mutation).id()
    -- or what that was doing, and why the examples (in the codesandbox) all return plain objects
    n
    n
    • 3
    • 10
  • p

    Plínio Naves

    02/06/2019, 1:06 AM
    Good night people! I would like to confirm if I am right (if you can help me), so I saw the only way to do schema delegation is through the prisma-binding package, is that right? Or does the Prisma Client also provide a way to do?
    n
    • 2
    • 1
  • j

    Juliano Sena

    02/11/2019, 5:44 PM
    Hi everyone
  • j

    Juliano Sena

    02/11/2019, 5:44 PM
    I have an existing mongo database And I want to connect prisma in it How can i do that ? because the prisma server always creating a new database when I deploy service in it
  • j

    Juliano Sena

    02/11/2019, 5:45 PM
    someone can help me?
  • a

    amandeep

    02/16/2019, 3:06 PM
    Hi all! I am fetching this query and it is taking 5 seconds approx to return result back. I am using prisma-client. Do I need to implement dataloader with prisma or it support out of the box
    l
    r
    • 3
    • 3
  • a

    amandeep

    02/16/2019, 3:07 PM
    As Scalar fields are returned automatically. For nested fields I am returning it like this (author & comments). Am I doing something wrong?
  • j

    jackgray

    02/22/2019, 3:59 PM
    anyone getting a parse error when importing generated api into schema.graphql? Keep restarting with the graphql auth/shield example and getting this error:
    GraphQLError: Syntax Error: Cannot parse the unexpected character ".".
    It goes away when I remove this line from my schema:
    # import * from './generated/prisma-client
    Used this method for almost a year without issues until recently. Using prisma-client-lib v 1.25.7 Min repo: github.com/jackgray/govtrackr
    h
    • 2
    • 19
  • u

    Uxname

    03/13/2019, 1:19 PM
    Does anyone know how to get relation object in realtime (subscription) iterator? I need to get object
    sender
    (type User) from created message.
    newMessage.sender
    is
    undefined
    t
    • 2
    • 10
  • d

    dany

    03/15/2019, 5:43 AM
    hello!
  • d

    dany

    03/15/2019, 5:44 AM
    i got a trouble in prisma init
  • d

    dany

    03/15/2019, 5:44 AM
    i selected existing database, mysql .. and database information
  • d

    dany

    03/15/2019, 5:44 AM
    then, i got a message
  • d

    dany

    03/15/2019, 5:44 AM
    Cannot read property 'startsWith' of undefined
  • d

    dany

    03/15/2019, 5:45 AM
    plz, help me!
    h
    • 2
    • 98
  • p

    Peter Mbanugo

    03/15/2019, 12:19 PM
    Hi. i’m having an error with my query and I’m not seeing what could be wrong
  • p

    Peter Mbanugo

    03/15/2019, 12:21 PM
    I have a schema like this
    Copy code
    type Query {
      info: String!
      users: [User!]!
      conversations: [Conversation!]!
      conversation(id: String!): Conversation!
    }
    
    type Mutation {
      createUser(name: String!): User!
      createConversation(user1: ID!, user2: ID!): Conversation!
    }
    
    type User {
      id: ID!
      name: String!
      conversations: [Conversation!]!
    }
    
    type Conversation {
      id: ID!
      messages: [Message!]!
      users: [User!]!
    }
    
    type Message {
      id: ID!
      content: String!
      createdAt: String!
      userId: ID!
      conversation: Conversation!
    }
    And I have my resolvers implemented as such:
    Copy code
    const resolvers = {
      Query: {
        info: (root, args, context) =>
          `This is the API of chatt app for Packt course`,
        users: (root, args, context) => context.prisma.users(),
        conversations: (root, args, context) => context.prisma.conversations(),
        conversation: (root, args, context) =>
          context.prisma.conversations({ id: args.id })
      },
      Mutation: {
        createUser: (root, args, context) => {
          return context.prisma.createUser({
            name: args.name
          });
        },
        createConversation: (root, args, context) => {
          return context.prisma.createConversation({
            users: {
              connect: [{ id: args.user1 }, { id: args.user2 }]
            }
          });
        }
      },
      Conversation: {
        users: (parent, args, context) => {
          console.log("calling users");
          return context.prisma.conversations({ id: parent.id }).users();
        },
        id: (parent, args, context) => parent.id
      },
    
      User: {
        conversations: (parent, args, context) => {
          return context.prisma.users({ id: parent.id }).conversations();
        }
      }
    };
    When I call the query
    Copy code
    query {
      conversation (id: "cjta0oy64ocr60b79pevff0lw"){
        id,
        users {
          name
        }
      }
    }
    I get an error that says
    Copy code
    {
      "data": null,
      "errors": [
        {
          "message": "Could not find argument id for type Conversation",
          "locations": [
            {
              "line": 2,
              "column": 3
            }
          ],
          "path": [
            "conversation"
          ]
        }
      ]
    }
    I don’t know what that means
  • p

    Peter Mbanugo

    03/15/2019, 12:23 PM
    I’ve added the ID property but it seems I’m missing something
  • p

    Peter Mbanugo

    03/15/2019, 12:30 PM
    maybe I’m query prisma client wrong
  • p

    Peter Mbanugo

    03/15/2019, 1:37 PM
    I found the problem. rather than
    context.prisma.conversations({ id: parent.id }).users();
    I should be using
    context.prisma.conversations()
    n
    • 2
    • 4
  • y

    yuri

    03/18/2019, 3:53 PM
    Spectrum doesn't look very alive, so I'll post it here as well 🙂 Hey guys, I'm not sure if it's a bug or I'm doing something wrong, please confirm. I use postgres connector (but I've checked mysql as well and still the same issue) and prisma typescript-client generator. After I deploy my datamodel which is very simple and looks like this:
    Copy code
    type Member {
      id: ID! @unique
      currentBalance: Float!
      transactions: [Transaction!]
      retailers: [Retailer!]
    }
    
    type Retailer {
      id: ID! @unique
      name: String!
    }
    
    type Transaction {
      id: ID! @unique
      purchaseDate: DateTime!
      rewardedDate: DateTime!
    }
    typescript-client generates interface without relational fields.
    Copy code
    export interface Member {
      id: ID_Output;
      currentBalance: Float;
    }
    So some of my resolvers don't have necessary types 😞 Anyone already faced this? Thanks in advance!
    d
    • 2
    • 9
  • g

    Gabe Tong

    03/19/2019, 3:05 AM
    how to send two mutations by prisma-binding ?
    h
    • 2
    • 2
  • b

    Biel Simon

    03/21/2019, 4:55 AM
    I have posted it in #general, but it is realted to the prisma client (maybe). Prisma is failing to export / reset / import to itself
  • f

    friebetill

    04/15/2019, 11:52 AM
    Is it possible to use nested queries with TypeScript and prisma-client-lib? Previously with prisma-binding, it was possible to pass the info variable to the binding, but the prisma-client-lib lacks this capability.
    h
    • 2
    • 2
  • f

    friebetill

    04/15/2019, 12:23 PM
    I’ve found this blog https://medium.com/@lukehamilton/nested-relations-in-prisma-971e060a16ab
  • f

    friebetill

    04/15/2019, 12:24 PM
    This blog helps me so far, I only have to extract the fragment from the info parameter. Are there already solutions?
  • p

    prilutskiy

    04/18/2019, 7:28 PM
    Guys, what is the status of https://github.com/prisma/rfcs/blob/new-ts-client-rfc/text/0000-new-ts-client.md ?
    h
    • 2
    • 1
  • p

    prilutskiy

    04/18/2019, 7:28 PM
    Is any team working on implementation of prisma-client v2 ?
  • c

    Chinmay Ajit Acharya

    04/22/2019, 1:50 PM
    Can any one guide me..How i can try prisma graphQL api with rest api client like postman?
    t
    • 2
    • 2
12345...23Latest