Description
ApexStore currently only has a REST API. Adding GraphQL would enable:
- Fetch multiple keys in a single request
- Project only needed fields from values (when values are JSON)
- Subscription to data changes (via WebSocket)
- Strongly typed queries via schema introspection
Proposed Implementation
- Add
async-graphql or juniper crate
- Define GraphQL schema:
type Query {
get(key: String!, cf: String): String
keys(prefix: String, limit: Int): [String!]!
scan(cf: String, start: String, end: String, limit: Int): [KV!]!
stats: EngineStats!
}
type Mutation {
put(key: String!, value: String!, cf: String): Boolean!
delete(key: String!, cf: String): Boolean!
flush: Boolean!
compact: Boolean!
}
type Subscription {
keyChanges(cf: String): ChangeEvent!
}
- Mount GraphQL at
/graphql and GraphiQL IDE at /graphiql
Labels
Description
ApexStore currently only has a REST API. Adding GraphQL would enable:
Proposed Implementation
async-graphqlorjunipercrate/graphqland GraphiQL IDE at/graphiqlLabels