{"record":{"id":"164e2a082b373483","repo":"refinedev/refine","slug":"graphql-operation-name-required-164e2a","errorCode":null,"errorMessage":"GraphQL operation name required.","messagePattern":"GraphQL operation name required\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/nestjs-query/src/dataProvider/index.ts","lineNumber":491,"sourceCode":"              operation: meta.operation,\n              fields: meta.fields,\n              variables: meta.variables,\n            });\n\n            query = gqlMutation.query;\n            variables = gqlMutation.variables;\n          }\n\n          const response = await _client.request<BaseRecord>({\n            document: query,\n            variables,\n          });\n\n          return {\n            data: response[meta.operation],\n          };\n        }\n        throw Error(\"GraphQL operation name required.\");\n      }\n      throw Error(\n        \"GraphQL needs operation, fields and variables values in meta object.\",\n      );\n    },\n  };\n};\n\nexport default dataProvider;\n","sourceCodeStart":473,"sourceCodeEnd":501,"githubUrl":"https://github.com/refinedev/refine/blob/779d52a20e29b0307ac0df04d135beba434370dc/packages/nestjs-query/src/dataProvider/index.ts#L473-L501","documentation":"The nestjs-query data provider's custom() method requires meta.operation naming the GraphQL operation whose result should be returned. It throws when meta exists but has no operation key, since the provider returns response[meta.operation] from the GraphQL payload.","triggerScenarios":"Calling custom({ url, method, meta }) where meta lacks operation (e.g. only fields and variables are supplied), or misspelling the key.","commonSituations":"Reusing meta shapes from other providers; assuming the operation is inferred from the query document; key typos like operationName.","solutions":["Add meta.operation matching the root field of your GraphQL query/mutation","Make sure the name is a top-level key of the parsed response","Double-check spelling: operation, fields, variables are the expected keys"],"exampleFix":"// before\nawait dataProvider.custom({ url: \"\", method: \"post\", meta: { fields: [\"id\"], variables: {} } });\n\n// after\nawait dataProvider.custom({ url: \"\", method: \"post\", meta: { operation: \"user\", fields: [\"id\", \"email\"], variables: { id: 1 } } });","handlingStrategy":"validation","validationCode":"if (!meta || typeof meta.operation !== \"string\") throw new Error(\"meta.operation required\");","typeGuard":"const isCustomMeta = (m: unknown): m is { operation: string; fields: any[]; variables: Record<string, unknown> } =>\n  typeof m === \"object\" && m !== null && \"operation\" in m && \"fields\" in m && \"variables\" in m;","tryCatchPattern":"try { await dataProvider.custom({ url, method, meta }); } catch (e) { if (String(e).includes(\"operation name required\")) { /* add meta.operation */ } else throw e; }","preventionTips":["Always include operation in the meta object for nestjs-query custom()","Share one typed helper for building meta across the app"],"tags":["refine","nestjs-query","graphql","meta","custom-query"],"backgroundTag":"missing-graphql-operation-meta","analyzedSha":"779d52a20e29b0307ac0df04d135beba434370dc","analyzedAt":"2026-08-27T11:15:25.854Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}