{"record":{"id":"cf4aa5aeeea71941","repo":"marmelab/react-admin","slug":"the-override-option-is-deprecated-you-should-inst","errorCode":null,"errorMessage":"The override option is deprecated. You should instead wrap the buildQuery function provided by the dataProvider you use.","messagePattern":"The override option is deprecated\\. You should instead wrap the buildQuery function provided by the dataProvider you use\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/ra-data-graphql/src/index.ts","lineNumber":149,"sourceCode":"    watchQuery?: GetWatchQueryOptions;\n};\n\nconst buildGraphQLProvider = (options: Options): GraphqlDataProvider => {\n    const {\n        client: clientObject,\n        clientOptions,\n        introspection,\n        resolveIntrospection,\n        buildQuery: buildQueryFactory,\n        override = {},\n        ...otherOptions\n    } = merge({}, defaultOptions, options);\n\n    if (\n        Object.keys(override).length > 0 &&\n        process.env.NODE_ENV === 'production'\n    ) {\n        console.warn(\n            'The override option is deprecated. You should instead wrap the buildQuery function provided by the dataProvider you use.'\n        );\n    }\n\n    const client = clientObject || buildApolloClient(clientOptions);\n\n    let introspectionResults;\n    let introspectionResultsPromise;\n\n    const callApollo = async (raFetchMethod, resource, params) => {\n        if (introspection) {\n            if (!introspectionResultsPromise) {\n                introspectionResultsPromise = resolveIntrospection(\n                    client,\n                    introspection\n                );\n            }\n","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/marmelab/react-admin/blob/051f511bb0afb5ea565c2d3728bf4dab0a6fa5e0/packages/ra-data-graphql/src/index.ts#L131-L167","documentation":"buildGraphQLProvider logs a warning (not a throw) when the deprecated override option is passed with non-empty keys in production. override was replaced by the recommended pattern of wrapping the buildQuery function returned by the buildQuery factory before handing it to buildGraphQLProvider.","triggerScenarios":"Calling buildGraphQLProvider({ buildQuery, override: { queries: {...}, types: {...} } }) with a non-empty override object while NODE_ENV === 'production'.","commonSituations":"Upgrading ra-data-graphql: older codebases customized queries/types via override; newer versions require a wrapped buildQuery.","solutions":["Remove the override option and wrap the buildQuery function instead (intercept operations and adjust queries/types).","If override is only transitional, empty it or gate it to development to silence the warning.","Consult the current ra-data-graphql docs for the buildQuery wrapper API."],"exampleFix":"// before\nbuildGraphQLProvider({ buildQuery, override: { queries: { allPosts: customQuery } } });\n// after\nconst buildQueryCustom = (introspection) => {\n  const bq = buildQuery(introspection);\n  return (type, operation) => {\n    if (type === 'Post' && operation === 'GET_LIST') return customQuery;\n    return bq(type, operation);\n  };\n};\nbuildGraphQLProvider({ buildQuery: buildQueryCustom });","handlingStrategy":"validation","validationCode":"if (options.override && Object.keys(options.override).length > 0) {\n  console.warn('override is deprecated; wrap buildQuery instead');\n}","typeGuard":"const usesDeprecatedOverride = (o: { override?: object }): o is { override: object } => !!o.override && Object.keys(o.override).length > 0;","tryCatchPattern":"const warn = jest.spyOn(console, 'warn').mockImplementation();\nbuildGraphQLProvider(opts);\nexpect(warn).toHaveBeenCalledWith(expect.stringContaining('override option is deprecated'));","preventionTips":["Migrate override usage to a wrapped buildQuery.","Add a lint/CI grep for 'override:' in provider options.","Watch deprecation warnings in development builds before shipping."],"tags":["react-admin","deprecation","graphql"],"backgroundTag":"deprecated-api-usage","analyzedSha":"051f511bb0afb5ea565c2d3728bf4dab0a6fa5e0","analyzedAt":"2026-08-30T02:28:14.926Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}