Skip to content

Instantly share code, notes, and snippets.

@BrutalSimplicity
Created March 9, 2022 16:15
Show Gist options
  • Save BrutalSimplicity/90fc63b9f05ea2fdef17b0ce1aeb90bb to your computer and use it in GitHub Desktop.
Save BrutalSimplicity/90fc63b9f05ea2fdef17b0ce1aeb90bb to your computer and use it in GitHub Desktop.
Request every data point for all customers
const query: Query = {
select: properties,
where: {
match: { and: { type: createIriValue('abound', 'Customer'), name: 'Abound Dev Customer' } },
},
relation: 'owns',
sites: {
select: spaceProps,
where: { match: { and: { type: createIriValue('brick', 'Site') } } },
relation: 'hasPart',
buildings: {
select: spaceProps,
where: { match: { and: { type: createIriValue('brick', 'Building') } } },
assets: [
'isLocationOf',
{
select: assetProps,
...(points ? { points } : undefined),
},
],
floors: [
'hasPart',
{
select: spaceProps,
where: { match: { and: { type: createIriValue('brick', 'Floor') } } },
assets: [
'isLocationOf',
{
select: assetProps,
...(points ? { points } : undefined),
},
],
rooms: [
'hasPart',
{
select: spaceProps,
where: { match: { and: { type: createIriValue('brick', 'Room') } } },
relation: 'isLocationOf',
assets: {
select: assetProps,
...(points ? { points } : undefined),
},
},
],
},
],
},
},
hints: {
executionStrategy: {
type: strategy,
},
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment