diff --git a/console/cypress/e2e/tracing/api-graphiql/heap.api-graphiql.integration.test.ts b/console/cypress/e2e/tracing/api-graphiql/heap.api-graphiql.integration.test.ts index d8fa137532c..b1541d4797b 100644 --- a/console/cypress/e2e/tracing/api-graphiql/heap.api-graphiql.integration.test.ts +++ b/console/cypress/e2e/tracing/api-graphiql/heap.api-graphiql.integration.test.ts @@ -31,6 +31,10 @@ describe('Tracing GraphiQL plugins usage', () => { }); it('When the users interact with GraphiQL, then some custom Heap events must be traced', () => { + // ATTENTION: This test checks only that the events are sent, not that the involved features work! + // For example: the query used in this test is not valid, but the test passes anyway since it + // checks for the events only + // -------------------- cy.log('**--- Click the GraphiQL Prettify button**'); cy.get('.graphiql-container').within(() => { diff --git a/console/src/components/Services/ApiExplorer/GraphiQLWrapper/GraphiQLWrapper.js b/console/src/components/Services/ApiExplorer/GraphiQLWrapper/GraphiQLWrapper.js index 2eb391da5a8..167d24f3916 100644 --- a/console/src/components/Services/ApiExplorer/GraphiQLWrapper/GraphiQLWrapper.js +++ b/console/src/components/Services/ApiExplorer/GraphiQLWrapper/GraphiQLWrapper.js @@ -171,7 +171,7 @@ class GraphiQLWrapper extends Component { dispatch(_push(getActionsCreateRoute())); }; - const routeToREST = gqlProps => () => { + const createRouteToREST = gqlProps => () => { const { query, schema } = graphiqlContext.state; setLSItem(LS_KEYS.graphiqlQuery, query); if (!query || !schema || !gqlProps.query || !isQueryValid(query)) { @@ -239,6 +239,8 @@ class GraphiQLWrapper extends Component { // get toolbar buttons const getGraphiqlButtons = () => { + const routeToREST = createRouteToREST(graphiqlProps); + const buttons = [ { label: 'Prettify', @@ -274,7 +276,7 @@ class GraphiQLWrapper extends Component { title: 'REST Endpoints', onClick: () => { trackGraphiQlToolbarButtonClick('REST'); - routeToREST(graphiqlProps); + routeToREST(); }, }, ];