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

    peitalin

    01/16/2017, 5:46 AM
    Is it possible to delete a permission? (rather than just turn it off)
  • s

    sorenbs

    01/16/2017, 6:55 AM
    Hi @peitalin We are currently adding this feature to the Console. You can follow along here https://github.com/graphcool/console/issues/465
    👍 1
  • n

    nilan

    01/16/2017, 7:34 AM
    @heyMartinAdams I'm happy to look into PR and investigate 🙂
    👍🏽 1
  • p

    phil

    01/16/2017, 8:35 AM
    GraphQL question: Is it possible to pipe the result of one mutation into the next? Example below. I am creating a team, and then want to immediately create a team-membership, which uses the “teamId” (returned from the first mutation) as the foreign-key to establish the relationship.
    Copy code
    mutation {
      createTeam(name: "My Team") {
        id
        
      }  
      createTeamMembership(teamId: id) {
        id
      }
      
    }
    What’s the correct approach? Can this be done in one move, or does it require more requests to the server?
  • n

    nilan

    01/16/2017, 8:37 AM
    you can use our nested mutations API in situations like these. simply define the teammembership object in the createTeam call
    👌 2
  • n

    nilan

    01/16/2017, 8:37 AM
    this will create a team and a team membership and connect the two new nodes
  • p

    phil

    01/16/2017, 8:41 AM
    Is that you guys extending GraphQL?
  • p

    phil

    01/16/2017, 8:42 AM
    I was looking for how to do this in GraphQL references, and couldn’t find it. I go look up your documentation now to make sure I’m getting all the context.
  • p

    phil

    01/16/2017, 8:46 AM
    Can you give me an example of the mutation @nilan please? This is not working, which is what I think you said:
    Copy code
    mutation CreateTeamAndMember {
      createTeam(name: "My Team") {
        id
        createTeamMembership(id: id, userId: "cixxvdfjydsja0137xu2efklp") {
          id
        }
      }
    }
  • p

    phil

    01/16/2017, 8:51 AM
    Oh wow
  • p

    phil

    01/16/2017, 8:51 AM
    I get it :0
  • p

    phil

    01/16/2017, 8:51 AM
    🙂
  • p

    phil

    01/16/2017, 8:51 AM
    Copy code
    mutation CreateTeamAndMember {
      createTeam(name: "My Team", members: {userId: "cixxvdfjydsja0137xu2efklp"}) {
        id
        members {
          id
          team {
            name
          }
        }
      }
    }
    👍 1
  • n

    nilan

    01/16/2017, 8:51 AM
    Copy code
    mutation CreateTeamAndMember {
      createTeam(
        name: "My Team",
        teammembership: {
          userId:  "cixxvdfjydsja0137xu2efklp",
          description: "Hello"
        }
      ) {
        id
      }
    }
  • p

    phil

    01/16/2017, 8:52 AM
    That’s really sweet @nilan
  • n

    nilan

    01/16/2017, 8:52 AM
    🎉
  • n

    nilan

    01/16/2017, 8:52 AM
    Is that you guys extending GraphQL?
  • n

    nilan

    01/16/2017, 8:52 AM
    no, that's all spec conform
  • p

    phil

    01/16/2017, 8:52 AM
    Yeah, it’s not right
  • p

    phil

    01/16/2017, 8:52 AM
    it’s you being clever with the incoming parameters
  • p

    phil

    01/16/2017, 8:52 AM
    yeah?
  • n

    nilan

    01/16/2017, 8:53 AM
    you said it 😄
    🤖 1
  • n

    nilan

    01/16/2017, 8:56 AM
    going back to your mutation though, isn't
    members
    list?
  • n

    nilan

    01/16/2017, 8:57 AM
    ahh
  • n

    nilan

    01/16/2017, 8:57 AM
    I see how that works
  • n

    nilan

    01/16/2017, 8:58 AM
    Copy code
    mutation CreateTeamAndMember {
      createTeam(name: "My Team", members: [{userId: "cixxvdfjydsja0137xu2efklp"}, {userId: "another-user-id"}], memberIds: ["some-member-id", "another-member-id"]) {
        id
        members {
          id
          team {
            name
          }
        }
      }
    }
  • n

    nilan

    01/16/2017, 8:58 AM
    this works as well 🙂
  • n

    nilan

    01/16/2017, 8:59 AM
    members: {userId: "cixxvdfjydsja0137xu2efklp"}
    works because one element is a valid value for a GraphQL list
  • p

    phil

    01/16/2017, 9:10 AM
    Oh, that was a fluke on my part 🙂
  • p

    phil

    01/16/2017, 9:10 AM
    Hey, so the
    userId
    thing doesn’t work though:
1...757677...637Latest