{"record":{"id":"3ea18985cd9532fd","repo":"gatsbyjs/gatsby","slug":"calling-actionname-in-the-api-api-is-dep","errorCode":null,"errorMessage":"Calling `${actionName}` in the `${api}` API is deprecated. Please use: ${allowedIn.map(a => `${a}`).join(`, `)}.","messagePattern":"Calling `(.+?)` in the `(.+?)` API is deprecated\\. Please use: (.+?)`\\)\\.join\\(`, `\\)\\}\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby/src/redux/actions/restricted.ts","lineNumber":570,"sourceCode":"    const urls = Array.isArray(url) ? url : [url]\n    return {\n      type: `ADD_REMOTE_FILE_ALLOWED_URL`,\n      payload: { urls },\n      plugin,\n      traceId,\n    }\n  },\n}\n\nconst withDeprecationWarning =\n  (\n    actionName: RestrictionActionNames,\n    action: SomeActionCreator,\n    api: API,\n    allowedIn: Array<API>\n  ): SomeActionCreator =>\n  (...args: Array<any>): ReturnType<ActionCreator<any>> => {\n    report.warn(\n      `Calling \\`${actionName}\\` in the \\`${api}\\` API is deprecated. ` +\n        `Please use: ${allowedIn.map(a => `\\`${a}\\``).join(`, `)}.`\n    )\n    return action(...args)\n  }\n\nconst withErrorMessage =\n  (actionName: RestrictionActionNames, api: API, allowedIn: Array<API>) =>\n  () =>\n  // return a thunk that does not dispatch anything\n  (): void => {\n    report.error(\n      `\\`${actionName}\\` is not available in the \\`${api}\\` API. ` +\n        `Please use: ${allowedIn.map(a => `\\`${a}\\``).join(`, `)}.`\n    )\n  }\n\nconst nodeAPIs = Object.keys(require(`../../utils/api-node-docs`))","sourceCodeStart":552,"sourceCodeEnd":588,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/gatsby/src/redux/actions/restricted.ts#L552-L588","documentation":"withDeprecationWarning wraps restricted action creators: when a deprecated action is invoked from a given API context (e.g. sourceNodes vs createPages), it warns that this API usage is deprecated and lists the API(s) where the action is still allowed. The action still executes; this is a migration nudge emitted by Gatsby's action-restriction layer.","triggerScenarios":"Thrown at packages/gatsby/src/redux/actions/restricted.ts:570 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Move the action call into one of the allowed APIs listed in the message (e.g. createPages instead of sourceNodes)","Restructure gatsby-node so side effects run in the recommended API","Track plugin updates that remove the deprecated call"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e85d62f1779e353eaac1753211629a26d123e26c","analyzedAt":"2026-08-26T17:50:09.662Z","contentChangedAt":"2026-08-26T17:50:09.662Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}