https://www.prisma.io/ logo
Join SlackCommunities
Powered by
# random
  • q

    qsys

    06/13/2018, 2:20 PM
    got it, need to make it`agentId` and
    bookingId
    ...
  • a

    Alex Howard

    06/13/2018, 8:28 PM
    Hey guys, dumb question... given this type in my schema:
    Copy code
    type User {
      id: ID!
      oid: String!
      role: Role!
      roleName: String!
    }
    and this code:
    Copy code
    const attachRoleName = user => ({
      ...user,
      roleName: user.role.name,
    });
    
    const Query = {
      ...
      async currentUser(parent, args, context, info) {
        const { request } = context;
        const user = await context.db.query.user({ where: { oid: request.user.oid } }, info);
        return attachRoleName(user);
      },
      ...
    };
    I can't seem to request
    roleName
    from the clientside without requesting
    role { name }
    as well–which makes sense since I'm just passing
    info
    straight through–so how would I add the equiv of
    role { name }
    to info if I detect that they are requesting
    roleName
    ?
    b
    • 2
    • 5
  • a

    Alex Howard

    06/13/2018, 8:29 PM
    info
    is of the GraphQLResolveInfo type
  • a

    alechp

    06/14/2018, 3:18 PM
    ny
    🤯 2
  • t

    timm

    06/14/2018, 7:44 PM
    have a question about querying a type that exists to join two types. so i have User and Song types and then RecentSong which is basically a list of songs the user has recently played. The thing is when the same song is played again I don't want to create a new recent song, i just want to update the time last played. Is it possible to do a single graphql mutation that would get a user's recent songs and "upsert" the time last played if the recent song already exists or it would create a new recent song if it doesn't exist?? Does this schema approach even make sense?
  • m

    medelman

    06/15/2018, 8:56 PM
    What's everyone using for React Native CI/CD these days?
    a
    b
    • 3
    • 2
  • e

    ericsonluciano

    06/16/2018, 2:17 PM
    anyone here a sample of authentication with email with prisma
    s
    • 2
    • 2
  • c

    csilvacaio

    06/20/2018, 4:02 PM
    Hi guys, i want to do some report dynamic construct using graphql. The user will create the report's structure according his necessity, with operations and, or, etc. My question is, how can I create a query (server) that will consider all the
    and's
    and
    or's
    of the request? Trying to clarify a little bit, e.g.:
    Copy code
    (
    name = 'Caio'
    OR
    name = 'Felipe'
    )
    AND 
    (
    age = '25'
    OR
    age = '30'
    )
    a
    • 2
    • 3
  • l

    Lucas Geitner

    06/21/2018, 5:27 PM
    Waa, so easy to deploy in production with Amazon Database😎. I wasn’t sleeping since days working with Digital Océan, It should be added to the doc. 🤗
    j
    • 2
    • 3
  • d

    Dukuo

    06/22/2018, 5:54 AM
    Could you generate a custom ID in a resolver before going to Prisma? Like implenting https://github.com/segmentio/ksuid instead of the regular ID thats generated in Prisma.
  • e

    ericsonluciano

    06/22/2018, 2:50 PM
    hi everyone anyone try to
    prisma init
    and set the cluster endpoint to digitalocean i already setup the digital ocean but look's like i can't create a project
  • m

    MChorfa

    06/23/2018, 1:36 AM
    Is there any guide of something like "how to convince my septic team to use Prisma"?
    c
    a
    • 3
    • 5
  • d

    Dukuo

    06/23/2018, 5:39 AM
    If anyone is looking an answer to this, there's an ongoing discussion on gitub https://github.com/prismagraphql/prisma/issues/1278 .. (would `myId`be the most realistic approach at the moment @nilan? )
    👍 1
  • j

    jake

    06/29/2018, 7:11 PM
    I’m really struggling to find documentation explaining how to handle any record associations in my resolver BEFORE returning the payload.
  • j

    jake

    06/29/2018, 7:11 PM
    Anybody give me a clue as to what to look for?
  • j

    jake

    06/29/2018, 7:12 PM
    Example: I have a mutation that passes a record id. I want to request that resource from my DB WITH all of it’s assigned relationships, perform some operations on those related resources, and then return a response.
  • j

    Jenkins

    06/29/2018, 7:21 PM
    You can
    await
    the response from the database, modify your stuff and then return?
  • j

    jake

    06/29/2018, 7:30 PM
    Those “relationships” are setup like
    Copy code
    LineItem: {
        id: root => root._id || root.id,
        product: async ({ Product_SKU__c }) => {
          let Product = await sf.sobject('Product2').retrieve(Product_SKU__c);
    
          return Object.assign({ id: Product_SKU__c }, SerializeRecord(Product));
        }
      },
  • j

    jake

    06/29/2018, 7:49 PM
    I’m not even sure how to talk about the problem- but if I return an Order from my query, it will have all of its relationships in the response (LineItem, etc). But if I try to reference them in the query prior to returning them, they are not available.
  • j

    jake

    06/29/2018, 7:50 PM
    I feel like I need a way to run the item thru the resolver…
  • j

    Jenkins

    06/29/2018, 8:07 PM
    @jake Yeah, don't think I'll be much help for you there mate! Sorry for that 😕
  • j

    jake

    06/30/2018, 2:02 PM
    No worries, appreciate it anyways @Jenkins!
    ❤️ 1
  • m

    miho

    07/02/2018, 12:41 PM
    Hi Guys .. maybe some one know how to create multiple create mutation via prisma binding ? Thnx
  • w

    weakky

    07/03/2018, 10:18 AM
    https://www.reddit.com/r/ProgrammerHumor/comments/8tlqo9/javascript_is_getting_real_tired_of_your_jokes/
    🤣 4
    j
    • 2
    • 1
  • g

    gantman

    07/03/2018, 1:34 PM
    https://hackernoon.com/5-conference-speaking-tips-from-tech-gurus-2f7d1a250af3
  • d

    dreadjr

    07/03/2018, 9:41 PM
    Anyone have any resources for a middleware or proxy for quota type token bucket algorithm, on the graphql api?
  • h

    hvillain

    07/06/2018, 11:56 AM
    My spare-time project is on Product Hunt: https://producthunt.com/posts/try-cereals! React + Apollo + Graphcool framework (yup 😇), be sure to join the convo!
    🙌 4
  • p

    playra

    07/09/2018, 7:33 PM
    How to make a mutation update?
    Copy code
    async createDraft(parent, { title, text }, ctx, info) {
        const userId = getUserId(ctx)
        return ctx.db.mutation.createPost(
          {
            data: {
              title,
              text,
              isPublished: false,
              author: {
                connect: { id: userId },
              },
            },
          },
          info
        )
      },
    m
    • 2
    • 2
  • h

    Haider Malik

    07/11/2018, 11:49 AM
    I have got the same error
    Message: Your token is invalid. It might have expired or you mightbe using a token from a different project., Location: undefined, Path: undefined [Network error]: Error: Your token is invalid. It might have expired or you might be using a token from a different project.
    Prisma.yaml
    Copy code
    endpoint: <https://eu1.prisma.sh/haider-malik-c1556sddd/had/dev>
            datamodel: datamodel.graphql
            secret: mysecret33
            hooks:
              post-deploy:
                - graphql get-schema --project database
    .graphqlconfig.yml
    Copy code
    projects:
          app:
            schemaPath: src/schema.graphql
            extensions:
              endpoints:
                default: <http://localhost:4000>
          database:
            schemaPath: src/generated/prisma.graphql
            extensions:
              prisma: database/prisma.yml
  • a

    Arnab

    07/11/2018, 1:10 PM
    If I have an existing database and I try to run prisma against that DB, does prisma then change username/passwords on that DB? I am asking because I just did that and I had trouble connecting to the database (authentication error on the username). When I used me
    reset_db
    script (that basically wipes all data and reinitializes the DB), then I was able to log in again.
    n
    • 2
    • 1
1...222324...53Latest