hasura / hasura/graphql-engine

tables.yaml alpha sort rules different for different devs

Open
#6,950 3 comments 0 reactions 1 assignee Claimed by @rikinsk View on GitHub
a/collab-ci-cd c/cli k/bug t/cli
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

Hasura version 1.3.3.

Array and Object relationships in table.yaml are following different alpha-sorting rules on my machine vs another persons machine. On my machine, when a change is made, all the names are sorted with all capitalized names ahead of all lower case names. In another persons machine, a change resorts all the names alphabetically irrespective of case. This causes the tables.yaml file to get reshuffled every time one of us modifies something in the hasura console, leading to diffs that bury the actual table.yaml changes we are applying in a list of the reshuffling changes.

For example, the below file snippet is how it appears on my machine:

```yaml
- table:
schema: public
name: MyTable
object_relationships:
- name: SomeField
...
- name: anotherField
...
- name: thirdField
...
```

but when another person runs the console on their machine and makes a change that has nothing to do with these fields, the above code gets resorted to this:

```yaml
- table:
schema: public
name: MyTable
object_relationships:
- name: anotherField
...
- name: SomeField
...
- name: thirdField
...
```
with the Capitalized SomeField moved down to where it appears in a case-insensitive sort.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.