The discover() query provides a way to display learning recommendations by categories and topics. It is commonly used to display as a landing page providing an overview and entry point to browse the content offering. It would support the display of a page looking like this:
Here is an example request:
query { discover( blocks:[ {type: TopicCarousel, data: L1_TOPICS}, {type: TopicCarousel, data: TOP_TOPICS}, {type: LearningCarousel, data:TOP_TOPICS, filters: {topic: "Business Skills"}, names:"Top learning in Business Skills" }, {type: LearningCarousel, data:TOP_TOPICS, filters: {topic: "Project Management"}, names:"Top learning in Project Management" }, {type: LearningCarousel, data:USE_FILTERS, filters: {contentGroups:[43003]}, names:"Newest learning in Content Group 43003", sort: {field:CREATED, direction:DESC} }, {type: LearningCarousel, data:USE_FILTERS, filters: {}, names:"Top-rated Courses", sort: {field:POPULAR, direction:DESC} }, {type: LearningCarousel, data:USE_FILTERS, filters: {}, names:"Newest Courses", sort: {field:CREATED, direction:DESC} }, ] context: { appId: "someappID", language: "en", region: GLOBAL } ) { blocks { ...on TopicCarousel { title items { id parentId name level } }, ...on LearningCarousel { title metadata { name topic { id name } } response(first:5) { edges { node { ... on CourseCard { id title duration image metadata { contentGroups { id title subGroup { id } } } } } } } } } } }
Please make sure to send your OAuth token in the header. Example below:
{ "Authorization": "Bearer {YOUR OAUTH TOKEN}" }
Let's examine the query in more detail. Firstly, the discover query expects two arguments:
Available block types:
Further documentation and the GraphQL API Schema/Reference can be found here.