diff --git a/app/client/src/PluginActionEditor/components/PluginActionForm/PluginActionForm.tsx b/app/client/src/PluginActionEditor/components/PluginActionForm/PluginActionForm.tsx
index 66ab320a3048..759ea60f1b70 100644
--- a/app/client/src/PluginActionEditor/components/PluginActionForm/PluginActionForm.tsx
+++ b/app/client/src/PluginActionEditor/components/PluginActionForm/PluginActionForm.tsx
@@ -4,6 +4,7 @@ import { Flex } from "@appsmith/ads";
import { useChangeActionCall } from "./hooks/useChangeActionCall";
import { usePluginActionContext } from "../../PluginActionContext";
import { UIComponentTypes } from "api/PluginApi";
+import GraphQLEditorForm from "./components/GraphQLEditor/GraphQLEditorForm";
const PluginActionForm = () => {
useChangeActionCall();
@@ -11,9 +12,12 @@ const PluginActionForm = () => {
return (
- {plugin.uiComponent === UIComponentTypes.ApiEditorForm ? (
+ {plugin.uiComponent === UIComponentTypes.ApiEditorForm && (
- ) : null}
+ )}
+ {plugin.uiComponent === UIComponentTypes.GraphQLEditorForm && (
+
+ )}
);
};
diff --git a/app/client/src/PluginActionEditor/components/PluginActionForm/components/CommonEditorForm/hooks/useGetFormActionValues.ts b/app/client/src/PluginActionEditor/components/PluginActionForm/components/CommonEditorForm/hooks/useGetFormActionValues.ts
index da75a1482a26..8b71a662e410 100644
--- a/app/client/src/PluginActionEditor/components/PluginActionForm/components/CommonEditorForm/hooks/useGetFormActionValues.ts
+++ b/app/client/src/PluginActionEditor/components/PluginActionForm/components/CommonEditorForm/hooks/useGetFormActionValues.ts
@@ -20,6 +20,7 @@ function useGetFormActionValues() {
// return empty values to avoid form ui issues
if (!formValues || !isAPIAction(formValues)) {
return {
+ actionConfigurationBody: "",
actionHeaders: [],
actionParams: [],
autoGeneratedHeaders: [],
@@ -28,6 +29,12 @@ function useGetFormActionValues() {
};
}
+ const actionConfigurationBody = get(
+ formValues,
+ "actionConfiguration.body",
+ "",
+ ) as string;
+
const actionHeaders = get(
formValues,
"actionConfiguration.headers",
@@ -67,6 +74,7 @@ function useGetFormActionValues() {
) as Property[];
return {
+ actionConfigurationBody,
actionHeaders,
autoGeneratedHeaders,
actionParams,
diff --git a/app/client/src/PluginActionEditor/components/PluginActionForm/components/GraphQLEditor/GraphQLEditorForm.tsx b/app/client/src/PluginActionEditor/components/PluginActionForm/components/GraphQLEditor/GraphQLEditorForm.tsx
new file mode 100644
index 000000000000..717781b5a382
--- /dev/null
+++ b/app/client/src/PluginActionEditor/components/PluginActionForm/components/GraphQLEditor/GraphQLEditorForm.tsx
@@ -0,0 +1,53 @@
+import React from "react";
+import { reduxForm } from "redux-form";
+import { API_EDITOR_FORM_NAME } from "ee/constants/forms";
+import CommonEditorForm from "../CommonEditorForm";
+import Pagination from "pages/Editor/APIEditor/GraphQL/Pagination";
+import { GRAPHQL_HTTP_METHOD_OPTIONS } from "constants/ApiEditorConstants/GraphQLEditorConstants";
+import PostBodyData from "./PostBodyData";
+import { usePluginActionContext } from "PluginActionEditor";
+import { useFeatureFlag } from "utils/hooks/useFeatureFlag";
+import { FEATURE_FLAG } from "ee/entities/FeatureFlag";
+import { getHasManageActionPermission } from "ee/utils/BusinessFeatures/permissionPageHelpers";
+import { noop } from "lodash";
+import { EditorTheme } from "components/editorComponents/CodeEditor/EditorConfig";
+import useGetFormActionValues from "../CommonEditorForm/hooks/useGetFormActionValues";
+
+const FORM_NAME = API_EDITOR_FORM_NAME;
+
+function GraphQLEditorForm() {
+ const { action } = usePluginActionContext();
+ const theme = EditorTheme.LIGHT;
+
+ const isFeatureEnabled = useFeatureFlag(FEATURE_FLAG.license_gac_enabled);
+ const isChangePermitted = getHasManageActionPermission(
+ isFeatureEnabled,
+ action.userPermissions,
+ );
+
+ const { actionConfigurationBody } = useGetFormActionValues();
+
+ return (
+ }
+ formName={FORM_NAME}
+ httpMethodOptions={GRAPHQL_HTTP_METHOD_OPTIONS}
+ isChangePermitted={isChangePermitted}
+ paginationUiComponent={
+
+ }
+ />
+ );
+}
+
+export default reduxForm({ form: FORM_NAME, enableReinitialize: true })(
+ GraphQLEditorForm,
+);
diff --git a/app/client/src/PluginActionEditor/components/PluginActionForm/components/GraphQLEditor/PostBodyData.tsx b/app/client/src/PluginActionEditor/components/PluginActionForm/components/GraphQLEditor/PostBodyData.tsx
new file mode 100644
index 000000000000..f897d38246e9
--- /dev/null
+++ b/app/client/src/PluginActionEditor/components/PluginActionForm/components/GraphQLEditor/PostBodyData.tsx
@@ -0,0 +1,109 @@
+import React, { useCallback, useRef } from "react";
+import styled from "styled-components";
+import QueryEditor from "pages/Editor/APIEditor/GraphQL/QueryEditor";
+import VariableEditor from "pages/Editor/APIEditor/GraphQL/VariableEditor";
+import useHorizontalResize from "utils/hooks/useHorizontalResize";
+import { EditorTheme } from "components/editorComponents/CodeEditor/EditorConfig";
+import classNames from "classnames";
+import { tailwindLayers } from "constants/Layers";
+
+const ResizableDiv = styled.div`
+ display: flex;
+ height: 100%;
+ flex-shrink: 0;
+`;
+
+const PostBodyContainer = styled.div`
+ display: flex;
+ height: 100%;
+ overflow: hidden;
+ &&&& .CodeMirror {
+ height: 100%;
+ border-top: 1px solid var(--ads-v2-color-border);
+ border-bottom: 1px solid var(--ads-v2-color-border);
+ border-radius: 0;
+ padding: 0;
+ }
+ & .CodeMirror-scroll {
+ margin: 0px;
+ padding: 0px;
+ overflow: auto !important;
+ }
+`;
+
+const ResizerHandler = styled.div<{ resizing: boolean }>`
+ width: 6px;
+ height: 100%;
+ margin-left: 2px;
+ border-right: 1px solid var(--ads-v2-color-border);
+ background: ${(props) =>
+ props.resizing ? "var(--ads-v2-color-border)" : "transparent"};
+ &:hover {
+ background: var(--ads-v2-color-border);
+ border-color: transparent;
+ }
+`;
+
+const DEFAULT_GRAPHQL_VARIABLE_WIDTH = 300;
+
+interface Props {
+ actionName: string;
+}
+
+function PostBodyData(props: Props) {
+ const { actionName } = props;
+ const theme = EditorTheme.LIGHT;
+ const resizeableRef = useRef(null);
+ const [variableEditorWidth, setVariableEditorWidth] = React.useState(
+ DEFAULT_GRAPHQL_VARIABLE_WIDTH,
+ );
+ /**
+ * Variable Editor's resizeable handler for the changing of width
+ */
+ const onVariableEditorWidthChange = useCallback((newWidth) => {
+ setVariableEditorWidth(newWidth);
+ }, []);
+
+ const { onMouseDown, onMouseUp, onTouchStart, resizing } =
+ useHorizontalResize(
+ resizeableRef,
+ onVariableEditorWidthChange,
+ undefined,
+ true,
+ );
+
+ return (
+
+
+
+
+
+
+
+
+
+ );
+}
+
+export default PostBodyData;
diff --git a/app/client/src/api/PluginApi.ts b/app/client/src/api/PluginApi.ts
index ef8987b4208f..5bcc33486109 100644
--- a/app/client/src/api/PluginApi.ts
+++ b/app/client/src/api/PluginApi.ts
@@ -13,6 +13,7 @@ export enum UIComponentTypes {
UQIDbEditorForm = "UQIDbEditorForm",
ApiEditorForm = "ApiEditorForm",
JsEditorForm = "JsEditorForm",
+ GraphQLEditorForm = "GraphQLEditorForm",
}
export enum DatasourceComponentTypes {
diff --git a/app/client/src/pages/Editor/APIEditor/ApiEditorContext.tsx b/app/client/src/pages/Editor/APIEditor/ApiEditorContext.tsx
index 1a2d9d517898..adca7c27f607 100644
--- a/app/client/src/pages/Editor/APIEditor/ApiEditorContext.tsx
+++ b/app/client/src/pages/Editor/APIEditor/ApiEditorContext.tsx
@@ -14,7 +14,6 @@ interface ApiEditorContextContextProps {
saveActionName: (
params: SaveActionNameParams,
) => ReduxAction;
- closeEditorLink?: React.ReactNode;
showRightPaneTabbedSection?: boolean;
actionRightPaneAdditionSections?: React.ReactNode;
notification?: React.ReactNode | string;
@@ -31,7 +30,6 @@ export function ApiEditorContextProvider({
actionRightPaneAdditionSections,
actionRightPaneBackLink,
children,
- closeEditorLink,
handleDeleteClick,
handleRunClick,
moreActionsMenu,
@@ -44,7 +42,6 @@ export function ApiEditorContextProvider({
() => ({
actionRightPaneAdditionSections,
actionRightPaneBackLink,
- closeEditorLink,
handleDeleteClick,
showRightPaneTabbedSection,
handleRunClick,
@@ -56,7 +53,6 @@ export function ApiEditorContextProvider({
[
actionRightPaneBackLink,
actionRightPaneAdditionSections,
- closeEditorLink,
handleDeleteClick,
showRightPaneTabbedSection,
handleRunClick,
diff --git a/app/client/src/pages/Editor/APIEditor/CommonEditorForm.tsx b/app/client/src/pages/Editor/APIEditor/CommonEditorForm.tsx
index 979c4edf1cb1..7c265e98b5c0 100644
--- a/app/client/src/pages/Editor/APIEditor/CommonEditorForm.tsx
+++ b/app/client/src/pages/Editor/APIEditor/CommonEditorForm.tsx
@@ -3,11 +3,7 @@ import { useSelector } from "react-redux";
import styled from "styled-components";
import FormLabel from "components/editorComponents/FormLabel";
import FormRow from "components/editorComponents/FormRow";
-import type {
- ActionResponse,
- PaginationField,
- SuggestedWidget,
-} from "api/ActionAPI";
+import type { ActionResponse, PaginationField } from "api/ActionAPI";
import type { Action, PaginationType } from "entities/Action";
import ApiResponseView from "components/editorComponents/ApiResponseView";
import type { AppState } from "ee/reducers";
@@ -15,7 +11,6 @@ import ActionNameEditor from "components/editorComponents/ActionNameEditor";
import { EditorTheme } from "components/editorComponents/CodeEditor/EditorConfig";
import { Button } from "@appsmith/ads";
import { useParams } from "react-router";
-import type { Datasource } from "entities/Datasource";
import equal from "fast-deep-equal/es6";
import { getPlugin } from "ee/selectors/entitiesSelector";
import type { AutoGeneratedHeader } from "./helpers";
@@ -148,23 +143,11 @@ export interface CommonFormProps {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
datasourceParams?: any;
actionName: string;
- apiId: string;
apiName: string;
// TODO: Fix this the next time the file is edited
// eslint-disable-next-line @typescript-eslint/no-explicit-any
settingsConfig: any;
hintMessages?: Array;
- // TODO: Fix this the next time the file is edited
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- datasources?: any;
- currentPageId?: string;
- applicationId?: string;
- hasResponse: boolean;
- responseDataTypes: { key: string; title: string }[];
- responseDisplayFormat: { title: string; value: string };
- suggestedWidgets?: SuggestedWidget[];
- updateDatasource: (datasource: Datasource) => void;
- currentActionDatasourceId: string;
autoGeneratedActionConfigHeaders?: AutoGeneratedHeader[];
}
@@ -177,9 +160,6 @@ type CommonFormPropsWithExtraParams = CommonFormProps & {
// TODO: Fix this the next time the file is edited
// eslint-disable-next-line @typescript-eslint/no-explicit-any
handleSubmit: any;
- // defaultSelectedTabIndex
- defaultTabSelected?: number;
- closeEditorLink?: React.ReactNode;
httpsMethods: { value: string }[];
};
@@ -215,7 +195,6 @@ function CommonEditorForm(props: CommonFormPropsWithExtraParams) {
actionConfigurationParams,
actionResponse,
autoGeneratedActionConfigHeaders,
- closeEditorLink,
formName,
handleSubmit,
hintMessages,
@@ -287,7 +266,6 @@ function CommonEditorForm(props: CommonFormPropsWithExtraParams) {
return (
- {closeEditorLink}