paypal / mocca

Mocca is a GraphQL client for JVM languages with the goal of being easy to use, flexible and modular.
MIT License
15 stars 14 forks source link

Add support for response headers #42

Open fabiocarvalho777 opened 2 years ago

fabiocarvalho777 commented 2 years ago

Mocca already supports request headers, however, it doesn't support response headers yet, which should be covered by this issue.

Potential API modification to support this feature

A new Mocca annotation could be introduced (named ResponseHeaders and applicable only to method paramteres) which users could use to annotate a parameter of type Map<String, List<String>> (the type must be necessarily that). Mocca would then identify this parameter (if present), and populate it with response headers as part of response message processing. The name of the parameter would be irrelevant.

Acceptance Criteria

  1. Use case described above is implemented
  2. End user document is changed accordingly
  3. Javadocs are changed accordingly
  4. Unit and/or functional tests are added
  5. Make sure to add negative tests as well