Find Entities by Name
Two ways to find an entity when you know (or roughly know) its name. Pick based on whether you need ranked relevance or exact match.
Option 1 — search: ranked, fuzzy, across all spaces
search returns entities whose name contains the query string, ordered by relevance. Best for "I think there's an entity called something like X" queries.
query Search($q: String!) {
search(query: $q, first: 10) {
id
name
}
}
{ "q": "Stable Diffusion" }
{
"data": {
"search": [
{ "id": "9e49e5a95d2a41a6ba90cd84944080b5", "name": "Stable Diffusion" },
{ "id": "b786eb79e29b4ec997f4fe6e9bfc902b", "name": "Stable Diffusion" },
{ "id": "86f01f1167034107841c8c9c94634441", "name": "Stable Diffusion, bu" }
]
}
}
Loading interactive query runner…
Watch out: search is global and untyped. A query for "Creator" will return Role entities, Person entities, Property entities — whatever ranks first. If you specifically want a Property entity, see Look up a Property or Type instead.
Option 2 — entities filter: exact match, optionally space-scoped
When you want a precise name match (e.g. "find the entity called exactly GPT-4 in the AI space"), use entities with a name filter.
query FindExact($name: String!, $spaceId: UUID!) {
entities(
first: 10
filter: {
name: { is: $name }
spaceIds: { anyEqualTo: $spaceId }
}
) {
id
name
types { id name }
}
}
{
"name": "Stable Diffusion",
"spaceId": "41e851610e13a19441c4d980f2f2ce6b"
}
Loading interactive query runner…
The filter.name argument supports several operators — see the StringFilter reference:
| Operator | Meaning |
|---|---|
is / isNot | exact case-sensitive match |
equalTo / notEqualTo | same as is |
like / notLike | SQL LIKE patterns (% wildcards) |
includes / includesInsensitive | contains substring |
startsWith / endsWith | prefix/suffix match |
Notes
- There can be multiple entities with the same name (the search example above returned two
Stable Diffusionentities in different spaces). Always select theidand disambiguate bytypesorspaceIds. - Names can be
null. Block entities, system entities, and partial publishes often lack a Name property — those won't show insearchbut will show inentitiesif you don't filter on name.