Hotchocolate: Properties are sorted alphabetically

Created on 12 Jun 2019  路  2Comments  路  Source: ChilliCream/hotchocolate

Describe the bug
If I have a class like

public class User {
    public string Id {get; set;}
    public string Firstname{get; set;}
    public string Lastname {get; set;}
}

before the update to version 9 my Snapshot of the Schema looked like

type User{
    id: ID
    firstname: string
    lastname: String
}

but after the update to v9 it looks like this:

type User{
    firstname: string
    id: ID
    lastname: String
}

This new behavior is probably caused by this line

Expected behavior
I would like the properties in the Schema to be sorted as they are in my class and not alphabetically as they are now. The alphabetical sorting makes a schema harder to read.

馃攳 investigate

Most helpful comment

In my opinion it makes more sense to have the fields sorted the same as they are in the actual class. For example I always put the ID of an entity on the top because it's the place I would expect it.

All 2 comments

Just because of interest.
Why do you want the fields not sorted alphabetically?

In my opinion it makes more sense to have the fields sorted the same as they are in the actual class. For example I always put the ID of an entity on the top because it's the place I would expect it.

Was this page helpful?
0 / 5 - 0 ratings