{"record":{"id":"67d49630b21d9e21","repo":"gatsbyjs/gatsby","slug":"deprecated-syntax-of-sort-and-or-aggregation-field-67d496","errorCode":null,"errorMessage":"Deprecated syntax of sort and/or aggregation field arguments were found in your query (see https://gatsby.dev/graphql-nested-sort-and-aggregate). Query was automatically converted to a new syntax. You should update query in your code.\\n\\nFile: ${filePath}\\n\\nCurrent query:\\n\\n${originalQueryText}\\n\\nConverted query:\\n\\n${print(transformedDocument)}","messagePattern":"Deprecated syntax of sort and/or aggregation field arguments were found in your query \\(see https://gatsby\\.dev/graphql-nested-sort-and-aggregate\\)\\. Query was automatically converted to a new syntax\\. You should update query in your code\\.\\\\n\\\\nFile: (.+?)\\\\n\\\\nCurrent query:\\\\n\\\\n(.+?)\\\\n\\\\nConverted query:\\\\n\\\\n(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby/src/query/query-compiler.js","lineNumber":225,"sourceCode":"    doc: originalDoc,\n    isHook,\n    isStaticQuery,\n    isConfigQuery,\n  } of parsedQueries) {\n    let doc = originalDoc\n\n    let errors = validate(schema, doc, preValidationRules)\n    if (errors && errors.length) {\n      const originalQueryText = print(originalDoc)\n      const { ast: transformedDocument, hasChanged } = tranformDocument(doc)\n      if (hasChanged) {\n        const newErrors = validate(\n          schema,\n          transformedDocument,\n          preValidationRules\n        )\n        if (newErrors.length === 0) {\n          report.warn(\n            `Deprecated syntax of sort and/or aggregation field arguments were found in your query (see https://gatsby.dev/graphql-nested-sort-and-aggregate). Query was automatically converted to a new syntax. You should update query in your code.\\n\\nFile: ${filePath}\\n\\nCurrent query:\\n\\n${originalQueryText}\\n\\nConverted query:\\n\\n${print(\n              transformedDocument\n            )}`\n          )\n          doc = transformedDocument\n          errors = newErrors\n        }\n      }\n    }\n\n    if (errors && errors.length) {\n      addError(\n        ...errors.map(error => {\n          const location = {\n            start: locInGraphQlToLocInFile(templateLoc, error.locations[0]),\n          }\n          return errorParser({\n            message: error.message,","sourceCodeStart":207,"sourceCodeEnd":243,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/gatsby/src/query/query-compiler.js#L207-L243","documentation":"During extractOperations, query validation fails but the document auto-transformer rewrites deprecated sort/aggregate field argument syntax to the new GraphQL spec form and revalidation passes. Gatsby proceeds with the converted query while warning you to update the source, printing the file, original and converted query text.","triggerScenarios":"Thrown at packages/gatsby/src/query/query-compiler.js:225 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rewrite the query in the file to match the `Converted query` output (nested sort/aggregate syntax, see gatsby.dev/graphql-nested-sort-and-aggregate)","Re-run the build to confirm the warning disappears","Update shared query snippets/templates to the new syntax"],"exampleFix":null,"handlingStrategy":"fallback","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-14T00:17:10.932Z"}