graphql-code-generator icon indicating copy to clipboard operation
graphql-code-generator copied to clipboard

[schema-ast] sort parameter ignored

Open Vincz opened this issue 7 months ago • 0 comments

Which packages are impacted by your issue?

schema-ast plugin

Describe the bug

With the schema-ast plugin, the sort option is ignored and the output is sorted every time.
I'm trying to dump my schema composed of multiple .graphql files but don't want my graphql input properties sorted as generated code depends on this order.

Your Example Website or App

Personnal repo

Steps to Reproduce the Bug or Issue

Create a simple type and generate the AST from it while setting sort: false as argument.

  ./path/schema.graphql:
    plugins:
      - "schema-ast"
    config:
      sort: false

Expected behavior

When using sort: false the properties of generate AST shouldn't be sorted.

Screenshots or Videos

No response

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • NodeJS: [e.g. 18.5.0]
  • graphql version: [e.g. 16.3.0]
  • @graphql-codegen/* version(s): [e.g. 2.6.2]

Codegen Config File

No response

Additional context

No response

Vincz avatar Apr 08 '25 08:04 Vincz