Hey folks. I’m writing my own node service embedding an Apollo federation server with a custom SupergraphManager instead of the built-in IntrospectAndCompose or the highly recommended static files for various irrelevant reasons. It’s actually replacing a previous version of the service written against much older versions of the Apollo libraries which have evolved significantly. It’s fine, we all make choices.
It’s all working great, except that the supergraph schema’s objects’ fields are not sorted in the graphiql browser, or, perhaps, other interactive graphql explorers any longer. This seems to have been a behavioral change in the Apollo libraries, but I can’t find any documentation thereof or any obvious way to control it. I feel confident I could sort each subgraph’s schema as I collect it and do my own set of transformations, but I assume that the federated server will then just present the fields in subgraph composition order, not lexicographically sorting the entire supergraph.
I have tried parsing the supergraph sdl string, applying lexical sort ast function from the graphql library, and rendering it again, but Apollo then complains the schema is not a valid federated schema; presumably something is being discarded thereby.
Any suggestions for how I might solve the problem? I would be happiest having a sorted merged schema to satisfy all introspection query callers, but I could readily live with telling graphiql to sort the schema for presentation, if only I could find such an option.