import { useAtomValue } from "@effect/atom-react"; import * as AsyncResult from "effect/unstable/reactivity/AsyncResult"; import * as Option from "effect/Option"; import { IntegrationSlug } from "@executor-js/sdk/shared"; import { decodeGraphqlIntegrationConfigOption } from "@executor-js/plugin-graphql"; import { graphqlIntegrationConfigAtom } from "./atoms"; import GraphqlAccountsPanel from "./GraphqlAccountsPanel"; // --------------------------------------------------------------------------- // Edit form — v2: custom authentication methods and connections live in the // shared accounts hub. Keep edit and accounts on the same component path so // GraphQL gets the same "+ Custom method" behavior as OpenAPI. // --------------------------------------------------------------------------- export default function EditGraphqlSource(props: { readonly sourceId: string; readonly onSave: () => void; }) { const slug = IntegrationSlug.make(props.sourceId); const configResult = useAtomValue(graphqlIntegrationConfigAtom(slug)); const config = AsyncResult.isSuccess(configResult) ? Option.getOrNull(decodeGraphqlIntegrationConfigOption(configResult.value)) : null; if (!AsyncResult.isSuccess(configResult) || !config) { return (

GraphQL Source

Loading configuration…

); } return ( ); }