graphql-java-annotations icon indicating copy to clipboard operation
graphql-java-annotations copied to clipboard

When using the default strategy that prettifies the fields, schema field order depends on original method name

Open trunkate opened this issue 4 years ago • 2 comments

Although the output is deterministic, I didn't found a way to order the fields alphabetically.

For example:

public interface Sample {
    @GraphQLField
    Integer getId();

    @GraphQLField
    Boolean isActive();
}
type Sample {
  id: Int
  active: Boolean
}

any idea how to solve this?

Thanks

trunkate avatar Jan 10 '20 10:01 trunkate

When you order your fields in the Sample class alphabetically, isn't it appears alphabetically in the graphql type?

graphql-java-annotations does not support ordering of fields, although it can be a nice feature

yarinvak avatar Jan 17 '20 15:01 yarinvak

Fields are ordered, but when prettified, the method name is used, is..() come after get..()

trunkate avatar Jan 18 '20 06:01 trunkate

Hi @trunkate ,

We're helping with project maintenance and reviewing the list of opened PRs and Issues.

This issue was created quite a while ago, we were wondering if you were still interested in the outcome, please let us know if this is the case.

Without an answer by July 1st, 2023, this issue will be closed as "inactive" (and can always be re-opened later on if needed).

Thanks,

Fgerthoffert avatar Jun 02 '23 08:06 Fgerthoffert