Created
June 21, 2019 09:28
-
-
Save lgandecki/44825595b4dba82b531a6a23baa8815e to your computer and use it in GitHub Desktop.
This file contains 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
//Remember to add this require | |
const { estimateShipping } = require("./estimateShipping"); | |
exports.resolvers = { | |
Product: { | |
__resolveReference(object) { | |
return { | |
...object, | |
...inventory.find(product => product.upc === object.upc) | |
}; | |
}, | |
// This is where we make changes | |
shippingEstimate: object => | |
estimateShipping({ | |
price: object.price, | |
weight: object.weight | |
}) | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment