Welcome to ResolveSpec Discussions! #1
bitechsystems
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
ResolveSpec — Discussion
The ResolveSpec project is designed to bridge the gap between traditional REST APIs and the flexible query capabilities often associated with GraphQL, without abandoning REST’s simplicity. It positions itself as a REST API specification and implementation platform that allows clients to perform dynamic queries, relationship preloading, and advanced filtering while keeping the overall style familiar to developers accustomed to RESTful patterns.
GitHub
Purpose and Primary Value Proposition
Flexible API Behavior: ResolveSpec supports complex client queries that are more expressive than typical REST endpoints. It includes features such as dynamic data querying, relationship preloads, multi-column sorting, cursor pagination, and custom operators—bringing some of the flexibility normally found in GraphQL into a REST context.
GitHub
Multiple API Modes:
Body-Based API: Standard REST interface with options encoded in the JSON request body.
Header-Based API: Query options (e.g., filters, relationships) passed via HTTP headers.
Function-Based API: Mapping requests to SQL functions via headers.
GitHub
Compatibility: Designed to integrate with different router and ORM frameworks, including GORM and Bun, and supports typical Go routing libraries.
GitHub
Key Features Highlighted
Dynamic Data Selection: Clients can specify which fields and relations they need, reducing overfetching.
GitHub
Filtering and Sorting: The APIs provide rich filtering logic (AND/OR, custom operators) and multi-column sorting support.
GitHub
Pagination: Both offset and cursor-based pagination are supported, catering to different data retrieval patterns.
GitHub
Computed Columns & Hooks: The ability to compute virtual fields on demand and register request lifecycle hooks (e.g., for custom logic before or after operations).
GitHub
Response Formats: Multiple output formats (simple lists, detailed objects, Syncfusion-friendly structure) are available, depending on the client’s needs.
GitHub
Architecture and Design Considerations
REST at Core: Though inspired by GraphQL’s flexibility, ResolveSpec stays true to REST principles—using HTTP methods and status codes while enabling tightly controlled dynamic query constructs.
GitHub
Middleware & Hooks: Lifecycle hooks allow custom behavior for create/read/update/delete actions, making it suitable for implementing authorization, logging, validation, or transformation logic.
GitHub
ORM Agnostic: The core architecture is database-agnostic, supporting adapters for popular Go ORMs and extensible route setups.
GitHub
Practical Integration Points
Router Integration: Provides utilities to register models and handlers with routers like Gorilla Mux or Gin.
GitHub
CORS & Options Support: Built-in handling for cross-origin requests and proper handling of HTTP OPTIONS helps with browser integrations.
GitHub
Testing Friendly: The design enables mockable interfaces, facilitating unit testing of API handlers.
Beta Was this translation helpful? Give feedback.
All reactions