AnsweredAssumed Answered

Fetch List Of ALL (Un-)Published Pages For A Course Using GraphQL

Question asked by Orion Benson on Dec 24, 2019
Latest reply on Dec 25, 2019 by James Jones

Hi, new member here so forgive me if this is being posted in the wrong area.

 

We have an ungraded course which we have dubbed our "Cyber Portal" which contains information about our cyber program spread across multiple linked Pages. I want to dynamically update the Pages' contents using the GraphQL API.

 

query MyQuery {
  course(id: XXXXX) {
    modulesConnection {
      nodes {
        name
        moduleItems {
          content {
            ... on Page {
              id
              title
}}}}}}}


When I run the above I get no results back for the specific course. However, when I do it for `allCourses{}` I get the info returned for Pages in the other courses. Is there something specific I need to do to the Pages to allow them to show up? I tested on published and unpublished and neither show up for that course. Is there a better way for me to get a list of all created Pages for a course?

Outcomes