-
Notifications
You must be signed in to change notification settings - Fork 26
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
feat: make graphql queries compatible with new Squid #380
Conversation
@@ -33,7 +33,11 @@ export function createNFTsHandler( | |||
const isLand = params.getBoolean('isLand') | |||
const isOnRent = params.getBoolean('isOnRent') | |||
const isWearableHead = params.getBoolean('isWearableHead') | |||
? params.getString('isWearableHead') === 'true' |
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.
This change is needed to know if it needs to be applied in the query as parameter or not
https://github.com/decentraland/nft-server/pull/380/files#diff-d1debe4191e7ee45f023c53cecc0a2d6c05c4dba8f24d44c3a2c69261102a0bcR310
$isWearableHead: Boolean | ||
$isWearableAccessory: Boolean) { | ||
|
||
const variablesBasedOnFilters = Object.entries(filters) |
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.
the variables in the GraphQL query must be used somewhere in the query, so this new logic is to put them in dynamically just if they are being used after.
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.
Looks great! I've left a simple comment with a refactor.
const variablesBasedOnFilters = Object.entries(filters) | ||
.filter(([key, value]) => value !== undefined && key in PRICES_FILTERS_DICT) | ||
.map(([key]) => (PRICES_FILTERS_DICT[key] ? PRICES_FILTERS_DICT[key] : '')) |
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.
What do you think about abstracting this mechanism so we can use it in all of these queries?
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.
Sure, great idea, let me prepare that in a following up PR so we can review that exclusively.
No description provided.