Search
Search query accepts attribute arguments to pinpoint target rows and selection that specifies which attributes
and relations should be returned. Each entity will have generic search query in camelCase entity name prefixed
by "search
". For example example dataset following search queries will be generated:
#
Datasets Search Methods- searchDataset(_distinct:Boolean, _limit:Int, _offset:Int, _order_by: [orderByOperator], _where:searchByOperator)
- searchDatasetVersion(_distinct:Boolean, _limit:Int, _offset:Int, _order_by: [orderByOperator], _where:searchByOperator)
- searchDatasetRelation(_distinct:Boolean, _limit:Int, _offset:Int, _order_by: [orderByOperator], _where:searchByOperator)
- searchDatasetEntity(_distinct:Boolean, _limit:Int, _offset:Int, _order_by: [orderByOperator], _where:searchByOperator)
- searchDatasetEntityAttribute(_distinct:Boolean, _limit:Int, _offset:Int, _order_by: [orderByOperator], _where:searchByOperator)
Search result will always return list of results. To control how search results will be returned EYWA will generate search queries that will accept +limit+, +_offset+ arguments as Int type, and for each entity special orderByOperator object will be generated to allow user to specify sequence of attributes with desc and asc values.
Following example will search through all attributes that are active and return first five records of found attributes with
"active=true
".
#
Query{ searchDatasetEntityAttribute(active:{_eq:true} _limit:5) { active configuration constraint euuid modified_on name seq type dataset { name datasets { dataset { name } } } }}
#
Response{ "data": { "searchDatasetEntityAttribute": [ { "active": true, "configuration": null, "constraint": "unique", "euuid": "b9d88982-7d35-4b26-813a-a8d0365c68d6", "modified_on": "2020-07-24T22:30:24Z", "name": "name", "seq": 0, "type": "string", "entity": { "name": "User", "dataset_versions": [ { "dataset": { "name": "Authentication, Authorization & Access" } } ] } }, { "active": true, "configuration": null, "constraint": "optional", "euuid": "2c5684ac-d8e1-40a9-8a4b-db602052907f", "modified_on": "2020-07-24T22:30:25Z", "name": "Password", "seq": 1, "type": "hashed", "entity": { "name": "User", "dataset_versions": [ { "dataset": { "name": "Authentication, Authorization & Access" } } ] } }, { "active": true, "configuration": null, "constraint": "optional", "euuid": "5cc58b70-6897-4919-bb4f-74e5faea55a4", "modified_on": "2020-07-24T22:30:25Z", "name": "Avatar", "seq": 2, "type": "string", "entity": { "name": "User", "dataset_versions": [ { "dataset": { "name": "Authentication, Authorization & Access" } } ] } }, { "active": true, "configuration": null, "constraint": "optional", "euuid": "4ae319a6-2e71-4bf5-ba13-b758e43f0366", "modified_on": "2020-07-24T22:30:25Z", "name": "Active", "seq": 2, "type": "boolean", "entity": { "name": "User", "dataset_versions": [ { "dataset": { "name": "Authentication, Authorization & Access" } } ] } }, { "active": true, "configuration": null, "constraint": "optional", "euuid": "6a44cf06-d72c-4930-b2d2-3d607ebf5a04", "modified_on": "2020-07-24T22:30:25Z", "name": "Personalization", "seq": 4, "type": "json", "entity": { "name": "User", "dataset_versions": [ { "dataset": { "name": "Authentication, Authorization & Access" } } ] } } ] }}