# Discussions

### Topics & Comments

A `DiscussionActivity` consists of topics. A `Topic` contains a connection to `Comment`, which contains the top-level comments, then every `Comment` contains a connection to `Comment` for replies.

{% hint style="info" %}
Comment replies in Eduflow go one level deep only.
{% endhint %}

### API Example

Topics and Comments are available via a pageable [GraphQL Connection](https://graphql.org/learn/pagination/#end-of-list-counts-and-connections):

{% content-ref url="/pages/-MT0jmlOIXnJAuofcp4E" %}
[Paginating queries](/graphql/pagination.md)
{% endcontent-ref %}

{% tabs %}
{% tab title="Query" %}

```graphql
{
  activity(id: "ae8f3183-0fd0-48e1-b52d-2f455cd78db7") {
    ... on DiscussionActivity {
      title
      topics(first: 2) {
        edges {
          node {
            title
            content
            likesCount
            author {
              name
            }
            commentsCount
            comments {
              edges {
                node {
                  content
                  likesCount
                  repliesCount
                  author {
                    name
                  }
                  replies {
                    edges {
                      node {
                        content
                        author {
                          name
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

```

{% endtab %}

{% tab title="Response" %}

```javascript
{
    'data': {
        'activity': {
            'topics': {
                'totalCount': 2,
                'edges': [
                    {
                        'node': {
                            'title': 'Topic 2',
                            'content': '<p>Topic 2</p>',
                            'author': {
                                'name': 'Ryan Howard'
                            },
                            'commentsCount': 0,
                            'comments': {
                                'edges': [
                                ]
                            },
                            'likesCount': 0
                        }
                    },
                    {
                        'node': {
                            'title': 'Topic 1',
                            'content': '<p>Topic 1</p>',
                            'author': {
                                'name': 'Ryan Howard'
                            },
                            'likesCount': 2,
                            'commentsCount': 4,
                            'comments': {
                                'edges': [
                                    {
                                        'node': {
                                            'author': {
                                                'name': 'Ryan Howard'
                                            },
                                            'content': '<p>Comment 1</p>',
                                            'likesCount': 2,
                                            'replies': {
                                                'edges': [
                                                    {
                                                        'node': {
                                                            'author': {
                                                                'name': 'Ryan Howard'
                                                            },
                                                            'content': '<p>Reply 1</p>'
                                                        }
                                                    },
                                                    {
                                                        'node': {
                                                            'author': {
                                                                'name': 'Ryan Howard'
                                                            },
                                                            'content': '<p>Reply 2</p>'
                                                        }
                                                    }
                                                ]
                                            },
                                            'repliesCount': 2
                                        }
                                    },
                                    {
                                        'node': {
                                            'author': {
                                                'name': 'Pam Beesley'
                                            },
                                            'content': '<p>Comment 2</p>',
                                            'likesCount': 0,
                                            'replies': {
                                                'edges': [
                                                ]
                                            },
                                            'repliesCount': 0
                                        }
                                    }
                                ]
                            }
                        }
                    }
                ]
            }
        }
    }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.eduflow.com/guides/discussions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
