Skip to content

Commit 8a1e1f0

Browse files
gabxyzLekoArts
andauthored
chore(gatsby): add getCache helper to NodePluginArgs (#33984)
Co-authored-by: Lennart <[email protected]>
1 parent 95a0650 commit 8a1e1f0

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

packages/gatsby/index.d.ts

+7
Original file line numberDiff line numberDiff line change
@@ -1038,6 +1038,13 @@ export interface NodePluginArgs {
10381038
*/
10391039
cache: GatsbyCache
10401040

1041+
/**
1042+
* Get cache instance by name - this should only be used by plugins that accept subplugins.
1043+
* @param id id of the node
1044+
* @returns See [cache](https://www.gatsbyjs.com/docs/reference/config-files/node-api-helpers/#cache) section for reference.
1045+
*/
1046+
getCache(this: void, id: string): GatsbyCache
1047+
10411048
/**
10421049
* Utility function useful to generate globally unique and stable node IDs.
10431050
* It will generate different IDs for different plugins if they use same

packages/gatsby/src/utils/api-node-helpers-docs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ const GatsbyTracing = {
159159
/**
160160
* Get cache instance by name - this should only be used by plugins that
161161
* accept subplugins.
162-
* @param {string} id Test
162+
* @param {string} id id of the node
163163
* @returns {GatsbyCache} See [`cache`](#cache) section for reference.
164164
*/
165165
module.exports.getCache = true;

0 commit comments

Comments
 (0)