Nice read, thanks.
Tshiamo Reginald Taukobong

Thank you, Tshiamo; I’m glad that you enjoyed my article!

As for your question, I have been in an identical situation.

You are trying to consolidate your API endpoints so that you can improve network performance with smaller responses, the caveat being that multiple consumers need different attributes of the same collections of data.

Supporting Justin Tubbs’ response, Facebook’s adoption of a GraphQL architecture allows for a RESTful-like URL access structure to resources whilst allowing the client to specify a comma-separated list of fields through a query-string such as ?fields=name,birthday,gender .

Although the idea of adopting a GraphQL architecture seems like a big deal, the specific feature of being able to specify particular fields to include in the response is a relatively tame feature to implement.

I know for instance that a library such as marshmallow for Python allows for schema serialisation which can take an only= tuple parameter of field names which may be parsed from the request’s query string.

I hope this helps!

Show your support

Clapping shows how much you appreciated Peter Boyer’s story.