How to use Confluence Legacy GraphQL in Forge app

Hi there,

I want to build a Confluence forge app to fetch the Confluence page last viewed information. We want to use the Confluence legacy GraphQL shown in GraphQL Gateway.

confluenceLegacy_contentAnalyticsLastViewedAtByPage

query MyQuery {
  confluenceLegacy_contentAnalyticsLastViewedAtByPage(
    contentIds: ["3962929262", "3963453586"]
    startTime: "2020-07-20T17:30:15+05:30"
  ) @optIn(to: "ConfluenceLegacyRN") {
    nodes {
      contentId
      lastViewedAt
    }
  }
}

When using the query in the Postman on our sites it works as expected. However, when invoking the resolver in Forge app using asUser().requestGraph, we get the following errors:

Does anyone have any idea on how to make it work? Thanks

I don’t think you can use the confluenceLegacy parts of the GraphQL schema with Forge. These queries and mutations only work with API keys, not with the tokens used by requestGraph.