{"record":{"id":"15f4b5390ffa51a2","repo":"gatsbyjs/gatsby","slug":"deprecated-syntax-of-sort-and-or-aggregation-field","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\\nCurrent query:\\n\\n${reporter.stripIndent(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\\\\nCurrent query:\\\\n\\\\n(.+?)\\\\n\\\\nConverted query:\\\\n\\\\n(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby/src/query/graphql-runner.ts","lineNumber":146,"sourceCode":"\n    errors = validate(schema, document)\n    warnings = validate(schema, document, [NoDeprecatedCustomRule])\n\n    if (!errors.length) {\n      this.validDocuments.set(originalDocument, document)\n    } else {\n      const { ast: transformedDocument, hasChanged } =\n        tranformDocument(document)\n      if (hasChanged) {\n        const { errors, warnings, document } = this.validate(\n          schema,\n          originalQueryText,\n          transformedDocument,\n          originalDocument\n        )\n\n        if (!errors.length) {\n          reporter.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\\nCurrent query:\\n\\n${reporter.stripIndent(\n              originalQueryText\n            )}\\n\\nConverted query:\\n\\n${print(transformedDocument)}`\n          )\n        }\n\n        return { errors, warnings, document }\n      }\n    }\n\n    return { errors, warnings, document }\n  }\n\n  getStats(): IGraphQLRunnerStatResults | null {\n    if (this.stats) {\n      const comparatorsUsedObj: Array<{\n        comparator: string\n        amount: number","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/gatsby/src/query/graphql-runner.ts#L128-L164","documentation":"Error \"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\\nCurrent query:\\n\\n${reporter.stripIndent(originalQueryText)}\\n\\nConverted query:\\n\\n${print(transformedDocument)}\" thrown in gatsbyjs/gatsby.","triggerScenarios":"Thrown at packages/gatsby/src/query/graphql-runner.ts:146 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Update the query in your code to the nested syntax, e.g. sort: {fields: [...], order: [...]} and object-form aggregate arguments (see https://gatsby.dev/graphql-nested-sort-and-aggregate)"],"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"}