feat: gql revamp (#2644)
Co-authored-by: Liyas Thomas <liyascthomas@gmail.com> Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>
This commit is contained in:
@@ -6,7 +6,7 @@ import { SpotlightService } from "../.."
|
||||
import { GQLHistoryEntry, RESTHistoryEntry } from "~/newstore/history"
|
||||
import { getDefaultRESTRequest } from "~/helpers/rest/default"
|
||||
import { HoppAction, HoppActionWithArgs } from "~/helpers/actions"
|
||||
import { defaultGQLSession } from "~/newstore/GQLSession"
|
||||
import { getDefaultGQLRequest } from "~/helpers/graphql/default"
|
||||
|
||||
async function flushPromises() {
|
||||
return await new Promise((r) => setTimeout(r))
|
||||
@@ -230,7 +230,7 @@ describe("HistorySpotlightSearcherService", () => {
|
||||
|
||||
historyMock.gqlEntries.push({
|
||||
request: {
|
||||
...defaultGQLSession.request,
|
||||
...getDefaultGQLRequest(),
|
||||
url: "bla.com",
|
||||
},
|
||||
response: "{}",
|
||||
@@ -267,7 +267,7 @@ describe("HistorySpotlightSearcherService", () => {
|
||||
|
||||
const historyEntry: GQLHistoryEntry = {
|
||||
request: {
|
||||
...defaultGQLSession.request,
|
||||
...getDefaultGQLRequest(),
|
||||
url: "bla.com",
|
||||
},
|
||||
response: "{}",
|
||||
@@ -302,7 +302,7 @@ describe("HistorySpotlightSearcherService", () => {
|
||||
|
||||
historyMock.gqlEntries.push({
|
||||
request: {
|
||||
...defaultGQLSession.request,
|
||||
...getDefaultGQLRequest(),
|
||||
url: "bla.com",
|
||||
},
|
||||
response: "{}",
|
||||
@@ -351,7 +351,7 @@ describe("HistorySpotlightSearcherService", () => {
|
||||
|
||||
historyMock.gqlEntries.push({
|
||||
request: {
|
||||
...defaultGQLSession.request,
|
||||
...getDefaultGQLRequest(),
|
||||
url: "bla.com",
|
||||
},
|
||||
response: "{}",
|
||||
@@ -398,7 +398,7 @@ describe("HistorySpotlightSearcherService", () => {
|
||||
it("none of the history entries are show when neither of the open actions are registered", async () => {
|
||||
historyMock.gqlEntries.push({
|
||||
request: {
|
||||
...defaultGQLSession.request,
|
||||
...getDefaultGQLRequest(),
|
||||
url: "bla.com",
|
||||
},
|
||||
response: "{}",
|
||||
|
||||
@@ -16,6 +16,7 @@ import IconFolder from "~icons/lucide/folder"
|
||||
import RESTRequestSpotlightEntry from "~/components/app/spotlight/entry/RESTRequest.vue"
|
||||
import GQLRequestSpotlightEntry from "~/components/app/spotlight/entry/GQLRequest.vue"
|
||||
import { createNewTab } from "~/helpers/rest/tab"
|
||||
import { createNewTab as createNewGQLTab } from "~/helpers/graphql/tab"
|
||||
import { getTabRefWithSaveContext } from "~/helpers/rest/tab"
|
||||
import { currentTabID } from "~/helpers/rest/tab"
|
||||
import {
|
||||
@@ -23,8 +24,6 @@ import {
|
||||
HoppGQLRequest,
|
||||
HoppRESTRequest,
|
||||
} from "@hoppscotch/data"
|
||||
import { setGQLSession } from "~/newstore/GQLSession"
|
||||
import { cloneDeep } from "lodash-es"
|
||||
import { hoppWorkspaceStore } from "~/newstore/workspace"
|
||||
import { changeWorkspace } from "~/newstore/workspace"
|
||||
|
||||
@@ -305,11 +304,13 @@ export class CollectionsSpotlightSearcherService
|
||||
|
||||
if (!req) return
|
||||
|
||||
setGQLSession({
|
||||
request: cloneDeep(req),
|
||||
schema: "",
|
||||
response: "",
|
||||
})
|
||||
createNewGQLTab(
|
||||
{
|
||||
request: req,
|
||||
isDirty: false,
|
||||
},
|
||||
true
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user