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

Middleware API Specification #3

Open
8 tasks
git-union bot opened this issue Mar 7, 2024 · 0 comments
Open
8 tasks

Middleware API Specification #3

git-union bot opened this issue Mar 7, 2024 · 0 comments

Comments

@git-union
Copy link
Contributor

git-union bot commented Mar 7, 2024

Middleware API Specification

As a developer, I want a middleware capable of handling both REST and GraphQL endpoints with GraphQL as the base to ensure versatility and flexibility in API consumption by clients.

Acceptance Criteria

  • The middleware must initialize a GraphQL server with a defined schema.
  • The GraphQL server should expose a single endpoint for GraphQL operations.
  • RESTful endpoints must translate requests into GraphQL queries/mutations.
  • The system should validate REST requests and construct proper GraphQL queries.
  • Errors from REST endpoint conversions must be handled and relayed as RESTful responses.
  • Middleware should include authorization checks for protected endpoints.
  • Performance metrics must be logged for both REST and GraphQL requests.
  • Should be able to extend the API with additional REST endpoints without impacting existing GraphQL capabilities.
sequenceDiagram
  participant Client
  participant Middleware
  participant GraphQL
  Client->>Middleware: REST request /users
  alt REST to GraphQL Conversion
    Middleware->>GraphQL: Query users {}
    GraphQL-->>Middleware: Users data
    Middleware-->>Client: 200 OK, Users data
  else Direct GraphQL Request
    Client->>GraphQL: POST /graphql { query: users }
    GraphQL-->>Client: 200 OK, Users data
  end
Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

0 participants