Skip to content

GraphQL client sends feature category header

Andrew Newdigate requested to merge graphql-resources into master

What does this MR do?

EDIT:

This MR adds an ApolloLink which sets the x-gitlab-feature-category header to requests made from Apollo based on the gon.feature_category. This will be used to immediately help segment performance data for the GraphQL endpoint.

Originally, this MR also added x-gitlab-graphql-query-path, but this broke Apollo request batching ([see comment]*(!66937 (comment 652289139))). See the original description below for more details.

ORIGINAL:

This is a proof-of-concept to add feature category and query file name headers to add graphql calls.

Part of #336431 (closed)

Part of #328535

It adds two headers:

  1. x-gitlab-feature-category
  2. x-gitlab-graphql-query-path

Header names are up for discussion.

Next steps:

  1. How do we configure CORS headers, change preflight responses for GitLab?
  2. Add support for mutations

cc @grzesiek

Screenshots or Screencasts (strongly suggested)

EDIT:

When visiting a single issue on the local GDK:

Description Screenshot
🎉 Header is added Screen_Shot_2021-09-07_at_12.33.28_PM
🎉 Batching still works Screen_Shot_2021-09-07_at_12.33.33_PM

ORIGINAL:

image

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by Paul Slaughter

Merge request reports