Skip to content

Commit d553f56

Browse files
bc-terra6juara9
andauthored
DEVDOCS-6375 - New GraphQL response headers (#948)
Added table of GraphQL headers as documentation doesn't currently exist <!-- Ticket number or summary of work --> # [DEVDOCS-6375] ## What changed? * We now have GraphQL headers for features of a request * `x-bc-gql-query-hash` - a hash for identifying specific requests * `x-bc-gql-operation-type` - the operation type used in the request * `x-bc-gql-operation-name` - the name of the operation, if given ## Release notes draft * We've added documentation for our GraphQL response headers, including several for quickly identifying specific requests. ## Anything else? <!-- Add related PRs, salient notes, additional ticket numbers, etc. --> ping { @bigcommerce/team-api-platform @bigcommerce/dev-docs-team } [DEVDOCS-6375]: https://bigcommercecloud.atlassian.net/browse/DEVDOCS-6375?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ --------- Co-authored-by: Vitya Chyzhyk <[email protected]>
1 parent 07c0a96 commit d553f56

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docs/start/about/index.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,16 @@ HTTP response header names are case-insensitive; see the [HTTP specification on
189189

190190
{/* | `X-Request-ID` | | | | */}
191191

192+
#### GraphQL-specific response headers
193+
194+
| Header | Possible Values | Description | Example |
195+
|:-------|:----------------|:------------|:--------|
196+
| `x-bc-graphql-complexity` | integer | Indicates the computed complexity score of the executed GraphQL query. If this exceeds `10000`, an error is returned. | `5241` |
197+
| `x-bc-graphql-query-hash` | string | A 'sha256' hash of the query body, not including variables. This allows identification of specific queries among those with non-unique names. | `bd2e22a00004abd3ec9437a6f895` |
198+
| `x-bc-graphql-variables-hash` | string | A `sha256` hash of the variables included in a query. | `44136fa355b3678a1146ad16f7e8` |
199+
| `x-bc-graphql-operation-type` | One of `query`, `mutation`, or `subscription` | The operation type of the request. Currently, `subscription` is not supported. | `query` |
200+
| `x-bc-graphql-operation-name` | string |The operation name within a query. Used with queries with multiple operations. This will return an empty string for anonymous requests. | `HomePageQuery` |
201+
192202
#### Response content type
193203

194204
When requesting a resource that returns a body, specify the type of content you want to receive with the `Accept` header. Alternatively, you can supply an extension to the resource you're requesting.

0 commit comments

Comments
 (0)