import gql from "graphql-tag";
import { TypedQuery } from "../queries";
import { Home } from "./types/Home";
const home = gql`
query Home($channel: String!) {
salesToday: ordersTotal(period: TODAY, channel: $channel) {
gross {
amount
currency
}
ordersToday: orders(created: TODAY, channel: $channel) {
totalCount
ordersToFulfill: orders(status: READY_TO_FULFILL, channel: $channel) {
ordersToCapture: orders(status: READY_TO_CAPTURE, channel: $channel) {
productsOutOfStock: products(
stockAvailability: OUT_OF_STOCK
channel: $channel
) {
productTopToday: reportProductSales(
period: TODAY
first: 5
edges {
node {
id
revenue(period: TODAY) {
attributes {
values {
name
product {
thumbnail {
url
quantityOrdered
activities: homepageEvents(last: 10) {
composedId
date
email
emailType
message
orderNumber
oversoldItems
quantity
type
user {
`;
export const HomePageQuery = TypedQuery<Home, {}>(home);