Schema always sorted
See original GitHub issueDescribe the bug
Schema is always sorted regardless of the sort
config.
To Reproduce Steps to reproduce the behavior:
https://codesandbox.io/s/gql-codegen-sort-5my7k
Note that the config does not set config: true
, but the generated is still sorted.
- My GraphQL schema:
type Query {
user(id: ID!): User!
}
type User {
id: ID!
username: String!
email: String!
}
- My GraphQL operations:
query user {
user(id: 1) {
id
username
email
}
}
- My
codegen.yml
config file:
schema: schema.graphql
documents: document.graphql
generates:
types.ts:
plugins:
- typescript
- typescript-operations
Expected behavior
I expect that the output won’t be sorted because sort
is not true
in the config.
Environment:
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
DB Schema: Maintaining Item Order - Stack Overflow
I see three alternatives: sort order field in the list item table. Normally the best choice: Simple and does what you need.
Read more >Schema Browser - Sort - Toad for Oracle - Beta
In the Schema Browser Treeview mode, sorting is always done by Oracle. Try this in the editor and see what the sort order...
Read more >Config mappings are sorted the way they are defined in their ...
It is always recommended to upgrade Drupal versions in their own branches ... are now sorted according to the order defined in their...
Read more >Properties order · Issue #7 · json-schema-org/json ... - GitHub
Keep in mind that this extension works like "prefered-sort-order", it does not act as a validation. Schema can still be valid regardless the ......
Read more >Schema design best practices | Cloud Bigtable Documentation
Keep in mind that row keys are sorted lexicographically. Don't use a timestamp by itself or at the beginning of a row key,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This change has been done to give more consistent results. I don’t think
sorting
is an issue, bug or a breaking change. It’s been documented here; https://github.com/dotansimha/graphql-code-generator/blob/master/packages/graphql-codegen-cli/CHANGELOG.md#minor-changes You can disable it withsort: false
. Closing this issue.@canac I resolved this problem by reverting these packages to the versions below:
“@graphql-codegen/cli”: “1.21.8”, “@graphql-codegen/typescript-operations”: “1.18.4”,