hummingbird-project / hummingbird-examples

Examples demonstrating various aspects of the Hummingbird swift server framework
Apache License 2.0
88 stars 19 forks source link

Use order-preserving JSON encoder in graphql-server #129

Closed rgcottrell closed 2 weeks ago

rgcottrell commented 2 weeks ago

This uses the GraphQLJSONEncoder when converting a GraphQLResult to a Response to return the query results in the order that the were specified in the request.

adam-fowler commented 2 weeks ago

The other way of doing this would be to extend GraphQLJSONEncoder() to conform to ResponseEncoder and then use a RequestContext to set the responseEncoder but it doesn't really make much difference either way.