This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const DataLoader = require('dataloader'); | |
const data = [ | |
{id: 1}, | |
{id: 2}, | |
{id: 3}, | |
]; | |
const myLoader = new DataLoader(keys => { | |
const results = keys.map(key => data[key - 1]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// GraphQL Schema with regards to applied filters : | |
// appliedFilters{ | |
// name | |
// rank | |
// values{ | |
// displayName | |
// urlLabel | |
// code | |
// count | |
// } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sample graphQl Query | |
// for our use case, we can ignore facets | |
/** | |
filters{ | |
name | |
values{ | |
urlLabel | |
displayName | |
count | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// concepts : | |
// a filterName is the name of the filter, like color or category | |
// the filter values each have a name, value, and priority | |
// name = a display name for the filter option | |
// value = uid or other identifyer for filter option | |
// priority = the order in which the filter option was applied, since filters applied first have a different impact on the URL and other SEO related features | |
// SOLUTION 1 : | |
// this structure supports the idea that grouping by filter (ie. category 1 or color) is more important than grouping by filter priority |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NOTE* The notations below assume that there is only 1 size per image, ie. new dynamically sized images are already working : | |
// POST a new image : | |
// soa/inventory-3/2/image | |
// payload : multi part form-data | |
// return value : | |
{ | |
id : '123', | |
original : '/path/to/original.jpeg', | |
master : '/path/to/master.jpeg', |