{"record":{"id":"976c99b8fa5af3e2","repo":"gatsbyjs/gatsby","slug":"invalid-field-arg","errorCode":null,"errorMessage":"Invalid field arg","messagePattern":"Invalid field arg","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/gatsby/src/schema/resolvers.ts","lineNumber":608,"sourceCode":"            (acc: Array<string>, fieldNode: FieldNode) => {\n              const fieldArg = fieldNode.arguments?.find(\n                arg => arg.name.value === `field`\n              )\n              if (isEnumType(fieldTC)) {\n                if (fieldArg?.value.kind === Kind.ENUM) {\n                  const enumKey = fieldArg.value.value\n                  const enumValue = fieldTC.getValue(enumKey)\n                  if (enumValue) {\n                    acc.push(enumValue.value)\n                  }\n                }\n              } else if (isInputObjectType(fieldTC)) {\n                const path: Array<string> = []\n                let currentValue = fieldArg?.value\n                while (currentValue) {\n                  if (currentValue.kind === Kind.OBJECT) {\n                    if (currentValue.fields.length !== 1) {\n                      throw new Error(`Invalid field arg`)\n                    }\n\n                    const fieldArg = currentValue.fields[0]\n                    path.push(fieldArg.name.value)\n                    currentValue = fieldArg.value\n                  } else {\n                    currentValue = undefined\n                  }\n                }\n\n                if (path.length > 0) {\n                  const sortPath = path.join(`.`)\n                  acc.push(sortPath)\n                }\n              }\n              return acc\n            },\n            []","sourceCodeStart":590,"sourceCodeEnd":626,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/gatsby/src/schema/resolvers.ts#L590-L626","documentation":"getProjectedField inspects the 'field' argument on an aggregate/pipe resolver (group, distinct, max, min, sum) to project which field to aggregate. When the enum/input-object argument node cannot be resolved to a field path, this sentinel is thrown — the 'field' argument is missing or malformed in the query.","triggerScenarios":"Thrown at packages/gatsby/src/schema/resolvers.ts:608 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a valid 'field' argument to the group/distinct/max/min/sum field","Use dotted path syntax matching the node's fields","Check for typos in the field path string"],"exampleFix":null,"handlingStrategy":"validation","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-14T05:17:10.506Z"}