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

    beeman

    10/31/2018, 1:16 AM
    Hello all!
  • b

    beeman

    10/31/2018, 1:16 AM
    I somehow got an invite to this slack - not sure how and why but that's ok!
  • b

    beeman

    10/31/2018, 1:17 AM
    I'm curious if there's somebody here that can merge a small PR: https://github.com/graphql-boilerplates/typescript-graphql-server/pull/356
  • p

    papomolina

    10/31/2018, 1:25 AM
    Hello Everyone.. got an invite as well, have no idea how they got my email but hope to learn a lot from you guys …
  • z

    Zefex Developer

    10/31/2018, 1:33 AM
    Is there anyone to help me implement a custom field with Prisma? https://www.prisma.io/forum/t/implement-a-viewerhasread-custom-field/4871
    n
    • 2
    • 1
  • z

    Zefex Developer

    10/31/2018, 2:42 AM
    In my resolvers should I pass the info as well? (and why?)
    Copy code
    export default {
      Query: {
        user: (parent, { id }, { database }) =>
          database.query.user({ where: { id } })
      }
    }
    n
    • 2
    • 4
  • p

    pedro

    10/31/2018, 3:14 AM
    Hello everybody
  • p

    pedro

    10/31/2018, 3:15 AM
    Anyone ever got around this problem? https://github.com/prisma/prisma/issues/2795
    n
    • 2
    • 2
  • n

    Nick

    10/31/2018, 4:30 AM
    I thought this video explained the all-new graphqlgen really well https://m.youtube.com/watch?v=5JuSXwFSJn4&list=LL8bYS4kY0br718lE_ButosQ&index=2&t=0s
    👍 5
    s
    • 2
    • 1
  • r

    rein

    10/31/2018, 8:50 AM
    Can someone briefly explain the difference between graphqlgen and codegen? I feel they kind of share the same purpose?
  • h

    halborg

    10/31/2018, 10:03 AM
    Does anyone know how to limit the results of lists in nested queries? For example, given the simple schema of
    Copy code
    type User {
      posts: [Post!]!
    }
    
    type Post {
      id: ID! @unique
      title: String!
    }
    
    type Comment {
      id: ID! @unique
      content: String!
      author: User!
    }
    and a query of
    Copy code
    {
      users(first: 100) {
        posts {
          comments {
            content
          }
        }
      }
    }
    and a one-line Prisma resolver such as
    Copy code
    resolve: async (parent, { first, after }, ctx, info) => {
        return ctx.db.query.usersConnection({ first, after }, info),
    }
    (where
    db
    is of type
    Prisma
    in the generated schema) it will fetch all of the posts, and all of the comments for each post for a 100 users, which is an obvious attack vector and a performance problem. How do I resolve that in Prisma? (forum post here: https://www.prisma.io/forum/t/how-to-limit-queries-on-nested-lists-with-prisma-bindings/4851)
    • 1
    • 1
  • t

    theom

    10/31/2018, 10:10 AM
    So, I'm getting the following error on permissions:
    Copy code
    {
      "data": null,
      "errors": [
        {
          "message": "Cannot return null for non-nullable field User.permissions.",
          "locations": [
            {
              "line": 14,
              "column": 5
            }
          ],
          "path": [
            "signin",
            "permissions"
          ]
        }
      ]
    }
    when attempting to run the following mutation. What am I overlooking:
    Copy code
    mutation SIGNIN_MUTATION($email: String!, $password: String!, $pathname: String!) {
        signin(email: $email, password: $password, pathname: $pathname) {
        id
        name
        email
        permissions
      }
    }
    based on the following schema and datamodel schema
    Copy code
    type Mutation {
        signin(email: String!, password: String!, pathname: String!): User!
    }
    datamodel
    Copy code
    type User {
      id: ID! @unique
      name: String!
      email: String! @unique
      password: String!
      resetToken: String
      resetTokenExpiry: String
      permissions: [Permission]
      cart: [CartItem!]!
    }
    m
    • 2
    • 2
  • j

    joao.santos

    10/31/2018, 11:54 AM
    hi guys, do you think this is a good code splitting to use with prisma? Every folder as its own logic, types querys mutations and subscriptions, and then index merge everything... Nevermind entity, thats from an orm...
    c
    h
    • 3
    • 6
  • z

    Zefex Developer

    10/31/2018, 1:13 PM
    Where can I find a considerably large project made using Apollo so I see how they create their resolvers and so on?
    m
    h
    • 3
    • 3
  • r

    rem

    10/31/2018, 1:36 PM
    I'm trying to get started with the "existing database" tutorial on prisma.io - but both local and remote postgres based servers result in the prisma playground saying "Server cannot be reached" and the
    prisma introspect
    fails (for the same reason). I can connect to both servers via the CLI - anyone seen this/tips?
    h
    • 2
    • 3
  • y

    yolen

    10/31/2018, 2:12 PM
    weird problem. my code is this
    Copy code
    const server = new GraphQLServer({
        typeDefs: './src/schema.graphql',
        port: 8080,
        resolvers,
        context: {
            db: prisma,
        },
    } as any)
    . runs fine and I can get the playground up and running..... but on port 4000 NOT 8080. I have tried other ports but no cigar. I found this old issue https://github.com/prisma/graphql-yoga/issues/281
    j
    z
    • 3
    • 23
  • n

    Nick

    10/31/2018, 3:11 PM
    I haven’t written here in a while a lot has changed since the summer time when I was using prisma heavily. The thing that bugs me is the docs, in the howtographql tutorials you taught that. That the resolver functions receives four arguments root, args, context and info. Lately I have seen examples where the cut out the forth arguments. Example https://www.prisma.io/docs/get-started/03-build-graphql-servers-with-prisma-e001/ I found that the new docs are vastly different from howtograpqhl that’s where majority that learns graphql/prisma comes from. Maybe in the new docs should include some schema delegation examples like the old way of doing it, less prisma client. Yeah I’m confused about that one(prisma-client) I still view the old docs 1:13 and I still use the old boilerplates(node and typescript one). The API(prisma eco-system) has changed a lot lately. I don’t guys I feel like the stuff that learned 3-4 months ago are already outdated somehow.
  • d

    Drew Delianides

    10/31/2018, 3:28 PM
    Is the prisma cloud console down for anyone else?
    z
    d
    • 3
    • 2
  • d

    divyendu

    10/31/2018, 3:35 PM
    We are aware that Prisma Cloud is down at the moment and we are working on restoring the service. I will post here once the service is fully restored.
    fast parrot 1
    👍 4
  • d

    divyendu

    10/31/2018, 3:56 PM
    Prisma Cloud service is fully restored.
  • d

    Dorkside

    10/31/2018, 3:56 PM
    Thanks
  • a

    aman06

    10/31/2018, 6:14 PM
    is it possible to use interfaces in the datamodel ? I saw a github issue related to this a while back and I wasn’t sure if it was ever added. Also, if interfaces are not available, is there a simple way to have inheritance?
  • r

    rooneyK

    10/31/2018, 6:24 PM
    Hi, everybody, and especially the Prisma-team. We are currently enjoying working with prisma for numerous projects and containers. It is simply amazing how much time we have saved by using it over general ORM. Our customers love it, so that is cool too.
  • r

    rooneyK

    10/31/2018, 6:27 PM
    As much time as we have saved, there is however, something I would like to ask for your advice.
  • r

    rooneyK

    10/31/2018, 6:40 PM
    In one of our project, (node, typescript) we are generating the database directly from prisma, and this works great. We would very much like to keep as much of this interface as possible, so that customers can use the same queries and mutations that are exposed directly. We would, however, like to hide a few fields, which will be filled by the node-server. As an minimal example, have a look at the schema below
    Copy code
    # database-generated input
    input TagCreateInput {
      name: String
      description: String
      type: TagTypes
      createdBy: UserCreateOneWithoutCreatedTagsInput!
    }
    
    input TagCreateInput {
      name: String
      description: String
      type: TagTypes
    }
    Now, in this example, the bottom one (publicly exposes) is what the user can see and interact with. Note that we have simply compied that whole
    Tag
    from the database and removed
    createdBy
    . This does work, but the maintenance-level is high for this solution, especially as tables evovle with more and more relations, nesting etc. There are so many ways that a
    Tag
    might be created. I am wondering, is it possible, to instead of copying the whole input-object and removing the fields we don't want publicly available, would it be possible to instead something like extending input with removal of some specific fields? Or is there a different solution available?
    m
    • 2
    • 3
  • k

    Keegan

    10/31/2018, 7:25 PM
    whats up everyone, thanks for the invite @Lydia Hallie
    👋 1
  • m

    mfcarneiro

    10/31/2018, 8:07 PM
    Hi guys! Anyone are using Apollo engine with prisma cloud, i'm creating a project and I want to work with both 😅
    h
    • 2
    • 1
  • m

    mfcarneiro

    10/31/2018, 8:08 PM
    let me know about some nice feedbacks on that, thanks! 😄
  • k

    kimf

    10/31/2018, 9:57 PM
    Hello all.. Been searching the interwebs but haven’t found a good answer. Is there any way to force the client to select certain fields? using the
    info
    attribute we noticed that if the client leaves out “externalServiceId” we can’t use that attribute in a later stage in the code…
    b
    f
    • 3
    • 3
  • m

    Mitch

    11/01/2018, 5:24 AM
    Hello! I am either having a strange issue or am missing something. I am new to using Prisma and I set up a workspace/service and it seems to have disappeared. I get this error:
    Copy code
    ERROR: Workspace mitch does not exist
    
    {
      "data": {
        "generateClusterToken": null
      },
      "errors": [
        {
          "message": "Workspace mitch does not exist",
          "locations": [
            {
              "line": 3,
              "column": 9
            }
          ],
          "path": [
            "generateClusterToken"
          ],
          "code": 222
        }
      ],
      "status": 200
    }
    It was previously working and I have since set my app up with a new workspace/service, but I am still wondering what happened to the last one. Any insight would be appreciated 🙂
    d
    h
    • 3
    • 19
1...146147148...637Latest