Open yuhanz opened 3 months ago
serviceList
has been deprecated. Is there a reason serviceList
has to be used?
I see. We had an old Java client (apollo-kotlin) built upon a schema from serviceList
. We have moved to supergraphSdl
and that caused a newly built of the GraphQL client to be incompatible in the Java code. I guess there will be no support of the schema format of serviceList
moving forward. (That's also why the app has moved to supergraphSdl) . Just want to note there is a difference between the two schema formats, and wonder if any one else built tools when they encountered the same issue.
We found out from apollo-kotlin client that the schema from graphql federation look different when created with serviceList or supergraphSdl file:
If ApolloGateway is created with
serviceList
, then the fields in a type are sorted in alphabetical order. If ApolloGateway is created withsupergraphSdl
, then the fields in a type are listed as they were ordered in their subgraph.Since apollo-kotlin compiles DTO classes based on the schema, the reordering causes the constructor signature incompatible when I switch between the two modes, :( while still at the same schema.
Is there some parameter in ApolloGateway to control the behavior of field ordering in a schema? Any command line tool to sort the fields in a graphql schema could help, too.