feat: add analytics logging while hoppscotch requests are fired
This commit is contained in:
@@ -485,9 +485,10 @@
|
||||
import * as gql from "graphql"
|
||||
import { commonHeaders } from "~/helpers/headers"
|
||||
import { getPlatformSpecialKey } from "~/helpers/platformutils"
|
||||
import { sendNetworkRequest } from "~/helpers/network"
|
||||
import { getCurrentStrategyID, sendNetworkRequest } from "~/helpers/network"
|
||||
import { getSettingSubject } from "~/newstore/settings"
|
||||
import { addGraphqlHistoryEntry } from "~/newstore/history"
|
||||
import { logHoppRequestRunToAnalytics } from "~/helpers/fb/analytics"
|
||||
|
||||
export default {
|
||||
beforeRouteLeave(_to, _from, next) {
|
||||
@@ -849,6 +850,11 @@ export default {
|
||||
})
|
||||
console.log("Error", error)
|
||||
}
|
||||
|
||||
logHoppRequestRunToAnalytics({
|
||||
platform: "graphql-query",
|
||||
strategy: getCurrentStrategyID(),
|
||||
})
|
||||
},
|
||||
|
||||
// NOTE : schema required here is the GQL Schema document object, not the schema string
|
||||
@@ -918,6 +924,11 @@ export default {
|
||||
await this.getSchema()
|
||||
|
||||
this.pollSchema()
|
||||
|
||||
logHoppRequestRunToAnalytics({
|
||||
platform: "graphql-schema",
|
||||
strategy: getCurrentStrategyID(),
|
||||
})
|
||||
}
|
||||
},
|
||||
async pollSchema() {
|
||||
|
||||
@@ -766,7 +766,11 @@ import getEnvironmentVariablesFromScript from "~/helpers/preRequest"
|
||||
import runTestScriptWithVariables from "~/helpers/postwomanTesting"
|
||||
import parseTemplateString from "~/helpers/templating"
|
||||
import { tokenRequest, oauthRedirect } from "~/helpers/oauth"
|
||||
import { cancelRunningRequest, sendNetworkRequest } from "~/helpers/network"
|
||||
import {
|
||||
cancelRunningRequest,
|
||||
getCurrentStrategyID,
|
||||
sendNetworkRequest,
|
||||
} from "~/helpers/network"
|
||||
import {
|
||||
hasPathParams,
|
||||
addPathParamsToVariables,
|
||||
@@ -782,6 +786,7 @@ import { generateCodeWithGenerator } from "~/helpers/codegen/codegen"
|
||||
import { getSettingSubject, applySetting } from "~/newstore/settings"
|
||||
import { addRESTHistoryEntry } from "~/newstore/history"
|
||||
import clone from "lodash/clone"
|
||||
import { logHoppRequestRunToAnalytics } from "~/helpers/fb/analytics"
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@@ -1642,6 +1647,11 @@ export default {
|
||||
response: syntheticResponse,
|
||||
})
|
||||
this.testReports = testResults
|
||||
|
||||
logHoppRequestRunToAnalytics({
|
||||
platform: "rest",
|
||||
strategy: getCurrentStrategyID(),
|
||||
})
|
||||
},
|
||||
getQueryStringFromPath() {
|
||||
const pathParsed = url.parse(this.uri)
|
||||
|
||||
Reference in New Issue
Block a user