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

    matty

    01/03/2018, 11:23 PM
    Just reading this... https://www.graph.cool/docs/reference/graphql-api/mutation-api-ol0yuoz6go appears not yet supported!
  • m

    matty

    01/03/2018, 11:43 PM
    if I've a list of things connected to User in one-to-many relationship, and the user can edit their profile and edit, add or remove from this list, is there a single-transaction way to update the User on the backend once they save, or no? must be done in multiple mutations?
  • m

    matty

    01/04/2018, 12:24 AM
    oh man - permissions are definitely not simple to debug
  • m

    matty

    01/04/2018, 12:25 AM
    if a user has access to edit a User, and create a related Type, should that be enough, or do they need the Connect permission also?
    a
    • 2
    • 11
  • m

    matty

    01/04/2018, 1:58 AM
    is there a way to deploy only permissions i.e. if none of the functions have changed... currently waiting on each deploy between 30-60 seconds for the functions
  • m

    matty

    01/04/2018, 1:58 AM
    and im struggling a lot to get a grasp on permission queries, so I'm having to re-deploy frequently
  • m

    matty

    01/04/2018, 2:03 AM
    also unable to get the right schema returning from https://api.graph.cool/simple/v1/__SERVICE_ID__/permissions
  • m

    matty

    01/04/2018, 2:03 AM
    it returns the Simple API schema, not the permissions query schema
  • m

    matty

    01/04/2018, 2:05 AM
    🤯
  • m

    matty

    01/04/2018, 3:15 AM
    where did the Export Data button go for projects not yet ejected?
  • m

    matty

    01/04/2018, 3:36 AM
    Copy code
    query permitCreatePost($user_id: ID!, $node_userId: ID!) {
      SomeUserExists(filter: {
        AND: [{
          id: $user_id
        }, {
          id: $node_userId
        }]
      })
    }
  • m

    matty

    01/04/2018, 3:36 AM
    any ideas why $node_userId is not a parameter?
  • m

    matty

    01/04/2018, 3:37 AM
    how can I ensure the Post being created, can only be created if being connected to the currently authenticated user?
  • m

    matty

    01/04/2018, 3:38 AM
    I know I could allow Post.create for all authenticated users, this would be an improvement on having no permissions however, this would still allow authenticated users to create Posts, while passing in the
    userId
    for a different user
  • m

    matty

    01/04/2018, 3:40 AM
    ah, I see that I have to use $input_userId
  • m

    matty

    01/04/2018, 3:40 AM
    https://www.graph.cool/forum/t/specify-permissions-for-create-actions/387/2
  • m

    Maxime Scibetta

    01/04/2018, 9:05 AM
    Hii, someone know how make a subscription on a child it's my subscription
    Copy code
    export const TABLE_EVENT_SUBSCRIPTION = gql `
    subscription Score($id: ID!){
        Score(
            filter: {
            mutation_in: [CREATED],
            node: {
                event_some: {id: $id}
            }
        }
        ) {
            node{
                score
                event{
                    id
                }
                implementation{
                    id
                }
                comment
                id
                meeting{
                    author{
                        name
                    }
                }
            }
        }
    }
    `
    it's my query based on parent (Event) i want to subscription on Score child of implementations
    Copy code
    export const TABLE_EVENT_QUERY = gql `
    query Event($id: ID!){
        Event(id : $id){
            courseName
            students{
                name
                implementations(filter: {events_every: {id: $id}}) {
                    id
                    project{
                        name
                    }
                    scores {
                        id
                        score
                        comment
                        meeting{
                            author{
                                name
                            }
                        }
                    }
                }
            }
        }
    }
    `
  • e

    efvaldez

    01/04/2018, 12:12 PM
    Hi, there is no cascade delete of related nodes right? so I need to add isDeleted:boolean to objects?
  • e

    efvaldez

    01/04/2018, 12:13 PM
    what is wrong with my ALL_NODES_QUERY and to deleted Subscription( updated the isDeleted field)
  • e

    efvaldez

    01/04/2018, 12:13 PM
    subscription { Link(filter: { mutation_in: [UPDATED] updatedFields_contains_some: ["isDeleted"] }) { node { id title url description category createdAt updatedAt tags{ id name } postedBy { id name } offers{ id amount offerdescription offerBy{ id name position } } votes { id user { id } } } updatedFields previousValues{ title description url category } } }
  • e

    efvaldez

    01/04/2018, 12:13 PM
    query AllLinksQuery($first: Int, $skip: Int, $orderBy: LinkOrderBy) { allLinks (first: $first, skip: $skip, orderBy: $orderBy) { id title updatedAt createdAt url description category postedBy { id name position } votes { id user { id } } offers{ id amount offerdescription offerBy{ id name position } } tags{ id name } } _allLinksMeta { count } }
  • s

    Stef

    01/04/2018, 12:14 PM
    Hey folks, I’m working on my first server-side subscription function. Is it possible for me to request a relation to the node I’m working with from within the function? Or should I have something like this as my subscription query?
    Copy code
    subscription {
      InstagramMedia(filter: {
        mutation_in: [CREATED]
      }) {
        updatedFields
        node {
          id
          instagramAccount {
            user {
              instagramToken
            }
          }
        }
      }
    }
  • l

    Lotafak

    01/04/2018, 12:40 PM
    Hey, can someone point me to a place where I can read more about what context object is in resolvers, about it’s structure and function?
    h
    a
    • 3
    • 8
  • k

    kitze

    01/04/2018, 2:28 PM
    Hey guys. Why does it take minimum 1-2 min. to build functions? The feedback process is very slow when you have to wait that much to know if you have an error in your config.
    a
    e
    • 3
    • 7
  • k

    kitze

    01/04/2018, 2:28 PM
    Is there maybe a way to just build the functions without deploying, just to see if there is an error or not?
  • k

    kitze

    01/04/2018, 3:00 PM
    Also if anyone has an idea about fixing “GraphQL error: No CONNECT permissions” that would be great.
  • l

    Lotafak

    01/04/2018, 3:22 PM
    I discovered weird behaviour (bug?). when creating user with given schema
    Copy code
    type User {
      id: ID! @unique
      createdAt: DateTime!
      updatedAt: DateTime!
      
      email: String @unique
      password: String
      facebookUserId: String @unique
      firstName: String
      lastName: String
      accounts: [Account!]! @relation(name: "UsersAccount")
    }
    sometimes I receive error:
    Error: GraphQL error: A unique constraint would be violated on User. Details: Field name = email
    even though given email address doesn’t exist in database. What’s more interesting, user is created! So I receive error, then I’m quering to display all the users and see the user was created. What is going on?
    👍 1
    n
    • 2
    • 2
  • m

    Maxime Scibetta

    01/04/2018, 3:30 PM
    Hi all, i try to make my 1st subscription but i'm blocked because i try to update a child element. I want to update student meetings in this query structure
    Copy code
    query allEvents($id: ID) {
            allEvents(filter: {id: $id}){
                id
                courseName
                academicYear
                students{
                    id
                    name
                    email
                    implementations(filter: {events_some: {id: $id}}){
                        id
                        project{
                            id
                            name
                        }
                    }
                    meetings(filter: {event: {id: $id}}) {
                        id
                        author{
                            id
                            name
                        }
                    }
                }
           }
      }
  • e

    efvaldez

    01/04/2018, 5:01 PM
    Hi All, I have a Link ,Offer and Comment Model. A link has many offers, and each offer has many comments. I added isDeleted:boolean to the three. however how do I filter Offers and Comments that are deleted? type Link @model { offers: [Offer!]! @relation(name: "LinksOffer") ... } type Offer @model { id: ID! @isUnique comments: [Comment!]! @relation(name: "OfferComments") ... }
  • e

    efvaldez

    01/04/2018, 5:02 PM
    I can filter links that are deleted. But how can I filter and subscribe to the link's offers, and the offer's comments that are deleted? Thanks const ALL_LINKS_QUERY = gql` query AllLinksQuery{ allLinks (filter{isDeletedfalse}){ id .... '
1...493494495...637Latest