1
0

api-extensions.ts 790 B

123456789101112131415161718192021222324252627282930
  1. import gql from 'graphql-tag';
  2. export const adminApiExtensions = gql`
  3. type DashboardMetricSummary {
  4. type: DashboardMetricType!
  5. title: String!
  6. entries: [DashboardMetricSummaryEntry!]!
  7. }
  8. enum DashboardMetricType {
  9. OrderCount
  10. OrderTotal
  11. AverageOrderValue
  12. }
  13. type DashboardMetricSummaryEntry {
  14. label: String!
  15. value: Float!
  16. }
  17. input DashboardMetricSummaryInput {
  18. types: [DashboardMetricType!]!
  19. refresh: Boolean
  20. startDate: DateTime!
  21. endDate: DateTime!
  22. }
  23. extend type Query {
  24. """
  25. Get metrics for the given date range and metric types.
  26. """
  27. dashboardMetricSummary(input: DashboardMetricSummaryInput): [DashboardMetricSummary!]!
  28. }
  29. `;