blitz-js / blitz-js/legacy-framework

Client-side middlewares

Open
#41 1 comment 0 reactions 0 assignees View on GitHub
kind/feature-change legacy-framework status/ready-to-define-implementation
Dominant language
JavaScript
Stars
3
Forks
2
PR merge metrics
No merged PRs in 30d

Description

### What do you want and why?
I want to suggest supporting client-side middlewares (or maybe interceptors is a better way to think about it) that work in a similar way that the server middlewares do and allow you to modify requests/responses during the client-side useQuery executions.

My specific scenario is that I want to add a JWT token to requests that will be used in subsequent requests on the backend inside some queries/mutations.

### Possible implementation(s)

The middlewares could be executed inside the [rpc](https://github.com/blitz-js/blitz/blob/canary/packages/core/src/rpc.ts) file that handles the client-side requests to the queries/mutations.

### Additional context

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.