File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -179,9 +179,21 @@ export class NextDrupalBase {
179179 /**
180180 * Fetches a resource from the given input URL or path.
181181 *
182- * @param {RequestInfo } input The input URL or path.
183- * @param {FetchOptions } init The fetch options.
182+ * @param {RequestInfo } input The url to fetch from.
183+ * @param {FetchOptions } init The fetch options with `withAuth`.
184+ * If `withAuth` is set, `fetch` will fetch an `Authorization` header before making the request.
184185 * @returns {Promise<Response> } The fetch response.
186+ * @remarks
187+ * To provide your own custom fetcher, see the fetcher docs.
188+ * @example
189+ * ```ts
190+ * const url = drupal.buildUrl("/jsonapi/node/article", {
191+ * sort: "-created",
192+ * "fields[node--article]": "title,path",
193+ * })
194+ *
195+ * const response = await drupal.fetch(url.toString())
196+ * ```
185197 */
186198 async fetch (
187199 input : RequestInfo ,
You can’t perform that action at this time.
0 commit comments