Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

DEVPROD-3935 Use correct query for project health view setting #2242

Merged
merged 2 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions src/gql/generated/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7111,13 +7111,10 @@ export type ProjectHealthViewQueryVariables = Exact<{

export type ProjectHealthViewQuery = {
__typename?: "Query";
projectSettings: {
__typename?: "ProjectSettings";
projectRef?: {
__typename?: "Project";
id: string;
projectHealthView: ProjectHealthView;
} | null;
project: {
__typename?: "Project";
id: string;
projectHealthView: ProjectHealthView;
};
};

Expand Down
8 changes: 3 additions & 5 deletions src/gql/queries/project-health-view.graphql
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
query ProjectHealthView($identifier: String!) {
projectSettings(identifier: $identifier) {
projectRef {
id
projectHealthView
}
project(projectIdentifier: $identifier) {
id
projectHealthView
}
}
2 changes: 1 addition & 1 deletion src/pages/commits/ViewToggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const ViewToggle: React.FC<Props> = ({ identifier }) => {

useEffect(() => {
if (!view) {
setView(data?.projectSettings?.projectRef?.projectHealthView);
setView(data?.project.projectHealthView);
khelif96 marked this conversation as resolved.
Show resolved Hide resolved
}
}, [data, setView, view]);

Expand Down
Loading