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 Resource #130

Open oksanasalohubova opened 3 years ago

oksanasalohubova commented 3 years ago

Linked with Asses ZenPub replacement with BonFire #121

Resource

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

fragment ResourcePreview on Resource {
    id
    icon{ id, url }
    name
    summary
    canonicalUrl
    payload:content{
      id
      mediaType
      mirror {url}
      upload {size}
      url
    }
    myLike { id }
    myFlag { id }
    likers { totalCount }
    collection {
      id
      name
      preferredUsername
      canonicalUrl
      icon{ id, url }
      summary
      community {
        id
        ...CommunityInfo
      }
    }
    license
    # likerCount
}
fragment AddResourceCreateResourceMutationResult on Resource {
    id
    ...ResourcePreview
}
fragment CollectionPageResource on Resource {
  id
  createdAt
  ...ResourcePreview
}
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
    }
  }
}
fragment CommentPreview on Comment {
  ...CommentPreviewBase
  id
  inReplyTo { ...CommentPreviewBase }
  likerCount
  myLike{ id }
  myFlag{ id }
  thread {
    id
    comments(limit:1){
      edges{
        ...CommentPreviewBase
      }
    }
    context {
      ...on Flag {
        id
      }
      ...on Community {
        id
        ...CommunityInfo
      }
      ...on Collection {
        id
        community {
          id
          ...CommunityInfo
        }
      }
      ...on Resource {
        id
        collection {
          id
          community {
            id
            ...CommunityInfo
          }
        }
      }
    }
  }
}
fragment CommentPreviewThread on Thread {
  id
  isLocal
  canonicalUrl
  context {
    ...on Collection {
      ...CollectionPreview
    }
    ...on Resource {
      ...ResourcePreview
    }
    ...on Community {
      ...CommunityPreview
    }
  }
}
fragment FlagPreview on Flag{
  id
  message
  isResolved
  creator{
    ...UserPreview
  }
  createdAt
  context{
    ...on Community {
      ...CommunityPreview
    }
    ...on Collection {
      ...CollectionPreview
    }
    ...on Resource {
      ...ResourcePreview
    }
    ...on User {
      ...UserPreview
    }
    ...on Comment {
      ...CommentPreview
    }
  }
}
fragment LikePreview on Like{
  id
  createdAt

  context{
    ...on Community {
      ...CommunityPreview
    }
    ...on Collection {
      ...CollectionPreview
    }
    ...on Resource {
      ...ResourcePreview
    }
    ...on User {
      ...UserPreview
    }
    ...on Comment {
      ...CommentPreview
    }
  }
}
fragment ThreadPreview on Thread {
  id
  lastActivity
  createdAt
  context{
    ...on Community {
      ...CommunityPreview
    }
    ...on Collection {
      ...CollectionPreview
    }
    ...on Resource {
      ...ResourcePreview
    }
    ...on Flag {
      ...FlagPreview
    }
  }
  comments(limit:1){
    totalCount
    edges{
     ...on Comment {
          ...CommentPreview
        }
    }
  }
}
fragment CollectionResource on Resource{
  ...CollectionPageResource
}
VolodymyrPavlichenko commented 3 years ago
Resources
pral2a commented 3 years ago

We should deprecate all the functionalities linked to resources, not to confuse with economic resources. In Weloop views resources are called "Publications".

Screenshot 2021-10-15 at 18 48 12