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

Commit

Permalink
DEVPROD-3935 Use correct query for project health view setting (#2242)
Browse files Browse the repository at this point in the history
  • Loading branch information
khelif96 authored Jan 25, 2024
1 parent 11d84a3 commit 39459e0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
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);
}
}, [data, setView, view]);

Expand Down

0 comments on commit 39459e0

Please sign in to comment.