How to filter by a key inside an object?
See original GitHub issueLooking to filter by a key inside a nested JSON object. How would I accomplish that?
query
filter: {
details: {
selling_asset_code: "USD"
}
}
data
{
"data": {
"allHistoryOperations": {
"nodes": [
{
"transactionId": "33362562925989890",
"details": {
"price": "2.9973324",
"amount": "149.1600010",
"price_r": {
"d": 100000000,
"n": 299733237
},
"offer_id": 120736,
"buying_asset_type": "native",
"selling_asset_code": "USD",
"selling_asset_type": "credit_alphanum4",
"selling_asset_issuer": "GA7RXKBZOUA3FCUUS65JRLU5SZD3XBQUGRWL7NVQWU5QOXQW2LUZNBFZ"
},
"type": 3
}
]
}
}
}
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:21 (13 by maintainers)
Top Results From Across the Web
How to Filter an Object by Key and Value in JavaScript
To filter an object by key-value, you can iterate over the object using Object.entries() const obj = { name: 'Luke Skywalker', title: 'Jedi ......
Read more >How to Filter an Object by Key in JavaScript - Stack Abuse
After you've generated the keys, you may use filter() to loop over the existing values and return just those that meet the specified...
Read more >Filter object properties by key in ES6 - Stack Overflow
Object.keys to list all properties in raw (the original data), then; Array.prototype.filter to select keys that are present in the allowed ...
Read more >How to Filter an Javascript Object by Key? - STechies
In this article, we have discussed three different methods of filtering objects by keys, namely the Object.keys() method and filter() with reduce() methods ......
Read more >How to Filter Keys of an Object with Lodash?
Lodash comes with the pickBy method that takes an object and a callback that lets us return the condition of the keys we...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Agh, it’s my fault. Here’s the culprit:
https://github.com/graphile-contrib/postgraphile-plugin-connection-filter/blob/28ad0b65a6b293460d1109a4639daf39b51d1324/src/PgConnectionArgFilterOperatorsPlugin.js#L601-L604
Getting late here, so I’ll try to fix it tomorrow.
That works as expected.
But with
--dynamic-json
, it fails:The --dynamic-json support is part of the PostGraphile core lib, so hopefully @benjie can offer some insight?