Introspection tweak

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

View File

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

View File

@@ -183,6 +183,10 @@
.cm-completionIcon {
@apply italic font-mono;
&::after {
content: 'x' !important; /* Default (eg. for GraphQL) */
}
&.cm-completionIcon-class::after {
content: 'o' !important;
}
@@ -258,7 +262,7 @@
}
.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 {

View File

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