router icon indicating copy to clipboard operation
router copied to clipboard

Graphql requests return non-graphql responses

Open BrynCooke opened this issue 1 year ago • 1 comments

In https://github.com/apollographql/router/blob/dev/apollo-router/src/axum_factory/axum_http_server_factory.rs#L666-L681 we are returning non-graphql errors. This should never be the case inside handle_graphql.

            if let Some(source_err) = err.source() {
                if source_err.is::<RateLimited>() {
                    return RateLimited::new().into_response();
                }
                if source_err.is::<Elapsed>() {
                    return Elapsed::new().into_response();
                }
            }
            if err.is::<RateLimited>() {
                return RateLimited::new().into_response();
            }
            if err.is::<Elapsed>() {
                return Elapsed::new().into_response();
            }

main_router should be checked that if will also never return an error in itself therefore returning a non-graphql error. I don't think that it does, but this needs valdiation.

BrynCooke avatar May 15 '24 09:05 BrynCooke

This was partially fixed by #5159, but there are still some remaining things to be looked at.

abernix avatar Jun 10 '24 09:06 abernix