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

    THpubs

    12/08/2018, 6:07 AM
    Anyone know how to apply validations for your schema? Let’s say I have a User which have multiple Posts. Now a Post can be created using createPost and also using createUser (Creating related records). I found this great article to put validations and used it: https://itnext.io/graphql-mutation-arguments-validation-with-yup-using-graphql-middleware-645822fb748 But there’s a problem. If I need to add validation to Post, I need to put the validation in both Post and User create functions. So, my question is, how to do this properly?
    n
    • 2
    • 1
  • a

    artindaniel

    12/08/2018, 11:10 AM
    Hey guys, I have the following subscription
    Copy code
    Subscription: {
        userUpdate: {
          subscribe: async (parent, args, context) => {
            const { userId } = args;
            return context.prisma.$subscribe
              .user({
                id: userId,
                mutation_in: ["UPDATED"]
              })
              .node();
          },
          resolve: payload => {
            return payload;
          }
        }
      }
    Copy code
    subscription { 
    	userUpdate(userId:"5c0b97f4be07770009dad41f") { 
      	id 
        posts { 
        	id 
        }
      }
    }
    The problem is that the subscription doesn't resolve relationship fields. For example
    posts
    returns null. Is this intended behavior or am I missing something? I'm using docker with Prisma 1.22 and the mongo db connector.
  • s

    Seun LanLege

    12/08/2018, 1:23 PM
    hey guys
  • s

    Seun LanLege

    12/08/2018, 1:23 PM
    Is it possible to have unique references?
    h
    • 2
    • 1
  • o

    Owen Garland

    12/08/2018, 3:19 PM
    Does anyone have any suggestions on how to clear a test database after each test?
    n
    • 2
    • 1
  • o

    Owen Garland

    12/08/2018, 3:20 PM
    I have my project setup so that when I run my tests I start a new connection to a test instance, but I need to have a step that will reset the database after each test, but I can't see a way to do that.
  • o

    Owen Garland

    12/08/2018, 4:24 PM
    Basically is there anyway to stop a GraphQLServer?
  • j

    JustinR

    12/08/2018, 6:41 PM
    thread: Has anyone got the prisma with mongodb to work on a window 10 machine. I followed the Prisma 1.22 setup instructions and I can't run prisma deploy
    p
    • 2
    • 11
  • c

    Chas

    12/08/2018, 11:39 PM
    Hello I am hoping someone can help me. I am trying to change my data model from a one to one, to a one to many. But it keeps saying I will have a data loss. Is there a way to do it without losing my data?
    datamodel_prisma.php
    • 1
    • 1
  • n

    Nick

    12/09/2018, 2:08 PM
    Why is there not any tutorials on graphcool framework as much there is on prisma?
    h
    • 2
    • 2
  • k

    KenJazzy

    12/09/2018, 3:36 PM
    Hi! Beginner question here to make sure Im starting down the right path. Im researching a full stack app. Im really just a little confused on what I can use Prisma / Prisma Client for and when/if I need to reach for Apollo/GraphqlYoga. Any direction to get me started would be much appreciated 🙂. Id love to take advantage of Prisma for as much as I can!
    h
    f
    • 3
    • 8
  • j

    Jake Ranallo

    12/10/2018, 7:44 AM
    Hi all. Does anyone know of any example projects that have a blog style posts model showing a many to many 'tags' style relationship? Struggling to implement arrays of tags on posts in my project? Thanks
    m
    • 2
    • 3
  • m

    mezie

    12/10/2018, 10:30 AM
    Hi guys! I'm trying to wrap my head around my Prisma subscriptions isn't working with my custom resolvers. But works if I use the Prisma API directly
    h
    a
    • 3
    • 7
  • s

    siyfion

    12/10/2018, 1:53 PM
    There’s no way to use the result of one mutation in the fields of another, in the
    seed.graphql
    file, is there?
    h
    a
    • 3
    • 4
  • s

    siyfion

    12/10/2018, 1:53 PM
    ie. create a relationship in the data?
  • x

    xiaoqf10

    12/10/2018, 2:07 PM
    How can I set the PRISMA_CONFIG environment in aws task?
    s
    • 2
    • 35
  • v

    vdiaz1130

    12/10/2018, 2:24 PM
    Hi everyone! I’m trying to get Okgrow/graphql-scalars and GraphQLJSON working. Anyone successful doing that? I have an opened ticket here:
    <https://www.prisma.io/forum/t/okgrow-graphql-scalars-and-graphqljson-not-working/5303>
  • m

    markus_str

    12/10/2018, 3:30 PM
    hey guys, I'm trying since hours to get the context.prisma.user({id}) from the examples working in another project. Is this the right channel to ask for help?
    p
    • 2
    • 77
  • c

    ccouchot

    12/10/2018, 6:51 PM
    Hi there ! I've been trying to use
    prisma login
    from behind a company proxy, after having set HTTP_PROXY and HTTPS_PROXY env variables but still no luck returning the following error... Been driving me crazy for hours 😕 Any help would be greatly appreciated !
    -.txt
  • h

    hassank

    12/10/2018, 8:07 PM
    hi guys, I'm new to graphcool and prisma. I'm experimenting with graphcool playground and I'm trying to make an authenticated query, how or where do I get a token to include in the http headers?
    s
    • 2
    • 3
  • s

    sf

    12/10/2018, 8:28 PM
    Following the tutorial here https://www.howtographql.com/graphql-js/8-filtering-pagination-and-sorting/ -- the last step of adding the aggregate count seems to have broken the sorting implemented in the previous section of the tutorial. Wonder what I'm missing. The feed resolver is implemented using an IN query
    context.db.query.links({ where: { id_in: parent.linkIds } }, info)
    and I'm not following how that can maintain the order specified in the original query.
  • r

    rohit

    12/10/2018, 8:52 PM
    Hey guys, Our team at Novvum is putting together a study on the effects of adopting GraphQL. We would really love your input. Your experience will be valuable information to developers and CTOs researching the benefits. We would appreciate it if you can fill out a quick 3 min survey about your experience. Don’t worry, the questions are generic and we won’t be sharing any of your personal information. Survey here 👉 http://bit.ly/2E44lOc We can really grow the community with this study. If you know who could fill out this survey, please feel free to share it with them. Thanks! Cheers~
    👍 2
  • k

    KyleG

    12/10/2018, 9:28 PM
    Anyone run into an issue in Apollo mutations where if you pass a variable that is just the integer
    0
    it'll be ignored and not sent in the request to the server?
    Whoops, never mind. Just a silly mistake in my own resolver code. ^o^ Just needed to use my own patented "Truthy Zero" function haha.
    Copy code
    function t0(input) {
      return !!(input || input === 0);
    }
  • g

    Gaurav

    12/10/2018, 10:17 PM
    Hi all, I am trying to set up a MySQL DB with AWS RDS, and was hoping to then deploy Prisma server with DigitalOcean, but I couldn't. Could somebody please help with their inputs/insights on my forum post: https://www.prisma.io/forum/t/aws-rds-could-not-connect-to-server-and-where-are-the-docs-for-deployments/5314? Thanks 🙂
  • v

    vdiaz1130

    12/11/2018, 12:56 AM
    When using secret with Prisma typically you would set that in prisma.yml and at the point where an instance of Prisma is created.
    Copy code
    const prisma = new Prisma({
        typeDefs: 'src/generated/prisma.graphql',
        endpoint: process.env.PRISMA_ENDPOINT,
        secret: process.env.PRISMA_SECRET
    })
    When using graphql gen, that Prisma instance is created for you. Anyone know how to pass the secret to that instance?
  • v

    vdiaz1130

    12/11/2018, 12:59 AM
    Ignore. It’s passed into the generated code
    Copy code
    export const Prisma = makePrismaClientClass<ClientConstructor<Prisma>>({
      typeDefs,
      models,
      endpoint: `${process.env["PRISMA_ENDPOINT"]}`,
      secret: `${process.env["PRISMA_SECRET"]}`
    });
    export const prisma = new Prisma();
  • c

    CCBCodeMonkey

    12/11/2018, 4:41 AM
    hey, something has changed with my config
    f
    • 2
    • 5
  • c

    CCBCodeMonkey

    12/11/2018, 4:41 AM
    graphql get-schema -p prisma
    no longer generates my prisma.graphql file
  • c

    CCBCodeMonkey

    12/11/2018, 4:41 AM
    and I can't figure out why, I don't believe I changed anything
  • c

    CCBCodeMonkey

    12/11/2018, 4:50 AM
    says it is generating
1...174175176...637Latest