{"record":{"id":"f0f4884032f7dc03","repo":"refinedev/refine","slug":"graphql-does-not-support-method-method","errorCode":null,"errorMessage":"GraphQL does not support ${method} method.","messagePattern":"GraphQL does not support (.+?) method\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/nestjs-query/src/dataProvider/index.ts","lineNumber":426,"sourceCode":"          },\n        },\n      };\n\n      await client.request<BaseRecord>(query, variables);\n\n      return {\n        data: [],\n      };\n    },\n    getApiUrl: () => {\n      return (client as any).url; // url field in GraphQLClient is private\n    },\n    custom: async ({ url, method, headers, meta }) => {\n      const SUPPORTED_METHODS = [\"get\", \"post\"];\n      const requestUrl = url || (client as any).url;\n\n      if (!SUPPORTED_METHODS.some((it) => it === method)) {\n        throw Error(`GraphQL does not support ${method} method.`);\n      }\n\n      const validMethod = method as \"get\" | \"post\";\n\n      const _client = new GraphQLClient(requestUrl, {\n        ...client.requestConfig,\n        method: validMethod,\n        headers: { ...client.requestConfig.headers, ...headers },\n      });\n\n      const gqlOperation = meta?.gqlMutation ?? meta?.gqlQuery;\n\n      if (gqlOperation) {\n        const response: any = await _client.request<BaseRecord>({\n          document: gqlOperation,\n          variables: meta?.variables,\n        });\n","sourceCodeStart":408,"sourceCodeEnd":444,"githubUrl":"https://github.com/refinedev/refine/blob/779d52a20e29b0307ac0df04d135beba434370dc/packages/nestjs-query/src/dataProvider/index.ts#L408-L444","documentation":"The nestjs-query data provider's custom() method only accepts HTTP methods \"get\" and \"post\" because those are the only methods meaningful for GraphQL over HTTP. Any other method string (put, delete, patch, or a typo like \"GET\") throws this error before a request is made.","triggerScenarios":"Calling dataProvider.custom({ url, method: \"put\" | \"delete\" | \"patch\", ... }) on the nestjs-query provider, including mutations sent with method: \"delete\" out of REST habit, or uppercase method strings.","commonSituations":"Porting custom() calls from refine's REST providers where put/delete are normal; sending mutations with delete/put semantics; case-sensitive typos in method.","solutions":["Use method: \"post\" for mutations and \"get\" for queries","Verify the method string is lowercase (\"get\"/\"post\")","If you truly need REST verbs, issue the request with your own fetch/axios client"],"exampleFix":"// before\nawait dataProvider.custom({ url: \"\", method: \"delete\", meta: { ... } });\n\n// after\nawait dataProvider.custom({ url: \"\", method: \"post\", meta: { operation: \"removeUser\", fields: [\"id\"], variables: { id: 1 } } });","handlingStrategy":"validation","validationCode":"const ok = method === \"get\" || method === \"post\";\nif (!ok) throw new Error(`Use get/post, got ${method}`);","typeGuard":"const isSupportedMethod = (m: unknown): m is \"get\" | \"post\" => m === \"get\" || m === \"post\";","tryCatchPattern":"try { await dataProvider.custom({ url, method, meta }); } catch (e) { if (String(e).includes(\"does not support\")) { /* switch to get/post */ } else throw e; }","preventionTips":["Map all mutations to post and all reads to get in GraphQL providers","Normalize method strings to lowercase before calling custom()"],"tags":["refine","nestjs-query","graphql","http-method","custom-query"],"backgroundTag":"unsupported-http-method","analyzedSha":"779d52a20e29b0307ac0df04d135beba434370dc","analyzedAt":"2026-08-27T11:15:25.854Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}