Filters
GraphQL filters are a feature that allows you to retrieve data from your API based on specific criteria. With filters, you can selectively retrieve only the data that matches your desired criteria, reducing the amount of data returned and improving your application's performance. GraphQL filters are a powerful tool for creating more efficient and targeted queries. You can use filters in a variety of use cases, such as searching and filtering data or aggregating and analyzing large datasets. This document provides an overview of GraphQL filters and explains how to use them in your API queries.
Each entity in the Finite State API has a set of filters that can be used to get the information you are looking for, and reduce the amount of data returned.
The Finite State API has an extensive number of filters which are different for each type of entity. For example, the Product
entity has a different set of filters than the Finding
entity. The filters for each entity are defined in the GraphQL schema for that entity.
Common Filters
Scalar fields have a consistent set of filters no matter which type they belong to.
Commonly used Entity filters include:
DateTime
Filters for DateTime
fields (such as createdAt
) include:
Filter | Description |
---|---|
gt | Greater than (after) the specified date |
gte | Greater than or equal to (after or equal to) the specified date |
in | In the specified list of dates |
lt | Less than (before) the specified date |
lte | Less than or equal to (before or equal to) the specified date |
not | Not equal to the specified date |
not_in | Not in the specified list of dates |
String
Filters for String
fields (such as name
) include:
Filter | Description |
---|---|
contains | Contains the specified value (case-sensitive) |
ends_with | Ends with the specified value (case-sensitive) |
gt | Greater than (after) the specified value (case-sensitive). Can be used for sorting. |
gte | Greater than or equal to (after or equal to) the specified value (case-sensitive). Can be used for sorting. |
in | In the specified list of values (case-sensitive) |
like | Matches against a pattern case-insensitively with the following placeholders: % : matches any sequence of characters, including the empty string; _ matches exactly one character; \ can be used to escape the placeholders (use \ for a literal backslash) |
lt | Less than (before) the specified value (case-sensitive). Can be used for sorting. |
lte | Less than or equal to (before or equal to) the specified value (case-sensitive). Can be used for sorting. |
not | Not equal to the specified value (case-sensitive) |
not_contains | Does not contain the specified value (case-sensitive) |
not_ends_with | Does not end with the specified value (case-sensitive) |
not_in | Not in the specified list of values (case-sensitive) |
not_like | Does not match against a pattern case-insensitively with the following placeholders: % : matches any sequence of characters, including the empty string; _ matches exactly one character; \ can be used to escape the placeholders (use \ for a literal backslash) |
not_starts_with | Does not start with the specified value (case-sensitive) |
starts_with | Starts with the specified value (case-sensitive) |
Filters on Fields
In addition, these filters can be combined with field names on an entity to apply the filter to the field.
For example, to filter the createdAt
field on a Finding, you could use the following filters that are part of the FindingFilter
type:
Filter | Description |
---|---|
createdAt_gt | createdAt is greater than (after) the specified date |
createdAt_gte | createdAt is greater than or equal to (after or equal to) the specified date |
createdAt_lt | createdAt is less than (before) the specified date |
createdAt_lte | createdAt is less than or equal to (before or equal to) the specified date |
Some filters available on name
fields for ProductFilter
:
Filter | Description |
---|---|
name_like | Matches name against a pattern case-insensitively with the following placeholders: % : matches any sequence of characters, including the empty string; _ matches exactly one character; \ can be used to escape the placeholders (use \ for a literal backslash) |
name_not_contains | name does not contain the specified value (case-sensitive) |
name_starts_with | name starts with the specified value (case-sensitive) |
name_not_ends_with | name does not end with the specified value (case-sensitive) |
For more details about filtering on a specific type, look at its corresponding Filter type.
All Filters
- ArtifactFilter
- ArtifactFlexSearchFilter
- ArtifactLinkFilter
- AssetFilter
- AssetFlexSearchFilter
- AssetVersionCveMatchFilter
- AssetVersionFilter
- AssetVersionFlexSearchFilter
- AssetVersionMetricsFilter
- AuthorFilter
- BotnetFilter
- CVSSBaseMetricV2Filter
- CVSSBaseMetricV3Filter
- CVSSMetricV2Filter
- CVSSMetricV3Filter
- CVSSMetricV4Filter
- CopyrightFilter
- CveFilter
- CveFlexSearchFilter
- CveReferencesFilter
- CveUpdateSummaryFilter
- CveUpdateSummaryFlexSearchFilter
- CweFilter
- CweFlexSearchFilter
- EPSSFilter
- EncodedDataFilter
- EntityCtxFilter
- EntityCtxFlexSearchFilter
- EnvironmentalControlsFilter
- ExploitFilter
- ExploitInfoFilter
- ExploitTimelineFilter
- ExportJobFilter
- ExternalReferenceFilter
- FileFilter
- FileFlexSearchFilter
- FileSystemFilter
- FileSystemFlexSearchFilter
- FindingCommentFilter
- FindingConfidenceFilter
- FindingFilter
- FindingFlexSearchFilter
- FindingLocationFilter
- FindingSourceTypeFilter
- FindingStatusFilter
- GroupFilter
- GroupFlexSearchFilter
- HashFilter
- IDFilter
- KeyValuePairFilter
- LicenseExceptionFilter
- LicenseExpressionFilter
- LicenseFilter
- OperatingSystemFilter
- OperatingSystemFlexSearchFilter
- OperatingSystemInstanceFilter
- OperatingSystemInstanceFlexSearchFilter
- OrganizationFilter
- OrganizationFlexSearchFilter
- OrganizationSettingsFilter
- OrganizationalContactFilter
- OrganizationalEntityFilter
- PatchFilter
- ProcessingEventLogFilter
- ProcessingEventLogFlexSearchFilter
- ProcessingStatusFilter
- ProductFamilyFilter
- ProductFamilyFlexSearchFilter
- ProductFilter
- ProductFlexSearchFilter
- ProductIdentifiersFilter
- ProductRelationEntityCtxFilter
- ProductRelationEntityCtxFlexSearchFilter
- RansomwareFilter
- RelationEntityCtxFilter
- RelationEntityCtxFlexSearchFilter
- ReleaseNoteFilter
- ReleaseNotesFilter
- ResolvedIssueInfoFilter
- ResolvedIssueSourceFilter
- SecurityAdvisoryFilter
- SoftwareComponentCommentFilter
- SoftwareComponentFilter
- SoftwareComponentFlexSearchFilter
- SoftwareComponentInstanceConfidenceFilter
- SoftwareComponentInstanceFilter
- SoftwareComponentInstanceFlexSearchFilter
- SoftwareComponentInstanceRelationshipFilter
- SoftwareComponentStatusFilter
- SoftwareIdentifiersFilter
- StringFilter
- TagFilter
- TagFlexSearchFilter
- TestFilter
- TestFlexSearchFilter
- TestResultsProcessingStateFilter
- TestingToolFilter
- ThreatActorFilter
- ToolSettingsFilter
- TrendingDataFilter
- UserFilter
- UserFlexSearchFilter
- UserNewCveNotificationConfigFilter
- UserNotificationSettingsFilter
- UserSettingsFilter
- VendorFilter
- VendorFlexSearchFilter
- VendorNameForThreatActorFilter
- VulnerabilityContextFilter
This page was generated: 2024-11-06