@parhelia/alpaca 0.1.12902 → 0.1.12904
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/GraphQL.d.ts.map +1 -1
- package/dist/GraphQL.js +6 -19
- package/dist/GraphiQLPanel.d.ts.map +1 -1
- package/dist/GraphiQLPanel.js +10 -98
- package/dist/Layout.d.ts.map +1 -1
- package/dist/Layout.js +1 -1
- package/dist/graphqlService.d.ts.map +1 -1
- package/dist/graphqlService.js +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -7
- package/package.json +1 -1
package/dist/GraphQL.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphQL.d.ts","sourceRoot":"","sources":["../src/GraphQL.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GraphQL.d.ts","sourceRoot":"","sources":["../src/GraphQL.tsx"],"names":[],"mappings":"AA+BA,wBAAgB,OAAO,mDAmQtB"}
|
package/dist/GraphQL.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useMemo, useState } from "react";
|
|
3
|
-
import { ActionButton, createAgentCommand, getComponentById,
|
|
4
|
-
import { getGraphQLSchema } from "./graphqlService";
|
|
3
|
+
import { ActionButton, createAgentCommand, getComponentById, SecretAgentIcon, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, useEditContext, } from "@parhelia/core";
|
|
4
|
+
import { getGraphQLSchema, } from "./graphqlService";
|
|
5
5
|
import { GraphiQLPanel } from "./GraphiQLPanel";
|
|
6
6
|
function sameItem(left, right) {
|
|
7
7
|
return (!!left &&
|
|
@@ -17,7 +17,6 @@ export function GraphQL() {
|
|
|
17
17
|
const [query, setQuery] = useState("");
|
|
18
18
|
const [schemaResult, setSchemaResult] = useState({});
|
|
19
19
|
const [showSchemaSpinner, setShowSchemaSpinner] = useState(false);
|
|
20
|
-
const [schemaLoadKey, setSchemaLoadKey] = useState("");
|
|
21
20
|
const [aiGeneratedQuery, setAiGeneratedQuery] = useState("");
|
|
22
21
|
const [graphiqlVariables, setGraphiqlVariables] = useState("{}");
|
|
23
22
|
const [baseItem, setBaseItem] = useState(null);
|
|
@@ -25,7 +24,7 @@ export function GraphQL() {
|
|
|
25
24
|
if (!editContext?.page || (editContext.selection?.length || 0) !== 1) {
|
|
26
25
|
return null;
|
|
27
26
|
}
|
|
28
|
-
return
|
|
27
|
+
return getComponentById(editContext.selection[0], editContext.page) || null;
|
|
29
28
|
}, [editContext?.page, selectionKey]);
|
|
30
29
|
const baseItemDescriptor = useMemo(() => {
|
|
31
30
|
const componentItem = selectedComponent?.datasourceItem || selectedComponent?.items?.[0];
|
|
@@ -96,30 +95,18 @@ export function GraphQL() {
|
|
|
96
95
|
}, [queryField?.id, queryField?.rawValue]);
|
|
97
96
|
useEffect(() => {
|
|
98
97
|
setSchemaResult({});
|
|
99
|
-
setSchemaLoadKey("");
|
|
100
98
|
setGraphiqlVariables("{}");
|
|
101
99
|
setAiGeneratedQuery("");
|
|
102
100
|
}, [currentItem?.id, currentItem?.language, currentItem?.version]);
|
|
103
|
-
const currentItemKey = currentItem
|
|
104
|
-
? `${currentItem.id}:${currentItem.language}:${currentItem.version}`
|
|
105
|
-
: "";
|
|
106
101
|
useEffect(() => {
|
|
107
|
-
if (currentItem &&
|
|
108
|
-
!schemaResult?.data &&
|
|
109
|
-
!schemaResult?.error &&
|
|
110
|
-
!showSchemaSpinner &&
|
|
111
|
-
schemaLoadKey !== currentItemKey) {
|
|
112
|
-
setSchemaLoadKey(currentItemKey);
|
|
102
|
+
if (currentItem && !schemaResult?.data && !showSchemaSpinner) {
|
|
113
103
|
void fetchSchema();
|
|
114
104
|
}
|
|
115
105
|
}, [
|
|
116
106
|
currentItem?.id,
|
|
117
107
|
currentItem?.language,
|
|
118
108
|
currentItem?.version,
|
|
119
|
-
currentItemKey,
|
|
120
|
-
schemaLoadKey,
|
|
121
109
|
schemaResult?.data,
|
|
122
|
-
schemaResult?.error,
|
|
123
110
|
showSchemaSpinner,
|
|
124
111
|
]);
|
|
125
112
|
useEffect(() => {
|
|
@@ -182,7 +169,7 @@ export function GraphQL() {
|
|
|
182
169
|
setQuery(newQuery);
|
|
183
170
|
setAiGeneratedQuery(newQuery);
|
|
184
171
|
};
|
|
185
|
-
return (_jsxs("div", { className: "relative flex h-full min-h-0 flex-col overflow-hidden text-xs", children: [aiGeneratedQuery && aiGeneratedQuery !== query && (_jsxs("div", { className: "shrink-0 flex items-center gap-2 border-b border-
|
|
172
|
+
return (_jsxs("div", { className: "relative flex h-full min-h-0 flex-col overflow-hidden text-xs", children: [aiGeneratedQuery && aiGeneratedQuery !== query && (_jsxs("div", { className: "shrink-0 flex items-center gap-2 border-b border-yellow-200 bg-yellow-50 p-2 text-xs", children: [_jsx("span", { className: "text-yellow-800", children: "AI generated a new query" }), _jsx(ActionButton, { onClick: () => applyQueryToEditor(aiGeneratedQuery), className: "p-1 text-xs", variant: "outline", children: "Apply" }), _jsx(ActionButton, { onClick: () => setAiGeneratedQuery(""), className: "p-1", variant: "ghost", children: "x" })] })), _jsx(GraphiQLPanel, { item: currentItem, itemLabel: baseItemLabel, query: query, variables: graphiqlVariables, onQueryChange: setQuery, onVariablesChange: setGraphiqlVariables, onExecutionResult: () => { }, headerActions: _jsx(TooltipProvider, { delayDuration: 300, children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsxs(ActionButton, { variant: "outline", className: "h-8 w-8 rounded-full p-0", onClick: () => {
|
|
186
173
|
editContext?.executeCommand?.({
|
|
187
174
|
command: createAgentCommand,
|
|
188
175
|
data: {
|
|
@@ -194,5 +181,5 @@ export function GraphQL() {
|
|
|
194
181
|
},
|
|
195
182
|
},
|
|
196
183
|
});
|
|
197
|
-
}, children: [_jsx(
|
|
184
|
+
}, children: [_jsx(SecretAgentIcon, { size: 16, strokeWidth: 1.5 }), _jsx("span", { className: "sr-only", children: "Start GraphQL Agent" })] }) }), _jsx(TooltipContent, { children: "Start GraphQL Agent" })] }) }) })] }));
|
|
198
185
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphiQLPanel.d.ts","sourceRoot":"","sources":["../src/GraphiQLPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,qCAAqC,CAAC;AAC7C,OAAO,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"GraphiQLPanel.d.ts","sourceRoot":"","sources":["../src/GraphiQLPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,qCAAqC,CAAC;AAC7C,OAAO,gCAAgC,CAAC;AAOxC,OAAO,EAGL,uBAAuB,EAEvB,gBAAgB,EAEjB,MAAM,kBAAkB,CAAC;AAwD1B,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,KAAK,EACL,SAAS,EACT,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,SAAS,EACT,aAAa,GACd,EAAE;IACD,IAAI,EAAE,gBAAgB,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,iBAAiB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,iBAAiB,EAAE,CAAC,MAAM,EAAE,uBAAuB,KAAK,IAAI,CAAC;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACjC,2CA4IA"}
|
package/dist/GraphiQLPanel.js
CHANGED
|
@@ -6,8 +6,6 @@ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
|
6
6
|
import { GraphiQL as GraphiQLIDE } from "graphiql";
|
|
7
7
|
import { useGraphiQL, useGraphiQLActions } from "@graphiql/react";
|
|
8
8
|
import { explorerPlugin } from "@graphiql/plugin-explorer";
|
|
9
|
-
import { ActionButton } from "@parhelia/core";
|
|
10
|
-
import { RefreshCw } from "lucide-react";
|
|
11
9
|
import { executeGraphiQLRequest, fetchGraphiQLSchema, isSchemaIntrospectionQuery, } from "./graphqlService";
|
|
12
10
|
function GraphiQLSyncBridge({ query, variables, }) {
|
|
13
11
|
const { updateActiveTabValues } = useGraphiQLActions();
|
|
@@ -42,91 +40,31 @@ function parseVariables(variables) {
|
|
|
42
40
|
: "Variables JSON is invalid.");
|
|
43
41
|
}
|
|
44
42
|
}
|
|
45
|
-
function getSchemaErrorMessage(result) {
|
|
46
|
-
if (result.error) {
|
|
47
|
-
return result.error;
|
|
48
|
-
}
|
|
49
|
-
const firstError = Array.isArray(result.errors)
|
|
50
|
-
? result.errors[0]
|
|
51
|
-
: result.errors;
|
|
52
|
-
if (firstError) {
|
|
53
|
-
if (typeof firstError.message === "string") {
|
|
54
|
-
return firstError.message;
|
|
55
|
-
}
|
|
56
|
-
if (typeof firstError === "string") {
|
|
57
|
-
return firstError;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
if (result.status && result.status !== 200) {
|
|
61
|
-
return "Schema introspection failed";
|
|
62
|
-
}
|
|
63
|
-
return undefined;
|
|
64
|
-
}
|
|
65
43
|
export function GraphiQLPanel({ item, query, variables, onQueryChange, onVariablesChange, onExecutionResult, itemLabel, headerActions, }) {
|
|
66
44
|
const [schemaResult, setSchemaResult] = useState({});
|
|
67
45
|
const [isRefreshingSchema, setIsRefreshingSchema] = useState(false);
|
|
68
|
-
const [autoSchemaLoadKey, setAutoSchemaLoadKey] = useState("");
|
|
69
|
-
const activeSchemaRequestRef = useRef(0);
|
|
70
|
-
const failedSchemaRequestKeyRef = useRef("");
|
|
71
46
|
const explorer = useMemo(() => explorerPlugin(), []);
|
|
72
47
|
const plugins = useMemo(() => [explorer], [explorer]);
|
|
73
48
|
const handleEditHeaders = useCallback(() => { }, []);
|
|
74
49
|
const graphiqlSchema = schemaResult.schema ?? null;
|
|
75
|
-
const schemaRequestKey = useMemo(() => `${item.id}:${item.language}:${item.version}`, [item.id, item.language, item.version]);
|
|
76
50
|
const refreshSchema = useCallback(async () => {
|
|
77
|
-
const requestKey = schemaRequestKey;
|
|
78
|
-
const requestId = activeSchemaRequestRef.current + 1;
|
|
79
|
-
activeSchemaRequestRef.current = requestId;
|
|
80
51
|
setIsRefreshingSchema(true);
|
|
81
52
|
try {
|
|
82
53
|
const result = await fetchGraphiQLSchema(item);
|
|
83
|
-
|
|
84
|
-
const error = getSchemaErrorMessage(result);
|
|
85
|
-
if (error) {
|
|
86
|
-
failedSchemaRequestKeyRef.current = requestKey;
|
|
87
|
-
setSchemaResult({ ...result, error });
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
failedSchemaRequestKeyRef.current = "";
|
|
91
|
-
setSchemaResult(result);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
54
|
+
setSchemaResult(result);
|
|
94
55
|
}
|
|
95
56
|
finally {
|
|
96
|
-
|
|
97
|
-
setIsRefreshingSchema(false);
|
|
98
|
-
}
|
|
57
|
+
setIsRefreshingSchema(false);
|
|
99
58
|
}
|
|
100
|
-
}, [item.id, item.language, item.version
|
|
59
|
+
}, [item.id, item.language, item.version]);
|
|
101
60
|
useEffect(() => {
|
|
102
|
-
activeSchemaRequestRef.current += 1;
|
|
103
|
-
failedSchemaRequestKeyRef.current = "";
|
|
104
|
-
setAutoSchemaLoadKey("");
|
|
105
61
|
setSchemaResult({});
|
|
106
|
-
|
|
107
|
-
}, [schemaRequestKey]);
|
|
62
|
+
}, [item.id, item.language, item.version]);
|
|
108
63
|
useEffect(() => {
|
|
109
|
-
if (!graphiqlSchema &&
|
|
110
|
-
!schemaResult.error &&
|
|
111
|
-
!isRefreshingSchema &&
|
|
112
|
-
autoSchemaLoadKey !== schemaRequestKey) {
|
|
113
|
-
setAutoSchemaLoadKey(schemaRequestKey);
|
|
64
|
+
if (!graphiqlSchema && !isRefreshingSchema) {
|
|
114
65
|
void refreshSchema();
|
|
115
66
|
}
|
|
116
|
-
}, [
|
|
117
|
-
autoSchemaLoadKey,
|
|
118
|
-
graphiqlSchema,
|
|
119
|
-
isRefreshingSchema,
|
|
120
|
-
refreshSchema,
|
|
121
|
-
schemaRequestKey,
|
|
122
|
-
schemaResult.error,
|
|
123
|
-
]);
|
|
124
|
-
const handleRefreshSchema = useCallback(() => {
|
|
125
|
-
failedSchemaRequestKeyRef.current = "";
|
|
126
|
-
setSchemaResult({});
|
|
127
|
-
setAutoSchemaLoadKey(schemaRequestKey);
|
|
128
|
-
void refreshSchema();
|
|
129
|
-
}, [refreshSchema, schemaRequestKey]);
|
|
67
|
+
}, [graphiqlSchema, isRefreshingSchema, refreshSchema]);
|
|
130
68
|
const fetcher = useCallback(async (graphQLParams) => {
|
|
131
69
|
if (!graphQLParams.query) {
|
|
132
70
|
return {
|
|
@@ -144,32 +82,14 @@ export function GraphiQLPanel({ item, query, variables, onQueryChange, onVariabl
|
|
|
144
82
|
],
|
|
145
83
|
};
|
|
146
84
|
}
|
|
147
|
-
const isIntrospectionQuery = isSchemaIntrospectionQuery(graphQLParams.query);
|
|
148
|
-
if (isIntrospectionQuery &&
|
|
149
|
-
failedSchemaRequestKeyRef.current === schemaRequestKey) {
|
|
150
|
-
const message = schemaResult.error ||
|
|
151
|
-
"Schema introspection failed. Use Retry to try loading the schema again.";
|
|
152
|
-
return {
|
|
153
|
-
data: null,
|
|
154
|
-
errors: [{ message }],
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
85
|
const result = await executeGraphiQLRequest({
|
|
158
86
|
item,
|
|
159
87
|
query: graphQLParams.query,
|
|
160
88
|
variables: graphQLParams.variables ?? parsedVariables,
|
|
161
89
|
operationName: graphQLParams.operationName,
|
|
162
90
|
});
|
|
163
|
-
if (
|
|
164
|
-
|
|
165
|
-
if (error) {
|
|
166
|
-
failedSchemaRequestKeyRef.current = schemaRequestKey;
|
|
167
|
-
setSchemaResult({ ...result, error });
|
|
168
|
-
}
|
|
169
|
-
else {
|
|
170
|
-
failedSchemaRequestKeyRef.current = "";
|
|
171
|
-
setSchemaResult(result);
|
|
172
|
-
}
|
|
91
|
+
if (isSchemaIntrospectionQuery(graphQLParams.query)) {
|
|
92
|
+
setSchemaResult(result);
|
|
173
93
|
}
|
|
174
94
|
else {
|
|
175
95
|
onExecutionResult(result);
|
|
@@ -184,15 +104,7 @@ export function GraphiQLPanel({ item, query, variables, onQueryChange, onVariabl
|
|
|
184
104
|
data: result.data ?? null,
|
|
185
105
|
errors: result.errors,
|
|
186
106
|
};
|
|
187
|
-
}, [
|
|
188
|
-
item.id,
|
|
189
|
-
item.language,
|
|
190
|
-
item.version,
|
|
191
|
-
onExecutionResult,
|
|
192
|
-
schemaRequestKey,
|
|
193
|
-
schemaResult.error,
|
|
194
|
-
variables,
|
|
195
|
-
]);
|
|
107
|
+
}, [item.id, item.language, item.version, onExecutionResult, variables]);
|
|
196
108
|
const lastTransportMessage = useMemo(() => {
|
|
197
109
|
if (schemaResult.transport?.used === "v1-fallback") {
|
|
198
110
|
return `Schema fetch fell back to v1 after v2 status ${schemaResult.transport.fallbackFromStatus}.`;
|
|
@@ -203,5 +115,5 @@ export function GraphiQLPanel({ item, query, variables, onQueryChange, onVariabl
|
|
|
203
115
|
.alpaca-graphiql-shell .graphiql-logo {
|
|
204
116
|
display: none;
|
|
205
117
|
}
|
|
206
|
-
` }), _jsxs("div", { className: "flex items-center justify-between gap-3 border-b border-
|
|
118
|
+
` }), _jsxs("div", { className: "flex items-center justify-between gap-3 border-b border-gray-200 bg-gray-50 px-3 py-2 text-xs text-gray-600", children: [_jsxs("div", { className: "flex min-w-0 flex-wrap items-center gap-2", children: [_jsxs("span", { children: ["Base item: ", _jsx("span", { className: "font-mono", children: itemLabel || item.id })] }), _jsxs("span", { children: [item.language, " v", item.version] })] }), headerActions && (_jsx("div", { className: "ml-auto flex shrink-0 items-center gap-2", children: headerActions }))] }), !!lastTransportMessage && (_jsx("div", { className: "border-b border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-800", children: lastTransportMessage })), schemaResult.error && (_jsx("div", { className: "border-b border-red-300 bg-red-50 px-3 py-2 text-xs text-red-800", children: schemaResult.error })), _jsx("div", { className: "alpaca-graphiql-shell min-h-0 flex-1 bg-white [&_.graphiql-container]:h-full", children: _jsx(GraphiQLIDE, { className: "h-full", fetcher: fetcher, schema: graphiqlSchema, forcedTheme: "light", initialQuery: query, initialVariables: variables, initialHeaders: "", onEditQuery: onQueryChange, onEditVariables: onVariablesChange, onEditHeaders: handleEditHeaders, isHeadersEditorEnabled: false, defaultEditorToolsVisibility: "variables", plugins: plugins, children: _jsx(GraphiQLSyncBridge, { query: query, variables: variables }) }) })] }));
|
|
207
119
|
}
|
package/dist/Layout.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../src/Layout.tsx"],"names":[],"mappings":"AAYA,wBAAgB,MAAM,
|
|
1
|
+
{"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../src/Layout.tsx"],"names":[],"mappings":"AAYA,wBAAgB,MAAM,mDA0GrB"}
|
package/dist/Layout.js
CHANGED
|
@@ -62,5 +62,5 @@ export function Layout() {
|
|
|
62
62
|
id: "page",
|
|
63
63
|
content: (_jsx("div", { className: "relative h-full min-h-0", children: _jsx("div", { className: "absolute inset-0 overflow-auto p-2", children: _jsx(ObjectInspector, { data: page, nodeRenderer: defaultNodeRenderer }) }) })),
|
|
64
64
|
});
|
|
65
|
-
return (_jsxs("div", { className: "relative flex h-full min-h-0 flex-col", children: [_jsx(SimpleTabs, { tabs: tabs, activeTab: activeTab, setActiveTab: setActiveTab, className: "border-
|
|
65
|
+
return (_jsxs("div", { className: "relative flex h-full min-h-0 flex-col", children: [_jsx(SimpleTabs, { tabs: tabs, activeTab: activeTab, setActiveTab: setActiveTab, className: "border-gray-3 flex border-b px-2 pt-2 text-xs" }), _jsx("div", { className: "absolute top-2 right-1 h-4 w-4", children: _jsx(CopyButton, { textToCopy: JSON.stringify(activeTab === 0 && component ? component : page, replacer, 2), iconOnly: true }) })] }));
|
|
66
66
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphqlService.d.ts","sourceRoot":"","sources":["../src/graphqlService.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,aAAa,EAKd,MAAM,SAAS,CAAC;AAEjB,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,EAAE,IAAI,CAAC;IAChB,IAAI,EAAE,IAAI,GAAG,aAAa,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,SAAS,EAAE,gBAAgB,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAA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E;IACpD,IAAI,EAAE,gBAAgB,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC3C,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAkDnC;AAED,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,gBAAgB,GACrB,OAAO,CAAC,oBAAoB,CAAC,CAuC/B;AAED,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,oBAAoB,UAcvE"}
|
package/dist/graphqlService.js
CHANGED
|
@@ -140,7 +140,7 @@ function getStatus(result) {
|
|
|
140
140
|
return result.response?.status ?? 500;
|
|
141
141
|
}
|
|
142
142
|
function getErrorMessage(result) {
|
|
143
|
-
return
|
|
143
|
+
return result.details || result.summary || result.rawDetails || "Request failed";
|
|
144
144
|
}
|
|
145
145
|
function joinWarnings(...warnings) {
|
|
146
146
|
return warnings.filter(Boolean).join(" ");
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,mBAAmB,EAIpB,MAAM,gBAAgB,CAAC;AAuCxB,wBAAgB,eAAe,CAAC,aAAa,EAAE,mBAAmB,uBAgCjE"}
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { lazy, Suspense } from "react";
|
|
3
2
|
import { PanelsTopLeft } from "lucide-react";
|
|
4
3
|
import { GraphQLIcon, JsonIcon, } from "@parhelia/core";
|
|
5
4
|
import { Layout } from "./Layout";
|
|
5
|
+
import { GraphQL } from "./GraphQL";
|
|
6
6
|
import { alpacaComponentCommandProvider } from "./componentCommands";
|
|
7
|
-
const GraphQL = lazy(() => import("./GraphQL").then((module) => ({ default: module.GraphQL })));
|
|
8
|
-
function LazyGraphQLPanel() {
|
|
9
|
-
return (_jsx(Suspense, { fallback: _jsx("div", { className: "p-4 text-sm text-muted-foreground", children: "Loading GraphQL editor..." }), children: _jsx(GraphQL, {}) }));
|
|
10
|
-
}
|
|
11
7
|
const layoutDebugSidebar = {
|
|
12
8
|
id: "layout",
|
|
13
9
|
title: "Layout",
|
|
@@ -35,7 +31,7 @@ const graphqlSidebar = {
|
|
|
35
31
|
name: "graphql",
|
|
36
32
|
icon: _jsx(GraphQLIcon, {}),
|
|
37
33
|
title: "GraphQL",
|
|
38
|
-
content: _jsx(
|
|
34
|
+
content: _jsx(GraphQL, {}),
|
|
39
35
|
initialSize: 100,
|
|
40
36
|
},
|
|
41
37
|
],
|
|
@@ -56,7 +52,10 @@ export function configureAlpaca(configuration) {
|
|
|
56
52
|
const componentCommandProviders = configuration.componentCommands?.providers ?? [];
|
|
57
53
|
if (!componentCommandProviders.includes(alpacaComponentCommandProvider)) {
|
|
58
54
|
configuration.componentCommands = {
|
|
59
|
-
providers: [
|
|
55
|
+
providers: [
|
|
56
|
+
...componentCommandProviders,
|
|
57
|
+
alpacaComponentCommandProvider,
|
|
58
|
+
],
|
|
60
59
|
};
|
|
61
60
|
}
|
|
62
61
|
return configuration;
|