You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add log and log type for deprecation reason/notice
* Add documentation covering the new log type
* Allow the logging of any deprecation reason from GraphQL requests to allow apps to monitor these
| userAgentPrefix? |`string`| Any prefix you wish to include in the User-Agent for requests made by the library. |
59
59
| retries? |`number`| The number of HTTP request retries if the request was abandoned or the server responded with a `Too Many Requests (429)` or `Service Unavailable (503)` response. Default value is `0`. Maximum value is `3`. |
60
60
| customFetchApi? |`(url: string, init?: {method?: string, headers?: HeaderInit, body?: string}) => Promise<Response>`| A replacement `fetch` function that will be used in all client network requests. By default, the client uses `window.fetch()`. |
61
-
| logger? |`(logContent:`[`UnsupportedApiVersionLog`](#unsupportedapiversionlog)`\|`[`HTTPResponseLog`](#httpresponselog)`\|`[`HTTPRetryLog`](#httpretrylog)`) => void`| A logger function that accepts [log content objects](#log-content-types). This logger will be called in certain conditions with contextual information. |
61
+
| logger? |`(logContent:`[`UnsupportedApiVersionLog`](#unsupportedapiversionlog)`\|`[`HTTPResponseLog`](#httpresponselog)`\|`[`HTTPRetryLog`](#httpretrylog)`\|`[`HTTPResponseGraphQLDeprecationNotice`](#httpresponsegraphqldeprecationnotice)`) => void`| A logger function that accepts [log content objects](#log-content-types). This logger will be called in certain conditions with contextual information. |
62
62
63
63
### Client properties
64
64
@@ -363,6 +363,15 @@ This log content is sent to the logger whenever the client attempts to retry HTT
363
363
| type |`LogType['HTTP-Retry']`| The type of log content. Is always set to `HTTP-Retry`|
364
364
| content |`{`[`requestParams`](#requestparams)`: [url, init?], lastResponse?: Response, retryAttempt: number, maxRetries: number}`| Contextual data regarding the upcoming retry attempt. <br /><br/>`requestParams`: [parameters](#requestparams) used in the request<br/>`lastResponse`: previous response <br/> `retryAttempt`: the current retry attempt count <br/> `maxRetries`: the maximum number of retries |
365
365
366
+
### `HTTPResponseGraphQLDeprecationNotice`
367
+
368
+
This log content is sent to the logger whenever a HTTP response with a `X-Shopify-API-Deprecated-Reason` is received by the client.
| type |`LogType['HTTP-Response-GraphQL-Deprecation-Notice']`| The type of log content. Is always set to `HTTP-Response-GraphQL-Deprecation-Notice`|
373
+
| content |`{`[`requestParams`](#requestparams)`: [url, init?], deprecationNotice: string}`| Contextual data regarding the request and received deprecation information |
| headers |`Record<string, string \| string[]>`| Headers to be included in requests |
72
72
| retries? |`number`| The number of HTTP request retries if the request was abandoned or the server responded with a `Too Many Requests (429)` or `Service Unavailable (503)` response. Default value is `0`. Maximum value is `3`. |
73
73
| customFetchApi? |`(url: string, init?: {method?: string, headers?: HeaderInit, body?: string}) => Promise<Response>`| A replacement `fetch` function that will be used in all client network requests. By default, the client uses `window.fetch()`. |
74
-
| logger? |`(logContent: `[`HTTPResponseLog`](#httpresponselog)`\|`[`HTTPRetryLog`](#httpretrylog)`) => void`| A logger function that accepts [log content objects](#log-content-types). This logger will be called in certain conditions with contextual information. |
74
+
| logger? |`(logContent: `[`HTTPResponseLog`](#httpresponselog)`\|`[`HTTPRetryLog`](#httpretrylog)`\|`[`HTTPResponseGraphQLDeprecationNotice`](#httpresponsegraphqldeprecationnotice)`) => void`| A logger function that accepts [log content objects](#log-content-types). This logger will be called in certain conditions with contextual information. |
75
75
76
76
## Client properties
77
77
@@ -313,6 +313,15 @@ This log content is sent to the logger whenever the client attempts to retry HTT
313
313
| type |`LogType['HTTP-Retry']`| The type of log content. Is always set to `HTTP-Retry`|
314
314
| content |`{`[`requestParams`](#requestparams)`: [url, init?], lastResponse?: Response, retryAttempt: number, maxRetries: number}`| Contextual data regarding the upcoming retry attempt. <br /><br/>`requestParams`: [parameters](#requestparams) used in the request<br/>`lastResponse`: previous response <br/> `retryAttempt`: the current retry attempt count <br/> `maxRetries`: the maximum number of retries |
315
315
316
+
### `HTTPResponseGraphQLDeprecationNotice`
317
+
318
+
This log content is sent to the logger whenever a HTTP response with a `X-Shopify-API-Deprecated-Reason` is received by the client.
| type |`LogType['HTTP-Response-GraphQL-Deprecation-Notice']`| The type of log content. Is always set to `HTTP-Response-GraphQL-Deprecation-Notice`|
323
+
| content |`{`[`requestParams`](#requestparams)`: [url, init?], deprecationNotice: string}`| Contextual data regarding the request and received deprecation information |
0 commit comments