File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -1278,6 +1278,20 @@ export class NextDrupal extends NextDrupalBase {
12781278 * @param {any } body The response body.
12791279 * @param {any } options Options for deserialization.
12801280 * @returns {any } The deserialized response body.
1281+ * @remarks
1282+ * To provide your own custom deserializer, see the serializer docs.
1283+ * @example
1284+ * ```ts
1285+ * const url = drupal.buildUrl("/jsonapi/node/article", {
1286+ * sort: "-created",
1287+ * "fields[node--article]": "title,path",
1288+ * })
1289+ *
1290+ * const response = await drupal.fetch(url.toString())
1291+ * const json = await response.json()
1292+ *
1293+ * const resource = drupal.deserialize(json)
1294+ * ```
12811295 */
12821296 deserialize ( body , options ?) {
12831297 if ( ! body ) return null
You can’t perform that action at this time.
0 commit comments