-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: import LS only for monaco-graphql (#2103)
- Loading branch information
Showing
14 changed files
with
205 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'graphql-language-service': patch | ||
'monaco-graphql': patch | ||
--- | ||
|
||
LangugeService should not be imported by `codemirror-graphql`, and thus `picomatch` should not be imported. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { buildClientSchema, buildASTSchema } from 'graphql'; | ||
|
||
import type { SchemaLoader } from './typings'; | ||
|
||
export const defaultSchemaLoader: SchemaLoader = (schemaConfig, parser) => { | ||
const { | ||
schema, | ||
documentAST, | ||
introspectionJSON, | ||
introspectionJSONString, | ||
buildSchemaOptions, | ||
documentString, | ||
} = schemaConfig; | ||
if (schema) { | ||
return schema; | ||
} | ||
if (introspectionJSONString) { | ||
const introspectionJSONResult = JSON.parse(introspectionJSONString); | ||
return buildClientSchema(introspectionJSONResult, buildSchemaOptions); | ||
} | ||
if (documentString && parser) { | ||
const docAST = parser(documentString); | ||
return buildASTSchema(docAST, buildSchemaOptions); | ||
} | ||
if (introspectionJSON) { | ||
return buildClientSchema(introspectionJSON, buildSchemaOptions); | ||
} | ||
if (documentAST) { | ||
return buildASTSchema(documentAST, buildSchemaOptions); | ||
} | ||
throw Error('no schema supplied'); | ||
}; |
Oops, something went wrong.
a44772d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 Published on https://monaco-graphql.netlify.app as production
🚀 Deployed on https://61afd823d9c8dc0a9102a9e8--monaco-graphql.netlify.app
a44772d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 Published on https://graphiql-test.netlify.app as production
🚀 Deployed on https://61afd83963d47f0a02e14554--graphiql-test.netlify.app