Eduflow
  • Welcome
  • API Reference
  • API Explorer
  • Getting started
    • API Overview
    • Authentication
    • Usage
  • GraphQL at Eduflow
    • Introduction to GraphQL
    • Variables
    • Fragments
    • Paginating queries
    • Inline fragments
  • Guides
    • Institutions
    • Courses
    • Flows and Activities
    • Reviews and Reflections
    • Discussions
    • Quizzes
    • Users & Participants
    • Tags
    • Course summary (outputs)
    • vs Peergrade
  • API Changelog
Powered by GitBook
On this page
  • Topics & Comments
  • API Example

Was this helpful?

  1. Guides

Discussions

PreviousReviews and ReflectionsNextQuizzes

Last updated 3 years ago

Was this helpful?

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.

Comment replies in Eduflow go one level deep only.

API Example

Topics and Comments are available via a pageable :

{
  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
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
{
    '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
                                        }
                                    }
                                ]
                            }
                        }
                    }
                ]
            }
        }
    }
}
GraphQL Connection
Paginating queries