Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): Entity version filtering #31

Open
cvauclair opened this issue Feb 21, 2025 · 0 comments
Open

feat(api): Entity version filtering #31

cvauclair opened this issue Feb 21, 2025 · 0 comments

Comments

@cvauclair
Copy link
Contributor

Motivation

Allow users to reduce the number of versions returned by the API in cases where only a subset of versions is of interest.

Implementation

Add the following filter object to the GraphQL API

input VersionFilter {
  proposedAt: String
  proposedAt_gt: String
  proposedAt_gte: String
  proposedAt_lt: String
  proposedAt_lte: String
  proposedAt_not: String

  publishedAt: String
  publishedAt_gt: String
  publishedAt_gte: String
  publishedAt_lt: String
  publishedAt_lte: String
  publishedAt_not: String

  author: String
  author_not: String
  author_in: [String!]
  author_not_in: [String!]

  updatedAttributes_contains: [String!]
  updatedAttributes_not_contains: [String!]
}

Note: Many of these filters relate to new entity version fields spec-ed out in

This filter would be used when selecting the versions of an entity, e.g.:

# Schema
type Entity {
  versions(where: VersionFilter): [EntityVersion!]!
}

# Query
query {
  entity(entityId: "Foo", spaceId: "MySpace") {
    # Get versions proposed by Byron since the start of the month
    versions(where: {
      author: "Byron",
      proposedAt_gte: "2025-02-01T00:00:00",
    }) {
      id
      name
    }
  }
}

Note: argument values not accurate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant