Skip to content

Commit

Permalink
fix: schema autocomplete/ai (#2372)
Browse files Browse the repository at this point in the history
instanceof does not work with primitive types
  • Loading branch information
HugoCasa authored Oct 2, 2023
1 parent 66d15f0 commit 9ed748a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion frontend/src/lib/components/Editor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@
function updateSchema(lang, args) {
const schemaRes = lang === 'graphql' ? args.api : args.database
if (schemaRes instanceof String) {
if (typeof schemaRes === 'string') {
dbSchema = $dbSchemas[schemaRes.replace('$res:', '')]
}
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/components/copilot/ScriptFix.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
function updateSchema(lang, args) {
const schemaRes = lang === 'graphql' ? args.api : args.database
if (schemaRes instanceof String) {
if (typeof schemaRes === 'string') {
dbSchema = $dbSchemas[schemaRes.replace('$res:', '')]
}
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/components/copilot/ScriptGen.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
function updateSchema(lang, args) {
const schemaRes = lang === 'graphql' ? args.api : args.database
if (schemaRes instanceof String) {
if (typeof schemaRes === 'string') {
dbSchema = $dbSchemas[schemaRes.replace('$res:', '')]
}
}
Expand Down

0 comments on commit 9ed748a

Please sign in to comment.