https://www.prisma.io/ logo
Join SlackCommunities
Powered by
# prisma-whats-new
  • n

    Neill Kapron

    03/28/2018, 8:11 PM
    Question- I'm learning prisma/graphql et al, and have a question regarding many to many relationships with join tables that have additional data
  • n

    Neill Kapron

    03/28/2018, 8:11 PM
    Is that possible in graphql?
  • n

    Neill Kapron

    03/28/2018, 8:12 PM
    for example- I have a ingredients and a recipe
  • n

    Neill Kapron

    03/28/2018, 8:12 PM
    the ingredients can be in multiple recipes, and a recipe has multiple ingredients
  • n

    Neill Kapron

    03/28/2018, 8:12 PM
    however, the order of the ingredients matters
  • n

    Neill Kapron

    03/28/2018, 8:13 PM
    Do I just define the join table as its own type and build it out that way?
    f
    • 2
    • 2
  • c

    Christian Genco

    03/28/2018, 8:19 PM
    @Neill Kapron from what I've read, I don't think you can add data to a join table natively in prisma. You could probably hack it on, but I'd wager it's easier to add a
    ingredientOrder
    json field to your
    Recipe
  • c

    Christian Genco

    03/28/2018, 8:20 PM
    Something like
    {ingredientId: ORDER}
    so you can do
    ingredients.sort_by(ing => recipe.ingredientOrder[ing.id])
  • c

    Christian Genco

    03/28/2018, 8:21 PM
    (on the client)
  • n

    Neill Kapron

    03/28/2018, 8:21 PM
    @Christian Genco Thanks, that makes sense
    ❤️ 1
  • j

    joshjoe

    03/28/2018, 9:29 PM
    Is it possible to link two types with an ID that is shared? I have several types that represent REST endpoints. One endpoint returns a person_id, but not the whole person
    c
    f
    • 3
    • 21
  • e

    eugenistoc

    03/28/2018, 9:45 PM
    How can I create a hook, so that during an insert, for example, a bunch of other items are initialized. For example, a user is created, so after it s crested, create a new "Organization" a new "Profile", etc. Can that be done with the functions hooks?
    c
    • 2
    • 7
  • f

    finn

    03/28/2018, 9:51 PM
    I'm working with the email-password auth template, and I'm wondering what the best way to reset a user's password is. I found some "outdated" templates that appear to do what I want, but in the README it says very explicitly: "outdated templates are not officially supported". Indeed, after adding this template from the CLI, non of these mutations are accessible. Is there some other feature I'm missing? https://github.com/graphcool/templates/tree/master/outdated/auth/email-user-management/functions/reset-password
    f
    • 2
    • 4
  • j

    Jonathan

    03/28/2018, 10:00 PM
    What is a typical workflow for deployment of a dynamic graphcool site? Do you push frontend code to AWS or somewhere and then all the backend stuff stays at graphcool? If so, what kinds of places do you guys recommend for the hosting of the front-end code. I see that Surge was used in the howToGraphQL example, but the site I'm building is dynamic (a CRM type application) so I assume Surge won't work for my purposes.
    f
    c
    • 3
    • 14
  • j

    johhansantana

    03/29/2018, 12:00 AM
    I'm still getting this after following Digital Ocean manual tutorial for prisma deploy. It has never worked for me 😞
  • v

    Vendicto

    03/29/2018, 7:41 AM
    Hi there, can graphcool recognize "onDelete: CASCADE" ?
    h
    • 2
    • 4
  • r

    rem

    03/29/2018, 12:01 PM
    I'm getting occasional
    A unique constraint would be violated on Order. Details: Sorry, no more details available.
    when sending a mutation to graph.cool - but when I manually run the mutation (in the playground), the mutation is fine.
  • r

    rem

    03/29/2018, 12:02 PM
    Is there some intermittent bug that I should be wary of?
  • v

    Vendicto

    03/29/2018, 12:57 PM
    Who knows, how to make a resolver function for Query request in graphcool and how to invoke it ? http://prntscr.com/iy13vf
  • p

    patrick_madx

    03/29/2018, 12:59 PM
    Anyone knows how to have a computed property in Prisma? E.g. , my datamodel looks something like:
    Copy code
    type Quotation {
      id: ID! @unique
      costs: [Cost!]!
      prices: [Float!]!  // Sum of costs
    }
    
    type Cost {
     ...
     values: [Float!]!
     currency: String!
    }
    I'd expect to have my own resolver, so this works:
    Copy code
    export const Quotation = {
        prices: async (parent, args, ctx: Context, info) => {
            return [1,2,3]
        },
    }
    Yet how do I rerieve the costs? I don't have a `quotation id`/`cost ids` somewhere...
    v
    n
    • 3
    • 20
  • a

    apertureless

    03/29/2018, 1:14 PM
    I have a question about the serverless functions. Does the complete event always ends up in the logs?
  • a

    apertureless

    03/29/2018, 1:17 PM
    I looked at the password-auth template and even if I remove the first console.log(event). The whole event + cleartext passwords are getting logged in the function log
  • a

    Aubron Wood (ScoreShots)

    03/29/2018, 1:17 PM
    I do believe there's a configuration for that. One second.
  • a

    Aubron Wood (ScoreShots)

    03/29/2018, 1:19 PM
    Is_the_debug_setting_what_you_re_looking_for_in_your_scenario_.txt
  • a

    Aubron Wood (ScoreShots)

    03/29/2018, 1:20 PM
    Oh you're talking lambda event
  • a

    Aubron Wood (ScoreShots)

    03/29/2018, 1:20 PM
    not sure there
  • a

    Aubron Wood (ScoreShots)

    03/29/2018, 1:20 PM
    or, serverless event
  • a

    apertureless

    03/29/2018, 1:20 PM
    yeah I am talking about the graph.cool cloud functions. Not prisma.
  • a

    Aubron Wood (ScoreShots)

    03/29/2018, 1:20 PM
    sorry, my bad
  • a

    apertureless

    03/29/2018, 1:26 PM
    Okay, it seems there is an issue https://github.com/graphcool/graphcool-framework/issues/463 And as far as I understand this is not possible right now? Which makes the auth-template unuseable, as it leaks user password. Which is imo critical.
    😲 2
1...624625626...637Latest