Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add data queries with data arrays by date #736

Merged
merged 4 commits into from
Nov 23, 2022

Conversation

CarlosQ96
Copy link
Collaborator

No issue exists. This is for making a graph in the data dashboard created by Ramin.
Url: https://analytics-dashboard-blue.vercel.app/

New updated queries and return data: (totalPerMonthAndYear is an array)

export const fetchTotalDonors = `
  query (
    $fromDate: String
    $toDate: String
  ) {
    totalDonorsCountPerDate(
      fromDate: $fromDate
      toDate: $toDate
    ) {
      total
      totalPerMonthAndYear {
        total
        date
      }
    }
  }
`;

export const fetchTotalDonationsUsdAmount = `
  query (
    $fromDate: String
    $toDate: String
  ) {
    donationsTotalUsdPerDate (
      fromDate: $fromDate
      toDate: $toDate
    ) {
      total
      totalPerMonthAndYear {
        total
        date
      }
    }
  }

export const fetchNewProjectsPerDate = `
  query (
    $fromDate: String
    $toDate: String
  ) {
    projectsPerDate(
      fromDate: $fromDate
      toDate: $toDate
    ) {
      total
      totalPerMonthAndYear {
        total
        date
      }
    }
  }
`;
`;

@CarlosQ96
Copy link
Collaborator Author

@RamRamez This is the Pr for the data arrays. The only query I did not return data array is for the totalDonationsPerCategory that you normalized.
I think that query doesn't require it as it already has a normalized distribution graph. And it's quite complex to separate repeated data, which would still be somewhat inaccurate.

If you think this is ok, let me know.

@CarlosQ96
Copy link
Collaborator Author

CarlosQ96 commented Nov 23, 2022

They are already sorted by date, oldest first.
Example Result:

{
   total: xxxx 
   totalPerMonthAndYear: [{ total: xxxx, date: '2021/1' }, { total: xxxx, date: '2022/2' }]
}

@CarlosQ96
Copy link
Collaborator Author

This is breaking changes, it will break staging dashboard. So once merged, Ramin must change it.

Copy link
Collaborator

@mohammadranjbarz mohammadranjbarz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CarlosQ96 Great job, I tested query and had correct result,
LGTM

@RamRamez As carlos said it had breaking change on dashboard, so we will merge it whenever you tell us

@RamRamez
Copy link
Collaborator

Great!
Thanks, @CarlosQ96 and @mohammadranjbarz for doing this.
The dashboard is currently connected to mainnet backend so you can safely merge this to staging.

@CarlosQ96 CarlosQ96 merged commit 2e00dfd into staging Nov 23, 2022
@aminlatifi aminlatifi deleted the f_update_data_dashboard_queries branch January 25, 2023 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants