lens-protocol/api-examples

search query (type PUBLICATION) pagination issue

krzysu opened this issue · 2 comments

For the search query and variables below, API returns no items but PaginatedResultInfo points to the next page (result.pageInfo.next).

query SearchPublications(
  $limit: LimitScalar
  $cursor: Cursor
  $query: Search!
  $sources: [Sources!]
) {
  result: search(
    request: {
      query: $query
      type: PUBLICATION
      limit: $limit
      cursor: $cursor
      sources: $sources
    }
  ) {
    ... on PublicationSearchResult {
      __typename
      items {
        ... on Post {
          id
          __typename
        }
        ... on Comment {
          id
          __typename
        }
        __typename
      }
      pageInfo {
        ...CommonPaginatedResultInfo
        __typename
      }
    }
    __typename
  }
}

fragment CommonPaginatedResultInfo on PaginatedResultInfo {
  __typename
  prev
  next
  totalCount
}

variables:

{
  "query":"web3",
  "sources":["lenster","orb"],
  "limit":10,
  "cursor":"{\"offset\":26}"
}

Thanks will fix tomorrow

fixed