feat: initial graphql language definition
This commit is contained in:
@@ -307,7 +307,7 @@ import { makeGQLHistoryEntry, addGraphqlHistoryEntry } from "~/newstore/history"
|
||||
import { logHoppRequestRunToAnalytics } from "~/helpers/fb/analytics"
|
||||
import { getCurrentStrategyID } from "~/helpers/network"
|
||||
import { makeGQLRequest } from "~/helpers/types/HoppGQLRequest"
|
||||
import { useCodemirror } from "~/helpers/editor/codemirror"
|
||||
import { useNewCodemirror as useCodemirror } from "~/helpers/editor/codemirror"
|
||||
import "codemirror/mode/javascript/javascript"
|
||||
import "~/helpers/editor/modes/graphql"
|
||||
import jsonLinter from "~/helpers/editor/linting/json"
|
||||
|
||||
@@ -43,6 +43,7 @@ import { watch, onMounted, ref, Ref, useContext } from "@nuxtjs/composition-api"
|
||||
|
||||
import { javascriptLanguage } from "@codemirror/lang-javascript"
|
||||
import { jsonLanguage } from "@codemirror/lang-json"
|
||||
import { GQLLanguage } from "@hoppscotch/codemirror-lang-graphql"
|
||||
import { onBeforeUnmount } from "@vue/runtime-dom"
|
||||
import { pipe } from "fp-ts/function"
|
||||
import * as O from "fp-ts/Option"
|
||||
@@ -304,6 +305,8 @@ const getLanguage = (langMime: string): Language | null => {
|
||||
return jsonLanguage
|
||||
} else if (langMime === "application/javascript") {
|
||||
return javascriptLanguage
|
||||
} else if (langMime === "graphql") {
|
||||
return GQLLanguage
|
||||
}
|
||||
|
||||
// None matched, so return null
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
"@codemirror/state": "^0.19.3",
|
||||
"@codemirror/text": "^0.19.5",
|
||||
"@codemirror/view": "^0.19.12",
|
||||
"@hoppscotch/codemirror-lang-graphql": "workspace:^0.1.0",
|
||||
"@hoppscotch/js-sandbox": "workspace:^1.0.0",
|
||||
"@nuxtjs/axios": "^5.13.6",
|
||||
"@nuxtjs/composition-api": "^0.29.3",
|
||||
|
||||
Reference in New Issue
Block a user