diff --git a/packages/web/src/components/AppFlows/index.tsx b/packages/web/src/components/AppFlows/index.tsx index 53057c7a..78a19110 100644 --- a/packages/web/src/components/AppFlows/index.tsx +++ b/packages/web/src/components/AppFlows/index.tsx @@ -4,8 +4,13 @@ import { GET_FLOWS } from 'graphql/queries/get-flows'; import AppFlowRow from 'components/AppFlowRow'; import type { IFlow } from '@automatisch/types'; -export default function AppFlows(): React.ReactElement { - const { data } = useQuery(GET_FLOWS); +type AppFlowsProps = { + appKey: string; +} + +export default function AppFlows(props: AppFlowsProps): React.ReactElement { + const { appKey } = props; + const { data } = useQuery(GET_FLOWS, { variables: { appKey }}); const appFlows: IFlow[] = data?.getFlows || []; return ( diff --git a/packages/web/src/graphql/queries/get-flows.ts b/packages/web/src/graphql/queries/get-flows.ts index 660a209a..ac28cf70 100644 --- a/packages/web/src/graphql/queries/get-flows.ts +++ b/packages/web/src/graphql/queries/get-flows.ts @@ -1,8 +1,8 @@ import { gql } from '@apollo/client'; export const GET_FLOWS = gql` - query GetFlows { - getFlows { + query GetFlows($appKey: String) { + getFlows(appKey: $appKey) { id name } diff --git a/packages/web/src/pages/Application/index.tsx b/packages/web/src/pages/Application/index.tsx index 3c0e5b11..8ce2ad6a 100644 --- a/packages/web/src/pages/Application/index.tsx +++ b/packages/web/src/pages/Application/index.tsx @@ -155,7 +155,7 @@ export default function Application(): React.ReactElement { - } /> + } /> } />