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

    Luke

    03/20/2018, 3:40 AM
    I should probably just read that entire link
    👍 1
  • l

    Luke

    03/20/2018, 3:40 AM
    thanks!
  • l

    Luke

    03/20/2018, 3:45 AM
    hrmm
  • l

    Luke

    03/20/2018, 3:46 AM
    how does that affect the
    topics: { connect: { name : "Productivity" } }
    line ?
  • b

    beb

    03/20/2018, 3:47 AM
    What's your
    Topic
    defintion?
  • l

    Luke

    03/20/2018, 3:47 AM
    Copy code
    type Topic {
      id: ID! @unique
      name: String!
      slug: String!
    }
  • l

    Luke

    03/20/2018, 3:49 AM
    do i need to change that?
  • b

    beb

    03/20/2018, 3:49 AM
    no
  • b

    beb

    03/20/2018, 3:49 AM
    can you show your updated mutation
  • l

    Luke

    03/20/2018, 3:50 AM
    Copy code
    mutation {
      topic1: createTopic(data: {
        name: "Productivity"
        slug: "productivity"
      }) {
        id
      }
      product1: createProduct(data: {
        name: "Caramella"
        slug: "caramella"
        tagline: "A clean, modern blogging platform without the fuss"
        votes_count: 473
        comments_count: 28
        topics: { connect: { name : "Productivity", slug: "productivity" } }
      }) {
        id
      }
    }
  • b

    beb

    03/20/2018, 3:55 AM
    can you try just:
    topics: { connect: [ { name : "Productivity" } ] }
  • l

    Luke

    03/20/2018, 3:56 AM
    Copy code
    ERROR: Argument 'data' expected type 'ProductCreateInput!' but got: {name: "Caramella", slug: "caramella", tagline: "A clean, modern blogging platform without the fuss", votes_count: 473, comments_count: 28, topics: {connect: [{name: "Productivity"}]}}. Reason: 'topics.connect[0].name' Field 'name' is not defined in the input type 'TopicWhereUniqueInput'. (line 8, column 33):
      product1: createProduct(data: {
                                    ^
     (line 14, column 5):
        topics: { connect: [ { name : "Productivity" } ] }
        ^
     (line 14, column 15):
        topics: { connect: [ { name : "Productivity" } ] }
                  ^
     (line 14, column 24):
        topics: { connect: [ { name : "Productivity" } ] }
                           ^
     (line 14, column 28):
        topics: { connect: [ { name : "Productivity" } ] }
                               ^
  • l

    Luke

    03/20/2018, 3:56 AM
    same issue
  • l

    Luke

    03/20/2018, 4:21 AM
    @beb I got it, I had to define slug as a unique attribute on the Topic model
  • l

    Luke

    03/20/2018, 4:21 AM
    🙂
  • l

    Luke

    03/20/2018, 4:21 AM
    thanks for your help
  • l

    Luke

    03/20/2018, 4:21 AM
    off to bed!
  • l

    lancej

    03/20/2018, 6:59 AM
    Is there a good example of how to integrate Firebase Auth as a Auth provider with Prisma?
  • a

    Akshay

    03/20/2018, 8:29 AM
    https://stackoverflow.com/questions/49379421/how-to-update-an-array-in-graphcool
  • a

    Akshay

    03/20/2018, 8:29 AM
    Can someone help with this?
  • n

    nampdn

    03/20/2018, 8:38 AM
    How can I unlink all the reference of a record in one mutation?
  • r

    rein

    03/20/2018, 9:29 AM
    hi guys, quick question, Im trying to set up a currentUserQuery with prisma but it seems that even thought the Authorization header is null, it still sees Authorization is truthy and it keeps giving me the error
    jwt malformed
  • r

    rein

    03/20/2018, 9:29 AM
    my code:
    Copy code
    const jwt = require('jsonwebtoken');
    
    module.exports = (parent, args, ctx, info) => {
      const Authorization = ctx.request.get('Authorization');
    
      if (Authorization) {
        const token = Authorization.replace('Bearer ', '');
        const { userId } = jwt.verify(token, 'mysecret123');
    
        return ctx.db.query.user({ where: { id: userId } }, info);
      }
    
      return null;
    };
    n
    • 2
    • 8
  • l

    lawrence

    03/20/2018, 10:14 AM
    I have in the past been able to create a new type and use it without the
    @relation
    directive, however this is now being forced when trying to deploy after creating a second non-relational type after upgrading to 1.4.1. Is it mandatory again or have I encountered a bug? @nilan? thanks!
    n
    • 2
    • 2
  • a

    Adrián

    03/20/2018, 11:43 AM
    Hi all!! Following the instructions in this post: https://www.graph.cool/forum/t/deleting-associated-nodes-in-a-one-to-many-relationship/551/3 I have created a server-side subscription with this query
  • a

    Adrián

    03/20/2018, 11:43 AM
    -.txt
  • a

    Adrián

    03/20/2018, 11:44 AM
    and Graphcool Function
  • a

    Adrián

    03/20/2018, 11:44 AM
    -.txt
  • a

    Adrián

    03/20/2018, 11:45 AM
    but when I test I get the following error
  • a

    Adrián

    03/20/2018, 11:45 AM
    -.txt
1...615616617...637Latest