Skip to content

Commit

Permalink
📚 Add new indexer documents for Lens v3 (#indexer-codegen)
Browse files Browse the repository at this point in the history
Summary: Added new GraphQL documents for indexing accounts, groups, posts, and timelines.

Highlights:

• Introduced `GroupFields` and `PostBaseFields` fragments for structured data retrieval.
• Created queries `FullAccount`, `Group`, `Groups`, `Timeline`, `WhoActedOnPost`, and `WhoReferencedPost`.
• Refactored `PostFields` to utilize `PostBaseFields` for nested post structures.

Read more: https://pierre.co/hey/hey/indexer-codegen
  • Loading branch information
Yoginth authored and Pierre committed Nov 26, 2024
1 parent 1d7d79f commit 38297f9
Show file tree
Hide file tree
Showing 12 changed files with 478 additions and 32 deletions.
13 changes: 5 additions & 8 deletions packages/indexer/documents/fragments/AccountFields.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@ fragment AccountFields on Account {
address
score
metadata {
attributes {
type
key
value
}
bio
coverPicture
id
name
bio
picture
coverPicture
attributes {
...MetadataAttributeFields
}
}
username {
...UsernameFields
Expand Down
10 changes: 10 additions & 0 deletions packages/indexer/documents/fragments/GroupFields.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
fragment GroupFields on Group {
address
metadata {
name
slug
description
icon
}
timestamp
}
24 changes: 24 additions & 0 deletions packages/indexer/documents/fragments/PostBaseFields.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
fragment PostBaseFields on Post {
id
isDeleted
isEdited
stats {
...PostStatsFields
}
author {
...AccountFields
}
metadata {
...PostMetadataFields
}
app {
...AppFields
}
mentions {
replace {
from
to
}
}
timestamp
}
23 changes: 13 additions & 10 deletions packages/indexer/documents/fragments/PostFields.graphql
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
fragment PostFields on Post {
id
isDeleted
isEdited
stats {
...PostStatsFields
...PostBaseFields
root {
... on Post {
...PostBaseFields
}
}
author {
...AccountFields
commentOn {
... on Post {
...PostBaseFields
}
}
metadata {
...PostMetadataFields
quoteOf {
... on Post {
...PostBaseFields
}
}
timestamp
}
23 changes: 23 additions & 0 deletions packages/indexer/documents/queries/FullAccount.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
query FullAccount(
$accountRequest: AccountRequest!
$accountStatsRequest: AccountStatsRequest!
) {
account(request: $accountRequest) {
...AccountFields
}
accountStats(request: $accountStatsRequest) {
feedStats {
collects
comments
posts
quotes
reacted
reactions
reposts
}
graphFollowStats {
followers
following
}
}
}
5 changes: 5 additions & 0 deletions packages/indexer/documents/queries/Group.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
query Group($request: GroupRequest!) {
group(request: $request) {
...GroupFields
}
}
7 changes: 7 additions & 0 deletions packages/indexer/documents/queries/GroupMembers.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
query GroupMembers($request: GroupMembersRequest!) {
groupMembers(request: $request) {
items {
...AccountFields
}
}
}
7 changes: 7 additions & 0 deletions packages/indexer/documents/queries/Groups.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
query Groups($request: GroupsRequest!) {
groups(request: $request) {
items {
...GroupFields
}
}
}
16 changes: 16 additions & 0 deletions packages/indexer/documents/queries/Timeline.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
query Timeline($request: TimelineRequest!) {
timeline(request: $request) {
items {
id
primary {
...PostFields
}
comments {
...PostFields
}
reposts {
...PostFields
}
}
}
}
7 changes: 7 additions & 0 deletions packages/indexer/documents/queries/WhoActedOnPost.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
query WhoActedOnPost($request: WhoActedOnPostRequest!) {
whoActedOnPost(request: $request) {
items {
...AccountFields
}
}
}
7 changes: 7 additions & 0 deletions packages/indexer/documents/queries/WhoReferencedPost.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
query WhoReferencedPost($request: WhoReferencedPostRequest!) {
whoReferencedPost(request: $request) {
items {
...AccountFields
}
}
}
368 changes: 354 additions & 14 deletions packages/indexer/generated.ts

Large diffs are not rendered by default.

1 comment on commit 38297f9

@vercel
Copy link

@vercel vercel bot commented on 38297f9 Nov 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

web – ./

web-heyxyz.vercel.app
heyxyz.vercel.app
web-git-main-heyxyz.vercel.app
hey.xyz

Please sign in to comment.