0xPlaygrounds / 0xPlaygrounds/kg-node

feat(api): Entity version filtering

Aperta
#31 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Rust
Stelle
10
Fork
5
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

#### 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
```graphql
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 #30

This filter would be used when selecting the versions of an entity, e.g.:
```graphql
# 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

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

The issue specifies adding a VersionFilter input type to the GraphQL API for filtering entity versions. Start by examining the GraphQL schema definitions in the codebase, likely in a schema.graphql or similar file, and the corresponding resolver logic for the Entity.versions field. Look for existing filter patterns in the project to understand the implementation approach. The filter fields relate to new entity version fields from issue #30, so review that issue for context. Implement the filter input type and integrate it into the versions field resolver, ensuring it can handle the proposed filter conditions like author and proposedAt_gte.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
graphql, rust
Ambito
api, backend
Tipo di issue
Funzionalità
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
50/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.