feat: initial graphql language definition

This commit is contained in:
Andrew Bastin
2021-11-10 01:16:08 +05:30
parent 7de8e6be5e
commit a9bca8e1f8
14 changed files with 769 additions and 8 deletions

View File

@@ -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"

View File

@@ -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

View File

@@ -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",