-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds a Node interface to Sale #795
Conversation
I will address the test failures on Monday. |
This will probably be useful for getting the tests to pass: https://medium.com/@boriscoder/the-hidden-power-of-jest-matchers-f3d86d8101b0 |
@@ -12,6 +13,8 @@ import { connectionFromArraySlice, connectionDefinitions } from "graphql-relay" | |||
import { amount } from "schema/fields/money" | |||
import { exclude } from "lib/helpers" | |||
import { map } from "lodash" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can add has
here and avoid the import below.
@@ -47,6 +47,7 @@ const SupportedTypes = { | |||
"./partner", | |||
"./partner_show", | |||
"./show", | |||
"./sale", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -59,6 +62,8 @@ const saleArtworkConnection = connectionDefinitions({ | |||
|
|||
const SaleType = new GraphQLObjectType({ | |||
name: "Sale", | |||
interfaces: [NodeInterface], | |||
isTypeOf: obj => _.has(obj, "is_auction") && _.has(obj, "currency"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 seems reasonable!
Nice! I've experienced that before- adding the |
Thanks! I've written up some notes and will add what I learned to the wiki for next time. |
Continues work from #794. Paired with @orta. This is required to get Relay working with Emission for sales.