Introspection tweak

This commit is contained in:
Gregory Schier
2024-02-26 17:24:44 -08:00
parent e1ffc387ea
commit 89793ebe2f
3 changed files with 12 additions and 4 deletions

View File

@@ -8,7 +8,7 @@
}, },
"package": { "package": {
"productName": "Yaak", "productName": "Yaak",
"version": "2024.3.0-beta.2" "version": "2024.3.0"
}, },
"tauri": { "tauri": {
"windows": [], "windows": [],

View File

@@ -183,6 +183,10 @@
.cm-completionIcon { .cm-completionIcon {
@apply italic font-mono; @apply italic font-mono;
&::after {
content: 'x' !important; /* Default (eg. for GraphQL) */
}
&.cm-completionIcon-class::after { &.cm-completionIcon-class::after {
content: 'o' !important; content: 'o' !important;
} }
@@ -258,7 +262,7 @@
} }
.cm-completionIcon { .cm-completionIcon {
@apply text-sm flex items-center pb-0.5 mr-2 flex-shrink-0; @apply text-xs flex items-center pb-0.5 flex-shrink-0;
} }
.cm-completionLabel { .cm-completionLabel {

View File

@@ -22,7 +22,7 @@ export function useIntrospectGraphQL(baseRequest: HttpRequest) {
const [refetchKey, setRefetchKey] = useState<number>(0); const [refetchKey, setRefetchKey] = useState<number>(0);
const [isLoading, setIsLoading] = useState<boolean>(false); const [isLoading, setIsLoading] = useState<boolean>(false);
const [error, setError] = useState<string>(); const [error, setError] = useState<string>();
const [introspection, setIntrospection] = useLocalStorage<IntrospectionQuery>( const [introspection, setIntrospection] = useLocalStorage<IntrospectionQuery | null>(
`introspection:${baseRequest.id}`, `introspection:${baseRequest.id}`,
); );
@@ -61,7 +61,10 @@ export function useIntrospectGraphQL(baseRequest: HttpRequest) {
const runIntrospection = () => { const runIntrospection = () => {
fetchIntrospection() fetchIntrospection()
.catch((e) => setError(e.message)) .catch((e) => {
setIntrospection(null);
setError(e.message);
})
.finally(() => setIsLoading(false)); .finally(() => setIsLoading(false));
}; };
@@ -82,5 +85,6 @@ export function useIntrospectGraphQL(baseRequest: HttpRequest) {
[introspection], [introspection],
); );
console.log('SCHEMA', introspection);
return { schema, isLoading, error, refetch }; return { schema, isLoading, error, refetch };
} }