Skip to content

fix(server): query to return book related versions

Pokhi requested to merge fix/1280 into book-version-feature

Targets: #1280 (closed)

Changes proposed

This MR adds a new query getBookVersions that, given bookId, returns an array of all the versions of that book (excluding itself).

Example

Query

query getBookVersions($bookId: ID!) {
  getBookVersions(bookId: $bookId) {
    id
    fundedContentType
    version
  }
}

Response

{
  "data": {
    "getBookVersions": [
      {
        "id": "32ffb4a8-c1fb-4d38-b946-df2e47833676",
        "fundedContentType": "authorManuscript",
        "version": "1"
      },
      {
        "id": "a92a81a2-3dc7-4420-b4d0-392e8f380b05",
        "fundedContentType": "authorManuscript",
        "version": "2"
      },
      {
        "id": "2e0cb6d0-c6dc-4d6d-975b-125d6268e6e8",
        "fundedContentType": "publishedPDF",
        "version": "2"
      }
    ]
  }
}
Edited by Pokhi

Merge request reports