juniper icon indicating copy to clipboard operation
juniper copied to clipboard

Feature request: lexicographic schema sort

Open mrtnzlml opened this issue 3 years ago • 5 comments

Is your feature request related to a problem? Please describe.

GraphQL reference implementation has support for lexicographicSortSchema: https://github.com/graphql/graphql-js/search?q=lexicographicSortSchema. This is useful when printing the schema. Unfortunately, Juniper doesn't seem to support this feature when using as_schema_language() (correct me if I am wrong) which sometimes results in a complicated diff when doing some changes in the schema - the elements seems to be in a random order (?). It would be nice, if Juniper could sort the schema as well.

Describe the solution you'd like none

Describe alternatives you've considered

I am not aware of any alternative (apart from not sorting the schema at all).

Additional context none

mrtnzlml avatar Jan 27 '21 14:01 mrtnzlml

Great idea! This should actually be the default.

LegNeato avatar Jan 28 '21 09:01 LegNeato

Is there anybody on it or I can try to tackle this one?

AlexPikalov avatar Feb 01 '21 20:02 AlexPikalov

lexicographicSortSchema is one of many utilities provided by GraphQL. Question: @LegNeato do you plan to add all or some of those utilities from the list (so I would need to make a public mod with this utility and other ones could be added later) or no plans for that and only one thing needed is to implement sorting for as_schema_language()?

AlexPikalov avatar Feb 01 '21 21:02 AlexPikalov

I'd like to propose to make it ready for future extensions because for example findBreakingChanges and findDangerousChanges are also super useful.

mrtnzlml avatar Feb 01 '21 21:02 mrtnzlml

Is there anybody on it or I can try to tackle this one?

@AlexPikalov I don't think anyone is working on this issue. Would you like to take care of it? It would be much appreciated! 😊

mrtnzlml avatar Feb 09 '21 20:02 mrtnzlml