It's not possible to filter paragraph's comments by any type of filtering, we have tried to filter by Comment ID OR by any relationship, e.g. entity_id

Steps to reproduce:

  1. Clean installation of Drupal 8.7.x
  2. Enable the JSON API module
  3. Download and enable the Paragraphs module (8.x-1.8)
  4. Add a custom content type (Or use existing one like article)
  5. Add a custom paragraph type
  6. Add a reference field to the paragraph type from the content type
  7. Add a custom comments type for paragraphs
  8. Add a comments field to the paragraph type
  9. Add a new node with comments, just to have some content to see in the API endpoint (You might have to add this patch because of an error in the paragraphs module)
  10. Go to the jsonapi e.g. http://{{host}}/jsonapi/comment/paragraph
  11. Try to filter comments by Drupal ID i.e. http://{{host}}/jsonapi/comment/paragraph?filter[drupal_internal__cid]=1
  12. Try to filter comments by parent entity ID (paragraph) i.e. http://{{host}}/jsonapi/comment/paragraph?filter[eid][condition][path]=entity_id.id&filter[eid][condition][value]={{ID}}

The data array will return is always empty.

CommentFileSizeAuthor
#4 Selection_106.png46.89 KBamitaibu
#4 Selection_105.png33.37 KBamitaibu

Comments

nedSaf created an issue. See original summary.

nader@gizra.com’s picture

Issue summary: View changes
nader@gizra.com’s picture

Issue summary: View changes
amitaibu’s picture

Project: Drupal core » Paragraphs
Version: 8.7.x-dev » 8.x-1.x-dev
Component: jsonapi.module » Code
Issue tags: -jsonapi, -comments, -Paragraphs
StatusFileSize
new33.37 KB
new46.89 KB

Moving to Paragraphs module. To give a bit more visual info.

1st image: We have a Comment on a Paragraph.
2nd image: When we try to filter in the same way we do with other entities, we get an empty result

amitaibu’s picture

Status: Active » Closed (works as designed)

Sorry for the noise - it's not a bug.

See https://www.drupal.org/node/3036792

osopolar’s picture