reflow-project / weloop

WeLoop is a React/TypeScript client for ZenPub and a key component of ReflowOS
https://weloop.reflowproject.eu
GNU Affero General Public License v3.0
5 stars 5 forks source link

BonFire does not contain Like #134

Open oksanasalohubova opened 2 years ago

oksanasalohubova commented 2 years ago

Linked with Asses ZenPub replacement with BonFire #121

Like

We have no way to get Like in these requests and mutations

fragment LikePreview on Like{
  id
  createdAt

  context{
    ...on Community {
      ...CommunityPreview
    }
    ...on Collection {
      ...CollectionPreview
    }
    ...on Resource {
      ...ResourcePreview
    }
    ...on User {
      ...UserPreview
    }
    ...on Comment {
      ...CommentPreview
    }
  }
}
fragment ActivityPreview on Activity {
  id
  verb
  createdAt
  user {
    icon {
      id
      url
    }
    image {
      id
      url
    }
    userId: id
    userName: name
    canonicalUrl
  }
  context {
    ... on Community {
      ...CommunityPreview
    }
    ... on Collection {
      ...CollectionPreview
    }
    ... on Resource {
      ...ResourcePreview
    }
    ... on User {
      ...UserPreview
    }
    ... on Comment {
      ...CommentPreview
    }
    ... on Flag {
      ...FlagPreview
    }
    ... on Like {
      ...LikePreview
    }
    ... on Follow {
      ...FollowPreview
    }
  }
}
query user($userId: String!) {
    user(userId: $userId) {
        outbox(limit:15) {
            edges {
                user {
                    icon {
                        id
                    }
                    name
                    image {
                        id
                    }
                }
                verb
                context  {
                    ... on Community {
                        ...CommunityPreview
                    }
                    ... on Collection {
                        ...CollectionPreview
                    }
                    ... on Resource {
                        ...ResourcePreview
                    }
                    ... on User {
                        ...UserPreview
                    }
                    ... on Comment {
                        ...CommentPreview
                    }
                    ... on Flag {
                        ...FlagPreview
                    }
                    ... on Like {
                        ...LikePreview
                    }
                    ... on Follow {
                        ...FollowPreview
                    }
                }

            }
            totalCount
            pageInfo {
                hasNextPage
                hasPreviousPage
            }
        }
    }
}
mutation deleteFlagContext($contextId:String!){
  delete(contextId:$contextId){
    ...on Collection { id }
    ...on Comment { id }
    ...on Community { id }
    # ...on Feature { id }
    ...on Flag { id }
    ...on Follow { id }
    ...on Like { id }
    ...on Resource { id }
    # ...on Thread { id }
  }
}
mutation unlike($contextId: String!) {
  delete(contextId: $contextId){
    ... on Like {
      context{
        ...on Collection{
          id
          myLike{ id }
          likerCount
        }
        ...on Comment{
          id
          myLike{ id }
          likerCount
        }
        ...on Community{
          id
          myLike{ id }
          likerCount
        }
        ...on Resource{
          id
          myLike{ id }
          likers{ totalCount }
        }
        ...on User{
          userId: id
          myLike{ id }
          likerCount
        }
      }
    }
  }
}
VolodymyrPavlichenko commented 2 years ago
user, me, like, Activity, Collection, Community Like