Fix GraphQL content type on creation, and placeholder

This commit is contained in:
Gregory Schier
2024-02-28 13:03:53 -08:00
parent 4f6a678ca6
commit 9dc2435e43
4 changed files with 14 additions and 5 deletions

View File

@@ -8,7 +8,7 @@
},
"package": {
"productName": "Yaak",
"version": "2024.3.2"
"version": "2024.3.3"
},
"tauri": {
"windows": [],
@@ -28,7 +28,7 @@
"scope": [
"$RESOURCE/*",
"$APPDATA/responses/*"
]
]
},
"shell": {
"all": false,

View File

@@ -179,7 +179,9 @@ const _Editor = forwardRef<EditorView | undefined, EditorProps>(function Editor(
doc: `${defaultValue ?? ''}`,
extensions: [
languageCompartment.of(langExt),
placeholderCompartment.current.of([]),
placeholderCompartment.current.of(
placeholderExt(placeholderElFromText(placeholder ?? '')),
),
wrapLinesCompartment.current.of([]),
...getExtensions({
container,

View File

@@ -32,7 +32,12 @@ export function useCreateDropdownItems({
label: 'GraphQL Query',
leftSlot: hideIcons ? undefined : <Icon icon="plus" />,
onSelect: () =>
createHttpRequest.mutate({ folderId, bodyType: BODY_TYPE_GRAPHQL, method: 'POST' }),
createHttpRequest.mutate({
folderId,
bodyType: BODY_TYPE_GRAPHQL,
method: 'POST',
headers: [{ name: 'Content-Type', value: 'application/json' }],
}),
},
{
key: 'create-grpc-request',

View File

@@ -16,7 +16,9 @@ export function useCreateHttpRequest() {
return useMutation<
HttpRequest,
unknown,
Partial<Pick<HttpRequest, 'name' | 'sortPriority' | 'folderId' | 'bodyType' | 'method'>>
Partial<
Pick<HttpRequest, 'name' | 'sortPriority' | 'folderId' | 'bodyType' | 'method' | 'headers'>
>
>({
mutationFn: (patch) => {
if (workspaceId === null) {