feat: introduce graphql mode for codemirror

This commit is contained in:
Andrew Bastin
2021-09-10 19:00:18 +05:30
parent 41a02f059d
commit 003400cfa8
4 changed files with 85 additions and 1 deletions

View File

@@ -300,6 +300,7 @@ import { getCurrentStrategyID } from "~/helpers/network"
import { makeGQLRequest } from "~/helpers/types/HoppGQLRequest"
import { useCodemirror } from "~/helpers/editor/codemirror"
import "codemirror/mode/javascript/javascript"
import "~/helpers/editor/modes/graphql"
import jsonLinter from "~/helpers/editor/linting/json"
import { createGQLQueryLinter } from "~/helpers/editor/linting/gqlQuery"
import queryCompleter from "~/helpers/editor/completion/gqlQuery"
@@ -365,7 +366,7 @@ const schemaString = useReadonlyStream(props.conn.schema$, null)
useCodemirror(queryEditor, gqlQueryString, {
extendedEditorConfig: {
mode: "application/ld+json",
mode: "graphql",
},
linter: createGQLQueryLinter(schemaString),
completer: queryCompleter(schemaString),