Custom fields can be configured to be used as constraints and sorts to use in queries that retrieve Entities. This section will explain how you can use custom fields in GraphQL Queries that query for the different Entities that support custom fields.
The following example query retrieves message entity using custom fields:
query messages($customFieldsConstraints: [CustomFieldConstraintInput!]) {
messages(constraints: {customFieldsConstraints: $customFieldsConstraints}) {
edges {
node {
id
entityType
customFields {
...CustomFieldView
}
}
}
}
}
fragment CustomFieldView on CustomField {
name
... on CustomBooleanField {
booleanValue
}
... on CustomStringField {
stringValue
}
... on CustomIntField {
intValue
}
... on CustomLongField {
longValue
}
... on CustomFloatField {
floatValue
}
... on CustomDateTimeField {
dateTimeValue
}
... on CustomStringListField {
stringListValue
}
... on CustomIntListField {
intListValue
}
... on CustomFloatListField {
floatListValue
}
}
{
"customFieldsConstraints": [
{
"name": "89309_test_Boolean",
"constraint": {
"boolean": {
"eq": true
}
}
},
{
"name": "89309_test_Int",
"constraint": {
"int": {
"gt": 10
}
}
},
{
"name": "89309_test_Long",
"constraint": {
"long": {
"lt": 2292233
}
}
},
{
"name": "89309_test_Float",
"constraint": {
"float": {
"gte": 11.347
}
}
},
{
"name": "89309_test_String",
"constraint": {
"string": {
"eq": "Balloon"
}
}
}
]
}
ATLAS
Comments