Skip to content

[FEATURE] GraphQL API — flexible query interface alongside existing REST API #202

@ElioNeto

Description

@ElioNeto

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

  1. Add async-graphql or juniper crate
  2. 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!
}
  1. Mount GraphQL at /graphql and GraphiQL IDE at /graphiql

Labels

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions