{"record":{"id":"df34a72bd557e7f7","repo":"refinedev/refine","slug":"code-not-implemented-on-refine-graphql-data-prov","errorCode":null,"errorMessage":"[Code] Not implemented on refine-graphql data provider.","messagePattern":"\\[Code\\] Not implemented on refine-graphql data provider\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"packages/graphql/src/dataProvider/index.ts","lineNumber":257,"sourceCode":"        return { data: options.custom.dataMapper(response, params) };\n      }\n\n      const response = await client\n        .query(\n          meta.gqlQuery!,\n          options.custom.buildVariables(params),\n          JSON.parse(JSON.stringify({ url })),\n        )\n        .toPromise();\n\n      if (response?.error) {\n        throw new Error(errorHandler(response?.error));\n      }\n\n      return { data: options.custom.dataMapper(response, params) };\n    },\n    getApiUrl: () => {\n      throw Error(\"[Code] Not implemented on refine-graphql data provider.\");\n    },\n  };\n};\n\nexport default createDataProvider;\n","sourceCodeStart":239,"sourceCodeEnd":263,"githubUrl":"https://github.com/refinedev/refine/blob/779d52a20e29b0307ac0df04d135beba434370dc/packages/graphql/src/dataProvider/index.ts#L239-L263","documentation":"The refine-graphql data provider does not implement the getApiUrl() method required by Refine's DataProvider interface. Calling getApiUrl() always throws because a GraphQL endpoint URL is not tracked by this provider; the provider is a community package with limited coverage. Use your own GraphQL client URL instead.","triggerScenarios":"Calling dataProvider.getApiUrl() on the provider returned by createDataProvider from @refinedev/graphql, e.g. to build custom fetch URLs or in components that assume a REST-style API base.","commonSituations":"Copying code from a REST-based Refine example (e.g. axios provider) into a GraphQL app; libraries or hooks that call getApiUrl() internally; expecting the community graphql provider to have parity with the core providers.","solutions":["Store the GraphQL endpoint URL in your own constant/config and use it directly instead of getApiUrl()","If you need getApiUrl(), wrap the provider and implement it: spread the provider and override getApiUrl: () => GRAPHQL_URL","Switch to a data provider that supports getApiUrl (e.g. @refinedev/strapi-graphql or a custom provider)"],"exampleFix":"// before\nconst apiUrl = dataProvider.getApiUrl(); // throws\n\n// after\nconst apiUrl = \"https://api.example.com/graphql\";\n// or wrap:\nconst provider = { ...gqlDataProvider, getApiUrl: () => \"https://api.example.com/graphql\" };","handlingStrategy":"validation","validationCode":"const supportsGetApiUrl = (p: unknown): p is { getApiUrl: () => string } =>\n  typeof p === \"object\" && p !== null &&\n  \"getApiUrl\" in p &&\n  (() => { try { return typeof (p as any).getApiUrl() === \"string\"; } catch { return false; } })();\nconst apiUrl = supportsGetApiUrl(dataProvider) ? dataProvider.getApiUrl() : MY_GRAPHQL_URL;","typeGuard":null,"tryCatchPattern":"try { dataProvider.getApiUrl(); } catch (e) { if (String(e).includes(\"Not implemented\")) { /* fall back to your configured GraphQL URL */ } else throw e; }","preventionTips":["Keep the GraphQL endpoint in a single app config constant","Wrap community providers to fill interface gaps (getApiUrl, custom) at setup time"],"tags":["refine","graphql","data-provider","not-implemented"],"backgroundTag":"unsupported-operation","analyzedSha":"779d52a20e29b0307ac0df04d135beba434370dc","analyzedAt":"2026-08-27T11:15:25.854Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}