• /
  • Log in
  • Free account

EntitiesByDomainTypeQuery

Usage

import { EntitiesByDomainTypeQuery } from 'nr1'

Examples

Props

childrenfunction

Render prop function as a child.

function (
queryResult: QueryResult

Results of the query.

) => React.ReactNode
entityDomainrequiredstring

Domain of the entities you want to query.

entityFragmentExtensionobject

GraphQL fragment document parsed into an AST by graphql-tag.

The Query components return the most commonly used fields available on an entity. You can use this prop when you want to request additional fields for the entities returned by your query.

The fragment should be named EntityFragmentExtension and apply to the EntityOutline type.

entityTyperequiredstring

Type of the entities you want to query.

fetchPolicyTypeenum
DEFAULT
EntitiesByDomainTypeQuery.FETCH_POLICY_TYPE.CACHE_AND_NETWORK

Allows you to specify how you want your query to interact with the cached data.

  • CACHE_AND_NETWORK: The query returns your initial data from the cache if available. However, regardless of whether or not the full data is in your cache, the query always makes a request using your network interface and returns the updated data. This option is not available when using the static query() method of the component.

  • CACHE_FIRST: The query makes a request using your network interface only if the data for your query is not already in the cache.

  • CACHE_ONLY: The query never makes a request using your network interface. Instead it returns the data available in the cache. If the data for your query does not exist in the cache, then an error is thrown.

  • NETWORK_ONLY: The query never returns your initial data from the cache. Instead it always makes a request using your network interface.

  • NO_CACHE: The query never returns your initial data from the cache. Instead it always makes a request using your network interface. Unlike the NETWORK_ONLY policy, it does not write any data to the cache after the query completes.

<One of
EntitiesByDomainTypeQuery.FETCH_POLICY_TYPE.CACHE_AND_NETWORK,
EntitiesByDomainTypeQuery.FETCH_POLICY_TYPE.CACHE_FIRST,
EntitiesByDomainTypeQuery.FETCH_POLICY_TYPE.CACHE_ONLY,
EntitiesByDomainTypeQuery.FETCH_POLICY_TYPE.NETWORK_ONLY,
EntitiesByDomainTypeQuery.FETCH_POLICY_TYPE.NO_CACHE,
>
filtersstring|(shape|shape|shape)[]

Filters used to narrow down the entities.

This is an array of filters, and there are 3 possible filters:

  • SearchQueryFilter: Object<type: string = "searchQuery", value: string>

  • EntityTypeFilter: Object<type: string = "entityType", Object<domain: string, type: string>>

  • TagFilter: Object<type: string = "tag", Object<key: string, value: string>>

includeSummaryMetricsboolean
DEFAULT
false
includeTagsboolean
DEFAULT
false

If true, the returned entities include their tags.

limitnumber
DEFAULT
500

Pagination, number of entities to fetch for on each page.

pollIntervalnumber
DEFAULT
0

Interval in milliseconds to poll for new data. Set to zero to avoid any kind of regular polling.

skipboolean
DEFAULT
false

When set to true, the query will be skipped entirely from rendering.

sortByenum[]

Array of criteras used to sort the entity search results.

<Array of
<One of
EntitiesByDomainTypeQuery.SORT_TYPE.ALERT_SEVERITY,
EntitiesByDomainTypeQuery.SORT_TYPE.DOMAIN,
EntitiesByDomainTypeQuery.SORT_TYPE.MOST_RELEVANT,
EntitiesByDomainTypeQuery.SORT_TYPE.NAME,
EntitiesByDomainTypeQuery.SORT_TYPE.REPORTING,
EntitiesByDomainTypeQuery.SORT_TYPE.TYPE,
>
>

Methods

EntitiesByDomainTypeQuery.query

function (
props: Object

Object containing the query options. Any EntitiesByDomainTypeQuery prop is a valid option except children and pollInterval.

) => PromiseQueryResult

Type definitions

PromiseQueryResult

{
error: ApolloClient.ApolloError,

Runtime error with graphQLErrors and networkError properties.

data: Object,

Object containing the result of your query.

fetchMore: function|null,

If not null, fetchMore allows you to load more results for your query. New data is merged with previous data.

refetch: function,

Refetch the query.

}

QueryResult

{
loading: boolean,

Indicates that the request is in flight.

error: ApolloClient.ApolloError,

Runtime error with graphQLErrors and networkError properties.

data: Object,

Object containing the result of your query.

fetchMore: function|null,

If not null, fetchMore allows you to load more results for your query. New data is merged with previous data.

refetch: function,

Refetch the query.

}
Create issueEdit page
Copyright © 2021 New Relic Inc.