Repository: saleor/saleor

Issue:
Grapql query for home page
### What I'm trying to achieve
I want to have a shop homepage which shows:
* new arrivals,
* product in a sale,
* featured products,
* featured collection,
* categories links

### Describe a proposed solution
```graphql
query HomePage {
  shop {
    featuredCollection {
      id
      name
    }
  }
  featured: products(first: 10, collectionSlug: "featured") {
    edges {
      node {
        id
        name
        thumbnailUrl
        category {
          id
          name
        }
        price {
          amount
          currency
        }
      }
    }
  }
  newArrivals: products(first: 10, sortBy: "creation_date") {
    edges {
      node {
        id
        name
        thumbnailUrl
        category {
          id
          name
        }
        price {
          amount
          currency
        }
      }
    }
  }
  sales: products(first: 10, collectionSlug: "sales") {
    edges {
      node {
        id
        name
        thumbnailUrl
        category {
          id
          name
        }
        price {
          amount
          currency
        }
      }
    }
  }
  categories {
    edges {
      node {
        id
        name
      }
    }
  }
}

```

### Other solutions I've tried and won't work
I introduced:
* filter by collection slug for featured and sales. That is the simplest approach which I have in my mind.
* exposing homepage collection in the shop query,
* sorting products by creation data for new arrivals.

This is only a proposition. If you have a better approach in mind please share it.


Discussion:
Nitpick: sort options should be enum types in API schema.
As @patrys pointed out yesterday we could use homepage collection as featured. In that case, we don't need `collectionSlug` filter anymore only `SortBy` is nice to have.

New query:
```graphql
query HomePage {
  shop {
    homepageCollection {
      id
      name
      products(first: 10) {
        edges {
          node {
            id
            name
            thumbnailUrl
            category {
              id
              name
            }
            price {
              amount
              currency
            }
          }
        }
      }
    }
  }
  newArrivals: products(first: 10, sortBy: "creation_date") {
    edges {
      node {
        id
        name
        thumbnailUrl
        category {
          id
          name
        }
        price {
          amount
          currency
        }
      }
    }
  }
  categories {
    edges {
      node {
        id
        name
      }
    }
  }
}
```

Resolving patch:
diff --git a/saleor/product/filters.py b/saleor/product/filters.py
--- a/saleor/product/filters.py
+++ b/saleor/product/filters.py
@@ -10,7 +10,9 @@
 
 SORT_BY_FIELDS = OrderedDict([
     ('name', pgettext_lazy('Product list sorting option', 'name')),
-    ('price', pgettext_lazy('Product list sorting option', 'price'))])
+    ('price', pgettext_lazy('Product list sorting option', 'price')),
+    ('updated_at', pgettext_lazy(
+        'Product list sorting option', 'last updated'))])
 
 
 class ProductFilter(SortedFilterSet):


Test patch: