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

    ahebwa49

    02/19/2019, 10:11 AM
    Hey guys, anyone with an idea on how i can query for an authenticated user using his/her token? using graphql-yoga, and prisma API. Please explain how i can i go about it or just provide a link to a good resource where i can find the info @Harshit
  • j

    joan

    02/19/2019, 10:23 AM
    if
    componentA
    loads a query like this:
    <Query query={EVENT_QUERY} variables={{ slug: this.props.match.params.slug }}>
    with the following qgl:
    Copy code
    export const EVENT_QUERY = gql`
      query EventQuery($slug: String!) {
        event(slug: $slug) {
          id
          slug
          description
          title
          dates {
            id
            timestamp
          }
          places {
            id
            name
            url
          }
          participants {
            id
            name
          }
          menus
        }
      }
    `;
    And then I pass
    participants
    to
    componentB
    What if
    componentC
    makes a
    create mutation
    and adds a new
    participant
    to that event... How should I update the original query so that the changes with cascade down to components A and B?
    h
    • 2
    • 2
  • o

    Oskar

    02/19/2019, 10:25 AM
    Does anyone know how to get the graphql-boilerplates running? There are no folder created after installation. There are a bunch of issues regarding this but no solutions 🤔 https://github.com/graphql-boilerplates/node-graphql-server/issues/449 https://github.com/graphql-boilerplates/react-fullstack-graphql/issues/562 https://github.com/graphql-boilerplates/node-graphql-server/issues/302
  • r

    rein

    02/19/2019, 10:26 AM
    Another question for people using prisma in production, if I have a hosted database connection (so not on the same droplet as my prisma server), how scalable does the prisma endpoint itself need to be? It is a sort of proxy to and from my db but I am not sure how much power this would need
  • j

    Jon

    02/19/2019, 12:06 PM
    Hello everyone, I have a settings page where the user can update their email, first name, and last name. I am getting the following error when I submit the data from the settings page:
    Copy code
    [GraphQL error]: Message: You provided an invalid argument for the where selector on User., Location: , Path: updateUser
    
    Uncaught (in promise) Error: GraphQL error: You provided an invalid argument for the where selector on User.
    schema.graphql
    Copy code
    ...
    # import * from './generated/prisma-client/prisma.graphql'
    
    updateUser(email: String, firstName: String, lastName: String, password: String): User!
    ...
    Mutation.js
    Copy code
    async updateUser(parent, args, ctx, info) {
        // First check if there is a user with that email
        const user = await ctx.db.query.user({ where: { email: args.email } });
        if (user) {
          throw new Error(`The email ${args.email} is already being used`);
        }
        const updatedUser = await ctx.db.mutation.updateUser({
          where: { id: args.id },
          data: {
            email: args.email,
            firstName: args.firstName,
            lastName: args.lastName
          }
        });
        return updatedUser;
      }
    Frontend Mutation:
    Copy code
    const UPDATE_USER_MUTATION = gql`
      mutation UPDATE_USER_MUTATION(
        $email: String!
        $firstName: String!
        $lastName: String!
      ) {
        updateUser(email: $email, firstName: $firstName, lastName: $lastName) {
          id
          email
          firstName
          lastName
        }
      }
    `;
    What am I doing wrong here?
    j
    • 2
    • 2
  • r

    rein

    02/19/2019, 12:10 PM
    If anyone here was succesful in connecting a Prisma server to digital ocean hosted db, please let me know!
    h
    a
    • 3
    • 34
  • r

    rein

    02/19/2019, 12:10 PM
    I keep getting errors
  • j

    Jidé

    02/19/2019, 12:41 PM
    hey folks ! Any idea when we’ll be able to have multiple field unique constraint ?
  • j

    Jidé

    02/19/2019, 12:42 PM
    ha it seems it’s planned for february 🙂 https://github.com/prisma/prisma/issues/3405#issuecomment-456323909
  • j

    JoeE

    02/19/2019, 1:06 PM
    Is there roadmap page for this project? Client and Cloud?
  • m

    MartĂ­ CrespĂ­

    02/19/2019, 2:21 PM
    Is there any way to expose an enum as argument in a query or mutation with nexus?
  • m

    MartĂ­ CrespĂ­

    02/19/2019, 2:21 PM
    -.php
    w
    • 2
    • 3
  • s

    stephan

    02/19/2019, 3:29 PM
    i need help regarding querying nested objects with prisma on mongo
    h
    • 2
    • 2
  • s

    stephan

    02/19/2019, 3:30 PM
    i'm building a graphql based api
  • s

    stephan

    02/19/2019, 3:30 PM
    using typescript and mongodb
  • r

    Robert Kaczmarek

    02/19/2019, 4:57 PM
    I need some help with prisma init. I'm trying to connect an empty MySQL-DB on localhost and am getting a TypeError. Can anybody offer some advice?
    h
    • 2
    • 3
  • m

    Mike Pechousek

    02/19/2019, 5:43 PM
    Hey guys; what do you guys recommend for storing date of births in the DB?
    r
    h
    • 3
    • 5
  • m

    Mike Pechousek

    02/19/2019, 5:44 PM
    Storing it as DateTime ?
  • m

    Mike Pechousek

    02/19/2019, 5:44 PM
    or as a string
  • m

    Mike Pechousek

    02/19/2019, 5:45 PM
    nevermind, realized DateTime could be converted by ISO
  • m

    Matt Abrams

    02/20/2019, 4:10 AM
    Hi, I’m interested to know if anyone has some good examples of resolver unit tests, preferably in typescript? The most challenging piece would seem to be mocking
    prisma
    on
    context
    . It might simply come down to needing to
    @ts-ignore
    every use of a mock prisma seeing as the type definition is pretty huge to replicate an instance of. Thanks!
    a
    v
    h
    • 4
    • 6
  • a

    Andrei Bacescu

    02/20/2019, 7:44 AM
    Hello guys! I think this tutorial:
    <https://www.prisma.io/tutorials/bootstrap-a-graphql-server-in-typescript-ct09/>
    is outdated. This tutorial was supposed to use prisma-binding but instead, it uses prisma-client. Thanks.
  • c

    codebeast

    02/20/2019, 8:29 AM
    Hi. I am trying to mutate a nested array as described in this question: https://www.prisma.io/forum/t/mutation-creating-nested-mutation-with-array-and-objects/4766
  • c

    codebeast

    02/20/2019, 8:30 AM
    Where I am lost is, how do I reference this kind of type:
    LineItemCreateManyWithoutInvoiceInput
    j
    • 2
    • 23
  • c

    codebeast

    02/20/2019, 8:30 AM
    Since it’s not anywhere in my custom
    schema.graphql
  • s

    stephan

    02/20/2019, 9:07 AM
    hi guys
  • s

    stephan

    02/20/2019, 9:07 AM
    did anyone have any problems querying parent entity and getting nested entities
    h
    m
    d
    • 4
    • 9
  • s

    stephan

    02/20/2019, 9:07 AM
    ?
  • m

    MartĂ­ CrespĂ­

    02/20/2019, 9:27 AM
    Does anyone knows if it's planned to integrate nexus fully with prisma? I mean, when you deploy prisma, overwrite prisma's client with nexus, and we would don't need a index.ts file. If you are using nexus doesn't make sense deploy the prisma server because it's reading from its own client not the new one created with nexus.
    m
    • 2
    • 2
  • b

    bkstorm

    02/20/2019, 9:33 AM
    Hi. I just use nexus-prisma, it works well except I don't see schema.graphql in
    generated
    folder. There is no errors when running graphql server, does anyone have this problem and how to fix it. Thanks!
    Copy code
    const Query = prismaObjectType({
        name: 'Query',
        definition: t => t.prismaFields(['*']),
      })
      const Mutation = prismaObjectType({
        name: 'Mutation',
        definition: t => t.prismaFields(['*']),
      })
    
      const schema = makePrismaSchema({
        types: [Query, Mutation],
        prisma: {
          datamodelInfo: metaSchema,
          client: prisma,
        },
    
        outputs: {
          schema: path.join(__dirname, './generated/schema.graphql'),
          typegen: path.join(__dirname, './generated/nexus.ts'),
        },
      })
    m
    a
    • 3
    • 22
1...213214215...637Latest