(
- repo.pipelines
- .filter((p) => p.isJob && !isHiddenAssetGroupJob(p.name))
- .map((p) => p.graphName),
- );
-
- const items: Graph[] = Array.from(jobGraphNames).map((graphName) => ({
- name: graphName,
- path: `/graphs/${graphName}`,
- description: null,
- }));
-
- repo.usedSolids.forEach((s) => {
- if (s.definition.__typename === 'CompositeSolidDefinition') {
- const invocation = s.invocations[0];
- if (invocation) {
- items.push({
- name: s.definition.name,
- path: `/graphs/${invocation.pipeline.name}/${invocation.solidHandle.handleID}/`,
- description: s.definition.description,
- });
- }
- }
- });
-
- return items.sort((a, b) => a.name.localeCompare(b.name));
+ return extractGraphsForRepo(repo);
}, [data]);
const filteredBySearch = useMemo(() => {
@@ -150,40 +125,3 @@ export const WorkspaceGraphsRoot = ({repoAddress}: {repoAddress: RepoAddress}) =
);
};
-
-const WORSKPACE_GRAPHS_QUERY = gql`
- query WorkspaceGraphsQuery($selector: RepositorySelector!) {
- repositoryOrError(repositorySelector: $selector) {
- ... on Repository {
- id
- usedSolids {
- definition {
- ... on CompositeSolidDefinition {
- id
- name
- description
- }
- }
- invocations {
- pipeline {
- id
- name
- }
- solidHandle {
- handleID
- }
- }
- }
- pipelines {
- id
- name
- isJob
- graphName
- }
- }
- ...PythonErrorFragment
- }
- }
-
- ${PYTHON_ERROR_FRAGMENT}
-`;
diff --git a/js_modules/dagster-ui/packages/ui-core/src/workspace/extractGraphsForRepo.tsx b/js_modules/dagster-ui/packages/ui-core/src/workspace/extractGraphsForRepo.tsx
new file mode 100644
index 0000000000000..f849d48390f2f
--- /dev/null
+++ b/js_modules/dagster-ui/packages/ui-core/src/workspace/extractGraphsForRepo.tsx
@@ -0,0 +1,31 @@
+import {Graph} from './VirtualizedGraphTable';
+import {RepositoryGraphsFragment} from './types/WorkspaceGraphsQuery.types';
+import {COMMON_COLLATOR} from '../app/Util';
+import {isHiddenAssetGroupJob} from '../asset-graph/Utils';
+
+export const extractGraphsForRepo = (repo: RepositoryGraphsFragment) => {
+ const jobGraphNames = new Set(
+ repo.pipelines.filter((p) => p.isJob && !isHiddenAssetGroupJob(p.name)).map((p) => p.graphName),
+ );
+
+ const items: Graph[] = Array.from(jobGraphNames).map((graphName) => ({
+ name: graphName,
+ path: `/graphs/${graphName}`,
+ description: null,
+ }));
+
+ repo.usedSolids.forEach((s) => {
+ if (s.definition.__typename === 'CompositeSolidDefinition') {
+ const invocation = s.invocations[0];
+ if (invocation) {
+ items.push({
+ name: s.definition.name,
+ path: `/graphs/${invocation.pipeline.name}/${invocation.solidHandle.handleID}/`,
+ description: s.definition.description,
+ });
+ }
+ }
+ });
+
+ return items.sort((a, b) => COMMON_COLLATOR.compare(a.name, b.name));
+};
diff --git a/js_modules/dagster-ui/packages/ui-core/src/workspace/types/WorkspaceGraphsRoot.types.ts b/js_modules/dagster-ui/packages/ui-core/src/workspace/types/WorkspaceGraphsQuery.types.ts
similarity index 67%
rename from js_modules/dagster-ui/packages/ui-core/src/workspace/types/WorkspaceGraphsRoot.types.ts
rename to js_modules/dagster-ui/packages/ui-core/src/workspace/types/WorkspaceGraphsQuery.types.ts
index 08cfdade30195..0bac5463f140c 100644
--- a/js_modules/dagster-ui/packages/ui-core/src/workspace/types/WorkspaceGraphsRoot.types.ts
+++ b/js_modules/dagster-ui/packages/ui-core/src/workspace/types/WorkspaceGraphsQuery.types.ts
@@ -2,6 +2,34 @@
import * as Types from '../../graphql/types';
+export type RepositoryGraphsFragment = {
+ __typename: 'Repository';
+ id: string;
+ usedSolids: Array<{
+ __typename: 'UsedSolid';
+ definition:
+ | {
+ __typename: 'CompositeSolidDefinition';
+ id: string;
+ name: string;
+ description: string | null;
+ }
+ | {__typename: 'SolidDefinition'};
+ invocations: Array<{
+ __typename: 'NodeInvocationSite';
+ pipeline: {__typename: 'Pipeline'; id: string; name: string};
+ solidHandle: {__typename: 'SolidHandle'; handleID: string};
+ }>;
+ }>;
+ pipelines: Array<{
+ __typename: 'Pipeline';
+ id: string;
+ name: string;
+ isJob: boolean;
+ graphName: string;
+ }>;
+};
+
export type WorkspaceGraphsQueryVariables = Types.Exact<{
selector: Types.RepositorySelector;
}>;