VirtusLab-Open-Source / strapi-plugin-comments

A plugin for Strapi Headless CMS that provides end to end comments feature with their moderation panel, bad words filtering, abuse reporting and more.
MIT License
409 stars 64 forks source link

[CU-2cq6005] Feat/rest fields query #132

Closed cyp3rius closed 2 years ago

cyp3rius commented 2 years ago

Ticket

https://github.com/VirtusLab/strapi-plugin-comments/issues/115

Summary

What does this PR do/solve?

Introduce support of Fields query via REST API according to Strapi documentation:

https://docs.strapi.io/developer-docs/latest/developer-resources/database-apis-reference/rest/populating-fields.html#field-selection

Test Plan

How are you testing the work you're submitting?

  1. Run project
  2. Try to call API with ?fields[0]=content and see that there are present some mandatory fields like id, related, threadOf, gotThread and content. Other fields has been dropped. Works for both flat and hierarchical query

Note This is not supported by GraphQL by design, not necessary.

codecov-commenter commented 2 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (develop@eddd4b3). Click here to learn what that means. The diff coverage is n/a.

@@            Coverage Diff             @@
##             develop     #132   +/-   ##
==========================================
  Coverage           ?   39.18%           
==========================================
  Files              ?        9           
  Lines              ?      490           
  Branches           ?      192           
==========================================
  Hits               ?      192           
  Misses             ?      296           
  Partials           ?        2           
Flag Coverage Δ
unittest 39.18% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update eddd4b3...5e7933d. Read the comment docs.

cyp3rius commented 2 years ago

Task linked: CU-2cq6005 Support for 'fields' query